aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DMA-API.txt122
-rw-r--r--Documentation/DocBook/mtdnand.tmpl6
-rw-r--r--Documentation/DocBook/v4l/common.xml2
-rw-r--r--Documentation/DocBook/v4l/vidioc-g-parm.xml2
-rw-r--r--Documentation/IPMI.txt12
-rw-r--r--Documentation/Makefile4
-rw-r--r--Documentation/PCI/PCI-DMA-mapping.txt352
-rw-r--r--Documentation/SubmitChecklist8
-rw-r--r--Documentation/arm/Samsung-S3C24XX/CPUfreq.txt4
-rw-r--r--Documentation/arm/Samsung/Overview.txt86
-rwxr-xr-xDocumentation/arm/Samsung/clksrc-change-registers.awk167
-rw-r--r--Documentation/cgroups/cgroup_event_listener.c110
-rw-r--r--Documentation/cgroups/cgroups.txt39
-rw-r--r--Documentation/cgroups/cpusets.txt127
-rw-r--r--Documentation/cgroups/memcg_test.txt47
-rw-r--r--Documentation/cgroups/memory.txt80
-rw-r--r--Documentation/console/console.txt2
-rw-r--r--Documentation/driver-model/platform.txt2
-rw-r--r--Documentation/eisa.txt2
-rw-r--r--Documentation/email-clients.txt30
-rw-r--r--Documentation/filesystems/00-INDEX2
-rw-r--r--Documentation/filesystems/Makefile8
-rw-r--r--Documentation/filesystems/dnotify.txt39
-rw-r--r--Documentation/filesystems/dnotify_test.c34
-rw-r--r--Documentation/filesystems/proc.txt2
-rw-r--r--Documentation/hwmon/abituguru2
-rw-r--r--Documentation/input/rotary-encoder.txt2
-rw-r--r--Documentation/laptops/00-INDEX6
-rw-r--r--Documentation/laptops/Makefile8
-rw-r--r--Documentation/laptops/dslm.c166
-rw-r--r--Documentation/laptops/laptop-mode.txt170
-rw-r--r--Documentation/networking/skfp.txt2
-rw-r--r--Documentation/networking/timestamping/timestamping.c2
-rw-r--r--Documentation/pnp.txt13
-rw-r--r--Documentation/power/runtime_pm.txt2
-rw-r--r--Documentation/s390/kvm.txt2
-rw-r--r--Documentation/scsi/ChangeLog.lpfc10
-rw-r--r--Documentation/serial/tty.txt4
-rw-r--r--Documentation/sysctl/vm.txt5
-rw-r--r--Documentation/timers/00-INDEX2
-rw-r--r--Documentation/timers/Makefile8
-rw-r--r--Documentation/timers/hpet.txt273
-rw-r--r--Documentation/timers/hpet_example.c269
-rw-r--r--Documentation/trace/ftrace.txt2
-rw-r--r--Documentation/vm/00-INDEX16
-rw-r--r--Documentation/vm/Makefile2
-rw-r--r--Documentation/vm/hugepage-mmap.c91
-rw-r--r--Documentation/vm/hugepage-shm.c98
-rw-r--r--Documentation/vm/hugetlbpage.txt169
-rw-r--r--Documentation/vm/map_hugetlb.c6
-rw-r--r--Documentation/voyager.txt95
-rw-r--r--MAINTAINERS34
-rw-r--r--arch/alpha/Kconfig4
-rw-r--r--arch/alpha/include/asm/dma-mapping.h80
-rw-r--r--arch/alpha/include/asm/pci.h139
-rw-r--r--arch/alpha/include/asm/ptrace.h1
-rw-r--r--arch/alpha/kernel/pci-noop.c101
-rw-r--r--arch/alpha/kernel/pci_iommu.c201
-rw-r--r--arch/alpha/kernel/ptrace.c59
-rw-r--r--arch/arm/Kconfig74
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/Makefile16
-rw-r--r--arch/arm/boot/bootp/init.S2
-rw-r--r--arch/arm/boot/compressed/head.S50
-rw-r--r--arch/arm/boot/compressed/vmlinux.lds.in3
-rw-r--r--arch/arm/common/clkdev.c2
-rw-r--r--arch/arm/common/it8152.c27
-rw-r--r--arch/arm/common/locomo.c362
-rw-r--r--arch/arm/common/sa1111.c112
-rw-r--r--arch/arm/common/scoop.c2
-rw-r--r--arch/arm/configs/ap4evb_defconfig779
-rw-r--r--arch/arm/configs/g3evm_defconfig774
-rw-r--r--arch/arm/configs/g4evm_defconfig779
-rw-r--r--arch/arm/configs/imote2_defconfig2077
-rw-r--r--arch/arm/configs/kirkwood_defconfig126
-rw-r--r--arch/arm/configs/mini2440_defconfig6
-rw-r--r--arch/arm/configs/mmp2_defconfig1194
-rw-r--r--arch/arm/configs/mv78xx0_defconfig1
-rw-r--r--arch/arm/configs/mx1ads_defconfig742
-rw-r--r--arch/arm/configs/mx27_defconfig2
-rw-r--r--arch/arm/configs/mx51_defconfig1286
-rw-r--r--arch/arm/configs/nuc950_defconfig53
-rw-r--r--arch/arm/configs/orion5x_defconfig101
-rw-r--r--arch/arm/configs/pxa168_defconfig229
-rw-r--r--arch/arm/configs/raumfeld_defconfig1898
-rw-r--r--arch/arm/configs/s3c2410_defconfig6
-rw-r--r--arch/arm/configs/s3c6400_defconfig360
-rw-r--r--arch/arm/configs/s5p6440_defconfig969
-rw-r--r--arch/arm/configs/s5p6442_defconfig883
-rw-r--r--arch/arm/configs/s5pc110_defconfig894
-rw-r--r--arch/arm/configs/s5pv210_defconfig894
-rw-r--r--arch/arm/include/asm/dma-mapping.h8
-rw-r--r--arch/arm/include/asm/entry-macro-vic2.S (renamed from arch/arm/mach-s3c6400/include/mach/entry-macro.S)29
-rw-r--r--arch/arm/include/asm/hardware/it8152.h12
-rw-r--r--arch/arm/include/asm/hardware/locomo.h4
-rw-r--r--arch/arm/include/asm/hardware/sa1111.h4
-rw-r--r--arch/arm/include/asm/pci.h11
-rw-r--r--arch/arm/include/asm/ptrace.h2
-rw-r--r--arch/arm/include/asm/unistd.h3
-rw-r--r--arch/arm/kernel/calls.S4
-rw-r--r--arch/arm/kernel/ptrace.c60
-rw-r--r--arch/arm/kernel/ptrace.h14
-rw-r--r--arch/arm/kernel/sys_arm.c129
-rw-r--r--arch/arm/kernel/sys_oabi-compat.c3
-rw-r--r--arch/arm/kernel/unwind.c4
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c20
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c11
-rw-r--r--arch/arm/mach-at91/include/mach/at91_mci.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/i2c.h2
-rw-r--r--arch/arm/mach-dove/common.c8
-rw-r--r--arch/arm/mach-ep93xx/micro9.c2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c26
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/hardware.h5
-rw-r--r--arch/arm/mach-kirkwood/Kconfig23
-rw-r--r--arch/arm/mach-kirkwood/Makefile4
-rw-r--r--arch/arm/mach-kirkwood/common.c8
-rw-r--r--arch/arm/mach-kirkwood/netspace_v2-setup.c59
-rw-r--r--arch/arm/mach-kirkwood/openrd-setup.c118
-rw-r--r--arch/arm/mach-kirkwood/openrd_base-setup.c96
-rw-r--r--arch/arm/mach-kirkwood/sheevaplug-setup.c50
-rw-r--r--arch/arm/mach-mmp/Kconfig35
-rw-r--r--arch/arm/mach-mmp/Makefile10
-rw-r--r--arch/arm/mach-mmp/avengers_lite.c51
-rw-r--r--arch/arm/mach-mmp/common.h4
-rw-r--r--arch/arm/mach-mmp/flint.c123
-rw-r--r--arch/arm/mach-mmp/include/mach/cputype.h9
-rw-r--r--arch/arm/mach-mmp/include/mach/devices.h12
-rw-r--r--arch/arm/mach-mmp/include/mach/entry-macro.S7
-rw-r--r--arch/arm/mach-mmp/include/mach/irqs.h115
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-mmp2.h240
-rw-r--r--arch/arm/mach-mmp/include/mach/mfp-pxa168.h4
-rw-r--r--arch/arm/mach-mmp/include/mach/mmp2.h60
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-apbc.h41
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-icu.h42
-rw-r--r--arch/arm/mach-mmp/include/mach/uncompress.h13
-rw-r--r--arch/arm/mach-mmp/irq-mmp2.c154
-rw-r--r--arch/arm/mach-mmp/irq-pxa168.c (renamed from arch/arm/mach-mmp/irq.c)0
-rw-r--r--arch/arm/mach-mmp/jasper.c80
-rw-r--r--arch/arm/mach-mmp/mmp2.c123
-rw-r--r--arch/arm/mach-mmp/time.c26
-rw-r--r--arch/arm/mach-mv78xx0/Kconfig6
-rw-r--r--arch/arm/mach-mv78xx0/Makefile3
-rw-r--r--arch/arm/mach-mv78xx0/buffalo-wxl-setup.c155
-rw-r--r--arch/arm/mach-mv78xx0/mpp.c96
-rw-r--r--arch/arm/mach-mv78xx0/mpp.h347
-rw-r--r--arch/arm/mach-mx1/Makefile5
-rw-r--r--arch/arm/mach-mx1/mach-mx1ads.c (renamed from arch/arm/mach-mx1/mx1ads.c)8
-rw-r--r--arch/arm/mach-mx1/mach-scb9328.c (renamed from arch/arm/mach-mx1/scb9328.c)4
-rw-r--r--arch/arm/mach-mx2/Kconfig10
-rw-r--r--arch/arm/mach-mx2/Makefile23
-rw-r--r--arch/arm/mach-mx2/clock_imx21.c236
-rw-r--r--arch/arm/mach-mx2/clock_imx27.c33
-rw-r--r--arch/arm/mach-mx2/cpu_imx27.c3
-rw-r--r--arch/arm/mach-mx2/crm_regs.h258
-rw-r--r--arch/arm/mach-mx2/devices.c640
-rw-r--r--arch/arm/mach-mx2/devices.h13
-rw-r--r--arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c2
-rw-r--r--arch/arm/mach-mx2/mach-cpuimx27.c (renamed from arch/arm/mach-mx2/eukrea_cpuimx27.c)19
-rw-r--r--arch/arm/mach-mx2/mach-imx27lite.c (renamed from arch/arm/mach-mx2/mx27lite.c)8
-rw-r--r--arch/arm/mach-mx2/mach-mx21ads.c (renamed from arch/arm/mach-mx2/mx21ads.c)16
-rw-r--r--arch/arm/mach-mx2/mach-mx27_3ds.c (renamed from arch/arm/mach-mx2/mx27pdk.c)8
-rw-r--r--arch/arm/mach-mx2/mach-mx27ads.c (renamed from arch/arm/mach-mx2/mx27ads.c)12
-rw-r--r--arch/arm/mach-mx2/mach-mxt_td60.c (renamed from arch/arm/mach-mx2/mxt_td60.c)10
-rw-r--r--arch/arm/mach-mx2/mach-pca100.c (renamed from arch/arm/mach-mx2/pca100.c)161
-rw-r--r--arch/arm/mach-mx2/mach-pcm038.c (renamed from arch/arm/mach-mx2/pcm038.c)40
-rw-r--r--arch/arm/mach-mx2/mm-imx21.c83
-rw-r--r--arch/arm/mach-mx2/mm-imx27.c (renamed from arch/arm/mach-mx2/generic.c)44
-rw-r--r--arch/arm/mach-mx2/pcm970-baseboard.c6
-rw-r--r--arch/arm/mach-mx2/serial.c48
-rw-r--r--arch/arm/mach-mx25/Kconfig1
-rw-r--r--arch/arm/mach-mx25/Makefile2
-rw-r--r--arch/arm/mach-mx25/clock.c14
-rw-r--r--arch/arm/mach-mx25/devices.c62
-rw-r--r--arch/arm/mach-mx25/devices.h3
-rw-r--r--arch/arm/mach-mx25/mach-mx25pdk.c (renamed from arch/arm/mach-mx25/mx25pdk.c)67
-rw-r--r--arch/arm/mach-mx3/Kconfig2
-rw-r--r--arch/arm/mach-mx3/Makefile32
-rw-r--r--arch/arm/mach-mx3/clock-imx31.c (renamed from arch/arm/mach-mx3/clock.c)5
-rw-r--r--arch/arm/mach-mx3/clock-imx35.c5
-rw-r--r--arch/arm/mach-mx3/cpu.c2
-rw-r--r--arch/arm/mach-mx3/crm_regs.h2
-rw-r--r--arch/arm/mach-mx3/iomux-imx31.c (renamed from arch/arm/mach-mx3/iomux.c)2
-rw-r--r--arch/arm/mach-mx3/mach-armadillo5x0.c (renamed from arch/arm/mach-mx3/armadillo5x0.c)14
-rw-r--r--arch/arm/mach-mx3/mach-kzm_arm11_01.c (renamed from arch/arm/mach-mx3/kzmarm11.c)33
-rw-r--r--arch/arm/mach-mx3/mach-mx31_3ds.c (renamed from arch/arm/mach-mx3/mx31pdk.c)12
-rw-r--r--arch/arm/mach-mx3/mach-mx31ads.c (renamed from arch/arm/mach-mx3/mx31ads.c)44
-rw-r--r--arch/arm/mach-mx3/mach-mx31lilly.c (renamed from arch/arm/mach-mx3/mx31lilly.c)10
-rw-r--r--arch/arm/mach-mx3/mach-mx31lite.c (renamed from arch/arm/mach-mx3/mx31lite.c)16
-rw-r--r--arch/arm/mach-mx3/mach-mx31moboard.c (renamed from arch/arm/mach-mx3/mx31moboard.c)49
-rw-r--r--arch/arm/mach-mx3/mach-mx35pdk.c (renamed from arch/arm/mach-mx3/mx35pdk.c)6
-rw-r--r--arch/arm/mach-mx3/mach-pcm037.c (renamed from arch/arm/mach-mx3/pcm037.c)155
-rw-r--r--arch/arm/mach-mx3/mach-pcm037_eet.c (renamed from arch/arm/mach-mx3/pcm037_eet.c)0
-rw-r--r--arch/arm/mach-mx3/mach-pcm043.c (renamed from arch/arm/mach-mx3/pcm043.c)160
-rw-r--r--arch/arm/mach-mx3/mach-qong.c (renamed from arch/arm/mach-mx3/qong.c)20
-rw-r--r--arch/arm/mach-mx3/mx31lite-db.c30
-rw-r--r--arch/arm/mach-mx3/mx31moboard-devboard.c32
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c39
-rw-r--r--arch/arm/mach-mx3/mx31moboard-smartbot.c162
-rw-r--r--arch/arm/mach-mx5/Kconfig18
-rw-r--r--arch/arm/mach-mx5/Makefile9
-rw-r--r--arch/arm/mach-mx5/Makefile.boot3
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c98
-rw-r--r--arch/arm/mach-mx5/clock-mx51.c825
-rw-r--r--arch/arm/mach-mx5/cpu.c47
-rw-r--r--arch/arm/mach-mx5/crm_regs.h583
-rw-r--r--arch/arm/mach-mx5/devices.c96
-rw-r--r--arch/arm/mach-mx5/devices.h4
-rw-r--r--arch/arm/mach-mx5/mm.c89
-rw-r--r--arch/arm/mach-mxc91231/magx-zn5.c2
-rw-r--r--arch/arm/mach-nomadik/board-nhk8815.c2
-rw-r--r--[-rwxr-xr-x]arch/arm/mach-omap2/board-3630sdp.c0
-rw-r--r--[-rwxr-xr-x]arch/arm/mach-omap2/board-zoom-peripherals.c0
-rw-r--r--arch/arm/mach-orion5x/Kconfig7
-rw-r--r--arch/arm/mach-orion5x/Makefile1
-rw-r--r--arch/arm/mach-orion5x/common.c4
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c45
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c36
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c276
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c8
-rw-r--r--arch/arm/mach-pxa/Kconfig35
-rw-r--r--arch/arm/mach-pxa/Makefile5
-rw-r--r--arch/arm/mach-pxa/am300epd.c2
-rw-r--r--arch/arm/mach-pxa/balloon3.c33
-rw-r--r--arch/arm/mach-pxa/capc7117.c158
-rw-r--r--arch/arm/mach-pxa/cm-x255.c21
-rw-r--r--arch/arm/mach-pxa/cm-x270.c83
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c2
-rw-r--r--arch/arm/mach-pxa/e740.c6
-rw-r--r--arch/arm/mach-pxa/e750.c6
-rw-r--r--arch/arm/mach-pxa/e800.c9
-rw-r--r--arch/arm/mach-pxa/em-x270.c21
-rw-r--r--arch/arm/mach-pxa/icontrol.c202
-rw-r--r--arch/arm/mach-pxa/idp.c20
-rw-r--r--arch/arm/mach-pxa/imote2.c3
-rw-r--r--arch/arm/mach-pxa/include/mach/balloon3.h10
-rw-r--r--arch/arm/mach-pxa/include/mach/hardware.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/irqs.h153
-rw-r--r--arch/arm/mach-pxa/include/mach/lpd270.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/lubbock.h11
-rw-r--r--arch/arm/mach-pxa/include/mach/mainstone.h17
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa25x.h32
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h27
-rw-r--r--arch/arm/mach-pxa/include/mach/mxm8x10.h21
-rw-r--r--arch/arm/mach-pxa/include/mach/pcm027.h7
-rw-r--r--arch/arm/mach-pxa/include/mach/ssp.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/uncompress.h41
-rw-r--r--arch/arm/mach-pxa/include/mach/zeus.h3
-rw-r--r--arch/arm/mach-pxa/lpd270.c6
-rw-r--r--arch/arm/mach-pxa/lubbock.c35
-rw-r--r--arch/arm/mach-pxa/magician.c21
-rw-r--r--arch/arm/mach-pxa/mainstone.c27
-rw-r--r--arch/arm/mach-pxa/mioa701.c24
-rw-r--r--arch/arm/mach-pxa/mxm8x10.c474
-rw-r--r--arch/arm/mach-pxa/palmld.c21
-rw-r--r--arch/arm/mach-pxa/palmt5.c21
-rw-r--r--arch/arm/mach-pxa/palmtc.c21
-rw-r--r--arch/arm/mach-pxa/palmte2.c21
-rw-r--r--arch/arm/mach-pxa/palmtreo.c20
-rw-r--r--arch/arm/mach-pxa/palmtx.c21
-rw-r--r--arch/arm/mach-pxa/palmz72.c22
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c9
-rw-r--r--arch/arm/mach-pxa/poodle.c28
-rw-r--r--arch/arm/mach-pxa/pxa27x.c19
-rw-r--r--arch/arm/mach-pxa/raumfeld.c1108
-rw-r--r--arch/arm/mach-pxa/spitz.c20
-rw-r--r--arch/arm/mach-pxa/ssp.c5
-rw-r--r--arch/arm/mach-pxa/time.c10
-rw-r--r--arch/arm/mach-pxa/tosa.c117
-rw-r--r--arch/arm/mach-pxa/trizeps4.c27
-rw-r--r--arch/arm/mach-pxa/viper.c8
-rw-r--r--arch/arm/mach-pxa/zeus.c91
-rw-r--r--arch/arm/mach-s3c2410/dma.c2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio-track.h (renamed from arch/arm/mach-s3c2410/include/mach/gpio-core.h)1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/pm-core.h (renamed from arch/arm/plat-s3c24xx/include/plat/pm-core.h)2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-gpio.h10
-rw-r--r--arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h32
-rw-r--r--arch/arm/mach-s3c2410/include/mach/spi-gpio.h2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/timex.h (renamed from arch/arm/plat-s3c/include/mach/timex.h)2
-rw-r--r--arch/arm/mach-s3c2410/include/mach/vmalloc.h (renamed from arch/arm/plat-s3c/include/mach/vmalloc.h)4
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-tct_hammer.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c4
-rw-r--r--arch/arm/mach-s3c2412/clock.c52
-rw-r--r--arch/arm/mach-s3c2412/dma.c2
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c2
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c3
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c2
-rw-r--r--arch/arm/mach-s3c2440/Kconfig74
-rw-r--r--arch/arm/mach-s3c2440/Makefile11
-rw-r--r--arch/arm/mach-s3c2440/clock.c6
-rw-r--r--arch/arm/mach-s3c2440/dma.c2
-rw-r--r--arch/arm/mach-s3c2440/dsc.c2
-rw-r--r--arch/arm/mach-s3c2440/include/mach/gta02.h (renamed from arch/arm/mach-s3c2442/include/mach/gta02.h)0
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c7
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c (renamed from arch/arm/mach-s3c2442/mach-gta02.c)7
-rw-r--r--arch/arm/mach-s3c2440/mach-mini2440.c8
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c4
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-12000000.c (renamed from arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c)2
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-16934400.c (renamed from arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c)2
-rw-r--r--arch/arm/mach-s3c2440/s3c2440.c2
-rw-r--r--arch/arm/mach-s3c2440/s3c2442.c (renamed from arch/arm/mach-s3c2442/clock.c)22
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-clock.c (renamed from arch/arm/plat-s3c24xx/s3c244x-clock.c)4
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-irq.c (renamed from arch/arm/plat-s3c24xx/s3c244x-irq.c)0
-rw-r--r--arch/arm/mach-s3c2440/s3c244x.c (renamed from arch/arm/plat-s3c24xx/s3c244x.c)3
-rw-r--r--arch/arm/mach-s3c2442/Kconfig37
-rw-r--r--arch/arm/mach-s3c2442/Makefile18
-rw-r--r--arch/arm/mach-s3c2442/s3c2442.c34
-rw-r--r--arch/arm/mach-s3c2443/Kconfig1
-rw-r--r--arch/arm/mach-s3c2443/clock.c842
-rw-r--r--arch/arm/mach-s3c2443/dma.c2
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c10
-rw-r--r--arch/arm/mach-s3c24a0/include/mach/io.h (renamed from arch/arm/plat-s3c/include/mach/io.h)4
-rw-r--r--arch/arm/mach-s3c6400/Kconfig30
-rw-r--r--arch/arm/mach-s3c6400/Makefile23
-rw-r--r--arch/arm/mach-s3c6400/include/mach/dma.h70
-rw-r--r--arch/arm/mach-s3c6400/include/mach/gpio-core.h21
-rw-r--r--arch/arm/mach-s3c6400/include/mach/irqs.h16
-rw-r--r--arch/arm/mach-s3c6400/include/mach/regs-clock.h16
-rw-r--r--arch/arm/mach-s3c6410/Makefile26
-rw-r--r--arch/arm/mach-s3c6410/setup-sdhci.c68
-rw-r--r--arch/arm/mach-s3c64xx/Kconfig (renamed from arch/arm/mach-s3c6410/Kconfig)87
-rw-r--r--arch/arm/mach-s3c64xx/Makefile (renamed from arch/arm/plat-s3c64xx/Makefile)48
-rw-r--r--arch/arm/mach-s3c64xx/Makefile.boot (renamed from arch/arm/mach-s3c6400/Makefile.boot)0
-rw-r--r--arch/arm/mach-s3c64xx/clock.c809
-rw-r--r--arch/arm/mach-s3c64xx/cpu.c (renamed from arch/arm/plat-s3c64xx/cpu.c)19
-rw-r--r--arch/arm/mach-s3c64xx/cpufreq.c (renamed from arch/arm/plat-s3c64xx/cpufreq.c)0
-rw-r--r--arch/arm/mach-s3c64xx/dev-adc.c46
-rw-r--r--arch/arm/mach-s3c64xx/dev-audio.c335
-rw-r--r--arch/arm/mach-s3c64xx/dev-rtc.c43
-rw-r--r--arch/arm/mach-s3c64xx/dev-spi.c182
-rw-r--r--arch/arm/mach-s3c64xx/dev-uart.c (renamed from arch/arm/plat-s3c64xx/dev-uart.c)29
-rw-r--r--arch/arm/mach-s3c64xx/dma.c (renamed from arch/arm/plat-s3c64xx/dma.c)3
-rw-r--r--arch/arm/mach-s3c64xx/gpiolib.c (renamed from arch/arm/plat-s3c64xx/gpiolib.c)166
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/debug-macro.S (renamed from arch/arm/mach-s3c6400/include/mach/debug-macro.S)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/dma.h (renamed from arch/arm/plat-s3c64xx/include/plat/dma-plat.h)79
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/entry-macro.S18
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-a.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-b.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-d.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-e.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-f.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-g.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-h.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-i.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-j.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-n.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-o.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-p.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h (renamed from arch/arm/plat-s3c64xx/include/plat/gpio-bank-q.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/gpio.h (renamed from arch/arm/mach-s3c6400/include/mach/gpio.h)6
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/hardware.h (renamed from arch/arm/mach-s3c6400/include/mach/hardware.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/io.h18
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/irqs.h (renamed from arch/arm/plat-s3c64xx/include/plat/irqs.h)24
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/map.h (renamed from arch/arm/mach-s3c6400/include/mach/map.h)22
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/memory.h (renamed from arch/arm/mach-s3c6400/include/mach/memory.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pll.h (renamed from arch/arm/plat-s3c64xx/include/plat/pll.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pm-core.h (renamed from arch/arm/plat-s3c64xx/include/plat/pm-core.h)4
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/pwm-clock.h (renamed from arch/arm/mach-s3c6400/include/mach/pwm-clock.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-clock.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-clock.h)71
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-fb.h (renamed from arch/arm/mach-s3c6400/include/mach/regs-fb.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-gpio.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-gpio.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-irq.h (renamed from arch/arm/mach-s3c6400/include/mach/regs-irq.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-modem.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-modem.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-srom.h59
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-sys.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-sys.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h (renamed from arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/s3c6400.h (renamed from arch/arm/plat-s3c64xx/include/plat/s3c6400.h)6
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/s3c6410.h (renamed from arch/arm/plat-s3c64xx/include/plat/s3c6410.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/spi-clocks.h18
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/system.h (renamed from arch/arm/mach-s3c6400/include/mach/system.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/tick.h (renamed from arch/arm/mach-s3c6400/include/mach/tick.h)2
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/uncompress.h (renamed from arch/arm/mach-s3c6400/include/mach/uncompress.h)0
-rw-r--r--arch/arm/mach-s3c64xx/include/mach/vmalloc.h20
-rw-r--r--arch/arm/mach-s3c64xx/irq-eint.c (renamed from arch/arm/plat-s3c64xx/irq-eint.c)2
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c (renamed from arch/arm/plat-s3c64xx/irq-pm.c)2
-rw-r--r--arch/arm/mach-s3c64xx/irq.c69
-rw-r--r--arch/arm/mach-s3c64xx/mach-anw6410.c (renamed from arch/arm/mach-s3c6410/mach-anw6410.c)8
-rw-r--r--arch/arm/mach-s3c64xx/mach-hmt.c (renamed from arch/arm/mach-s3c6410/mach-hmt.c)4
-rw-r--r--arch/arm/mach-s3c64xx/mach-ncp.c (renamed from arch/arm/mach-s3c6410/mach-ncp.c)4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6400.c (renamed from arch/arm/mach-s3c6400/mach-smdk6400.c)4
-rw-r--r--arch/arm/mach-s3c64xx/mach-smdk6410.c (renamed from arch/arm/mach-s3c6410/mach-smdk6410.c)337
-rw-r--r--arch/arm/mach-s3c64xx/pm.c (renamed from arch/arm/plat-s3c64xx/pm.c)12
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c (renamed from arch/arm/mach-s3c6400/s3c6400.c)11
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c (renamed from arch/arm/mach-s3c6410/cpu.c)24
-rw-r--r--arch/arm/mach-s3c64xx/setup-fb-24bpp.c (renamed from arch/arm/plat-s3c64xx/setup-fb-24bpp.c)0
-rw-r--r--arch/arm/mach-s3c64xx/setup-i2c0.c (renamed from arch/arm/plat-s3c64xx/setup-i2c0.c)2
-rw-r--r--arch/arm/mach-s3c64xx/setup-i2c1.c (renamed from arch/arm/plat-s3c64xx/setup-i2c1.c)2
-rw-r--r--arch/arm/mach-s3c64xx/setup-sdhci-gpio.c (renamed from arch/arm/plat-s3c64xx/setup-sdhci-gpio.c)0
-rw-r--r--arch/arm/mach-s3c64xx/setup-sdhci.c (renamed from arch/arm/mach-s3c6400/setup-sdhci.c)15
-rw-r--r--arch/arm/mach-s3c64xx/sleep.S (renamed from arch/arm/plat-s3c64xx/sleep.S)6
-rw-r--r--arch/arm/mach-s5p6440/Kconfig21
-rw-r--r--arch/arm/mach-s5p6440/Makefile19
-rw-r--r--arch/arm/mach-s5p6440/Makefile.boot2
-rw-r--r--arch/arm/mach-s5p6440/clock.c698
-rw-r--r--arch/arm/mach-s5p6440/cpu.c114
-rw-r--r--arch/arm/mach-s5p6440/gpio.c322
-rw-r--r--arch/arm/mach-s5p6440/include/mach/debug-macro.S37
-rw-r--r--arch/arm/mach-s5p6440/include/mach/entry-macro.S16
-rw-r--r--arch/arm/mach-s5p6440/include/mach/gpio.h80
-rw-r--r--arch/arm/mach-s5p6440/include/mach/hardware.h18
-rw-r--r--arch/arm/mach-s5p6440/include/mach/io.h18
-rw-r--r--arch/arm/mach-s5p6440/include/mach/irqs.h111
-rw-r--r--arch/arm/mach-s5p6440/include/mach/map.h68
-rw-r--r--arch/arm/mach-s5p6440/include/mach/memory.h19
-rw-r--r--arch/arm/mach-s5p6440/include/mach/pwm-clock.h62
-rw-r--r--arch/arm/mach-s5p6440/include/mach/regs-clock.h130
-rw-r--r--arch/arm/mach-s5p6440/include/mach/regs-gpio.h54
-rw-r--r--arch/arm/mach-s5p6440/include/mach/regs-irq.h19
-rw-r--r--arch/arm/mach-s5p6440/include/mach/system.h26
-rw-r--r--arch/arm/mach-s5p6440/include/mach/tick.h24
-rw-r--r--arch/arm/mach-s5p6440/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5p6440/include/mach/uncompress.h24
-rw-r--r--arch/arm/mach-s5p6440/include/mach/vmalloc.h17
-rw-r--r--arch/arm/mach-s5p6440/init.c52
-rw-r--r--arch/arm/mach-s5p6440/mach-smdk6440.c111
-rw-r--r--arch/arm/mach-s5p6442/Kconfig24
-rw-r--r--arch/arm/mach-s5p6442/Makefile19
-rw-r--r--arch/arm/mach-s5p6442/Makefile.boot2
-rw-r--r--arch/arm/mach-s5p6442/clock.c396
-rw-r--r--arch/arm/mach-s5p6442/cpu.c121
-rw-r--r--arch/arm/mach-s5p6442/include/mach/debug-macro.S36
-rw-r--r--arch/arm/mach-s5p6442/include/mach/entry-macro.S48
-rw-r--r--arch/arm/mach-s5p6442/include/mach/gpio.h123
-rw-r--r--arch/arm/mach-s5p6442/include/mach/hardware.h18
-rw-r--r--arch/arm/mach-s5p6442/include/mach/io.h17
-rw-r--r--arch/arm/mach-s5p6442/include/mach/irqs.h86
-rw-r--r--arch/arm/mach-s5p6442/include/mach/map.h58
-rw-r--r--arch/arm/mach-s5p6442/include/mach/memory.h19
-rw-r--r--arch/arm/mach-s5p6442/include/mach/pwm-clock.h69
-rw-r--r--arch/arm/mach-s5p6442/include/mach/regs-clock.h103
-rw-r--r--arch/arm/mach-s5p6442/include/mach/regs-irq.h19
-rw-r--r--arch/arm/mach-s5p6442/include/mach/system.h26
-rw-r--r--arch/arm/mach-s5p6442/include/mach/tick.h26
-rw-r--r--arch/arm/mach-s5p6442/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5p6442/include/mach/uncompress.h24
-rw-r--r--arch/arm/mach-s5p6442/include/mach/vmalloc.h17
-rw-r--r--arch/arm/mach-s5p6442/init.c44
-rw-r--r--arch/arm/mach-s5p6442/mach-smdk6442.c91
-rw-r--r--arch/arm/mach-s5pc100/include/mach/gpio-core.h21
-rw-r--r--arch/arm/mach-s5pc100/include/mach/io.h18
-rw-r--r--arch/arm/mach-s5pc100/include/mach/tick.h2
-rw-r--r--arch/arm/mach-s5pc100/include/mach/timex.h24
-rw-r--r--arch/arm/mach-s5pc100/include/mach/vmalloc.h17
-rw-r--r--arch/arm/mach-s5pc100/setup-sdhci.c4
-rw-r--r--arch/arm/mach-s5pv210/Kconfig40
-rw-r--r--arch/arm/mach-s5pv210/Makefile20
-rw-r--r--arch/arm/mach-s5pv210/Makefile.boot2
-rw-r--r--arch/arm/mach-s5pv210/clock.c454
-rw-r--r--arch/arm/mach-s5pv210/cpu.c126
-rw-r--r--arch/arm/mach-s5pv210/include/mach/debug-macro.S42
-rw-r--r--arch/arm/mach-s5pv210/include/mach/entry-macro.S54
-rw-r--r--arch/arm/mach-s5pv210/include/mach/gpio.h129
-rw-r--r--arch/arm/mach-s5pv210/include/mach/hardware.h18
-rw-r--r--arch/arm/mach-s5pv210/include/mach/io.h26
-rw-r--r--arch/arm/mach-s5pv210/include/mach/irqs.h146
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h65
-rw-r--r--arch/arm/mach-s5pv210/include/mach/memory.h23
-rw-r--r--arch/arm/mach-s5pv210/include/mach/pwm-clock.h69
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-clock.h169
-rw-r--r--arch/arm/mach-s5pv210/include/mach/regs-irq.h19
-rw-r--r--arch/arm/mach-s5pv210/include/mach/system.h26
-rw-r--r--arch/arm/mach-s5pv210/include/mach/tick.h26
-rw-r--r--arch/arm/mach-s5pv210/include/mach/timex.h29
-rw-r--r--arch/arm/mach-s5pv210/include/mach/uncompress.h24
-rw-r--r--arch/arm/mach-s5pv210/include/mach/vmalloc.h22
-rw-r--r--arch/arm/mach-s5pv210/init.c44
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c98
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c98
-rw-r--r--arch/arm/mach-sa1100/badge4.c5
-rw-r--r--arch/arm/mach-sa1100/collie.c4
-rw-r--r--arch/arm/mach-sa1100/include/mach/collie.h7
-rw-r--r--arch/arm/mach-sa1100/include/mach/irqs.h91
-rw-r--r--arch/arm/mach-sa1100/jornada720.c5
-rw-r--r--arch/arm/mach-sa1100/neponset.c5
-rw-r--r--arch/arm/mach-sa1100/time.c8
-rw-r--r--arch/arm/mach-shmobile/Kconfig84
-rw-r--r--arch/arm/mach-shmobile/Makefile22
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot9
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c301
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c211
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c211
-rw-r--r--arch/arm/mach-shmobile/clock-sh7367.c96
-rw-r--r--arch/arm/mach-shmobile/console.c31
-rw-r--r--arch/arm/mach-shmobile/include/mach/clkdev.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h23
-rw-r--r--arch/arm/mach-shmobile/include/mach/dma.h1
-rw-r--r--arch/arm/mach-shmobile/include/mach/entry-macro.S39
-rw-r--r--arch/arm/mach-shmobile/include/mach/gpio.h48
-rw-r--r--arch/arm/mach-shmobile/include/mach/hardware.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/io.h9
-rw-r--r--arch/arm/mach-shmobile/include/mach/irqs.h10
-rw-r--r--arch/arm/mach-shmobile/include/mach/memory.h7
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7367.h332
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h434
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7377.h360
-rw-r--r--arch/arm/mach-shmobile/include/mach/system.h14
-rw-r--r--arch/arm/mach-shmobile/include/mach/timex.h6
-rw-r--r--arch/arm/mach-shmobile/include/mach/uncompress.h21
-rw-r--r--arch/arm/mach-shmobile/include/mach/vmalloc.h6
-rw-r--r--arch/arm/mach-shmobile/intc-sh7367.c270
-rw-r--r--arch/arm/mach-shmobile/intc-sh7372.c369
-rw-r--r--arch/arm/mach-shmobile/intc-sh7377.c350
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7367.c1801
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7372.c1637
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7377.c1767
-rw-r--r--arch/arm/mach-shmobile/setup-sh7367.c198
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c199
-rw-r--r--arch/arm/mach-shmobile/setup-sh7377.c215
-rw-r--r--arch/arm/mach-shmobile/timer.c46
-rw-r--r--arch/arm/mach-u300/core.c4
-rw-r--r--arch/arm/mach-u300/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-ux500/include/mach/hardware.h8
-rw-r--r--arch/arm/mach-w90x900/cpu.h1
-rw-r--r--arch/arm/mach-w90x900/dev.c42
-rw-r--r--arch/arm/mach-w90x900/include/mach/fb.h83
-rw-r--r--arch/arm/mach-w90x900/include/mach/regs-ldm.h253
-rw-r--r--arch/arm/mach-w90x900/mach-nuc950evb.c47
-rw-r--r--arch/arm/mach-w90x900/nuc950.c4
-rw-r--r--arch/arm/plat-mxc/Kconfig30
-rw-r--r--arch/arm/plat-mxc/Makefile8
-rw-r--r--arch/arm/plat-mxc/audmux-v1.c14
-rw-r--r--arch/arm/plat-mxc/audmux-v2.c9
-rw-r--r--arch/arm/plat-mxc/clock.c1
-rw-r--r--arch/arm/plat-mxc/dma-mx1-mx2.c207
-rw-r--r--arch/arm/plat-mxc/ehci.c122
-rw-r--r--arch/arm/plat-mxc/gpio.c30
-rw-r--r--arch/arm/plat-mxc/include/mach/board-kzmarm11.h18
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31ads.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/board-mx31moboard.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/clock.h7
-rw-r--r--arch/arm/plat-mxc/include/mach/common.h5
-rw-r--r--arch/arm/plat-mxc/include/mach/debug-macro.S12
-rw-r--r--arch/arm/plat-mxc/include/mach/entry-macro.S34
-rw-r--r--arch/arm/plat-mxc/include/mach/hardware.h9
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx1.h313
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx21.h210
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx25.h24
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx27.h372
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx2x.h425
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx3.h76
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx35.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-mx51.h326
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v1.h103
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux.h128
-rw-r--r--arch/arm/plat-mxc/include/mach/irqs.h20
-rw-r--r--arch/arm/plat-mxc/include/mach/memory.h54
-rw-r--r--arch/arm/plat-mxc/include/mach/mtd-xip.h34
-rw-r--r--arch/arm/plat-mxc/include/mach/mx1.h395
-rw-r--r--arch/arm/plat-mxc/include/mach/mx21.h13
-rw-r--r--arch/arm/plat-mxc/include/mach/mx25.h36
-rw-r--r--arch/arm/plat-mxc/include/mach/mx27.h32
-rw-r--r--arch/arm/plat-mxc/include/mach/mx2x.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/mx31.h33
-rw-r--r--arch/arm/plat-mxc/include/mach/mx35.h13
-rw-r--r--arch/arm/plat-mxc/include/mach/mx3x.h8
-rw-r--r--arch/arm/plat-mxc/include/mach/mx51.h454
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc.h20
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc91231.h58
-rw-r--r--arch/arm/plat-mxc/include/mach/mxc_ehci.h4
-rw-r--r--arch/arm/plat-mxc/include/mach/ssi.h18
-rw-r--r--arch/arm/plat-mxc/include/mach/timex.h2
-rw-r--r--arch/arm/plat-mxc/include/mach/uncompress.h3
-rw-r--r--arch/arm/plat-mxc/iomux-mx1-mx2.c157
-rw-r--r--arch/arm/plat-mxc/iomux-v1.c238
-rw-r--r--arch/arm/plat-mxc/time.c41
-rw-r--r--arch/arm/plat-mxc/tzic.c172
-rw-r--r--arch/arm/plat-nomadik/timer.c9
-rw-r--r--arch/arm/plat-s3c/Kconfig215
-rw-r--r--arch/arm/plat-s3c/Makefile45
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig60
-rw-r--r--arch/arm/plat-s3c24xx/Makefile8
-rw-r--r--arch/arm/plat-s3c24xx/clock-dclk.c22
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c4
-rw-r--r--arch/arm/plat-s3c24xx/devs.c59
-rw-r--r--arch/arm/plat-s3c24xx/dma.c2
-rw-r--r--arch/arm/plat-s3c24xx/gpiolib.c2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/audio-simtec.h (renamed from arch/arm/plat-s3c/include/plat/audio-simtec.h)2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h2
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/mci.h9
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/s3c2440.h17
-rw-r--r--arch/arm/plat-s3c24xx/include/plat/s3c244x.h (renamed from arch/arm/plat-s3c24xx/s3c244x.h)14
-rw-r--r--arch/arm/plat-s3c64xx/Kconfig71
-rw-r--r--arch/arm/plat-s3c64xx/clock.c300
-rw-r--r--arch/arm/plat-s3c64xx/dev-audio.c167
-rw-r--r--arch/arm/plat-s3c64xx/irq.c256
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-clock.c758
-rw-r--r--arch/arm/plat-s3c64xx/s3c6400-init.c29
-rw-r--r--arch/arm/plat-s5p/Kconfig25
-rw-r--r--arch/arm/plat-s5p/Makefile19
-rw-r--r--arch/arm/plat-s5p/clock.c149
-rw-r--r--arch/arm/plat-s5p/cpu.c113
-rw-r--r--arch/arm/plat-s5p/dev-uart.c139
-rw-r--r--arch/arm/plat-s5p/include/plat/irqs.h90
-rw-r--r--arch/arm/plat-s5p/include/plat/map-s5p.h34
-rw-r--r--arch/arm/plat-s5p/include/plat/pll.h83
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p-clock.h40
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p6440.h37
-rw-r--r--arch/arm/plat-s5p/include/plat/s5p6442.h33
-rw-r--r--arch/arm/plat-s5p/include/plat/s5pv210.h33
-rw-r--r--arch/arm/plat-s5p/irq.c72
-rw-r--r--arch/arm/plat-s5p/setup-i2c0.c25
-rw-r--r--arch/arm/plat-s5pc1xx/Kconfig3
-rw-r--r--arch/arm/plat-s5pc1xx/clock.c31
-rw-r--r--arch/arm/plat-s5pc1xx/dev-uart.c29
-rw-r--r--arch/arm/plat-s5pc1xx/gpio-config.c2
-rw-r--r--arch/arm/plat-s5pc1xx/gpiolib.c2
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/irqs.h19
-rw-r--r--arch/arm/plat-s5pc1xx/include/plat/regs-clock.h119
-rw-r--r--arch/arm/plat-s5pc1xx/irq.c202
-rw-r--r--arch/arm/plat-s5pc1xx/s5pc100-clock.c770
-rw-r--r--arch/arm/plat-samsung/Kconfig229
-rw-r--r--arch/arm/plat-samsung/Makefile45
-rw-r--r--arch/arm/plat-samsung/adc.c (renamed from arch/arm/plat-s3c24xx/adc.c)55
-rw-r--r--arch/arm/plat-samsung/clock-clksrc.c212
-rw-r--r--arch/arm/plat-samsung/clock.c (renamed from arch/arm/plat-s3c/clock.c)75
-rw-r--r--arch/arm/plat-samsung/dev-fb.c (renamed from arch/arm/plat-s3c/dev-fb.c)0
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c (renamed from arch/arm/plat-s3c/dev-hsmmc.c)0
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c (renamed from arch/arm/plat-s3c/dev-hsmmc1.c)0
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c (renamed from arch/arm/plat-s3c/dev-hsmmc2.c)0
-rw-r--r--arch/arm/plat-samsung/dev-i2c0.c (renamed from arch/arm/plat-s3c/dev-i2c0.c)0
-rw-r--r--arch/arm/plat-samsung/dev-i2c1.c (renamed from arch/arm/plat-s3c/dev-i2c1.c)0
-rw-r--r--arch/arm/plat-samsung/dev-nand.c (renamed from arch/arm/plat-s3c/dev-nand.c)0
-rw-r--r--arch/arm/plat-samsung/dev-uart.c44
-rw-r--r--arch/arm/plat-samsung/dev-usb-hsotg.c (renamed from arch/arm/plat-s3c/dev-usb-hsotg.c)7
-rw-r--r--arch/arm/plat-samsung/dev-usb.c (renamed from arch/arm/plat-s3c/dev-usb.c)25
-rw-r--r--arch/arm/plat-samsung/dma.c (renamed from arch/arm/plat-s3c/dma.c)4
-rw-r--r--arch/arm/plat-samsung/gpio-config.c (renamed from arch/arm/plat-s3c/gpio-config.c)2
-rw-r--r--arch/arm/plat-samsung/gpio.c (renamed from arch/arm/plat-s3c/gpio.c)2
-rw-r--r--arch/arm/plat-samsung/gpiolib.c199
-rw-r--r--arch/arm/plat-samsung/include/plat/adc.h (renamed from arch/arm/plat-s3c/include/plat/adc.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/audio.h (renamed from arch/arm/plat-s3c/include/plat/audio.h)10
-rw-r--r--arch/arm/plat-samsung/include/plat/clock-clksrc.h83
-rw-r--r--arch/arm/plat-samsung/include/plat/clock.h (renamed from arch/arm/plat-s3c/include/plat/clock.h)36
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu-freq.h (renamed from arch/arm/plat-s3c/include/plat/cpu-freq.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h (renamed from arch/arm/plat-s3c/include/plat/cpu.h)5
-rw-r--r--arch/arm/plat-samsung/include/plat/debug-macro.S (renamed from arch/arm/plat-s3c/include/plat/debug-macro.S)14
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h (renamed from arch/arm/plat-s3c/include/plat/devs.h)11
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-core.h (renamed from arch/arm/plat-s3c/include/plat/dma-core.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-s3c24xx.h (renamed from arch/arm/plat-s3c24xx/include/plat/dma-plat.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/dma.h (renamed from arch/arm/plat-s3c/include/plat/dma.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/fb.h (renamed from arch/arm/plat-s3c/include/plat/fb.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h (renamed from arch/arm/plat-s3c/include/plat/gpio-cfg-helpers.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-cfg.h (renamed from arch/arm/plat-s3c/include/plat/gpio-cfg.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/gpio-core.h (renamed from arch/arm/plat-s3c/include/plat/gpio-core.h)30
-rw-r--r--arch/arm/plat-samsung/include/plat/hwmon.h (renamed from arch/arm/plat-s3c/include/plat/hwmon.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/iic-core.h (renamed from arch/arm/plat-s3c/include/plat/iic-core.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/iic.h (renamed from arch/arm/plat-s3c/include/plat/iic.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/irq-uart.h20
-rw-r--r--arch/arm/plat-samsung/include/plat/irq-vic-timer.h (renamed from arch/arm/plat-s3c24xx/include/plat/s3c2442.h)12
-rw-r--r--arch/arm/plat-samsung/include/plat/map-base.h (renamed from arch/arm/plat-s3c/include/plat/map-base.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/nand.h (renamed from arch/arm/plat-s3c/include/plat/nand.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h (renamed from arch/arm/plat-s3c/include/plat/pm.h)6
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-ac97.h (renamed from arch/arm/plat-s3c/include/plat/regs-ac97.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-adc.h (renamed from arch/arm/plat-s3c/include/plat/regs-adc.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb-v4.h (renamed from arch/arm/plat-s3c/include/plat/regs-fb-v4.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb.h (renamed from arch/arm/plat-s3c/include/plat/regs-fb.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-iic.h (renamed from arch/arm/plat-s3c/include/plat/regs-iic.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-irqtype.h (renamed from arch/arm/plat-s3c/include/plat/regs-irqtype.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-nand.h (renamed from arch/arm/plat-s3c/include/plat/regs-nand.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-rtc.h (renamed from arch/arm/plat-s3c/include/plat/regs-rtc.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-s3c2412-iis.h (renamed from arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-sdhci.h (renamed from arch/arm/plat-s3c/include/plat/regs-sdhci.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-serial.h (renamed from arch/arm/plat-s3c/include/plat/regs-serial.h)32
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-timer.h (renamed from arch/arm/plat-s3c/include/plat/regs-timer.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h (renamed from arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h (renamed from arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-watchdog.h (renamed from arch/arm/plat-s3c/include/plat/regs-watchdog.h)0
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c64xx-spi.h67
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h (renamed from arch/arm/plat-s3c/include/plat/sdhci.h)43
-rw-r--r--arch/arm/plat-samsung/include/plat/udc-hs.h (renamed from arch/arm/plat-s3c/include/plat/udc-hs.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/uncompress.h (renamed from arch/arm/plat-s3c/include/plat/uncompress.h)2
-rw-r--r--arch/arm/plat-samsung/include/plat/usb-control.h (renamed from arch/arm/plat-s3c/include/plat/usb-control.h)4
-rw-r--r--arch/arm/plat-samsung/include/plat/watchdog-reset.h (renamed from arch/arm/plat-s3c/include/plat/watchdog-reset.h)0
-rw-r--r--arch/arm/plat-samsung/init.c (renamed from arch/arm/plat-s3c/init.c)0
-rw-r--r--arch/arm/plat-samsung/irq-uart.c143
-rw-r--r--arch/arm/plat-samsung/irq-vic-timer.c86
-rw-r--r--arch/arm/plat-samsung/pm-check.c (renamed from arch/arm/plat-s3c/pm-check.c)8
-rw-r--r--arch/arm/plat-samsung/pm-gpio.c (renamed from arch/arm/plat-s3c/pm-gpio.c)2
-rw-r--r--arch/arm/plat-samsung/pm.c (renamed from arch/arm/plat-s3c/pm.c)8
-rw-r--r--arch/arm/plat-samsung/pwm-clock.c (renamed from arch/arm/plat-s3c/pwm-clock.c)112
-rw-r--r--arch/arm/plat-samsung/pwm.c (renamed from arch/arm/plat-s3c/pwm.c)0
-rw-r--r--arch/arm/plat-samsung/time.c (renamed from arch/arm/plat-s3c/time.c)2
-rw-r--r--arch/avr32/include/asm/ptrace.h2
-rw-r--r--arch/avr32/kernel/ptrace.c53
-rw-r--r--arch/blackfin/include/asm/dma-mapping.h36
-rw-r--r--arch/blackfin/include/asm/nand.h4
-rw-r--r--arch/cris/arch-v10/kernel/entry.S2
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v10/lib/old_checksum.c2
-rw-r--r--arch/cris/arch-v32/kernel/entry.S2
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c109
-rw-r--r--arch/cris/arch-v32/mm/tlb.c2
-rw-r--r--arch/cris/include/arch-v32/arch/ptrace.h1
-rw-r--r--arch/cris/include/asm/pci.h8
-rw-r--r--arch/cris/include/asm/unistd.h2
-rw-r--r--arch/cris/kernel/sys_cris.c96
-rw-r--r--arch/frv/include/asm/dma-mapping.h41
-rw-r--r--arch/frv/include/asm/pci.h8
-rw-r--r--arch/frv/include/asm/ptrace.h2
-rw-r--r--arch/frv/include/asm/unistd.h1
-rw-r--r--arch/frv/kernel/sys_frv.c89
-rw-r--r--arch/frv/mb93090-mb00/pci-dma-nommu.c30
-rw-r--r--arch/frv/mb93090-mb00/pci-dma.c30
-rw-r--r--arch/h8300/include/asm/io.h2
-rw-r--r--arch/h8300/include/asm/ptrace.h2
-rw-r--r--arch/h8300/include/asm/unistd.h3
-rw-r--r--arch/h8300/kernel/ptrace.c82
-rw-r--r--arch/h8300/kernel/sys_h8300.c138
-rw-r--r--arch/h8300/kernel/syscalls.S4
-rw-r--r--arch/h8300/platform/h8300h/ptrace_h8300h.c6
-rw-r--r--arch/h8300/platform/h8s/ptrace_h8s.c4
-rw-r--r--arch/ia64/Kconfig3
-rw-r--r--arch/ia64/include/asm/compat.h3
-rw-r--r--arch/ia64/include/asm/pci.h14
-rw-r--r--arch/ia64/include/asm/ptrace.h4
-rw-r--r--arch/ia64/sn/kernel/setup.c2
-rw-r--r--arch/m32r/include/asm/ptrace.h2
-rw-r--r--arch/m32r/include/asm/unistd.h1
-rw-r--r--arch/m32r/kernel/ptrace.c97
-rw-r--r--arch/m32r/kernel/sys_m32r.c92
-rw-r--r--arch/m68k/atari/atakeyb.c2
-rw-r--r--arch/m68k/include/asm/fbio.h2
-rw-r--r--arch/m68k/include/asm/io_no.h2
-rw-r--r--arch/m68k/include/asm/ptrace.h8
-rw-r--r--arch/m68k/include/asm/unistd.h3
-rw-r--r--arch/m68k/kernel/entry.S4
-rw-r--r--arch/m68k/kernel/sys_m68k.c131
-rw-r--r--arch/m68knommu/kernel/ptrace.c74
-rw-r--r--arch/m68knommu/kernel/sys_m68k.c136
-rw-r--r--arch/m68knommu/kernel/syscalltable.S4
-rw-r--r--arch/microblaze/kernel/ptrace.c64
-rw-r--r--arch/mips/Kconfig4
-rw-r--r--arch/mips/include/asm/compat.h3
-rw-r--r--arch/mips/include/asm/pci.h22
-rw-r--r--arch/mips/include/asm/unistd.h2
-rw-r--r--arch/mips/kernel/linux32.c16
-rw-r--r--arch/mips/kernel/ptrace.c30
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/kernel/syscall.c130
-rw-r--r--arch/mn10300/include/asm/dma-mapping.h65
-rw-r--r--arch/mn10300/include/asm/ptrace.h2
-rw-r--r--arch/mn10300/include/asm/unistd.h2
-rw-r--r--arch/mn10300/kernel/entry.S2
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c106
-rw-r--r--arch/parisc/Kconfig3
-rw-r--r--arch/parisc/include/asm/compat.h3
-rw-r--r--arch/parisc/include/asm/pci.h14
-rw-r--r--arch/parisc/include/asm/ptrace.h5
-rw-r--r--arch/parisc/kernel/sys_parisc.c15
-rw-r--r--arch/parisc/kernel/syscall_table.S2
-rw-r--r--arch/powerpc/Kconfig3
-rw-r--r--arch/powerpc/boot/dts/gef_ppc9a.dts4
-rw-r--r--arch/powerpc/boot/dts/gef_sbc310.dts4
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts4
-rw-r--r--arch/powerpc/boot/dts/kmeter1.dts2
-rw-r--r--arch/powerpc/include/asm/compat.h3
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h3
-rw-r--r--arch/powerpc/include/asm/paca.h18
-rw-r--r--arch/powerpc/include/asm/pci.h32
-rw-r--r--arch/powerpc/include/asm/perf_event.h109
-rw-r--r--arch/powerpc/include/asm/perf_event_fsl_emb.h50
-rw-r--r--arch/powerpc/include/asm/perf_event_server.h110
-rw-r--r--arch/powerpc/include/asm/ptrace.h7
-rw-r--r--arch/powerpc/include/asm/reg_booke.h4
-rw-r--r--arch/powerpc/include/asm/reg_fsl_emb.h2
-rw-r--r--arch/powerpc/include/asm/syscalls.h4
-rw-r--r--arch/powerpc/include/asm/systbl.h2
-rw-r--r--arch/powerpc/include/asm/unistd.h2
-rw-r--r--arch/powerpc/kernel/Makefile7
-rw-r--r--arch/powerpc/kernel/cputable.c2
-rw-r--r--arch/powerpc/kernel/e500-pmu.c129
-rw-r--r--arch/powerpc/kernel/head_64.S17
-rw-r--r--arch/powerpc/kernel/legacy_serial.c2
-rw-r--r--arch/powerpc/kernel/paca.c93
-rw-r--r--arch/powerpc/kernel/pci-common.c15
-rw-r--r--arch/powerpc/kernel/perf_event_fsl_emb.c654
-rw-r--r--arch/powerpc/kernel/prom.c3
-rw-r--r--arch/powerpc/kernel/ptrace.c12
-rw-r--r--arch/powerpc/kernel/setup-common.c3
-rw-r--r--arch/powerpc/kernel/setup_64.c12
-rw-r--r--arch/powerpc/kernel/syscalls.c164
-rw-r--r--arch/powerpc/mm/init_32.c2
-rw-r--r--arch/powerpc/platforms/82xx/pq2ads-pci-pic.c10
-rw-r--r--arch/powerpc/platforms/85xx/socrates_fpga_pic.c34
-rw-r--r--arch/powerpc/platforms/86xx/Kconfig12
-rw-r--r--arch/powerpc/platforms/86xx/gef_gpio.c10
-rw-r--r--arch/powerpc/platforms/86xx/gef_pic.c20
-rw-r--r--arch/powerpc/platforms/86xx/gef_ppc9a.c12
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc310.c12
-rw-r--r--arch/powerpc/platforms/86xx/gef_sbc610.c12
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype10
-rw-r--r--arch/powerpc/platforms/iseries/exception.S25
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c42
-rw-r--r--arch/powerpc/platforms/pseries/offline_states.h23
-rw-r--r--arch/powerpc/platforms/pseries/plpar_wrappers.h4
-rw-r--r--arch/powerpc/platforms/pseries/xics.c7
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.h2
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c10
-rw-r--r--arch/s390/crypto/sha_common.c2
-rw-r--r--arch/s390/include/asm/cio.h2
-rw-r--r--arch/s390/include/asm/compat.h3
-rw-r--r--arch/s390/include/asm/ptrace.h3
-rw-r--r--arch/s390/include/asm/unistd.h1
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/entry.h10
-rw-r--r--arch/s390/kernel/sclp.S2
-rw-r--r--arch/s390/kernel/sys_s390.c43
-rw-r--r--arch/s390/kernel/syscalls.S6
-rw-r--r--arch/score/include/asm/ptrace.h3
-rw-r--r--arch/sh/Kconfig3
-rw-r--r--arch/sh/include/asm/pci.h19
-rw-r--r--arch/sh/include/asm/ptrace.h2
-rw-r--r--arch/sh/include/asm/syscalls.h5
-rw-r--r--arch/sh/include/asm/unistd_32.h2
-rw-r--r--arch/sh/include/asm/unistd_64.h2
-rw-r--r--arch/sh/kernel/cpu/clock.c2
-rw-r--r--arch/sh/kernel/sys_sh.c115
-rw-r--r--arch/sparc/Kconfig3
-rw-r--r--arch/sparc/include/asm/compat.h3
-rw-r--r--arch/sparc/include/asm/dma-mapping.h14
-rw-r--r--arch/sparc/include/asm/fbio.h2
-rw-r--r--arch/sparc/include/asm/pci_32.h14
-rw-r--r--arch/sparc/include/asm/pci_64.h14
-rw-r--r--arch/sparc/include/asm/unistd.h4
-rw-r--r--arch/sparc/kernel/iommu.c10
-rw-r--r--arch/sparc/kernel/ioport.c11
-rw-r--r--arch/sparc/kernel/perf_event.c2
-rw-r--r--arch/sparc/kernel/sys_sparc_32.c113
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c13
-rw-r--r--arch/sparc/kernel/systbls.h5
-rw-r--r--arch/sparc/kernel/systbls_64.S6
-rw-r--r--arch/um/include/asm/dma-mapping.h8
-rw-r--r--arch/um/include/asm/ptrace-generic.h2
-rw-r--r--arch/um/kernel/ptrace.c70
-rw-r--r--arch/um/kernel/syscall.c45
-rw-r--r--arch/um/sys-i386/shared/sysdep/syscalls.h2
-rw-r--r--arch/um/sys-i386/sys_call_table.S2
-rw-r--r--arch/um/sys-i386/syscalls.c137
-rw-r--r--arch/um/sys-x86_64/syscall_table.c5
-rw-r--r--arch/um/sys-x86_64/syscalls.c14
-rw-r--r--arch/x86/Kconfig3
-rw-r--r--arch/x86/crypto/twofish-i586-asm_32.S10
-rw-r--r--arch/x86/crypto/twofish-x86_64-asm_64.S20
-rw-r--r--arch/x86/ia32/ia32entry.S6
-rw-r--r--arch/x86/ia32/sys_ia32.c76
-rw-r--r--arch/x86/include/asm/compat.h3
-rw-r--r--arch/x86/include/asm/pci.h28
-rw-r--r--arch/x86/include/asm/ptrace.h7
-rw-r--r--arch/x86/include/asm/sys_ia32.h11
-rw-r--r--arch/x86/include/asm/syscalls.h15
-rw-r--r--arch/x86/include/asm/unistd_32.h4
-rw-r--r--arch/x86/include/asm/unistd_64.h3
-rw-r--r--arch/x86/kernel/apic/apic_flat_64.c2
-rw-r--r--arch/x86/kernel/head_64.S2
-rw-r--r--arch/x86/kernel/pci-calgary_64.c2
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/ptrace.c2
-rw-r--r--arch/x86/kernel/sys_i386_32.c185
-rw-r--r--arch/x86/kernel/sys_x86_64.c12
-rw-r--r--arch/x86/kernel/syscall_table_32.S4
-rw-r--r--arch/x86/kernel/tsc.c2
-rw-r--r--arch/x86/kernel/vmiclock_32.c2
-rw-r--r--arch/x86/xen/smp.c2
-rw-r--r--arch/xtensa/include/asm/pci.h8
-rw-r--r--arch/xtensa/include/asm/ptrace.h1
-rw-r--r--arch/xtensa/kernel/entry.S4
-rw-r--r--arch/xtensa/kernel/ptrace.c56
-rw-r--r--block/Kconfig2
-rw-r--r--block/Kconfig.iosched2
-rw-r--r--block/blk-cgroup.c53
-rw-r--r--block/blk-cgroup.h10
-rw-r--r--block/bsg.c2
-rw-r--r--crypto/Kconfig4
-rw-r--r--drivers/Makefile1
-rw-r--r--drivers/acpi/dock.c2
-rw-r--r--drivers/acpi/proc.c2
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-sff.c2
-rw-r--r--drivers/ata/pata_acpi.c2
-rw-r--r--drivers/ata/pata_hpt3x3.c2
-rw-r--r--drivers/ata/pata_pcmcia.c2
-rw-r--r--drivers/block/drbd/drbd_int.h4
-rw-r--r--drivers/block/drbd/drbd_req.h2
-rw-r--r--drivers/block/floppy.c1493
-rw-r--r--drivers/char/ChangeLog775
-rw-r--r--drivers/char/agp/intel-agp.c2
-rw-r--r--drivers/char/applicom.c2
-rw-r--r--drivers/char/hvc_iseries.c2
-rw-r--r--drivers/char/hw_random/n2-drv.c2
-rw-r--r--drivers/char/ip2/i2hw.h2
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c71
-rw-r--r--drivers/char/mem.c195
-rw-r--r--drivers/char/mmtimer.c2
-rw-r--r--drivers/char/n_tty.c17
-rw-r--r--drivers/char/pty.c2
-rw-r--r--drivers/char/random.c2
-rw-r--r--drivers/char/serial167.c2
-rw-r--r--drivers/char/tty_audit.c1
-rw-r--r--drivers/char/tty_io.c2
-rw-r--r--drivers/char/vt.c6
-rw-r--r--drivers/crypto/hifn_795x.c2
-rw-r--r--drivers/dma/coh901318_lli.h2
-rw-r--r--drivers/edac/e752x_edac.c117
-rw-r--r--drivers/edac/mpc85xx_edac.c163
-rw-r--r--drivers/edac/mpc85xx_edac.h3
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h2
-rw-r--r--drivers/gpu/drm/radeon/radeon_state.c2
-rw-r--r--drivers/gpu/drm/via/via_irq.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.c2
-rw-r--r--drivers/i2c/busses/i2c-pxa.c2
-rw-r--r--drivers/ieee1394/pcilynx.c2
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qes.h4
-rw-r--r--drivers/infiniband/hw/ehca/ehca_reqs.c2
-rw-r--r--drivers/input/keyboard/locomokbd.c32
-rw-r--r--drivers/input/misc/yealink.h2
-rw-r--r--drivers/input/serio/i8042.c2
-rw-r--r--drivers/input/tablet/aiptek.c2
-rw-r--r--drivers/isdn/hardware/mISDN/mISDNisar.c4
-rw-r--r--drivers/isdn/i4l/isdn_common.c2
-rw-r--r--drivers/isdn/mISDN/dsp_core.c4
-rw-r--r--drivers/isdn/mISDN/l1oip_core.c4
-rw-r--r--drivers/isdn/sc/hardware.h2
-rw-r--r--drivers/macintosh/therm_pm72.c30
-rw-r--r--drivers/macintosh/therm_pm72.h2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.h8
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c4
-rw-r--r--drivers/media/video/gspca/ov519.c2
-rw-r--r--drivers/media/video/pwc/philips.txt2
-rw-r--r--drivers/media/video/sn9c102/sn9c102_sensor.h2
-rw-r--r--drivers/media/video/tea6420.c2
-rw-r--r--drivers/message/i2o/iop.c2
-rw-r--r--drivers/mfd/sm501.c8
-rw-r--r--drivers/misc/sgi-gru/grutables.h15
-rw-r--r--drivers/mmc/card/sdio_uart.c2
-rw-r--r--drivers/mmc/core/core.c1
-rw-r--r--drivers/mmc/core/sdio_ops.c36
-rw-r--r--drivers/mmc/core/sdio_ops.h1
-rw-r--r--drivers/mmc/host/msm_sdcc.c4
-rw-r--r--drivers/mmc/host/mxcmmc.c4
-rw-r--r--[-rwxr-xr-x]drivers/mtd/chips/cfi_util.c0
-rw-r--r--drivers/mtd/chips/jedec_probe.c2
-rw-r--r--[-rwxr-xr-x]drivers/mtd/inftlcore.c0
-rw-r--r--drivers/mtd/maps/pismo.c2
-rw-r--r--drivers/mtd/maps/plat-ram.c2
-rw-r--r--drivers/mtd/nand/Kconfig2
-rw-r--r--drivers/mtd/nand/bcm_umi_nand.c4
-rw-r--r--drivers/mtd/nand/mxc_nand.c2
-rw-r--r--drivers/net/atlx/atl2.h2
-rw-r--r--drivers/net/chelsio/sge.c2
-rw-r--r--drivers/net/cs89x0.c2
-rw-r--r--drivers/net/cxgb3/sge.c4
-rw-r--r--drivers/net/davinci_emac.c2
-rw-r--r--drivers/net/e1000e/82571.c2
-rw-r--r--drivers/net/e1000e/lib.c2
-rw-r--r--drivers/net/igb/igb_main.c2
-rw-r--r--drivers/net/irda/sa1100_ir.c2
-rw-r--r--drivers/net/ks8851.c2
-rw-r--r--drivers/net/qlge/qlge_ethtool.c2
-rw-r--r--drivers/net/qlge/qlge_main.c2
-rw-r--r--drivers/net/sfc/regs.h2
-rw-r--r--drivers/net/skfp/ess.c2
-rw-r--r--drivers/net/smsc9420.c2
-rw-r--r--drivers/net/spider_net.c4
-rw-r--r--drivers/net/sungem.c2
-rw-r--r--drivers/net/tehuti.c2
-rw-r--r--drivers/net/tokenring/tms380tr.c4
-rw-r--r--drivers/net/tun.c2
-rw-r--r--drivers/net/typhoon.c6
-rw-r--r--drivers/net/ucc_geth.c2
-rw-r--r--drivers/net/wan/cosa.c10
-rw-r--r--drivers/net/wan/hdlc_cisco.c8
-rw-r--r--drivers/net/wan/hdlc_x25.c4
-rw-r--r--drivers/net/wimax/i2400m/fw.c2
-rw-r--r--drivers/net/wimax/i2400m/i2400m.h2
-rw-r--r--drivers/net/wimax/i2400m/sdio.c4
-rw-r--r--drivers/net/wimax/i2400m/usb.c4
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c2
-rw-r--r--drivers/net/wireless/iwmc3200wifi/lmac.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c6
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c2
-rw-r--r--drivers/parport/ChangeLog583
-rw-r--r--drivers/pci/pci.c33
-rw-r--r--drivers/pcmcia/sa1111_generic.c25
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c4
-rw-r--r--drivers/pps/Kconfig2
-rw-r--r--drivers/pps/Makefile1
-rw-r--r--drivers/pps/clients/Kconfig25
-rw-r--r--drivers/pps/clients/Makefile10
-rw-r--r--drivers/pps/clients/pps-ktimer.c123
-rw-r--r--drivers/pps/clients/pps-ldisc.c154
-rw-r--r--drivers/rtc/hctosys.c59
-rw-r--r--drivers/rtc/rtc-sysfs.c5
-rw-r--r--drivers/s390/char/raw3270.c2
-rw-r--r--drivers/s390/char/sclp.c2
-rw-r--r--drivers/scsi/a100u2w.c2
-rw-r--r--drivers/scsi/initio.c2
-rw-r--r--drivers/scsi/libfc/fc_fcp.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c4
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c4
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h2
-rw-r--r--drivers/scsi/pm8001/pm8001_hwi.c2
-rw-r--r--drivers/scsi/pm8001/pm8001_sas.c2
-rw-r--r--drivers/scsi/pmcraid.h2
-rw-r--r--drivers/scsi/sd.c2
-rw-r--r--drivers/scsi/ses.c4
-rw-r--r--drivers/serial/8250.c16
-rw-r--r--drivers/serial/Kconfig31
-rw-r--r--drivers/serial/Makefile1
-rw-r--r--drivers/serial/amba-pl010.c15
-rw-r--r--drivers/serial/imx.c2
-rw-r--r--drivers/serial/s3c2412.c1
-rw-r--r--drivers/serial/s5pv210.c154
-rw-r--r--drivers/serial/samsung.c8
-rw-r--r--drivers/serial/samsung.h19
-rw-r--r--drivers/serial/sh-sci.h22
-rw-r--r--drivers/sh/intc.c10
-rw-r--r--drivers/spi/spi_s3c24xx.c2
-rw-r--r--drivers/usb/gadget/fsl_mx3_udc.c31
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c4
-rw-r--r--drivers/usb/gadget/s3c-hsotg.c2
-rw-r--r--drivers/usb/musb/davinci.c2
-rw-r--r--drivers/usb/musb/musb_regs.h2
-rw-r--r--drivers/usb/serial/cypress_m8.c2
-rw-r--r--drivers/usb/serial/opticon.c2
-rw-r--r--drivers/usb/serial/symbolserial.c2
-rw-r--r--drivers/usb/wusbcore/wusbhc.h2
-rw-r--r--drivers/uwb/i1480/i1480-est.c4
-rw-r--r--drivers/uwb/uwbd.c2
-rw-r--r--drivers/video/68328fb.c2
-rw-r--r--drivers/video/Kconfig27
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/asiliantfb.c4
-rw-r--r--drivers/video/bf54x-lq043fb.c30
-rw-r--r--drivers/video/bfin-lq035q1-fb.c1
-rw-r--r--drivers/video/bfin-t350mcqb-fb.c29
-rw-r--r--drivers/video/broadsheetfb.c738
-rw-r--r--drivers/video/mb862xx/mb862xxfb.c13
-rw-r--r--drivers/video/mbx/mbxfb.c2
-rw-r--r--drivers/video/modedb.c8
-rw-r--r--drivers/video/nuc900fb.c779
-rw-r--r--drivers/video/nuc900fb.h55
-rw-r--r--drivers/video/omap/lcdc.c2
-rw-r--r--drivers/video/pm2fb.c2
-rw-r--r--drivers/video/s1d13xxxfb.c4
-rw-r--r--drivers/video/sis/sis_main.c3
-rw-r--r--drivers/video/sm501fb.c2
-rw-r--r--drivers/video/sstfb.c2
-rw-r--r--drivers/video/via/Makefile2
-rw-r--r--drivers/video/via/chip.h11
-rw-r--r--drivers/video/via/dvi.c233
-rw-r--r--drivers/video/via/dvi.h7
-rw-r--r--drivers/video/via/global.c5
-rw-r--r--drivers/video/via/global.h3
-rw-r--r--drivers/video/via/hw.c330
-rw-r--r--drivers/video/via/hw.h17
-rw-r--r--drivers/video/via/iface.c78
-rw-r--r--drivers/video/via/iface.h38
-rw-r--r--drivers/video/via/lcd.c640
-rw-r--r--drivers/video/via/share.h56
-rw-r--r--drivers/video/via/via_utility.c12
-rw-r--r--drivers/video/via/via_utility.h1
-rw-r--r--drivers/video/via/viafbdev.c518
-rw-r--r--drivers/video/via/viafbdev.h6
-rw-r--r--drivers/video/via/viamode.c180
-rw-r--r--drivers/video/via/viamode.h8
-rw-r--r--drivers/w1/masters/ds2482.c2
-rw-r--r--drivers/w1/masters/mxc_w1.c4
-rw-r--r--drivers/w1/w1.c4
-rw-r--r--drivers/zorro/zorro.ids2
-rw-r--r--fs/affs/bitmap.c2
-rw-r--r--fs/binfmt_elf_fdpic.c2
-rw-r--r--fs/bio.c7
-rw-r--r--fs/btrfs/disk-io.c4
-rw-r--r--fs/btrfs/extent_io.c4
-rw-r--r--fs/btrfs/extent_map.c2
-rw-r--r--fs/btrfs/free-space-cache.c4
-rw-r--r--fs/btrfs/ordered-data.h2
-rw-r--r--fs/btrfs/ref-cache.h2
-rw-r--r--fs/btrfs/relocation.c4
-rw-r--r--fs/btrfs/super.c5
-rw-r--r--fs/btrfs/transaction.c2
-rw-r--r--fs/buffer.c15
-rw-r--r--fs/cifs/asn1.c2
-rw-r--r--fs/cifs/cifs_dfs_ref.c2
-rw-r--r--fs/cifs/cifssmb.c2
-rw-r--r--fs/compat.c18
-rw-r--r--fs/dlm/member.c2
-rw-r--r--fs/ext3/super.c2
-rw-r--r--fs/ext4/mballoc.c2
-rw-r--r--fs/ext4/super.c2
-rw-r--r--fs/fuse/inode.c2
-rw-r--r--fs/gfs2/ops_fstype.c2
-rw-r--r--fs/jbd/transaction.c2
-rw-r--r--fs/locks.c2
-rw-r--r--fs/mpage.c2
-rw-r--r--fs/namei.c2
-rw-r--r--fs/nfsd/nfs4xdr.c2
-rw-r--r--fs/ntfs/ChangeLog1702
-rw-r--r--fs/ocfs2/cluster/tcp.c4
-rw-r--r--fs/ocfs2/dlmglue.c2
-rw-r--r--fs/ocfs2/extent_map.c2
-rw-r--r--fs/qnx4/inode.c3
-rw-r--r--fs/reiserfs/bitmap.c2
-rw-r--r--fs/select.c17
-rw-r--r--fs/udf/inode.c2
-rw-r--r--fs/ufs/super.c3
-rw-r--r--fs/ufs/ufs_fs.h15
-rw-r--r--include/asm-generic/pci-dma-compat.h15
-rw-r--r--include/linux/acct.h3
-rw-r--r--include/linux/cgroup.h53
-rw-r--r--include/linux/compat.h3
-rw-r--r--include/linux/coredump.h10
-rw-r--r--include/linux/decompress/mm.h14
-rw-r--r--include/linux/dm9000.h2
-rw-r--r--include/linux/dma-mapping.h24
-rw-r--r--include/linux/hil.h16
-rw-r--r--include/linux/init_task.h8
-rw-r--r--include/linux/iocontext.h2
-rw-r--r--include/linux/ipc_namespace.h5
-rw-r--r--include/linux/ipmi_smi.h1
-rw-r--r--include/linux/kmod.h1
-rw-r--r--include/linux/lockdep.h4
-rw-r--r--include/linux/lru_cache.h2
-rw-r--r--include/linux/memcontrol.h6
-rw-r--r--include/linux/mm.h8
-rw-r--r--include/linux/mm_types.h2
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/nodemask.h2
-rw-r--r--include/linux/page_cgroup.h2
-rw-r--r--include/linux/pci-dma.h11
-rw-r--r--include/linux/pci.h3
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/ptrace.h5
-rw-r--r--include/linux/rbtree.h8
-rw-r--r--include/linux/rcupdate.h4
-rw-r--r--include/linux/reboot.h1
-rw-r--r--include/linux/rtc.h6
-rw-r--r--include/linux/rtmutex.h2
-rw-r--r--include/linux/sched.h4
-rw-r--r--include/linux/serial_core.h11
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/swap.h9
-rw-r--r--include/linux/syscalls.h11
-rw-r--r--include/linux/taskstats_kern.h7
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/tty_ldisc.h8
-rw-r--r--include/math-emu/op-common.h2
-rw-r--r--include/media/davinci/vpfe_capture.h2
-rw-r--r--include/net/irda/irttp.h2
-rw-r--r--include/net/net_namespace.h5
-rw-r--r--include/scsi/sg.h3
-rw-r--r--include/video/broadsheetfb.h23
-rw-r--r--init/Kconfig1
-rw-r--r--ipc/Makefile2
-rw-r--r--ipc/mqueue.c2
-rw-r--r--ipc/shm.c3
-rw-r--r--ipc/syscall.c99
-rw-r--r--kernel/acct.c10
-rw-r--r--kernel/audit.c2
-rw-r--r--kernel/cgroup.c693
-rw-r--r--kernel/fork.c38
-rw-r--r--kernel/irq/chip.c2
-rw-r--r--kernel/irq/devres.c4
-rw-r--r--kernel/ksysfs.c2
-rw-r--r--kernel/nsproxy.c13
-rw-r--r--kernel/params.c6
-rw-r--r--kernel/pid_namespace.c7
-rw-r--r--kernel/sched_cpupri.c2
-rw-r--r--kernel/sys.c67
-rw-r--r--kernel/sys_ni.c1
-rw-r--r--kernel/sysctl.c37
-rw-r--r--kernel/trace/ring_buffer.c4
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--lib/zlib_inflate/inffast.c72
-rw-r--r--mm/highmem.c2
-rw-r--r--mm/memcontrol.c1386
-rw-r--r--mm/memory.c11
-rw-r--r--mm/memory_hotplug.c6
-rw-r--r--mm/mmap.c24
-rw-r--r--mm/nommu.c24
-rw-r--r--mm/oom_kill.c10
-rw-r--r--mm/page_alloc.c85
-rw-r--r--mm/page_cgroup.c34
-rw-r--r--mm/slub.c2
-rw-r--r--mm/swapfile.c31
-rw-r--r--net/ipv4/tcp_timer.c2
-rw-r--r--net/mac80211/mesh_plink.c2
-rw-r--r--net/netfilter/nf_conntrack_sip.c4
-rw-r--r--net/netfilter/xt_hashlimit.c2
-rw-r--r--net/sctp/sm_sideeffect.c2
-rw-r--r--scripts/gfp-translate2
-rwxr-xr-xscripts/kernel-doc2
-rw-r--r--security/selinux/avc.c6
-rw-r--r--sound/arm/pxa2xx-ac97-lib.c68
-rw-r--r--sound/pci/rme9652/hdspm.c2
-rw-r--r--sound/soc/codecs/wm8990.c2
-rw-r--r--sound/soc/pxa/pxa-ssp.c93
-rw-r--r--sound/soc/s3c24xx/s3c64xx-i2s.c4
-rw-r--r--tools/perf/perf.c2
-rw-r--r--tools/perf/util/hist.c2
1223 files changed, 55114 insertions, 21097 deletions
diff --git a/Documentation/DMA-API.txt b/Documentation/DMA-API.txt
index 5aceb88b3f8b..05e2ae236865 100644
--- a/Documentation/DMA-API.txt
+++ b/Documentation/DMA-API.txt
@@ -4,20 +4,18 @@
4 James E.J. Bottomley <James.Bottomley@HansenPartnership.com> 4 James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
5 5
6This document describes the DMA API. For a more gentle introduction 6This document describes the DMA API. For a more gentle introduction
7phrased in terms of the pci_ equivalents (and actual examples) see 7of the API (and actual examples) see
8Documentation/PCI/PCI-DMA-mapping.txt. 8Documentation/DMA-API-HOWTO.txt.
9 9
10This API is split into two pieces. Part I describes the API and the 10This API is split into two pieces. Part I describes the API. Part II
11corresponding pci_ API. Part II describes the extensions to the API 11describes the extensions to the API for supporting non-consistent
12for supporting non-consistent memory machines. Unless you know that 12memory machines. Unless you know that your driver absolutely has to
13your driver absolutely has to support non-consistent platforms (this 13support non-consistent platforms (this is usually only legacy
14is usually only legacy platforms) you should only use the API 14platforms) you should only use the API described in part I.
15described in part I.
16 15
17Part I - pci_ and dma_ Equivalent API 16Part I - dma_ API
18------------------------------------- 17-------------------------------------
19 18
20To get the pci_ API, you must #include <linux/pci.h>
21To get the dma_ API, you must #include <linux/dma-mapping.h> 19To get the dma_ API, you must #include <linux/dma-mapping.h>
22 20
23 21
@@ -27,9 +25,6 @@ Part Ia - Using large dma-coherent buffers
27void * 25void *
28dma_alloc_coherent(struct device *dev, size_t size, 26dma_alloc_coherent(struct device *dev, size_t size,
29 dma_addr_t *dma_handle, gfp_t flag) 27 dma_addr_t *dma_handle, gfp_t flag)
30void *
31pci_alloc_consistent(struct pci_dev *dev, size_t size,
32 dma_addr_t *dma_handle)
33 28
34Consistent memory is memory for which a write by either the device or 29Consistent memory is memory for which a write by either the device or
35the processor can immediately be read by the processor or device 30the processor can immediately be read by the processor or device
@@ -53,15 +48,11 @@ The simplest way to do that is to use the dma_pool calls (see below).
53The flag parameter (dma_alloc_coherent only) allows the caller to 48The flag parameter (dma_alloc_coherent only) allows the caller to
54specify the GFP_ flags (see kmalloc) for the allocation (the 49specify the GFP_ flags (see kmalloc) for the allocation (the
55implementation may choose to ignore flags that affect the location of 50implementation may choose to ignore flags that affect the location of
56the returned memory, like GFP_DMA). For pci_alloc_consistent, you 51the returned memory, like GFP_DMA).
57must assume GFP_ATOMIC behaviour.
58 52
59void 53void
60dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 54dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
61 dma_addr_t dma_handle) 55 dma_addr_t dma_handle)
62void
63pci_free_consistent(struct pci_dev *dev, size_t size, void *cpu_addr,
64 dma_addr_t dma_handle)
65 56
66Free the region of consistent memory you previously allocated. dev, 57Free the region of consistent memory you previously allocated. dev,
67size and dma_handle must all be the same as those passed into the 58size and dma_handle must all be the same as those passed into the
@@ -89,10 +80,6 @@ for alignment, like queue heads needing to be aligned on N-byte boundaries.
89 dma_pool_create(const char *name, struct device *dev, 80 dma_pool_create(const char *name, struct device *dev,
90 size_t size, size_t align, size_t alloc); 81 size_t size, size_t align, size_t alloc);
91 82
92 struct pci_pool *
93 pci_pool_create(const char *name, struct pci_device *dev,
94 size_t size, size_t align, size_t alloc);
95
96The pool create() routines initialize a pool of dma-coherent buffers 83The pool create() routines initialize a pool of dma-coherent buffers
97for use with a given device. It must be called in a context which 84for use with a given device. It must be called in a context which
98can sleep. 85can sleep.
@@ -108,9 +95,6 @@ from this pool must not cross 4KByte boundaries.
108 void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags, 95 void *dma_pool_alloc(struct dma_pool *pool, gfp_t gfp_flags,
109 dma_addr_t *dma_handle); 96 dma_addr_t *dma_handle);
110 97
111 void *pci_pool_alloc(struct pci_pool *pool, gfp_t gfp_flags,
112 dma_addr_t *dma_handle);
113
114This allocates memory from the pool; the returned memory will meet the size 98This allocates memory from the pool; the returned memory will meet the size
115and alignment requirements specified at creation time. Pass GFP_ATOMIC to 99and alignment requirements specified at creation time. Pass GFP_ATOMIC to
116prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks), 100prevent blocking, or if it's permitted (not in_interrupt, not holding SMP locks),
@@ -122,9 +106,6 @@ pool's device.
122 void dma_pool_free(struct dma_pool *pool, void *vaddr, 106 void dma_pool_free(struct dma_pool *pool, void *vaddr,
123 dma_addr_t addr); 107 dma_addr_t addr);
124 108
125 void pci_pool_free(struct pci_pool *pool, void *vaddr,
126 dma_addr_t addr);
127
128This puts memory back into the pool. The pool is what was passed to 109This puts memory back into the pool. The pool is what was passed to
129the pool allocation routine; the cpu (vaddr) and dma addresses are what 110the pool allocation routine; the cpu (vaddr) and dma addresses are what
130were returned when that routine allocated the memory being freed. 111were returned when that routine allocated the memory being freed.
@@ -132,8 +113,6 @@ were returned when that routine allocated the memory being freed.
132 113
133 void dma_pool_destroy(struct dma_pool *pool); 114 void dma_pool_destroy(struct dma_pool *pool);
134 115
135 void pci_pool_destroy(struct pci_pool *pool);
136
137The pool destroy() routines free the resources of the pool. They must be 116The pool destroy() routines free the resources of the pool. They must be
138called in a context which can sleep. Make sure you've freed all allocated 117called in a context which can sleep. Make sure you've freed all allocated
139memory back to the pool before you destroy it. 118memory back to the pool before you destroy it.
@@ -144,8 +123,6 @@ Part Ic - DMA addressing limitations
144 123
145int 124int
146dma_supported(struct device *dev, u64 mask) 125dma_supported(struct device *dev, u64 mask)
147int
148pci_dma_supported(struct pci_dev *hwdev, u64 mask)
149 126
150Checks to see if the device can support DMA to the memory described by 127Checks to see if the device can support DMA to the memory described by
151mask. 128mask.
@@ -159,8 +136,14 @@ driver writers.
159 136
160int 137int
161dma_set_mask(struct device *dev, u64 mask) 138dma_set_mask(struct device *dev, u64 mask)
139
140Checks to see if the mask is possible and updates the device
141parameters if it is.
142
143Returns: 0 if successful and a negative error if not.
144
162int 145int
163pci_set_dma_mask(struct pci_device *dev, u64 mask) 146dma_set_coherent_mask(struct device *dev, u64 mask)
164 147
165Checks to see if the mask is possible and updates the device 148Checks to see if the mask is possible and updates the device
166parameters if it is. 149parameters if it is.
@@ -187,9 +170,6 @@ Part Id - Streaming DMA mappings
187dma_addr_t 170dma_addr_t
188dma_map_single(struct device *dev, void *cpu_addr, size_t size, 171dma_map_single(struct device *dev, void *cpu_addr, size_t size,
189 enum dma_data_direction direction) 172 enum dma_data_direction direction)
190dma_addr_t
191pci_map_single(struct pci_dev *hwdev, void *cpu_addr, size_t size,
192 int direction)
193 173
194Maps a piece of processor virtual memory so it can be accessed by the 174Maps a piece of processor virtual memory so it can be accessed by the
195device and returns the physical handle of the memory. 175device and returns the physical handle of the memory.
@@ -198,14 +178,10 @@ The direction for both api's may be converted freely by casting.
198However the dma_ API uses a strongly typed enumerator for its 178However the dma_ API uses a strongly typed enumerator for its
199direction: 179direction:
200 180
201DMA_NONE = PCI_DMA_NONE no direction (used for 181DMA_NONE no direction (used for debugging)
202 debugging) 182DMA_TO_DEVICE data is going from the memory to the device
203DMA_TO_DEVICE = PCI_DMA_TODEVICE data is going from the 183DMA_FROM_DEVICE data is coming from the device to the memory
204 memory to the device 184DMA_BIDIRECTIONAL direction isn't known
205DMA_FROM_DEVICE = PCI_DMA_FROMDEVICE data is coming from
206 the device to the
207 memory
208DMA_BIDIRECTIONAL = PCI_DMA_BIDIRECTIONAL direction isn't known
209 185
210Notes: Not all memory regions in a machine can be mapped by this 186Notes: Not all memory regions in a machine can be mapped by this
211API. Further, regions that appear to be physically contiguous in 187API. Further, regions that appear to be physically contiguous in
@@ -268,9 +244,6 @@ cache lines are updated with data that the device may have changed).
268void 244void
269dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 245dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
270 enum dma_data_direction direction) 246 enum dma_data_direction direction)
271void
272pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,
273 size_t size, int direction)
274 247
275Unmaps the region previously mapped. All the parameters passed in 248Unmaps the region previously mapped. All the parameters passed in
276must be identical to those passed in (and returned) by the mapping 249must be identical to those passed in (and returned) by the mapping
@@ -280,15 +253,9 @@ dma_addr_t
280dma_map_page(struct device *dev, struct page *page, 253dma_map_page(struct device *dev, struct page *page,
281 unsigned long offset, size_t size, 254 unsigned long offset, size_t size,
282 enum dma_data_direction direction) 255 enum dma_data_direction direction)
283dma_addr_t
284pci_map_page(struct pci_dev *hwdev, struct page *page,
285 unsigned long offset, size_t size, int direction)
286void 256void
287dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 257dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
288 enum dma_data_direction direction) 258 enum dma_data_direction direction)
289void
290pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address,
291 size_t size, int direction)
292 259
293API for mapping and unmapping for pages. All the notes and warnings 260API for mapping and unmapping for pages. All the notes and warnings
294for the other mapping APIs apply here. Also, although the <offset> 261for the other mapping APIs apply here. Also, although the <offset>
@@ -299,9 +266,6 @@ cache width is.
299int 266int
300dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 267dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
301 268
302int
303pci_dma_mapping_error(struct pci_dev *hwdev, dma_addr_t dma_addr)
304
305In some circumstances dma_map_single and dma_map_page will fail to create 269In some circumstances dma_map_single and dma_map_page will fail to create
306a mapping. A driver can check for these errors by testing the returned 270a mapping. A driver can check for these errors by testing the returned
307dma address with dma_mapping_error(). A non-zero return value means the mapping 271dma address with dma_mapping_error(). A non-zero return value means the mapping
@@ -311,9 +275,6 @@ reduce current DMA mapping usage or delay and try again later).
311 int 275 int
312 dma_map_sg(struct device *dev, struct scatterlist *sg, 276 dma_map_sg(struct device *dev, struct scatterlist *sg,
313 int nents, enum dma_data_direction direction) 277 int nents, enum dma_data_direction direction)
314 int
315 pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,
316 int nents, int direction)
317 278
318Returns: the number of physical segments mapped (this may be shorter 279Returns: the number of physical segments mapped (this may be shorter
319than <nents> passed in if some elements of the scatter/gather list are 280than <nents> passed in if some elements of the scatter/gather list are
@@ -353,9 +314,6 @@ accessed sg->address and sg->length as shown above.
353 void 314 void
354 dma_unmap_sg(struct device *dev, struct scatterlist *sg, 315 dma_unmap_sg(struct device *dev, struct scatterlist *sg,
355 int nhwentries, enum dma_data_direction direction) 316 int nhwentries, enum dma_data_direction direction)
356 void
357 pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,
358 int nents, int direction)
359 317
360Unmap the previously mapped scatter/gather list. All the parameters 318Unmap the previously mapped scatter/gather list. All the parameters
361must be the same as those and passed in to the scatter/gather mapping 319must be the same as those and passed in to the scatter/gather mapping
@@ -365,21 +323,23 @@ Note: <nents> must be the number you passed in, *not* the number of
365physical entries returned. 323physical entries returned.
366 324
367void 325void
368dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, 326dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
369 enum dma_data_direction direction) 327 enum dma_data_direction direction)
370void 328void
371pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, 329dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
372 size_t size, int direction) 330 enum dma_data_direction direction)
373void 331void
374dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, 332dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
375 enum dma_data_direction direction) 333 enum dma_data_direction direction)
376void 334void
377pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, 335dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
378 int nelems, int direction) 336 enum dma_data_direction direction)
379 337
380Synchronise a single contiguous or scatter/gather mapping. All the 338Synchronise a single contiguous or scatter/gather mapping for the cpu
381parameters must be the same as those passed into the single mapping 339and device. With the sync_sg API, all the parameters must be the same
382API. 340as those passed into the single mapping API. With the sync_single API,
341you can use dma_handle and size parameters that aren't identical to
342those passed into the single mapping API to do a partial sync.
383 343
384Notes: You must do this: 344Notes: You must do this:
385 345
@@ -461,9 +421,9 @@ void whizco_dma_map_sg_attrs(struct device *dev, dma_addr_t dma_addr,
461Part II - Advanced dma_ usage 421Part II - Advanced dma_ usage
462----------------------------- 422-----------------------------
463 423
464Warning: These pieces of the DMA API have no PCI equivalent. They 424Warning: These pieces of the DMA API should not be used in the
465should also not be used in the majority of cases, since they cater for 425majority of cases, since they cater for unlikely corner cases that
466unlikely corner cases that don't belong in usual drivers. 426don't belong in usual drivers.
467 427
468If you don't understand how cache line coherency works between a 428If you don't understand how cache line coherency works between a
469processor and an I/O device, you should not be using this part of the 429processor and an I/O device, you should not be using this part of the
@@ -514,16 +474,6 @@ into the width returned by this call. It will also always be a power
514of two for easy alignment. 474of two for easy alignment.
515 475
516void 476void
517dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
518 unsigned long offset, size_t size,
519 enum dma_data_direction direction)
520
521Does a partial sync, starting at offset and continuing for size. You
522must be careful to observe the cache alignment and width when doing
523anything like this. You must also be extra careful about accessing
524memory you intend to sync partially.
525
526void
527dma_cache_sync(struct device *dev, void *vaddr, size_t size, 477dma_cache_sync(struct device *dev, void *vaddr, size_t size,
528 enum dma_data_direction direction) 478 enum dma_data_direction direction)
529 479
diff --git a/Documentation/DocBook/mtdnand.tmpl b/Documentation/DocBook/mtdnand.tmpl
index 5e7d84b48505..133cd6c3f3c1 100644
--- a/Documentation/DocBook/mtdnand.tmpl
+++ b/Documentation/DocBook/mtdnand.tmpl
@@ -488,7 +488,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
488 The ECC bytes must be placed immidiately after the data 488 The ECC bytes must be placed immidiately after the data
489 bytes in order to make the syndrome generator work. This 489 bytes in order to make the syndrome generator work. This
490 is contrary to the usual layout used by software ECC. The 490 is contrary to the usual layout used by software ECC. The
491 seperation of data and out of band area is not longer 491 separation of data and out of band area is not longer
492 possible. The nand driver code handles this layout and 492 possible. The nand driver code handles this layout and
493 the remaining free bytes in the oob area are managed by 493 the remaining free bytes in the oob area are managed by
494 the autoplacement code. Provide a matching oob-layout 494 the autoplacement code. Provide a matching oob-layout
@@ -560,7 +560,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
560 bad blocks. They have factory marked good blocks. The marker pattern 560 bad blocks. They have factory marked good blocks. The marker pattern
561 is erased when the block is erased to be reused. So in case of 561 is erased when the block is erased to be reused. So in case of
562 powerloss before writing the pattern back to the chip this block 562 powerloss before writing the pattern back to the chip this block
563 would be lost and added to the bad blocks. Therefor we scan the 563 would be lost and added to the bad blocks. Therefore we scan the
564 chip(s) when we detect them the first time for good blocks and 564 chip(s) when we detect them the first time for good blocks and
565 store this information in a bad block table before erasing any 565 store this information in a bad block table before erasing any
566 of the blocks. 566 of the blocks.
@@ -1094,7 +1094,7 @@ in this page</entry>
1094 manufacturers specifications. This applies similar to the spare area. 1094 manufacturers specifications. This applies similar to the spare area.
1095 </para> 1095 </para>
1096 <para> 1096 <para>
1097 Therefor NAND aware filesystems must either write in page size chunks 1097 Therefore NAND aware filesystems must either write in page size chunks
1098 or hold a writebuffer to collect smaller writes until they sum up to 1098 or hold a writebuffer to collect smaller writes until they sum up to
1099 pagesize. Available NAND aware filesystems: JFFS2, YAFFS. 1099 pagesize. Available NAND aware filesystems: JFFS2, YAFFS.
1100 </para> 1100 </para>
diff --git a/Documentation/DocBook/v4l/common.xml b/Documentation/DocBook/v4l/common.xml
index c65f0ac9b6ee..cea23e1c4fc6 100644
--- a/Documentation/DocBook/v4l/common.xml
+++ b/Documentation/DocBook/v4l/common.xml
@@ -1170,7 +1170,7 @@ frames per second. If less than this number of frames is to be
1170captured or output, applications can request frame skipping or 1170captured or output, applications can request frame skipping or
1171duplicating on the driver side. This is especially useful when using 1171duplicating on the driver side. This is especially useful when using
1172the &func-read; or &func-write;, which are not augmented by timestamps 1172the &func-read; or &func-write;, which are not augmented by timestamps
1173or sequence counters, and to avoid unneccessary data copying.</para> 1173or sequence counters, and to avoid unnecessary data copying.</para>
1174 1174
1175 <para>Finally these ioctls can be used to determine the number of 1175 <para>Finally these ioctls can be used to determine the number of
1176buffers used internally by a driver in read/write mode. For 1176buffers used internally by a driver in read/write mode. For
diff --git a/Documentation/DocBook/v4l/vidioc-g-parm.xml b/Documentation/DocBook/v4l/vidioc-g-parm.xml
index 78332d365ce9..392aa9e5571e 100644
--- a/Documentation/DocBook/v4l/vidioc-g-parm.xml
+++ b/Documentation/DocBook/v4l/vidioc-g-parm.xml
@@ -55,7 +55,7 @@ captured or output, applications can request frame skipping or
55duplicating on the driver side. This is especially useful when using 55duplicating on the driver side. This is especially useful when using
56the <function>read()</function> or <function>write()</function>, which 56the <function>read()</function> or <function>write()</function>, which
57are not augmented by timestamps or sequence counters, and to avoid 57are not augmented by timestamps or sequence counters, and to avoid
58unneccessary data copying.</para> 58unnecessary data copying.</para>
59 59
60 <para>Further these ioctls can be used to determine the number of 60 <para>Further these ioctls can be used to determine the number of
61buffers used internally by a driver in read/write mode. For 61buffers used internally by a driver in read/write mode. For
diff --git a/Documentation/IPMI.txt b/Documentation/IPMI.txt
index bc38283379f0..69dd29ed824e 100644
--- a/Documentation/IPMI.txt
+++ b/Documentation/IPMI.txt
@@ -365,6 +365,7 @@ You can change this at module load time (for a module) with:
365 regshifts=<shift1>,<shift2>,... 365 regshifts=<shift1>,<shift2>,...
366 slave_addrs=<addr1>,<addr2>,... 366 slave_addrs=<addr1>,<addr2>,...
367 force_kipmid=<enable1>,<enable2>,... 367 force_kipmid=<enable1>,<enable2>,...
368 kipmid_max_busy_us=<ustime1>,<ustime2>,...
368 unload_when_empty=[0|1] 369 unload_when_empty=[0|1]
369 370
370Each of these except si_trydefaults is a list, the first item for the 371Each of these except si_trydefaults is a list, the first item for the
@@ -433,6 +434,7 @@ kernel command line as:
433 ipmi_si.regshifts=<shift1>,<shift2>,... 434 ipmi_si.regshifts=<shift1>,<shift2>,...
434 ipmi_si.slave_addrs=<addr1>,<addr2>,... 435 ipmi_si.slave_addrs=<addr1>,<addr2>,...
435 ipmi_si.force_kipmid=<enable1>,<enable2>,... 436 ipmi_si.force_kipmid=<enable1>,<enable2>,...
437 ipmi_si.kipmid_max_busy_us=<ustime1>,<ustime2>,...
436 438
437It works the same as the module parameters of the same names. 439It works the same as the module parameters of the same names.
438 440
@@ -450,6 +452,16 @@ force this thread on or off. If you force it off and don't have
450interrupts, the driver will run VERY slowly. Don't blame me, 452interrupts, the driver will run VERY slowly. Don't blame me,
451these interfaces suck. 453these interfaces suck.
452 454
455Unfortunately, this thread can use a lot of CPU depending on the
456interface's performance. This can waste a lot of CPU and cause
457various issues with detecting idle CPU and using extra power. To
458avoid this, the kipmid_max_busy_us sets the maximum amount of time, in
459microseconds, that kipmid will spin before sleeping for a tick. This
460value sets a balance between performance and CPU waste and needs to be
461tuned to your needs. Maybe, someday, auto-tuning will be added, but
462that's not a simple thing and even the auto-tuning would need to be
463tuned to the user's desired performance.
464
453The driver supports a hot add and remove of interfaces. This way, 465The driver supports a hot add and remove of interfaces. This way,
454interfaces can be added or removed after the kernel is up and running. 466interfaces can be added or removed after the kernel is up and running.
455This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a 467This is done using /sys/modules/ipmi_si/parameters/hotmod, which is a
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 94b945733534..6fc7ea1d1f9d 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,3 +1,3 @@
1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \ 1obj-m := DocBook/ accounting/ auxdisplay/ connector/ \
2 filesystems/configfs/ ia64/ networking/ \ 2 filesystems/ filesystems/configfs/ ia64/ laptops/ networking/ \
3 pcmcia/ spi/ video4linux/ vm/ watchdog/src/ 3 pcmcia/ spi/ timers/ video4linux/ vm/ watchdog/src/
diff --git a/Documentation/PCI/PCI-DMA-mapping.txt b/Documentation/PCI/PCI-DMA-mapping.txt
index ecad88d9fe59..52618ab069ad 100644
--- a/Documentation/PCI/PCI-DMA-mapping.txt
+++ b/Documentation/PCI/PCI-DMA-mapping.txt
@@ -1,12 +1,12 @@
1 Dynamic DMA mapping 1 Dynamic DMA mapping Guide
2 =================== 2 =========================
3 3
4 David S. Miller <davem@redhat.com> 4 David S. Miller <davem@redhat.com>
5 Richard Henderson <rth@cygnus.com> 5 Richard Henderson <rth@cygnus.com>
6 Jakub Jelinek <jakub@redhat.com> 6 Jakub Jelinek <jakub@redhat.com>
7 7
8This document describes the DMA mapping system in terms of the pci_ 8This is a guide to device driver writers on how to use the DMA API
9API. For a similar API that works for generic devices, see 9with example pseudo-code. For a concise description of the API, see
10DMA-API.txt. 10DMA-API.txt.
11 11
12Most of the 64bit platforms have special hardware that translates bus 12Most of the 64bit platforms have special hardware that translates bus
@@ -26,12 +26,15 @@ mapped only for the time they are actually used and unmapped after the DMA
26transfer. 26transfer.
27 27
28The following API will work of course even on platforms where no such 28The following API will work of course even on platforms where no such
29hardware exists, see e.g. arch/x86/include/asm/pci.h for how it is implemented on 29hardware exists.
30top of the virt_to_bus interface. 30
31Note that the DMA API works with any bus independent of the underlying
32microprocessor architecture. You should use the DMA API rather than
33the bus specific DMA API (e.g. pci_dma_*).
31 34
32First of all, you should make sure 35First of all, you should make sure
33 36
34#include <linux/pci.h> 37#include <linux/dma-mapping.h>
35 38
36is in your driver. This file will obtain for you the definition of the 39is in your driver. This file will obtain for you the definition of the
37dma_addr_t (which can hold any valid DMA address for the platform) 40dma_addr_t (which can hold any valid DMA address for the platform)
@@ -78,44 +81,43 @@ for you to DMA from/to.
78 DMA addressing limitations 81 DMA addressing limitations
79 82
80Does your device have any DMA addressing limitations? For example, is 83Does your device have any DMA addressing limitations? For example, is
81your device only capable of driving the low order 24-bits of address 84your device only capable of driving the low order 24-bits of address?
82on the PCI bus for SAC DMA transfers? If so, you need to inform the 85If so, you need to inform the kernel of this fact.
83PCI layer of this fact.
84 86
85By default, the kernel assumes that your device can address the full 87By default, the kernel assumes that your device can address the full
8632-bits in a SAC cycle. For a 64-bit DAC capable device, this needs 8832-bits. For a 64-bit capable device, this needs to be increased.
87to be increased. And for a device with limitations, as discussed in 89And for a device with limitations, as discussed in the previous
88the previous paragraph, it needs to be decreased. 90paragraph, it needs to be decreased.
89 91
90pci_alloc_consistent() by default will return 32-bit DMA addresses. 92Special note about PCI: PCI-X specification requires PCI-X devices to
91PCI-X specification requires PCI-X devices to support 64-bit 93support 64-bit addressing (DAC) for all transactions. And at least
92addressing (DAC) for all transactions. And at least one platform (SGI 94one platform (SGI SN2) requires 64-bit consistent allocations to
93SN2) requires 64-bit consistent allocations to operate correctly when 95operate correctly when the IO bus is in PCI-X mode.
94the IO bus is in PCI-X mode. Therefore, like with pci_set_dma_mask(), 96
95it's good practice to call pci_set_consistent_dma_mask() to set the 97For correct operation, you must interrogate the kernel in your device
96appropriate mask even if your device only supports 32-bit DMA 98probe routine to see if the DMA controller on the machine can properly
97(default) and especially if it's a PCI-X device. 99support the DMA addressing limitation your device has. It is good
98 100style to do this even if your device holds the default setting,
99For correct operation, you must interrogate the PCI layer in your
100device probe routine to see if the PCI controller on the machine can
101properly support the DMA addressing limitation your device has. It is
102good style to do this even if your device holds the default setting,
103because this shows that you did think about these issues wrt. your 101because this shows that you did think about these issues wrt. your
104device. 102device.
105 103
106The query is performed via a call to pci_set_dma_mask(): 104The query is performed via a call to dma_set_mask():
107 105
108 int pci_set_dma_mask(struct pci_dev *pdev, u64 device_mask); 106 int dma_set_mask(struct device *dev, u64 mask);
109 107
110The query for consistent allocations is performed via a call to 108The query for consistent allocations is performed via a call to
111pci_set_consistent_dma_mask(): 109dma_set_coherent_mask():
112 110
113 int pci_set_consistent_dma_mask(struct pci_dev *pdev, u64 device_mask); 111 int dma_set_coherent_mask(struct device *dev, u64 mask);
114 112
115Here, pdev is a pointer to the PCI device struct of your device, and 113Here, dev is a pointer to the device struct of your device, and mask
116device_mask is a bit mask describing which bits of a PCI address your 114is a bit mask describing which bits of an address your device
117device supports. It returns zero if your card can perform DMA 115supports. It returns zero if your card can perform DMA properly on
118properly on the machine given the address mask you provided. 116the machine given the address mask you provided. In general, the
117device struct of your device is embedded in the bus specific device
118struct of your device. For example, a pointer to the device struct of
119your PCI device is pdev->dev (pdev is a pointer to the PCI device
120struct of your device).
119 121
120If it returns non-zero, your device cannot perform DMA properly on 122If it returns non-zero, your device cannot perform DMA properly on
121this platform, and attempting to do so will result in undefined 123this platform, and attempting to do so will result in undefined
@@ -133,31 +135,30 @@ of your driver reports that performance is bad or that the device is not
133even detected, you can ask them for the kernel messages to find out 135even detected, you can ask them for the kernel messages to find out
134exactly why. 136exactly why.
135 137
136The standard 32-bit addressing PCI device would do something like 138The standard 32-bit addressing device would do something like this:
137this:
138 139
139 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 140 if (dma_set_mask(dev, DMA_BIT_MASK(32))) {
140 printk(KERN_WARNING 141 printk(KERN_WARNING
141 "mydev: No suitable DMA available.\n"); 142 "mydev: No suitable DMA available.\n");
142 goto ignore_this_device; 143 goto ignore_this_device;
143 } 144 }
144 145
145Another common scenario is a 64-bit capable device. The approach 146Another common scenario is a 64-bit capable device. The approach here
146here is to try for 64-bit DAC addressing, but back down to a 147is to try for 64-bit addressing, but back down to a 32-bit mask that
14732-bit mask should that fail. The PCI platform code may fail the 148should not fail. The kernel may fail the 64-bit mask not because the
14864-bit mask not because the platform is not capable of 64-bit 149platform is not capable of 64-bit addressing. Rather, it may fail in
149addressing. Rather, it may fail in this case simply because 150this case simply because 32-bit addressing is done more efficiently
15032-bit SAC addressing is done more efficiently than DAC addressing. 151than 64-bit addressing. For example, Sparc64 PCI SAC addressing is
151Sparc64 is one platform which behaves in this way. 152more efficient than DAC addressing.
152 153
153Here is how you would handle a 64-bit capable device which can drive 154Here is how you would handle a 64-bit capable device which can drive
154all 64-bits when accessing streaming DMA: 155all 64-bits when accessing streaming DMA:
155 156
156 int using_dac; 157 int using_dac;
157 158
158 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { 159 if (!dma_set_mask(dev, DMA_BIT_MASK(64))) {
159 using_dac = 1; 160 using_dac = 1;
160 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 161 } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) {
161 using_dac = 0; 162 using_dac = 0;
162 } else { 163 } else {
163 printk(KERN_WARNING 164 printk(KERN_WARNING
@@ -170,36 +171,36 @@ the case would look like this:
170 171
171 int using_dac, consistent_using_dac; 172 int using_dac, consistent_using_dac;
172 173
173 if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { 174 if (!dma_set_mask(dev, DMA_BIT_MASK(64))) {
174 using_dac = 1; 175 using_dac = 1;
175 consistent_using_dac = 1; 176 consistent_using_dac = 1;
176 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); 177 dma_set_coherent_mask(dev, DMA_BIT_MASK(64));
177 } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { 178 } else if (!dma_set_mask(dev, DMA_BIT_MASK(32))) {
178 using_dac = 0; 179 using_dac = 0;
179 consistent_using_dac = 0; 180 consistent_using_dac = 0;
180 pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 181 dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
181 } else { 182 } else {
182 printk(KERN_WARNING 183 printk(KERN_WARNING
183 "mydev: No suitable DMA available.\n"); 184 "mydev: No suitable DMA available.\n");
184 goto ignore_this_device; 185 goto ignore_this_device;
185 } 186 }
186 187
187pci_set_consistent_dma_mask() will always be able to set the same or a 188dma_set_coherent_mask() will always be able to set the same or a
188smaller mask as pci_set_dma_mask(). However for the rare case that a 189smaller mask as dma_set_mask(). However for the rare case that a
189device driver only uses consistent allocations, one would have to 190device driver only uses consistent allocations, one would have to
190check the return value from pci_set_consistent_dma_mask(). 191check the return value from dma_set_coherent_mask().
191 192
192Finally, if your device can only drive the low 24-bits of 193Finally, if your device can only drive the low 24-bits of
193address during PCI bus mastering you might do something like: 194address you might do something like:
194 195
195 if (pci_set_dma_mask(pdev, DMA_BIT_MASK(24))) { 196 if (dma_set_mask(dev, DMA_BIT_MASK(24))) {
196 printk(KERN_WARNING 197 printk(KERN_WARNING
197 "mydev: 24-bit DMA addressing not available.\n"); 198 "mydev: 24-bit DMA addressing not available.\n");
198 goto ignore_this_device; 199 goto ignore_this_device;
199 } 200 }
200 201
201When pci_set_dma_mask() is successful, and returns zero, the PCI layer 202When dma_set_mask() is successful, and returns zero, the kernel saves
202saves away this mask you have provided. The PCI layer will use this 203away this mask you have provided. The kernel will use this
203information later when you make DMA mappings. 204information later when you make DMA mappings.
204 205
205There is a case which we are aware of at this time, which is worth 206There is a case which we are aware of at this time, which is worth
@@ -208,7 +209,7 @@ functions (for example a sound card provides playback and record
208functions) and the various different functions have _different_ 209functions) and the various different functions have _different_
209DMA addressing limitations, you may wish to probe each mask and 210DMA addressing limitations, you may wish to probe each mask and
210only provide the functionality which the machine can handle. It 211only provide the functionality which the machine can handle. It
211is important that the last call to pci_set_dma_mask() be for the 212is important that the last call to dma_set_mask() be for the
212most specific mask. 213most specific mask.
213 214
214Here is pseudo-code showing how this might be done: 215Here is pseudo-code showing how this might be done:
@@ -217,17 +218,17 @@ Here is pseudo-code showing how this might be done:
217 #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24) 218 #define RECORD_ADDRESS_BITS DMA_BIT_MASK(24)
218 219
219 struct my_sound_card *card; 220 struct my_sound_card *card;
220 struct pci_dev *pdev; 221 struct device *dev;
221 222
222 ... 223 ...
223 if (!pci_set_dma_mask(pdev, PLAYBACK_ADDRESS_BITS)) { 224 if (!dma_set_mask(dev, PLAYBACK_ADDRESS_BITS)) {
224 card->playback_enabled = 1; 225 card->playback_enabled = 1;
225 } else { 226 } else {
226 card->playback_enabled = 0; 227 card->playback_enabled = 0;
227 printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n", 228 printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n",
228 card->name); 229 card->name);
229 } 230 }
230 if (!pci_set_dma_mask(pdev, RECORD_ADDRESS_BITS)) { 231 if (!dma_set_mask(dev, RECORD_ADDRESS_BITS)) {
231 card->record_enabled = 1; 232 card->record_enabled = 1;
232 } else { 233 } else {
233 card->record_enabled = 0; 234 card->record_enabled = 0;
@@ -252,8 +253,8 @@ There are two types of DMA mappings:
252 Think of "consistent" as "synchronous" or "coherent". 253 Think of "consistent" as "synchronous" or "coherent".
253 254
254 The current default is to return consistent memory in the low 32 255 The current default is to return consistent memory in the low 32
255 bits of the PCI bus space. However, for future compatibility you 256 bits of the bus space. However, for future compatibility you should
256 should set the consistent mask even if this default is fine for your 257 set the consistent mask even if this default is fine for your
257 driver. 258 driver.
258 259
259 Good examples of what to use consistent mappings for are: 260 Good examples of what to use consistent mappings for are:
@@ -285,9 +286,9 @@ There are two types of DMA mappings:
285 found in PCI bridges (such as by reading a register's value 286 found in PCI bridges (such as by reading a register's value
286 after writing it). 287 after writing it).
287 288
288- Streaming DMA mappings which are usually mapped for one DMA transfer, 289- Streaming DMA mappings which are usually mapped for one DMA
289 unmapped right after it (unless you use pci_dma_sync_* below) and for which 290 transfer, unmapped right after it (unless you use dma_sync_* below)
290 hardware can optimize for sequential accesses. 291 and for which hardware can optimize for sequential accesses.
291 292
292 This of "streaming" as "asynchronous" or "outside the coherency 293 This of "streaming" as "asynchronous" or "outside the coherency
293 domain". 294 domain".
@@ -302,8 +303,8 @@ There are two types of DMA mappings:
302 optimizations the hardware allows. To this end, when using 303 optimizations the hardware allows. To this end, when using
303 such mappings you must be explicit about what you want to happen. 304 such mappings you must be explicit about what you want to happen.
304 305
305Neither type of DMA mapping has alignment restrictions that come 306Neither type of DMA mapping has alignment restrictions that come from
306from PCI, although some devices may have such restrictions. 307the underlying bus, although some devices may have such restrictions.
307Also, systems with caches that aren't DMA-coherent will work better 308Also, systems with caches that aren't DMA-coherent will work better
308when the underlying buffers don't share cache lines with other data. 309when the underlying buffers don't share cache lines with other data.
309 310
@@ -315,33 +316,27 @@ you should do:
315 316
316 dma_addr_t dma_handle; 317 dma_addr_t dma_handle;
317 318
318 cpu_addr = pci_alloc_consistent(pdev, size, &dma_handle); 319 cpu_addr = dma_alloc_coherent(dev, size, &dma_handle, gfp);
319
320where pdev is a struct pci_dev *. This may be called in interrupt context.
321You should use dma_alloc_coherent (see DMA-API.txt) for buses
322where devices don't have struct pci_dev (like ISA, EISA).
323 320
324This argument is needed because the DMA translations may be bus 321where device is a struct device *. This may be called in interrupt
325specific (and often is private to the bus which the device is attached 322context with the GFP_ATOMIC flag.
326to).
327 323
328Size is the length of the region you want to allocate, in bytes. 324Size is the length of the region you want to allocate, in bytes.
329 325
330This routine will allocate RAM for that region, so it acts similarly to 326This routine will allocate RAM for that region, so it acts similarly to
331__get_free_pages (but takes size instead of a page order). If your 327__get_free_pages (but takes size instead of a page order). If your
332driver needs regions sized smaller than a page, you may prefer using 328driver needs regions sized smaller than a page, you may prefer using
333the pci_pool interface, described below. 329the dma_pool interface, described below.
334 330
335The consistent DMA mapping interfaces, for non-NULL pdev, will by 331The consistent DMA mapping interfaces, for non-NULL dev, will by
336default return a DMA address which is SAC (Single Address Cycle) 332default return a DMA address which is 32-bit addressable. Even if the
337addressable. Even if the device indicates (via PCI dma mask) that it 333device indicates (via DMA mask) that it may address the upper 32-bits,
338may address the upper 32-bits and thus perform DAC cycles, consistent 334consistent allocation will only return > 32-bit addresses for DMA if
339allocation will only return > 32-bit PCI addresses for DMA if the 335the consistent DMA mask has been explicitly changed via
340consistent dma mask has been explicitly changed via 336dma_set_coherent_mask(). This is true of the dma_pool interface as
341pci_set_consistent_dma_mask(). This is true of the pci_pool interface 337well.
342as well. 338
343 339dma_alloc_coherent returns two values: the virtual address which you
344pci_alloc_consistent returns two values: the virtual address which you
345can use to access it from the CPU and dma_handle which you pass to the 340can use to access it from the CPU and dma_handle which you pass to the
346card. 341card.
347 342
@@ -354,54 +349,54 @@ buffer you receive will not cross a 64K boundary.
354 349
355To unmap and free such a DMA region, you call: 350To unmap and free such a DMA region, you call:
356 351
357 pci_free_consistent(pdev, size, cpu_addr, dma_handle); 352 dma_free_coherent(dev, size, cpu_addr, dma_handle);
358 353
359where pdev, size are the same as in the above call and cpu_addr and 354where dev, size are the same as in the above call and cpu_addr and
360dma_handle are the values pci_alloc_consistent returned to you. 355dma_handle are the values dma_alloc_coherent returned to you.
361This function may not be called in interrupt context. 356This function may not be called in interrupt context.
362 357
363If your driver needs lots of smaller memory regions, you can write 358If your driver needs lots of smaller memory regions, you can write
364custom code to subdivide pages returned by pci_alloc_consistent, 359custom code to subdivide pages returned by dma_alloc_coherent,
365or you can use the pci_pool API to do that. A pci_pool is like 360or you can use the dma_pool API to do that. A dma_pool is like
366a kmem_cache, but it uses pci_alloc_consistent not __get_free_pages. 361a kmem_cache, but it uses dma_alloc_coherent not __get_free_pages.
367Also, it understands common hardware constraints for alignment, 362Also, it understands common hardware constraints for alignment,
368like queue heads needing to be aligned on N byte boundaries. 363like queue heads needing to be aligned on N byte boundaries.
369 364
370Create a pci_pool like this: 365Create a dma_pool like this:
371 366
372 struct pci_pool *pool; 367 struct dma_pool *pool;
373 368
374 pool = pci_pool_create(name, pdev, size, align, alloc); 369 pool = dma_pool_create(name, dev, size, align, alloc);
375 370
376The "name" is for diagnostics (like a kmem_cache name); pdev and size 371The "name" is for diagnostics (like a kmem_cache name); dev and size
377are as above. The device's hardware alignment requirement for this 372are as above. The device's hardware alignment requirement for this
378type of data is "align" (which is expressed in bytes, and must be a 373type of data is "align" (which is expressed in bytes, and must be a
379power of two). If your device has no boundary crossing restrictions, 374power of two). If your device has no boundary crossing restrictions,
380pass 0 for alloc; passing 4096 says memory allocated from this pool 375pass 0 for alloc; passing 4096 says memory allocated from this pool
381must not cross 4KByte boundaries (but at that time it may be better to 376must not cross 4KByte boundaries (but at that time it may be better to
382go for pci_alloc_consistent directly instead). 377go for dma_alloc_coherent directly instead).
383 378
384Allocate memory from a pci pool like this: 379Allocate memory from a dma pool like this:
385 380
386 cpu_addr = pci_pool_alloc(pool, flags, &dma_handle); 381 cpu_addr = dma_pool_alloc(pool, flags, &dma_handle);
387 382
388flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor 383flags are SLAB_KERNEL if blocking is permitted (not in_interrupt nor
389holding SMP locks), SLAB_ATOMIC otherwise. Like pci_alloc_consistent, 384holding SMP locks), SLAB_ATOMIC otherwise. Like dma_alloc_coherent,
390this returns two values, cpu_addr and dma_handle. 385this returns two values, cpu_addr and dma_handle.
391 386
392Free memory that was allocated from a pci_pool like this: 387Free memory that was allocated from a dma_pool like this:
393 388
394 pci_pool_free(pool, cpu_addr, dma_handle); 389 dma_pool_free(pool, cpu_addr, dma_handle);
395 390
396where pool is what you passed to pci_pool_alloc, and cpu_addr and 391where pool is what you passed to dma_pool_alloc, and cpu_addr and
397dma_handle are the values pci_pool_alloc returned. This function 392dma_handle are the values dma_pool_alloc returned. This function
398may be called in interrupt context. 393may be called in interrupt context.
399 394
400Destroy a pci_pool by calling: 395Destroy a dma_pool by calling:
401 396
402 pci_pool_destroy(pool); 397 dma_pool_destroy(pool);
403 398
404Make sure you've called pci_pool_free for all memory allocated 399Make sure you've called dma_pool_free for all memory allocated
405from a pool before you destroy the pool. This function may not 400from a pool before you destroy the pool. This function may not
406be called in interrupt context. 401be called in interrupt context.
407 402
@@ -411,15 +406,15 @@ The interfaces described in subsequent portions of this document
411take a DMA direction argument, which is an integer and takes on 406take a DMA direction argument, which is an integer and takes on
412one of the following values: 407one of the following values:
413 408
414 PCI_DMA_BIDIRECTIONAL 409 DMA_BIDIRECTIONAL
415 PCI_DMA_TODEVICE 410 DMA_TO_DEVICE
416 PCI_DMA_FROMDEVICE 411 DMA_FROM_DEVICE
417 PCI_DMA_NONE 412 DMA_NONE
418 413
419One should provide the exact DMA direction if you know it. 414One should provide the exact DMA direction if you know it.
420 415
421PCI_DMA_TODEVICE means "from main memory to the PCI device" 416DMA_TO_DEVICE means "from main memory to the device"
422PCI_DMA_FROMDEVICE means "from the PCI device to main memory" 417DMA_FROM_DEVICE means "from the device to main memory"
423It is the direction in which the data moves during the DMA 418It is the direction in which the data moves during the DMA
424transfer. 419transfer.
425 420
@@ -427,12 +422,12 @@ You are _strongly_ encouraged to specify this as precisely
427as you possibly can. 422as you possibly can.
428 423
429If you absolutely cannot know the direction of the DMA transfer, 424If you absolutely cannot know the direction of the DMA transfer,
430specify PCI_DMA_BIDIRECTIONAL. It means that the DMA can go in 425specify DMA_BIDIRECTIONAL. It means that the DMA can go in
431either direction. The platform guarantees that you may legally 426either direction. The platform guarantees that you may legally
432specify this, and that it will work, but this may be at the 427specify this, and that it will work, but this may be at the
433cost of performance for example. 428cost of performance for example.
434 429
435The value PCI_DMA_NONE is to be used for debugging. One can 430The value DMA_NONE is to be used for debugging. One can
436hold this in a data structure before you come to know the 431hold this in a data structure before you come to know the
437precise direction, and this will help catch cases where your 432precise direction, and this will help catch cases where your
438direction tracking logic has failed to set things up properly. 433direction tracking logic has failed to set things up properly.
@@ -442,21 +437,21 @@ potential platform-specific optimizations of such) is for debugging.
442Some platforms actually have a write permission boolean which DMA 437Some platforms actually have a write permission boolean which DMA
443mappings can be marked with, much like page protections in the user 438mappings can be marked with, much like page protections in the user
444program address space. Such platforms can and do report errors in the 439program address space. Such platforms can and do report errors in the
445kernel logs when the PCI controller hardware detects violation of the 440kernel logs when the DMA controller hardware detects violation of the
446permission setting. 441permission setting.
447 442
448Only streaming mappings specify a direction, consistent mappings 443Only streaming mappings specify a direction, consistent mappings
449implicitly have a direction attribute setting of 444implicitly have a direction attribute setting of
450PCI_DMA_BIDIRECTIONAL. 445DMA_BIDIRECTIONAL.
451 446
452The SCSI subsystem tells you the direction to use in the 447The SCSI subsystem tells you the direction to use in the
453'sc_data_direction' member of the SCSI command your driver is 448'sc_data_direction' member of the SCSI command your driver is
454working on. 449working on.
455 450
456For Networking drivers, it's a rather simple affair. For transmit 451For Networking drivers, it's a rather simple affair. For transmit
457packets, map/unmap them with the PCI_DMA_TODEVICE direction 452packets, map/unmap them with the DMA_TO_DEVICE direction
458specifier. For receive packets, just the opposite, map/unmap them 453specifier. For receive packets, just the opposite, map/unmap them
459with the PCI_DMA_FROMDEVICE direction specifier. 454with the DMA_FROM_DEVICE direction specifier.
460 455
461 Using Streaming DMA mappings 456 Using Streaming DMA mappings
462 457
@@ -467,43 +462,43 @@ scatterlist.
467 462
468To map a single region, you do: 463To map a single region, you do:
469 464
470 struct pci_dev *pdev = mydev->pdev; 465 struct device *dev = &my_dev->dev;
471 dma_addr_t dma_handle; 466 dma_addr_t dma_handle;
472 void *addr = buffer->ptr; 467 void *addr = buffer->ptr;
473 size_t size = buffer->len; 468 size_t size = buffer->len;
474 469
475 dma_handle = pci_map_single(pdev, addr, size, direction); 470 dma_handle = dma_map_single(dev, addr, size, direction);
476 471
477and to unmap it: 472and to unmap it:
478 473
479 pci_unmap_single(pdev, dma_handle, size, direction); 474 dma_unmap_single(dev, dma_handle, size, direction);
480 475
481You should call pci_unmap_single when the DMA activity is finished, e.g. 476You should call dma_unmap_single when the DMA activity is finished, e.g.
482from the interrupt which told you that the DMA transfer is done. 477from the interrupt which told you that the DMA transfer is done.
483 478
484Using cpu pointers like this for single mappings has a disadvantage, 479Using cpu pointers like this for single mappings has a disadvantage,
485you cannot reference HIGHMEM memory in this way. Thus, there is a 480you cannot reference HIGHMEM memory in this way. Thus, there is a
486map/unmap interface pair akin to pci_{map,unmap}_single. These 481map/unmap interface pair akin to dma_{map,unmap}_single. These
487interfaces deal with page/offset pairs instead of cpu pointers. 482interfaces deal with page/offset pairs instead of cpu pointers.
488Specifically: 483Specifically:
489 484
490 struct pci_dev *pdev = mydev->pdev; 485 struct device *dev = &my_dev->dev;
491 dma_addr_t dma_handle; 486 dma_addr_t dma_handle;
492 struct page *page = buffer->page; 487 struct page *page = buffer->page;
493 unsigned long offset = buffer->offset; 488 unsigned long offset = buffer->offset;
494 size_t size = buffer->len; 489 size_t size = buffer->len;
495 490
496 dma_handle = pci_map_page(pdev, page, offset, size, direction); 491 dma_handle = dma_map_page(dev, page, offset, size, direction);
497 492
498 ... 493 ...
499 494
500 pci_unmap_page(pdev, dma_handle, size, direction); 495 dma_unmap_page(dev, dma_handle, size, direction);
501 496
502Here, "offset" means byte offset within the given page. 497Here, "offset" means byte offset within the given page.
503 498
504With scatterlists, you map a region gathered from several regions by: 499With scatterlists, you map a region gathered from several regions by:
505 500
506 int i, count = pci_map_sg(pdev, sglist, nents, direction); 501 int i, count = dma_map_sg(dev, sglist, nents, direction);
507 struct scatterlist *sg; 502 struct scatterlist *sg;
508 503
509 for_each_sg(sglist, sg, count, i) { 504 for_each_sg(sglist, sg, count, i) {
@@ -527,16 +522,16 @@ accessed sg->address and sg->length as shown above.
527 522
528To unmap a scatterlist, just call: 523To unmap a scatterlist, just call:
529 524
530 pci_unmap_sg(pdev, sglist, nents, direction); 525 dma_unmap_sg(dev, sglist, nents, direction);
531 526
532Again, make sure DMA activity has already finished. 527Again, make sure DMA activity has already finished.
533 528
534PLEASE NOTE: The 'nents' argument to the pci_unmap_sg call must be 529PLEASE NOTE: The 'nents' argument to the dma_unmap_sg call must be
535 the _same_ one you passed into the pci_map_sg call, 530 the _same_ one you passed into the dma_map_sg call,
536 it should _NOT_ be the 'count' value _returned_ from the 531 it should _NOT_ be the 'count' value _returned_ from the
537 pci_map_sg call. 532 dma_map_sg call.
538 533
539Every pci_map_{single,sg} call should have its pci_unmap_{single,sg} 534Every dma_map_{single,sg} call should have its dma_unmap_{single,sg}
540counterpart, because the bus address space is a shared resource (although 535counterpart, because the bus address space is a shared resource (although
541in some ports the mapping is per each BUS so less devices contend for the 536in some ports the mapping is per each BUS so less devices contend for the
542same bus address space) and you could render the machine unusable by eating 537same bus address space) and you could render the machine unusable by eating
@@ -547,14 +542,14 @@ the data in between the DMA transfers, the buffer needs to be synced
547properly in order for the cpu and device to see the most uptodate and 542properly in order for the cpu and device to see the most uptodate and
548correct copy of the DMA buffer. 543correct copy of the DMA buffer.
549 544
550So, firstly, just map it with pci_map_{single,sg}, and after each DMA 545So, firstly, just map it with dma_map_{single,sg}, and after each DMA
551transfer call either: 546transfer call either:
552 547
553 pci_dma_sync_single_for_cpu(pdev, dma_handle, size, direction); 548 dma_sync_single_for_cpu(dev, dma_handle, size, direction);
554 549
555or: 550or:
556 551
557 pci_dma_sync_sg_for_cpu(pdev, sglist, nents, direction); 552 dma_sync_sg_for_cpu(dev, sglist, nents, direction);
558 553
559as appropriate. 554as appropriate.
560 555
@@ -562,27 +557,27 @@ Then, if you wish to let the device get at the DMA area again,
562finish accessing the data with the cpu, and then before actually 557finish accessing the data with the cpu, and then before actually
563giving the buffer to the hardware call either: 558giving the buffer to the hardware call either:
564 559
565 pci_dma_sync_single_for_device(pdev, dma_handle, size, direction); 560 dma_sync_single_for_device(dev, dma_handle, size, direction);
566 561
567or: 562or:
568 563
569 pci_dma_sync_sg_for_device(dev, sglist, nents, direction); 564 dma_sync_sg_for_device(dev, sglist, nents, direction);
570 565
571as appropriate. 566as appropriate.
572 567
573After the last DMA transfer call one of the DMA unmap routines 568After the last DMA transfer call one of the DMA unmap routines
574pci_unmap_{single,sg}. If you don't touch the data from the first pci_map_* 569dma_unmap_{single,sg}. If you don't touch the data from the first dma_map_*
575call till pci_unmap_*, then you don't have to call the pci_dma_sync_* 570call till dma_unmap_*, then you don't have to call the dma_sync_*
576routines at all. 571routines at all.
577 572
578Here is pseudo code which shows a situation in which you would need 573Here is pseudo code which shows a situation in which you would need
579to use the pci_dma_sync_*() interfaces. 574to use the dma_sync_*() interfaces.
580 575
581 my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len) 576 my_card_setup_receive_buffer(struct my_card *cp, char *buffer, int len)
582 { 577 {
583 dma_addr_t mapping; 578 dma_addr_t mapping;
584 579
585 mapping = pci_map_single(cp->pdev, buffer, len, PCI_DMA_FROMDEVICE); 580 mapping = dma_map_single(cp->dev, buffer, len, DMA_FROM_DEVICE);
586 581
587 cp->rx_buf = buffer; 582 cp->rx_buf = buffer;
588 cp->rx_len = len; 583 cp->rx_len = len;
@@ -606,25 +601,25 @@ to use the pci_dma_sync_*() interfaces.
606 * the DMA transfer with the CPU first 601 * the DMA transfer with the CPU first
607 * so that we see updated contents. 602 * so that we see updated contents.
608 */ 603 */
609 pci_dma_sync_single_for_cpu(cp->pdev, cp->rx_dma, 604 dma_sync_single_for_cpu(&cp->dev, cp->rx_dma,
610 cp->rx_len, 605 cp->rx_len,
611 PCI_DMA_FROMDEVICE); 606 DMA_FROM_DEVICE);
612 607
613 /* Now it is safe to examine the buffer. */ 608 /* Now it is safe to examine the buffer. */
614 hp = (struct my_card_header *) cp->rx_buf; 609 hp = (struct my_card_header *) cp->rx_buf;
615 if (header_is_ok(hp)) { 610 if (header_is_ok(hp)) {
616 pci_unmap_single(cp->pdev, cp->rx_dma, cp->rx_len, 611 dma_unmap_single(&cp->dev, cp->rx_dma, cp->rx_len,
617 PCI_DMA_FROMDEVICE); 612 DMA_FROM_DEVICE);
618 pass_to_upper_layers(cp->rx_buf); 613 pass_to_upper_layers(cp->rx_buf);
619 make_and_setup_new_rx_buf(cp); 614 make_and_setup_new_rx_buf(cp);
620 } else { 615 } else {
621 /* Just sync the buffer and give it back 616 /* Just sync the buffer and give it back
622 * to the card. 617 * to the card.
623 */ 618 */
624 pci_dma_sync_single_for_device(cp->pdev, 619 dma_sync_single_for_device(&cp->dev,
625 cp->rx_dma, 620 cp->rx_dma,
626 cp->rx_len, 621 cp->rx_len,
627 PCI_DMA_FROMDEVICE); 622 DMA_FROM_DEVICE);
628 give_rx_buf_to_card(cp); 623 give_rx_buf_to_card(cp);
629 } 624 }
630 } 625 }
@@ -634,19 +629,19 @@ Drivers converted fully to this interface should not use virt_to_bus any
634longer, nor should they use bus_to_virt. Some drivers have to be changed a 629longer, nor should they use bus_to_virt. Some drivers have to be changed a
635little bit, because there is no longer an equivalent to bus_to_virt in the 630little bit, because there is no longer an equivalent to bus_to_virt in the
636dynamic DMA mapping scheme - you have to always store the DMA addresses 631dynamic DMA mapping scheme - you have to always store the DMA addresses
637returned by the pci_alloc_consistent, pci_pool_alloc, and pci_map_single 632returned by the dma_alloc_coherent, dma_pool_alloc, and dma_map_single
638calls (pci_map_sg stores them in the scatterlist itself if the platform 633calls (dma_map_sg stores them in the scatterlist itself if the platform
639supports dynamic DMA mapping in hardware) in your driver structures and/or 634supports dynamic DMA mapping in hardware) in your driver structures and/or
640in the card registers. 635in the card registers.
641 636
642All PCI drivers should be using these interfaces with no exceptions. 637All drivers should be using these interfaces with no exceptions. It
643It is planned to completely remove virt_to_bus() and bus_to_virt() as 638is planned to completely remove virt_to_bus() and bus_to_virt() as
644they are entirely deprecated. Some ports already do not provide these 639they are entirely deprecated. Some ports already do not provide these
645as it is impossible to correctly support them. 640as it is impossible to correctly support them.
646 641
647 Optimizing Unmap State Space Consumption 642 Optimizing Unmap State Space Consumption
648 643
649On many platforms, pci_unmap_{single,page}() is simply a nop. 644On many platforms, dma_unmap_{single,page}() is simply a nop.
650Therefore, keeping track of the mapping address and length is a waste 645Therefore, keeping track of the mapping address and length is a waste
651of space. Instead of filling your drivers up with ifdefs and the like 646of space. Instead of filling your drivers up with ifdefs and the like
652to "work around" this (which would defeat the whole purpose of a 647to "work around" this (which would defeat the whole purpose of a
@@ -655,7 +650,7 @@ portable API) the following facilities are provided.
655Actually, instead of describing the macros one by one, we'll 650Actually, instead of describing the macros one by one, we'll
656transform some example code. 651transform some example code.
657 652
6581) Use DECLARE_PCI_UNMAP_{ADDR,LEN} in state saving structures. 6531) Use DEFINE_DMA_UNMAP_{ADDR,LEN} in state saving structures.
659 Example, before: 654 Example, before:
660 655
661 struct ring_state { 656 struct ring_state {
@@ -668,14 +663,11 @@ transform some example code.
668 663
669 struct ring_state { 664 struct ring_state {
670 struct sk_buff *skb; 665 struct sk_buff *skb;
671 DECLARE_PCI_UNMAP_ADDR(mapping) 666 DEFINE_DMA_UNMAP_ADDR(mapping);
672 DECLARE_PCI_UNMAP_LEN(len) 667 DEFINE_DMA_UNMAP_LEN(len);
673 }; 668 };
674 669
675 NOTE: DO NOT put a semicolon at the end of the DECLARE_*() 6702) Use dma_unmap_{addr,len}_set to set these values.
676 macro.
677
6782) Use pci_unmap_{addr,len}_set to set these values.
679 Example, before: 671 Example, before:
680 672
681 ringp->mapping = FOO; 673 ringp->mapping = FOO;
@@ -683,21 +675,21 @@ transform some example code.
683 675
684 after: 676 after:
685 677
686 pci_unmap_addr_set(ringp, mapping, FOO); 678 dma_unmap_addr_set(ringp, mapping, FOO);
687 pci_unmap_len_set(ringp, len, BAR); 679 dma_unmap_len_set(ringp, len, BAR);
688 680
6893) Use pci_unmap_{addr,len} to access these values. 6813) Use dma_unmap_{addr,len} to access these values.
690 Example, before: 682 Example, before:
691 683
692 pci_unmap_single(pdev, ringp->mapping, ringp->len, 684 dma_unmap_single(dev, ringp->mapping, ringp->len,
693 PCI_DMA_FROMDEVICE); 685 DMA_FROM_DEVICE);
694 686
695 after: 687 after:
696 688
697 pci_unmap_single(pdev, 689 dma_unmap_single(dev,
698 pci_unmap_addr(ringp, mapping), 690 dma_unmap_addr(ringp, mapping),
699 pci_unmap_len(ringp, len), 691 dma_unmap_len(ringp, len),
700 PCI_DMA_FROMDEVICE); 692 DMA_FROM_DEVICE);
701 693
702It really should be self-explanatory. We treat the ADDR and LEN 694It really should be self-explanatory. We treat the ADDR and LEN
703separately, because it is possible for an implementation to only 695separately, because it is possible for an implementation to only
@@ -732,15 +724,15 @@ to "Closing".
732DMA address space is limited on some architectures and an allocation 724DMA address space is limited on some architectures and an allocation
733failure can be determined by: 725failure can be determined by:
734 726
735- checking if pci_alloc_consistent returns NULL or pci_map_sg returns 0 727- checking if dma_alloc_coherent returns NULL or dma_map_sg returns 0
736 728
737- checking the returned dma_addr_t of pci_map_single and pci_map_page 729- checking the returned dma_addr_t of dma_map_single and dma_map_page
738 by using pci_dma_mapping_error(): 730 by using dma_mapping_error():
739 731
740 dma_addr_t dma_handle; 732 dma_addr_t dma_handle;
741 733
742 dma_handle = pci_map_single(pdev, addr, size, direction); 734 dma_handle = dma_map_single(dev, addr, size, direction);
743 if (pci_dma_mapping_error(pdev, dma_handle)) { 735 if (dma_mapping_error(dev, dma_handle)) {
744 /* 736 /*
745 * reduce current DMA mapping usage, 737 * reduce current DMA mapping usage,
746 * delay and try again later or 738 * delay and try again later or
diff --git a/Documentation/SubmitChecklist b/Documentation/SubmitChecklist
index 1053a56be3b1..8916ca48bc95 100644
--- a/Documentation/SubmitChecklist
+++ b/Documentation/SubmitChecklist
@@ -9,10 +9,14 @@ Documentation/SubmittingPatches and elsewhere regarding submitting Linux
9kernel patches. 9kernel patches.
10 10
11 11
121: Builds cleanly with applicable or modified CONFIG options =y, =m, and 121: If you use a facility then #include the file that defines/declares
13 that facility. Don't depend on other header files pulling in ones
14 that you use.
15
162: Builds cleanly with applicable or modified CONFIG options =y, =m, and
13 =n. No gcc warnings/errors, no linker warnings/errors. 17 =n. No gcc warnings/errors, no linker warnings/errors.
14 18
152: Passes allnoconfig, allmodconfig 192b: Passes allnoconfig, allmodconfig
16 20
173: Builds on multiple CPU architectures by using local cross-compile tools 213: Builds on multiple CPU architectures by using local cross-compile tools
18 or some other build farm. 22 or some other build farm.
diff --git a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
index 76b3a11e90be..fa968aa99d67 100644
--- a/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
+++ b/Documentation/arm/Samsung-S3C24XX/CPUfreq.txt
@@ -14,8 +14,8 @@ Introduction
14 how the clocks are arranged. The first implementation used as single 14 how the clocks are arranged. The first implementation used as single
15 PLL to feed the ARM, memory and peripherals via a series of dividers 15 PLL to feed the ARM, memory and peripherals via a series of dividers
16 and muxes and this is the implementation that is documented here. A 16 and muxes and this is the implementation that is documented here. A
17 newer version where there is a seperate PLL and clock divider for the 17 newer version where there is a separate PLL and clock divider for the
18 ARM core is available as a seperate driver. 18 ARM core is available as a separate driver.
19 19
20 20
21Layout 21Layout
diff --git a/Documentation/arm/Samsung/Overview.txt b/Documentation/arm/Samsung/Overview.txt
new file mode 100644
index 000000000000..7cced1fea9c3
--- /dev/null
+++ b/Documentation/arm/Samsung/Overview.txt
@@ -0,0 +1,86 @@
1 Samsung ARM Linux Overview
2 ==========================
3
4Introduction
5------------
6
7 The Samsung range of ARM SoCs spans many similar devices, from the initial
8 ARM9 through to the newest ARM cores. This document shows an overview of
9 the current kernel support, how to use it and where to find the code
10 that supports this.
11
12 The currently supported SoCs are:
13
14 - S3C24XX: See Documentation/arm/Samsung-S3C24XX/Overview.txt for full list
15 - S3C64XX: S3C6400 and S3C6410
16 - S5PC6440
17
18 S5PC100 and S5PC110 support is currently being merged
19
20
21S3C24XX Systems
22---------------
23
24 There is still documentation in Documnetation/arm/Samsung-S3C24XX/ which
25 deals with the architecture and drivers specific to these devices.
26
27 See Documentation/arm/Samsung-S3C24XX/Overview.txt for more information
28 on the implementation details and specific support.
29
30
31Configuration
32-------------
33
34 A number of configurations are supplied, as there is no current way of
35 unifying all the SoCs into one kernel.
36
37 s5p6440_defconfig - S5P6440 specific default configuration
38 s5pc100_defconfig - S5PC100 specific default configuration
39
40
41Layout
42------
43
44 The directory layout is currently being restructured, and consists of
45 several platform directories and then the machine specific directories
46 of the CPUs being built for.
47
48 plat-samsung provides the base for all the implementations, and is the
49 last in the line of include directories that are processed for the build
50 specific information. It contains the base clock, GPIO and device definitions
51 to get the system running.
52
53 plat-s3c is the s3c24xx/s3c64xx platform directory, although it is currently
54 involved in other builds this will be phased out once the relevant code is
55 moved elsewhere.
56
57 plat-s3c24xx is for s3c24xx specific builds, see the S3C24XX docs.
58
59 plat-s3c64xx is for the s3c64xx specific bits, see the S3C24XX docs.
60
61 plat-s5p is for s5p specific builds, more to be added.
62
63
64 [ to finish ]
65
66
67Port Contributors
68-----------------
69
70 Ben Dooks (BJD)
71 Vincent Sanders
72 Herbert Potzl
73 Arnaud Patard (RTP)
74 Roc Wu
75 Klaus Fetscher
76 Dimitry Andric
77 Shannon Holland
78 Guillaume Gourat (NexVision)
79 Christer Weinigel (wingel) (Acer N30)
80 Lucas Correia Villa Real (S3C2400 port)
81
82
83Document Author
84---------------
85
86Copyright 2009-2010 Ben Dooks <ben-linux@fluff.org>
diff --git a/Documentation/arm/Samsung/clksrc-change-registers.awk b/Documentation/arm/Samsung/clksrc-change-registers.awk
new file mode 100755
index 000000000000..0c50220851fb
--- /dev/null
+++ b/Documentation/arm/Samsung/clksrc-change-registers.awk
@@ -0,0 +1,167 @@
1#!/usr/bin/awk -f
2#
3# Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4#
5# Released under GPLv2
6
7# example usage
8# ./clksrc-change-registers.awk arch/arm/plat-s5pc1xx/include/plat/regs-clock.h < src > dst
9
10function extract_value(s)
11{
12 eqat = index(s, "=")
13 comat = index(s, ",")
14 return substr(s, eqat+2, (comat-eqat)-2)
15}
16
17function remove_brackets(b)
18{
19 return substr(b, 2, length(b)-2)
20}
21
22function splitdefine(l, p)
23{
24 r = split(l, tp)
25
26 p[0] = tp[2]
27 p[1] = remove_brackets(tp[3])
28}
29
30function find_length(f)
31{
32 if (0)
33 printf "find_length " f "\n" > "/dev/stderr"
34
35 if (f ~ /0x1/)
36 return 1
37 else if (f ~ /0x3/)
38 return 2
39 else if (f ~ /0x7/)
40 return 3
41 else if (f ~ /0xf/)
42 return 4
43
44 printf "unknown legnth " f "\n" > "/dev/stderr"
45 exit
46}
47
48function find_shift(s)
49{
50 id = index(s, "<")
51 if (id <= 0) {
52 printf "cannot find shift " s "\n" > "/dev/stderr"
53 exit
54 }
55
56 return substr(s, id+2)
57}
58
59
60BEGIN {
61 if (ARGC < 2) {
62 print "too few arguments" > "/dev/stderr"
63 exit
64 }
65
66# read the header file and find the mask values that we will need
67# to replace and create an associative array of values
68
69 while (getline line < ARGV[1] > 0) {
70 if (line ~ /\#define.*_MASK/ &&
71 !(line ~ /S5PC100_EPLL_MASK/) &&
72 !(line ~ /USB_SIG_MASK/)) {
73 splitdefine(line, fields)
74 name = fields[0]
75 if (0)
76 printf "MASK " line "\n" > "/dev/stderr"
77 dmask[name,0] = find_length(fields[1])
78 dmask[name,1] = find_shift(fields[1])
79 if (0)
80 printf "=> '" name "' LENGTH=" dmask[name,0] " SHIFT=" dmask[name,1] "\n" > "/dev/stderr"
81 } else {
82 }
83 }
84
85 delete ARGV[1]
86}
87
88/clksrc_clk.*=.*{/ {
89 shift=""
90 mask=""
91 divshift=""
92 reg_div=""
93 reg_src=""
94 indent=1
95
96 print $0
97
98 for(; indent >= 1;) {
99 if ((getline line) <= 0) {
100 printf "unexpected end of file" > "/dev/stderr"
101 exit 1;
102 }
103
104 if (line ~ /\.shift/) {
105 shift = extract_value(line)
106 } else if (line ~ /\.mask/) {
107 mask = extract_value(line)
108 } else if (line ~ /\.reg_divider/) {
109 reg_div = extract_value(line)
110 } else if (line ~ /\.reg_source/) {
111 reg_src = extract_value(line)
112 } else if (line ~ /\.divider_shift/) {
113 divshift = extract_value(line)
114 } else if (line ~ /{/) {
115 indent++
116 print line
117 } else if (line ~ /}/) {
118 indent--
119
120 if (indent == 0) {
121 if (0) {
122 printf "shift '" shift "' ='" dmask[shift,0] "'\n" > "/dev/stderr"
123 printf "mask '" mask "'\n" > "/dev/stderr"
124 printf "dshft '" divshift "'\n" > "/dev/stderr"
125 printf "rdiv '" reg_div "'\n" > "/dev/stderr"
126 printf "rsrc '" reg_src "'\n" > "/dev/stderr"
127 }
128
129 generated = mask
130 sub(reg_src, reg_div, generated)
131
132 if (0) {
133 printf "/* rsrc " reg_src " */\n"
134 printf "/* rdiv " reg_div " */\n"
135 printf "/* shift " shift " */\n"
136 printf "/* mask " mask " */\n"
137 printf "/* generated " generated " */\n"
138 }
139
140 if (reg_div != "") {
141 printf "\t.reg_div = { "
142 printf ".reg = " reg_div ", "
143 printf ".shift = " dmask[generated,1] ", "
144 printf ".size = " dmask[generated,0] ", "
145 printf "},\n"
146 }
147
148 printf "\t.reg_src = { "
149 printf ".reg = " reg_src ", "
150 printf ".shift = " dmask[mask,1] ", "
151 printf ".size = " dmask[mask,0] ", "
152
153 printf "},\n"
154
155 }
156
157 print line
158 } else {
159 print line
160 }
161
162 if (0)
163 printf indent ":" line "\n" > "/dev/stderr"
164 }
165}
166
167// && ! /clksrc_clk.*=.*{/ { print $0 }
diff --git a/Documentation/cgroups/cgroup_event_listener.c b/Documentation/cgroups/cgroup_event_listener.c
new file mode 100644
index 000000000000..8c2bfc4a6358
--- /dev/null
+++ b/Documentation/cgroups/cgroup_event_listener.c
@@ -0,0 +1,110 @@
1/*
2 * cgroup_event_listener.c - Simple listener of cgroup events
3 *
4 * Copyright (C) Kirill A. Shutemov <kirill@shutemov.name>
5 */
6
7#include <assert.h>
8#include <errno.h>
9#include <fcntl.h>
10#include <libgen.h>
11#include <limits.h>
12#include <stdio.h>
13#include <string.h>
14#include <unistd.h>
15
16#include <sys/eventfd.h>
17
18#define USAGE_STR "Usage: cgroup_event_listener <path-to-control-file> <args>\n"
19
20int main(int argc, char **argv)
21{
22 int efd = -1;
23 int cfd = -1;
24 int event_control = -1;
25 char event_control_path[PATH_MAX];
26 char line[LINE_MAX];
27 int ret;
28
29 if (argc != 3) {
30 fputs(USAGE_STR, stderr);
31 return 1;
32 }
33
34 cfd = open(argv[1], O_RDONLY);
35 if (cfd == -1) {
36 fprintf(stderr, "Cannot open %s: %s\n", argv[1],
37 strerror(errno));
38 goto out;
39 }
40
41 ret = snprintf(event_control_path, PATH_MAX, "%s/cgroup.event_control",
42 dirname(argv[1]));
43 if (ret >= PATH_MAX) {
44 fputs("Path to cgroup.event_control is too long\n", stderr);
45 goto out;
46 }
47
48 event_control = open(event_control_path, O_WRONLY);
49 if (event_control == -1) {
50 fprintf(stderr, "Cannot open %s: %s\n", event_control_path,
51 strerror(errno));
52 goto out;
53 }
54
55 efd = eventfd(0, 0);
56 if (efd == -1) {
57 perror("eventfd() failed");
58 goto out;
59 }
60
61 ret = snprintf(line, LINE_MAX, "%d %d %s", efd, cfd, argv[2]);
62 if (ret >= LINE_MAX) {
63 fputs("Arguments string is too long\n", stderr);
64 goto out;
65 }
66
67 ret = write(event_control, line, strlen(line) + 1);
68 if (ret == -1) {
69 perror("Cannot write to cgroup.event_control");
70 goto out;
71 }
72
73 while (1) {
74 uint64_t result;
75
76 ret = read(efd, &result, sizeof(result));
77 if (ret == -1) {
78 if (errno == EINTR)
79 continue;
80 perror("Cannot read from eventfd");
81 break;
82 }
83 assert(ret == sizeof(result));
84
85 ret = access(event_control_path, W_OK);
86 if ((ret == -1) && (errno == ENOENT)) {
87 puts("The cgroup seems to have removed.");
88 ret = 0;
89 break;
90 }
91
92 if (ret == -1) {
93 perror("cgroup.event_control "
94 "is not accessable any more");
95 break;
96 }
97
98 printf("%s %s: crossed\n", argv[1], argv[2]);
99 }
100
101out:
102 if (efd >= 0)
103 close(efd);
104 if (event_control >= 0)
105 close(event_control);
106 if (cfd >= 0)
107 close(cfd);
108
109 return (ret != 0);
110}
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index 0b33bfe7dde9..fd588ff0e296 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -22,6 +22,8 @@ CONTENTS:
222. Usage Examples and Syntax 222. Usage Examples and Syntax
23 2.1 Basic Usage 23 2.1 Basic Usage
24 2.2 Attaching processes 24 2.2 Attaching processes
25 2.3 Mounting hierarchies by name
26 2.4 Notification API
253. Kernel API 273. Kernel API
26 3.1 Overview 28 3.1 Overview
27 3.2 Synchronization 29 3.2 Synchronization
@@ -434,6 +436,25 @@ you give a subsystem a name.
434The name of the subsystem appears as part of the hierarchy description 436The name of the subsystem appears as part of the hierarchy description
435in /proc/mounts and /proc/<pid>/cgroups. 437in /proc/mounts and /proc/<pid>/cgroups.
436 438
4392.4 Notification API
440--------------------
441
442There is mechanism which allows to get notifications about changing
443status of a cgroup.
444
445To register new notification handler you need:
446 - create a file descriptor for event notification using eventfd(2);
447 - open a control file to be monitored (e.g. memory.usage_in_bytes);
448 - write "<event_fd> <control_fd> <args>" to cgroup.event_control.
449 Interpretation of args is defined by control file implementation;
450
451eventfd will be woken up by control file implementation or when the
452cgroup is removed.
453
454To unregister notification handler just close eventfd.
455
456NOTE: Support of notifications should be implemented for the control
457file. See documentation for the subsystem.
437 458
4383. Kernel API 4593. Kernel API
439============= 460=============
@@ -488,6 +509,11 @@ Each subsystem should:
488- add an entry in linux/cgroup_subsys.h 509- add an entry in linux/cgroup_subsys.h
489- define a cgroup_subsys object called <name>_subsys 510- define a cgroup_subsys object called <name>_subsys
490 511
512If a subsystem can be compiled as a module, it should also have in its
513module initcall a call to cgroup_load_subsys(), and in its exitcall a
514call to cgroup_unload_subsys(). It should also set its_subsys.module =
515THIS_MODULE in its .c file.
516
491Each subsystem may export the following methods. The only mandatory 517Each subsystem may export the following methods. The only mandatory
492methods are create/destroy. Any others that are null are presumed to 518methods are create/destroy. Any others that are null are presumed to
493be successful no-ops. 519be successful no-ops.
@@ -536,10 +562,21 @@ returns an error, this will abort the attach operation. If a NULL
536task is passed, then a successful result indicates that *any* 562task is passed, then a successful result indicates that *any*
537unspecified task can be moved into the cgroup. Note that this isn't 563unspecified task can be moved into the cgroup. Note that this isn't
538called on a fork. If this method returns 0 (success) then this should 564called on a fork. If this method returns 0 (success) then this should
539remain valid while the caller holds cgroup_mutex. If threadgroup is 565remain valid while the caller holds cgroup_mutex and it is ensured that either
566attach() or cancel_attach() will be called in future. If threadgroup is
540true, then a successful result indicates that all threads in the given 567true, then a successful result indicates that all threads in the given
541thread's threadgroup can be moved together. 568thread's threadgroup can be moved together.
542 569
570void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
571 struct task_struct *task, bool threadgroup)
572(cgroup_mutex held by caller)
573
574Called when a task attach operation has failed after can_attach() has succeeded.
575A subsystem whose can_attach() has some side-effects should provide this
576function, so that the subsytem can implement a rollback. If not, not necessary.
577This will be called only about subsystems whose can_attach() operation have
578succeeded.
579
543void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, 580void attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
544 struct cgroup *old_cgrp, struct task_struct *task, 581 struct cgroup *old_cgrp, struct task_struct *task,
545 bool threadgroup) 582 bool threadgroup)
diff --git a/Documentation/cgroups/cpusets.txt b/Documentation/cgroups/cpusets.txt
index 1d7e9784439a..4160df82b3f5 100644
--- a/Documentation/cgroups/cpusets.txt
+++ b/Documentation/cgroups/cpusets.txt
@@ -168,20 +168,20 @@ Each cpuset is represented by a directory in the cgroup file system
168containing (on top of the standard cgroup files) the following 168containing (on top of the standard cgroup files) the following
169files describing that cpuset: 169files describing that cpuset:
170 170
171 - cpus: list of CPUs in that cpuset 171 - cpuset.cpus: list of CPUs in that cpuset
172 - mems: list of Memory Nodes in that cpuset 172 - cpuset.mems: list of Memory Nodes in that cpuset
173 - memory_migrate flag: if set, move pages to cpusets nodes 173 - cpuset.memory_migrate flag: if set, move pages to cpusets nodes
174 - cpu_exclusive flag: is cpu placement exclusive? 174 - cpuset.cpu_exclusive flag: is cpu placement exclusive?
175 - mem_exclusive flag: is memory placement exclusive? 175 - cpuset.mem_exclusive flag: is memory placement exclusive?
176 - mem_hardwall flag: is memory allocation hardwalled 176 - cpuset.mem_hardwall flag: is memory allocation hardwalled
177 - memory_pressure: measure of how much paging pressure in cpuset 177 - cpuset.memory_pressure: measure of how much paging pressure in cpuset
178 - memory_spread_page flag: if set, spread page cache evenly on allowed nodes 178 - cpuset.memory_spread_page flag: if set, spread page cache evenly on allowed nodes
179 - memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes 179 - cpuset.memory_spread_slab flag: if set, spread slab cache evenly on allowed nodes
180 - sched_load_balance flag: if set, load balance within CPUs on that cpuset 180 - cpuset.sched_load_balance flag: if set, load balance within CPUs on that cpuset
181 - sched_relax_domain_level: the searching range when migrating tasks 181 - cpuset.sched_relax_domain_level: the searching range when migrating tasks
182 182
183In addition, the root cpuset only has the following file: 183In addition, the root cpuset only has the following file:
184 - memory_pressure_enabled flag: compute memory_pressure? 184 - cpuset.memory_pressure_enabled flag: compute memory_pressure?
185 185
186New cpusets are created using the mkdir system call or shell 186New cpusets are created using the mkdir system call or shell
187command. The properties of a cpuset, such as its flags, allowed 187command. The properties of a cpuset, such as its flags, allowed
@@ -229,7 +229,7 @@ If a cpuset is cpu or mem exclusive, no other cpuset, other than
229a direct ancestor or descendant, may share any of the same CPUs or 229a direct ancestor or descendant, may share any of the same CPUs or
230Memory Nodes. 230Memory Nodes.
231 231
232A cpuset that is mem_exclusive *or* mem_hardwall is "hardwalled", 232A cpuset that is cpuset.mem_exclusive *or* cpuset.mem_hardwall is "hardwalled",
233i.e. it restricts kernel allocations for page, buffer and other data 233i.e. it restricts kernel allocations for page, buffer and other data
234commonly shared by the kernel across multiple users. All cpusets, 234commonly shared by the kernel across multiple users. All cpusets,
235whether hardwalled or not, restrict allocations of memory for user 235whether hardwalled or not, restrict allocations of memory for user
@@ -304,15 +304,15 @@ times 1000.
304--------------------------- 304---------------------------
305There are two boolean flag files per cpuset that control where the 305There are two boolean flag files per cpuset that control where the
306kernel allocates pages for the file system buffers and related in 306kernel allocates pages for the file system buffers and related in
307kernel data structures. They are called 'memory_spread_page' and 307kernel data structures. They are called 'cpuset.memory_spread_page' and
308'memory_spread_slab'. 308'cpuset.memory_spread_slab'.
309 309
310If the per-cpuset boolean flag file 'memory_spread_page' is set, then 310If the per-cpuset boolean flag file 'cpuset.memory_spread_page' is set, then
311the kernel will spread the file system buffers (page cache) evenly 311the kernel will spread the file system buffers (page cache) evenly
312over all the nodes that the faulting task is allowed to use, instead 312over all the nodes that the faulting task is allowed to use, instead
313of preferring to put those pages on the node where the task is running. 313of preferring to put those pages on the node where the task is running.
314 314
315If the per-cpuset boolean flag file 'memory_spread_slab' is set, 315If the per-cpuset boolean flag file 'cpuset.memory_spread_slab' is set,
316then the kernel will spread some file system related slab caches, 316then the kernel will spread some file system related slab caches,
317such as for inodes and dentries evenly over all the nodes that the 317such as for inodes and dentries evenly over all the nodes that the
318faulting task is allowed to use, instead of preferring to put those 318faulting task is allowed to use, instead of preferring to put those
@@ -337,21 +337,21 @@ their containing tasks memory spread settings. If memory spreading
337is turned off, then the currently specified NUMA mempolicy once again 337is turned off, then the currently specified NUMA mempolicy once again
338applies to memory page allocations. 338applies to memory page allocations.
339 339
340Both 'memory_spread_page' and 'memory_spread_slab' are boolean flag 340Both 'cpuset.memory_spread_page' and 'cpuset.memory_spread_slab' are boolean flag
341files. By default they contain "0", meaning that the feature is off 341files. By default they contain "0", meaning that the feature is off
342for that cpuset. If a "1" is written to that file, then that turns 342for that cpuset. If a "1" is written to that file, then that turns
343the named feature on. 343the named feature on.
344 344
345The implementation is simple. 345The implementation is simple.
346 346
347Setting the flag 'memory_spread_page' turns on a per-process flag 347Setting the flag 'cpuset.memory_spread_page' turns on a per-process flag
348PF_SPREAD_PAGE for each task that is in that cpuset or subsequently 348PF_SPREAD_PAGE for each task that is in that cpuset or subsequently
349joins that cpuset. The page allocation calls for the page cache 349joins that cpuset. The page allocation calls for the page cache
350is modified to perform an inline check for this PF_SPREAD_PAGE task 350is modified to perform an inline check for this PF_SPREAD_PAGE task
351flag, and if set, a call to a new routine cpuset_mem_spread_node() 351flag, and if set, a call to a new routine cpuset_mem_spread_node()
352returns the node to prefer for the allocation. 352returns the node to prefer for the allocation.
353 353
354Similarly, setting 'memory_spread_slab' turns on the flag 354Similarly, setting 'cpuset.memory_spread_slab' turns on the flag
355PF_SPREAD_SLAB, and appropriately marked slab caches will allocate 355PF_SPREAD_SLAB, and appropriately marked slab caches will allocate
356pages from the node returned by cpuset_mem_spread_node(). 356pages from the node returned by cpuset_mem_spread_node().
357 357
@@ -404,24 +404,24 @@ the following two situations:
404 system overhead on those CPUs, including avoiding task load 404 system overhead on those CPUs, including avoiding task load
405 balancing if that is not needed. 405 balancing if that is not needed.
406 406
407When the per-cpuset flag "sched_load_balance" is enabled (the default 407When the per-cpuset flag "cpuset.sched_load_balance" is enabled (the default
408setting), it requests that all the CPUs in that cpusets allowed 'cpus' 408setting), it requests that all the CPUs in that cpusets allowed 'cpuset.cpus'
409be contained in a single sched domain, ensuring that load balancing 409be contained in a single sched domain, ensuring that load balancing
410can move a task (not otherwised pinned, as by sched_setaffinity) 410can move a task (not otherwised pinned, as by sched_setaffinity)
411from any CPU in that cpuset to any other. 411from any CPU in that cpuset to any other.
412 412
413When the per-cpuset flag "sched_load_balance" is disabled, then the 413When the per-cpuset flag "cpuset.sched_load_balance" is disabled, then the
414scheduler will avoid load balancing across the CPUs in that cpuset, 414scheduler will avoid load balancing across the CPUs in that cpuset,
415--except-- in so far as is necessary because some overlapping cpuset 415--except-- in so far as is necessary because some overlapping cpuset
416has "sched_load_balance" enabled. 416has "sched_load_balance" enabled.
417 417
418So, for example, if the top cpuset has the flag "sched_load_balance" 418So, for example, if the top cpuset has the flag "cpuset.sched_load_balance"
419enabled, then the scheduler will have one sched domain covering all 419enabled, then the scheduler will have one sched domain covering all
420CPUs, and the setting of the "sched_load_balance" flag in any other 420CPUs, and the setting of the "cpuset.sched_load_balance" flag in any other
421cpusets won't matter, as we're already fully load balancing. 421cpusets won't matter, as we're already fully load balancing.
422 422
423Therefore in the above two situations, the top cpuset flag 423Therefore in the above two situations, the top cpuset flag
424"sched_load_balance" should be disabled, and only some of the smaller, 424"cpuset.sched_load_balance" should be disabled, and only some of the smaller,
425child cpusets have this flag enabled. 425child cpusets have this flag enabled.
426 426
427When doing this, you don't usually want to leave any unpinned tasks in 427When doing this, you don't usually want to leave any unpinned tasks in
@@ -433,7 +433,7 @@ scheduler might not consider the possibility of load balancing that
433task to that underused CPU. 433task to that underused CPU.
434 434
435Of course, tasks pinned to a particular CPU can be left in a cpuset 435Of course, tasks pinned to a particular CPU can be left in a cpuset
436that disables "sched_load_balance" as those tasks aren't going anywhere 436that disables "cpuset.sched_load_balance" as those tasks aren't going anywhere
437else anyway. 437else anyway.
438 438
439There is an impedance mismatch here, between cpusets and sched domains. 439There is an impedance mismatch here, between cpusets and sched domains.
@@ -443,19 +443,19 @@ overlap and each CPU is in at most one sched domain.
443It is necessary for sched domains to be flat because load balancing 443It is necessary for sched domains to be flat because load balancing
444across partially overlapping sets of CPUs would risk unstable dynamics 444across partially overlapping sets of CPUs would risk unstable dynamics
445that would be beyond our understanding. So if each of two partially 445that would be beyond our understanding. So if each of two partially
446overlapping cpusets enables the flag 'sched_load_balance', then we 446overlapping cpusets enables the flag 'cpuset.sched_load_balance', then we
447form a single sched domain that is a superset of both. We won't move 447form a single sched domain that is a superset of both. We won't move
448a task to a CPU outside it cpuset, but the scheduler load balancing 448a task to a CPU outside it cpuset, but the scheduler load balancing
449code might waste some compute cycles considering that possibility. 449code might waste some compute cycles considering that possibility.
450 450
451This mismatch is why there is not a simple one-to-one relation 451This mismatch is why there is not a simple one-to-one relation
452between which cpusets have the flag "sched_load_balance" enabled, 452between which cpusets have the flag "cpuset.sched_load_balance" enabled,
453and the sched domain configuration. If a cpuset enables the flag, it 453and the sched domain configuration. If a cpuset enables the flag, it
454will get balancing across all its CPUs, but if it disables the flag, 454will get balancing across all its CPUs, but if it disables the flag,
455it will only be assured of no load balancing if no other overlapping 455it will only be assured of no load balancing if no other overlapping
456cpuset enables the flag. 456cpuset enables the flag.
457 457
458If two cpusets have partially overlapping 'cpus' allowed, and only 458If two cpusets have partially overlapping 'cpuset.cpus' allowed, and only
459one of them has this flag enabled, then the other may find its 459one of them has this flag enabled, then the other may find its
460tasks only partially load balanced, just on the overlapping CPUs. 460tasks only partially load balanced, just on the overlapping CPUs.
461This is just the general case of the top_cpuset example given a few 461This is just the general case of the top_cpuset example given a few
@@ -468,23 +468,23 @@ load balancing to the other CPUs.
4681.7.1 sched_load_balance implementation details. 4681.7.1 sched_load_balance implementation details.
469------------------------------------------------ 469------------------------------------------------
470 470
471The per-cpuset flag 'sched_load_balance' defaults to enabled (contrary 471The per-cpuset flag 'cpuset.sched_load_balance' defaults to enabled (contrary
472to most cpuset flags.) When enabled for a cpuset, the kernel will 472to most cpuset flags.) When enabled for a cpuset, the kernel will
473ensure that it can load balance across all the CPUs in that cpuset 473ensure that it can load balance across all the CPUs in that cpuset
474(makes sure that all the CPUs in the cpus_allowed of that cpuset are 474(makes sure that all the CPUs in the cpus_allowed of that cpuset are
475in the same sched domain.) 475in the same sched domain.)
476 476
477If two overlapping cpusets both have 'sched_load_balance' enabled, 477If two overlapping cpusets both have 'cpuset.sched_load_balance' enabled,
478then they will be (must be) both in the same sched domain. 478then they will be (must be) both in the same sched domain.
479 479
480If, as is the default, the top cpuset has 'sched_load_balance' enabled, 480If, as is the default, the top cpuset has 'cpuset.sched_load_balance' enabled,
481then by the above that means there is a single sched domain covering 481then by the above that means there is a single sched domain covering
482the whole system, regardless of any other cpuset settings. 482the whole system, regardless of any other cpuset settings.
483 483
484The kernel commits to user space that it will avoid load balancing 484The kernel commits to user space that it will avoid load balancing
485where it can. It will pick as fine a granularity partition of sched 485where it can. It will pick as fine a granularity partition of sched
486domains as it can while still providing load balancing for any set 486domains as it can while still providing load balancing for any set
487of CPUs allowed to a cpuset having 'sched_load_balance' enabled. 487of CPUs allowed to a cpuset having 'cpuset.sched_load_balance' enabled.
488 488
489The internal kernel cpuset to scheduler interface passes from the 489The internal kernel cpuset to scheduler interface passes from the
490cpuset code to the scheduler code a partition of the load balanced 490cpuset code to the scheduler code a partition of the load balanced
@@ -495,9 +495,9 @@ all the CPUs that must be load balanced.
495The cpuset code builds a new such partition and passes it to the 495The cpuset code builds a new such partition and passes it to the
496scheduler sched domain setup code, to have the sched domains rebuilt 496scheduler sched domain setup code, to have the sched domains rebuilt
497as necessary, whenever: 497as necessary, whenever:
498 - the 'sched_load_balance' flag of a cpuset with non-empty CPUs changes, 498 - the 'cpuset.sched_load_balance' flag of a cpuset with non-empty CPUs changes,
499 - or CPUs come or go from a cpuset with this flag enabled, 499 - or CPUs come or go from a cpuset with this flag enabled,
500 - or 'sched_relax_domain_level' value of a cpuset with non-empty CPUs 500 - or 'cpuset.sched_relax_domain_level' value of a cpuset with non-empty CPUs
501 and with this flag enabled changes, 501 and with this flag enabled changes,
502 - or a cpuset with non-empty CPUs and with this flag enabled is removed, 502 - or a cpuset with non-empty CPUs and with this flag enabled is removed,
503 - or a cpu is offlined/onlined. 503 - or a cpu is offlined/onlined.
@@ -542,7 +542,7 @@ As the result, task B on CPU X need to wait task A or wait load balance
542on the next tick. For some applications in special situation, waiting 542on the next tick. For some applications in special situation, waiting
5431 tick may be too long. 5431 tick may be too long.
544 544
545The 'sched_relax_domain_level' file allows you to request changing 545The 'cpuset.sched_relax_domain_level' file allows you to request changing
546this searching range as you like. This file takes int value which 546this searching range as you like. This file takes int value which
547indicates size of searching range in levels ideally as follows, 547indicates size of searching range in levels ideally as follows,
548otherwise initial value -1 that indicates the cpuset has no request. 548otherwise initial value -1 that indicates the cpuset has no request.
@@ -559,8 +559,8 @@ The system default is architecture dependent. The system default
559can be changed using the relax_domain_level= boot parameter. 559can be changed using the relax_domain_level= boot parameter.
560 560
561This file is per-cpuset and affect the sched domain where the cpuset 561This file is per-cpuset and affect the sched domain where the cpuset
562belongs to. Therefore if the flag 'sched_load_balance' of a cpuset 562belongs to. Therefore if the flag 'cpuset.sched_load_balance' of a cpuset
563is disabled, then 'sched_relax_domain_level' have no effect since 563is disabled, then 'cpuset.sched_relax_domain_level' have no effect since
564there is no sched domain belonging the cpuset. 564there is no sched domain belonging the cpuset.
565 565
566If multiple cpusets are overlapping and hence they form a single sched 566If multiple cpusets are overlapping and hence they form a single sched
@@ -607,9 +607,9 @@ from one cpuset to another, then the kernel will adjust the tasks
607memory placement, as above, the next time that the kernel attempts 607memory placement, as above, the next time that the kernel attempts
608to allocate a page of memory for that task. 608to allocate a page of memory for that task.
609 609
610If a cpuset has its 'cpus' modified, then each task in that cpuset 610If a cpuset has its 'cpuset.cpus' modified, then each task in that cpuset
611will have its allowed CPU placement changed immediately. Similarly, 611will have its allowed CPU placement changed immediately. Similarly,
612if a tasks pid is written to another cpusets 'tasks' file, then its 612if a tasks pid is written to another cpusets 'cpuset.tasks' file, then its
613allowed CPU placement is changed immediately. If such a task had been 613allowed CPU placement is changed immediately. If such a task had been
614bound to some subset of its cpuset using the sched_setaffinity() call, 614bound to some subset of its cpuset using the sched_setaffinity() call,
615the task will be allowed to run on any CPU allowed in its new cpuset, 615the task will be allowed to run on any CPU allowed in its new cpuset,
@@ -622,8 +622,8 @@ and the processor placement is updated immediately.
622Normally, once a page is allocated (given a physical page 622Normally, once a page is allocated (given a physical page
623of main memory) then that page stays on whatever node it 623of main memory) then that page stays on whatever node it
624was allocated, so long as it remains allocated, even if the 624was allocated, so long as it remains allocated, even if the
625cpusets memory placement policy 'mems' subsequently changes. 625cpusets memory placement policy 'cpuset.mems' subsequently changes.
626If the cpuset flag file 'memory_migrate' is set true, then when 626If the cpuset flag file 'cpuset.memory_migrate' is set true, then when
627tasks are attached to that cpuset, any pages that task had 627tasks are attached to that cpuset, any pages that task had
628allocated to it on nodes in its previous cpuset are migrated 628allocated to it on nodes in its previous cpuset are migrated
629to the tasks new cpuset. The relative placement of the page within 629to the tasks new cpuset. The relative placement of the page within
@@ -631,12 +631,12 @@ the cpuset is preserved during these migration operations if possible.
631For example if the page was on the second valid node of the prior cpuset 631For example if the page was on the second valid node of the prior cpuset
632then the page will be placed on the second valid node of the new cpuset. 632then the page will be placed on the second valid node of the new cpuset.
633 633
634Also if 'memory_migrate' is set true, then if that cpusets 634Also if 'cpuset.memory_migrate' is set true, then if that cpusets
635'mems' file is modified, pages allocated to tasks in that 635'cpuset.mems' file is modified, pages allocated to tasks in that
636cpuset, that were on nodes in the previous setting of 'mems', 636cpuset, that were on nodes in the previous setting of 'cpuset.mems',
637will be moved to nodes in the new setting of 'mems.' 637will be moved to nodes in the new setting of 'mems.'
638Pages that were not in the tasks prior cpuset, or in the cpusets 638Pages that were not in the tasks prior cpuset, or in the cpusets
639prior 'mems' setting, will not be moved. 639prior 'cpuset.mems' setting, will not be moved.
640 640
641There is an exception to the above. If hotplug functionality is used 641There is an exception to the above. If hotplug functionality is used
642to remove all the CPUs that are currently assigned to a cpuset, 642to remove all the CPUs that are currently assigned to a cpuset,
@@ -678,8 +678,8 @@ and then start a subshell 'sh' in that cpuset:
678 cd /dev/cpuset 678 cd /dev/cpuset
679 mkdir Charlie 679 mkdir Charlie
680 cd Charlie 680 cd Charlie
681 /bin/echo 2-3 > cpus 681 /bin/echo 2-3 > cpuset.cpus
682 /bin/echo 1 > mems 682 /bin/echo 1 > cpuset.mems
683 /bin/echo $$ > tasks 683 /bin/echo $$ > tasks
684 sh 684 sh
685 # The subshell 'sh' is now running in cpuset Charlie 685 # The subshell 'sh' is now running in cpuset Charlie
@@ -725,10 +725,13 @@ Now you want to do something with this cpuset.
725 725
726In this directory you can find several files: 726In this directory you can find several files:
727# ls 727# ls
728cpu_exclusive memory_migrate mems tasks 728cpuset.cpu_exclusive cpuset.memory_spread_slab
729cpus memory_pressure notify_on_release 729cpuset.cpus cpuset.mems
730mem_exclusive memory_spread_page sched_load_balance 730cpuset.mem_exclusive cpuset.sched_load_balance
731mem_hardwall memory_spread_slab sched_relax_domain_level 731cpuset.mem_hardwall cpuset.sched_relax_domain_level
732cpuset.memory_migrate notify_on_release
733cpuset.memory_pressure tasks
734cpuset.memory_spread_page
732 735
733Reading them will give you information about the state of this cpuset: 736Reading them will give you information about the state of this cpuset:
734the CPUs and Memory Nodes it can use, the processes that are using 737the CPUs and Memory Nodes it can use, the processes that are using
@@ -736,13 +739,13 @@ it, its properties. By writing to these files you can manipulate
736the cpuset. 739the cpuset.
737 740
738Set some flags: 741Set some flags:
739# /bin/echo 1 > cpu_exclusive 742# /bin/echo 1 > cpuset.cpu_exclusive
740 743
741Add some cpus: 744Add some cpus:
742# /bin/echo 0-7 > cpus 745# /bin/echo 0-7 > cpuset.cpus
743 746
744Add some mems: 747Add some mems:
745# /bin/echo 0-7 > mems 748# /bin/echo 0-7 > cpuset.mems
746 749
747Now attach your shell to this cpuset: 750Now attach your shell to this cpuset:
748# /bin/echo $$ > tasks 751# /bin/echo $$ > tasks
@@ -774,28 +777,28 @@ echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent
774This is the syntax to use when writing in the cpus or mems files 777This is the syntax to use when writing in the cpus or mems files
775in cpuset directories: 778in cpuset directories:
776 779
777# /bin/echo 1-4 > cpus -> set cpus list to cpus 1,2,3,4 780# /bin/echo 1-4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4
778# /bin/echo 1,2,3,4 > cpus -> set cpus list to cpus 1,2,3,4 781# /bin/echo 1,2,3,4 > cpuset.cpus -> set cpus list to cpus 1,2,3,4
779 782
780To add a CPU to a cpuset, write the new list of CPUs including the 783To add a CPU to a cpuset, write the new list of CPUs including the
781CPU to be added. To add 6 to the above cpuset: 784CPU to be added. To add 6 to the above cpuset:
782 785
783# /bin/echo 1-4,6 > cpus -> set cpus list to cpus 1,2,3,4,6 786# /bin/echo 1-4,6 > cpuset.cpus -> set cpus list to cpus 1,2,3,4,6
784 787
785Similarly to remove a CPU from a cpuset, write the new list of CPUs 788Similarly to remove a CPU from a cpuset, write the new list of CPUs
786without the CPU to be removed. 789without the CPU to be removed.
787 790
788To remove all the CPUs: 791To remove all the CPUs:
789 792
790# /bin/echo "" > cpus -> clear cpus list 793# /bin/echo "" > cpuset.cpus -> clear cpus list
791 794
7922.3 Setting flags 7952.3 Setting flags
793----------------- 796-----------------
794 797
795The syntax is very simple: 798The syntax is very simple:
796 799
797# /bin/echo 1 > cpu_exclusive -> set flag 'cpu_exclusive' 800# /bin/echo 1 > cpuset.cpu_exclusive -> set flag 'cpuset.cpu_exclusive'
798# /bin/echo 0 > cpu_exclusive -> unset flag 'cpu_exclusive' 801# /bin/echo 0 > cpuset.cpu_exclusive -> unset flag 'cpuset.cpu_exclusive'
799 802
8002.4 Attaching processes 8032.4 Attaching processes
801----------------------- 804-----------------------
diff --git a/Documentation/cgroups/memcg_test.txt b/Documentation/cgroups/memcg_test.txt
index 72db89ed0609..f7f68b2ac199 100644
--- a/Documentation/cgroups/memcg_test.txt
+++ b/Documentation/cgroups/memcg_test.txt
@@ -1,6 +1,6 @@
1Memory Resource Controller(Memcg) Implementation Memo. 1Memory Resource Controller(Memcg) Implementation Memo.
2Last Updated: 2009/1/20 2Last Updated: 2010/2
3Base Kernel Version: based on 2.6.29-rc2. 3Base Kernel Version: based on 2.6.33-rc7-mm(candidate for 34).
4 4
5Because VM is getting complex (one of reasons is memcg...), memcg's behavior 5Because VM is getting complex (one of reasons is memcg...), memcg's behavior
6is complex. This is a document for memcg's internal behavior. 6is complex. This is a document for memcg's internal behavior.
@@ -337,7 +337,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
337 race and lock dependency with other cgroup subsystems. 337 race and lock dependency with other cgroup subsystems.
338 338
339 example) 339 example)
340 # mount -t cgroup none /cgroup -t cpuset,memory,cpu,devices 340 # mount -t cgroup none /cgroup -o cpuset,memory,cpu,devices
341 341
342 and do task move, mkdir, rmdir etc...under this. 342 and do task move, mkdir, rmdir etc...under this.
343 343
@@ -348,7 +348,7 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
348 348
349 For example, test like following is good. 349 For example, test like following is good.
350 (Shell-A) 350 (Shell-A)
351 # mount -t cgroup none /cgroup -t memory 351 # mount -t cgroup none /cgroup -o memory
352 # mkdir /cgroup/test 352 # mkdir /cgroup/test
353 # echo 40M > /cgroup/test/memory.limit_in_bytes 353 # echo 40M > /cgroup/test/memory.limit_in_bytes
354 # echo 0 > /cgroup/test/tasks 354 # echo 0 > /cgroup/test/tasks
@@ -378,3 +378,42 @@ Under below explanation, we assume CONFIG_MEM_RES_CTRL_SWAP=y.
378 #echo 50M > memory.limit_in_bytes 378 #echo 50M > memory.limit_in_bytes
379 #echo 50M > memory.memsw.limit_in_bytes 379 #echo 50M > memory.memsw.limit_in_bytes
380 run 51M of malloc 380 run 51M of malloc
381
382 9.9 Move charges at task migration
383 Charges associated with a task can be moved along with task migration.
384
385 (Shell-A)
386 #mkdir /cgroup/A
387 #echo $$ >/cgroup/A/tasks
388 run some programs which uses some amount of memory in /cgroup/A.
389
390 (Shell-B)
391 #mkdir /cgroup/B
392 #echo 1 >/cgroup/B/memory.move_charge_at_immigrate
393 #echo "pid of the program running in group A" >/cgroup/B/tasks
394
395 You can see charges have been moved by reading *.usage_in_bytes or
396 memory.stat of both A and B.
397 See 8.2 of Documentation/cgroups/memory.txt to see what value should be
398 written to move_charge_at_immigrate.
399
400 9.10 Memory thresholds
401 Memory controler implements memory thresholds using cgroups notification
402 API. You can use Documentation/cgroups/cgroup_event_listener.c to test
403 it.
404
405 (Shell-A) Create cgroup and run event listener
406 # mkdir /cgroup/A
407 # ./cgroup_event_listener /cgroup/A/memory.usage_in_bytes 5M
408
409 (Shell-B) Add task to cgroup and try to allocate and free memory
410 # echo $$ >/cgroup/A/tasks
411 # a="$(dd if=/dev/zero bs=1M count=10)"
412 # a=
413
414 You will see message from cgroup_event_listener every time you cross
415 the thresholds.
416
417 Use /cgroup/A/memory.memsw.usage_in_bytes to test memsw thresholds.
418
419 It's good idea to test root cgroup as well.
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index b871f2552b45..f8bc802d70b9 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -182,6 +182,8 @@ list.
182NOTE: Reclaim does not work for the root cgroup, since we cannot set any 182NOTE: Reclaim does not work for the root cgroup, since we cannot set any
183limits on the root cgroup. 183limits on the root cgroup.
184 184
185Note2: When panic_on_oom is set to "2", the whole system will panic.
186
1852. Locking 1872. Locking
186 188
187The memory controller uses the following hierarchy 189The memory controller uses the following hierarchy
@@ -262,10 +264,12 @@ some of the pages cached in the cgroup (page cache pages).
2624.2 Task migration 2644.2 Task migration
263 265
264When a task migrates from one cgroup to another, it's charge is not 266When a task migrates from one cgroup to another, it's charge is not
265carried forward. The pages allocated from the original cgroup still 267carried forward by default. The pages allocated from the original cgroup still
266remain charged to it, the charge is dropped when the page is freed or 268remain charged to it, the charge is dropped when the page is freed or
267reclaimed. 269reclaimed.
268 270
271Note: You can move charges of a task along with task migration. See 8.
272
2694.3 Removing a cgroup 2734.3 Removing a cgroup
270 274
271A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a 275A cgroup can be removed by rmdir, but as discussed in sections 4.1 and 4.2, a
@@ -377,7 +381,8 @@ The feature can be disabled by
377NOTE1: Enabling/disabling will fail if the cgroup already has other 381NOTE1: Enabling/disabling will fail if the cgroup already has other
378cgroups created below it. 382cgroups created below it.
379 383
380NOTE2: This feature can be enabled/disabled per subtree. 384NOTE2: When panic_on_oom is set to "2", the whole system will panic in
385case of an oom event in any cgroup.
381 386
3827. Soft limits 3877. Soft limits
383 388
@@ -414,7 +419,76 @@ NOTE1: Soft limits take effect over a long period of time, since they involve
414NOTE2: It is recommended to set the soft limit always below the hard limit, 419NOTE2: It is recommended to set the soft limit always below the hard limit,
415 otherwise the hard limit will take precedence. 420 otherwise the hard limit will take precedence.
416 421
4178. TODO 4228. Move charges at task migration
423
424Users can move charges associated with a task along with task migration, that
425is, uncharge task's pages from the old cgroup and charge them to the new cgroup.
426This feature is not supported in !CONFIG_MMU environments because of lack of
427page tables.
428
4298.1 Interface
430
431This feature is disabled by default. It can be enabled(and disabled again) by
432writing to memory.move_charge_at_immigrate of the destination cgroup.
433
434If you want to enable it:
435
436# echo (some positive value) > memory.move_charge_at_immigrate
437
438Note: Each bits of move_charge_at_immigrate has its own meaning about what type
439 of charges should be moved. See 8.2 for details.
440Note: Charges are moved only when you move mm->owner, IOW, a leader of a thread
441 group.
442Note: If we cannot find enough space for the task in the destination cgroup, we
443 try to make space by reclaiming memory. Task migration may fail if we
444 cannot make enough space.
445Note: It can take several seconds if you move charges in giga bytes order.
446
447And if you want disable it again:
448
449# echo 0 > memory.move_charge_at_immigrate
450
4518.2 Type of charges which can be move
452
453Each bits of move_charge_at_immigrate has its own meaning about what type of
454charges should be moved.
455
456 bit | what type of charges would be moved ?
457 -----+------------------------------------------------------------------------
458 0 | A charge of an anonymous page(or swap of it) used by the target task.
459 | Those pages and swaps must be used only by the target task. You must
460 | enable Swap Extension(see 2.4) to enable move of swap charges.
461
462Note: Those pages and swaps must be charged to the old cgroup.
463Note: More type of pages(e.g. file cache, shmem,) will be supported by other
464 bits in future.
465
4668.3 TODO
467
468- Add support for other types of pages(e.g. file cache, shmem, etc.).
469- Implement madvise(2) to let users decide the vma to be moved or not to be
470 moved.
471- All of moving charge operations are done under cgroup_mutex. It's not good
472 behavior to hold the mutex too long, so we may need some trick.
473
4749. Memory thresholds
475
476Memory controler implements memory thresholds using cgroups notification
477API (see cgroups.txt). It allows to register multiple memory and memsw
478thresholds and gets notifications when it crosses.
479
480To register a threshold application need:
481 - create an eventfd using eventfd(2);
482 - open memory.usage_in_bytes or memory.memsw.usage_in_bytes;
483 - write string like "<event_fd> <memory.usage_in_bytes> <threshold>" to
484 cgroup.event_control.
485
486Application will be notified through eventfd when memory usage crosses
487threshold in any direction.
488
489It's applicable for root and non-root cgroup.
490
49110. TODO
418 492
4191. Add support for accounting huge pages (as a separate controller) 4931. Add support for accounting huge pages (as a separate controller)
4202. Make per-cgroup scanner reclaim not-shared pages first 4942. Make per-cgroup scanner reclaim not-shared pages first
diff --git a/Documentation/console/console.txt b/Documentation/console/console.txt
index 877a1b26cc3d..926cf1b5e63e 100644
--- a/Documentation/console/console.txt
+++ b/Documentation/console/console.txt
@@ -74,7 +74,7 @@ driver takes over the consoles vacated by the driver. Binding, on the other
74hand, will bind the driver to the consoles that are currently occupied by a 74hand, will bind the driver to the consoles that are currently occupied by a
75system driver. 75system driver.
76 76
77NOTE1: Binding and binding must be selected in Kconfig. It's under: 77NOTE1: Binding and unbinding must be selected in Kconfig. It's under:
78 78
79Device Drivers -> Character devices -> Support for binding and unbinding 79Device Drivers -> Character devices -> Support for binding and unbinding
80console drivers 80console drivers
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt
index 2e2c2ea90ceb..41f41632ee55 100644
--- a/Documentation/driver-model/platform.txt
+++ b/Documentation/driver-model/platform.txt
@@ -192,7 +192,7 @@ command line. This will execute all matching early_param() callbacks.
192User specified early platform devices will be registered at this point. 192User specified early platform devices will be registered at this point.
193For the early serial console case the user can specify port on the 193For the early serial console case the user can specify port on the
194kernel command line as "earlyprintk=serial.0" where "earlyprintk" is 194kernel command line as "earlyprintk=serial.0" where "earlyprintk" is
195the class string, "serial" is the name of the platfrom driver and 195the class string, "serial" is the name of the platform driver and
1960 is the platform device id. If the id is -1 then the dot and the 1960 is the platform device id. If the id is -1 then the dot and the
197id can be omitted. 197id can be omitted.
198 198
diff --git a/Documentation/eisa.txt b/Documentation/eisa.txt
index 60e361ba08c0..f297fc1202ae 100644
--- a/Documentation/eisa.txt
+++ b/Documentation/eisa.txt
@@ -171,7 +171,7 @@ device.
171virtual_root.force_probe : 171virtual_root.force_probe :
172 172
173Force the probing code to probe EISA slots even when it cannot find an 173Force the probing code to probe EISA slots even when it cannot find an
174EISA compliant mainboard (nothing appears on slot 0). Defaultd to 0 174EISA compliant mainboard (nothing appears on slot 0). Defaults to 0
175(don't force), and set to 1 (force probing) when either 175(don't force), and set to 1 (force probing) when either
176CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set. 176CONFIG_ALPHA_JENSEN or CONFIG_EISA_VLB_PRIMING are set.
177 177
diff --git a/Documentation/email-clients.txt b/Documentation/email-clients.txt
index a618efab7b15..945ff3fda433 100644
--- a/Documentation/email-clients.txt
+++ b/Documentation/email-clients.txt
@@ -216,26 +216,14 @@ Works. Use "Insert file..." or external editor.
216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 216~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217Gmail (Web GUI) 217Gmail (Web GUI)
218 218
219If you just have to use Gmail to send patches, it CAN be made to work. It 219Does not work for sending patches.
220requires a bit of external help, though. 220
221 221Gmail web client converts tabs to spaces automatically.
222The first problem is that Gmail converts tabs to spaces. This will 222
223totally break your patches. To prevent this, you have to use a different 223At the same time it wraps lines every 78 chars with CRLF style line breaks
224editor. There is a firefox extension called "ViewSourceWith" 224although tab2space problem can be solved with external editor.
225(https://addons.mozilla.org/en-US/firefox/addon/394) which allows you to 225
226edit any text box in the editor of your choice. Configure it to launch 226Another problem is that Gmail will base64-encode any message that has a
227your favorite editor. When you want to send a patch, use this technique. 227non-ASCII character. That includes things like European names.
228Once you have crafted your messsage + patch, save and exit the editor,
229which should reload the Gmail edit box. GMAIL WILL PRESERVE THE TABS.
230Hoorah. Apparently you can cut-n-paste literal tabs, but Gmail will
231convert those to spaces upon sending!
232
233The second problem is that Gmail converts tabs to spaces on replies. If
234you reply to a patch, don't expect to be able to apply it as a patch.
235
236The last problem is that Gmail will base64-encode any message that has a
237non-ASCII character. That includes things like European names. Be aware.
238
239Gmail is not convenient for lkml patches, but CAN be made to work.
240 228
241 ### 229 ###
diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
index 5139b8c9d5af..3bae418c6ad3 100644
--- a/Documentation/filesystems/00-INDEX
+++ b/Documentation/filesystems/00-INDEX
@@ -32,6 +32,8 @@ dlmfs.txt
32 - info on the userspace interface to the OCFS2 DLM. 32 - info on the userspace interface to the OCFS2 DLM.
33dnotify.txt 33dnotify.txt
34 - info about directory notification in Linux. 34 - info about directory notification in Linux.
35dnotify_test.c
36 - example program for dnotify
35ecryptfs.txt 37ecryptfs.txt
36 - docs on eCryptfs: stacked cryptographic filesystem for Linux. 38 - docs on eCryptfs: stacked cryptographic filesystem for Linux.
37exofs.txt 39exofs.txt
diff --git a/Documentation/filesystems/Makefile b/Documentation/filesystems/Makefile
new file mode 100644
index 000000000000..a5dd114da14f
--- /dev/null
+++ b/Documentation/filesystems/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := dnotify_test
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/filesystems/dnotify.txt b/Documentation/filesystems/dnotify.txt
index 9f5d338ddbb8..6baf88f46859 100644
--- a/Documentation/filesystems/dnotify.txt
+++ b/Documentation/filesystems/dnotify.txt
@@ -62,38 +62,9 @@ disabled, fcntl(fd, F_NOTIFY, ...) will return -EINVAL.
62 62
63Example 63Example
64------- 64-------
65See Documentation/filesystems/dnotify_test.c for an example.
65 66
66 #define _GNU_SOURCE /* needed to get the defines */ 67NOTE
67 #include <fcntl.h> /* in glibc 2.2 this has the needed 68----
68 values defined */ 69Beginning with Linux 2.6.13, dnotify has been replaced by inotify.
69 #include <signal.h> 70See Documentation/filesystems/inotify.txt for more information on it.
70 #include <stdio.h>
71 #include <unistd.h>
72
73 static volatile int event_fd;
74
75 static void handler(int sig, siginfo_t *si, void *data)
76 {
77 event_fd = si->si_fd;
78 }
79
80 int main(void)
81 {
82 struct sigaction act;
83 int fd;
84
85 act.sa_sigaction = handler;
86 sigemptyset(&act.sa_mask);
87 act.sa_flags = SA_SIGINFO;
88 sigaction(SIGRTMIN + 1, &act, NULL);
89
90 fd = open(".", O_RDONLY);
91 fcntl(fd, F_SETSIG, SIGRTMIN + 1);
92 fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT);
93 /* we will now be notified if any of the files
94 in "." is modified or new files are created */
95 while (1) {
96 pause();
97 printf("Got event on fd=%d\n", event_fd);
98 }
99 }
diff --git a/Documentation/filesystems/dnotify_test.c b/Documentation/filesystems/dnotify_test.c
new file mode 100644
index 000000000000..8b37b4a1e18d
--- /dev/null
+++ b/Documentation/filesystems/dnotify_test.c
@@ -0,0 +1,34 @@
1#define _GNU_SOURCE /* needed to get the defines */
2#include <fcntl.h> /* in glibc 2.2 this has the needed
3 values defined */
4#include <signal.h>
5#include <stdio.h>
6#include <unistd.h>
7
8static volatile int event_fd;
9
10static void handler(int sig, siginfo_t *si, void *data)
11{
12 event_fd = si->si_fd;
13}
14
15int main(void)
16{
17 struct sigaction act;
18 int fd;
19
20 act.sa_sigaction = handler;
21 sigemptyset(&act.sa_mask);
22 act.sa_flags = SA_SIGINFO;
23 sigaction(SIGRTMIN + 1, &act, NULL);
24
25 fd = open(".", O_RDONLY);
26 fcntl(fd, F_SETSIG, SIGRTMIN + 1);
27 fcntl(fd, F_NOTIFY, DN_MODIFY|DN_CREATE|DN_MULTISHOT);
28 /* we will now be notified if any of the files
29 in "." is modified or new files are created */
30 while (1) {
31 pause();
32 printf("Got event on fd=%d\n", event_fd);
33 }
34}
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 96a44dd95e03..a4f30faa4f1f 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -195,7 +195,7 @@ asynchronous manner and the vaule may not be very precise. To see a precise
195snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table. 195snapshot of a moment, you can see /proc/<pid>/smaps file and scan page table.
196It's slow but very precise. 196It's slow but very precise.
197 197
198Table 1-2: Contents of the statm files (as of 2.6.30-rc7) 198Table 1-2: Contents of the status files (as of 2.6.30-rc7)
199.............................................................................. 199..............................................................................
200 Field Content 200 Field Content
201 Name filename of the executable 201 Name filename of the executable
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru
index 87ffa0f5ec70..5eb3b9d5f0d5 100644
--- a/Documentation/hwmon/abituguru
+++ b/Documentation/hwmon/abituguru
@@ -30,7 +30,7 @@ Supported chips:
30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1 30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
31 You may also need to specify the fan_sensors option for these boards 31 You may also need to specify the fan_sensors option for these boards
32 fan_sensors=5 32 fan_sensors=5
33 2) There is a seperate abituguru3 driver for these motherboards, 33 2) There is a separate abituguru3 driver for these motherboards,
34 the abituguru (without the 3 !) driver will not work on these 34 the abituguru (without the 3 !) driver will not work on these
35 motherboards (and visa versa)! 35 motherboards (and visa versa)!
36 36
diff --git a/Documentation/input/rotary-encoder.txt b/Documentation/input/rotary-encoder.txt
index 3a6aec40c0b0..8b4129de1d2d 100644
--- a/Documentation/input/rotary-encoder.txt
+++ b/Documentation/input/rotary-encoder.txt
@@ -75,7 +75,7 @@ and the number of steps or will clamp at the maximum and zero depending on
75the configuration. 75the configuration.
76 76
77Because GPIO to IRQ mapping is platform specific, this information must 77Because GPIO to IRQ mapping is platform specific, this information must
78be given in seperately to the driver. See the example below. 78be given in separately to the driver. See the example below.
79 79
80---------<snip>--------- 80---------<snip>---------
81 81
diff --git a/Documentation/laptops/00-INDEX b/Documentation/laptops/00-INDEX
index ee5692b26dd4..fa688538e757 100644
--- a/Documentation/laptops/00-INDEX
+++ b/Documentation/laptops/00-INDEX
@@ -2,6 +2,12 @@
2 - This file 2 - This file
3acer-wmi.txt 3acer-wmi.txt
4 - information on the Acer Laptop WMI Extras driver. 4 - information on the Acer Laptop WMI Extras driver.
5asus-laptop.txt
6 - information on the Asus Laptop Extras driver.
7disk-shock-protection.txt
8 - information on hard disk shock protection.
9dslm.c
10 - Simple Disk Sleep Monitor program
5laptop-mode.txt 11laptop-mode.txt
6 - how to conserve battery power using laptop-mode. 12 - how to conserve battery power using laptop-mode.
7sony-laptop.txt 13sony-laptop.txt
diff --git a/Documentation/laptops/Makefile b/Documentation/laptops/Makefile
new file mode 100644
index 000000000000..5cb144af3c09
--- /dev/null
+++ b/Documentation/laptops/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := dslm
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/laptops/dslm.c b/Documentation/laptops/dslm.c
new file mode 100644
index 000000000000..72ff290c5fc6
--- /dev/null
+++ b/Documentation/laptops/dslm.c
@@ -0,0 +1,166 @@
1/*
2 * dslm.c
3 * Simple Disk Sleep Monitor
4 * by Bartek Kania
5 * Licenced under the GPL
6 */
7#include <unistd.h>
8#include <stdlib.h>
9#include <stdio.h>
10#include <fcntl.h>
11#include <errno.h>
12#include <time.h>
13#include <string.h>
14#include <signal.h>
15#include <sys/ioctl.h>
16#include <linux/hdreg.h>
17
18#ifdef DEBUG
19#define D(x) x
20#else
21#define D(x)
22#endif
23
24int endit = 0;
25
26/* Check if the disk is in powersave-mode
27 * Most of the code is stolen from hdparm.
28 * 1 = active, 0 = standby/sleep, -1 = unknown */
29static int check_powermode(int fd)
30{
31 unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
32 int state;
33
34 if (ioctl(fd, HDIO_DRIVE_CMD, &args)
35 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
36 && ioctl(fd, HDIO_DRIVE_CMD, &args)) {
37 if (errno != EIO || args[0] != 0 || args[1] != 0) {
38 state = -1; /* "unknown"; */
39 } else
40 state = 0; /* "sleeping"; */
41 } else {
42 state = (args[2] == 255) ? 1 : 0;
43 }
44 D(printf(" drive state is: %d\n", state));
45
46 return state;
47}
48
49static char *state_name(int i)
50{
51 if (i == -1) return "unknown";
52 if (i == 0) return "sleeping";
53 if (i == 1) return "active";
54
55 return "internal error";
56}
57
58static char *myctime(time_t time)
59{
60 char *ts = ctime(&time);
61 ts[strlen(ts) - 1] = 0;
62
63 return ts;
64}
65
66static void measure(int fd)
67{
68 time_t start_time;
69 int last_state;
70 time_t last_time;
71 int curr_state;
72 time_t curr_time = 0;
73 time_t time_diff;
74 time_t active_time = 0;
75 time_t sleep_time = 0;
76 time_t unknown_time = 0;
77 time_t total_time = 0;
78 int changes = 0;
79 float tmp;
80
81 printf("Starting measurements\n");
82
83 last_state = check_powermode(fd);
84 start_time = last_time = time(0);
85 printf(" System is in state %s\n\n", state_name(last_state));
86
87 while(!endit) {
88 sleep(1);
89 curr_state = check_powermode(fd);
90
91 if (curr_state != last_state || endit) {
92 changes++;
93 curr_time = time(0);
94 time_diff = curr_time - last_time;
95
96 if (last_state == 1) active_time += time_diff;
97 else if (last_state == 0) sleep_time += time_diff;
98 else unknown_time += time_diff;
99
100 last_state = curr_state;
101 last_time = curr_time;
102
103 printf("%s: State-change to %s\n", myctime(curr_time),
104 state_name(curr_state));
105 }
106 }
107 changes--; /* Compensate for SIGINT */
108
109 total_time = time(0) - start_time;
110 printf("\nTotal running time: %lus\n", curr_time - start_time);
111 printf(" State changed %d times\n", changes);
112
113 tmp = (float)sleep_time / (float)total_time * 100;
114 printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp);
115 tmp = (float)active_time / (float)total_time * 100;
116 printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp);
117 tmp = (float)unknown_time / (float)total_time * 100;
118 printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp);
119}
120
121static void ender(int s)
122{
123 endit = 1;
124}
125
126static void usage(void)
127{
128 puts("usage: dslm [-w <time>] <disk>");
129 exit(0);
130}
131
132int main(int argc, char **argv)
133{
134 int fd;
135 char *disk = 0;
136 int settle_time = 60;
137
138 /* Parse the simple command-line */
139 if (argc == 2)
140 disk = argv[1];
141 else if (argc == 4) {
142 settle_time = atoi(argv[2]);
143 disk = argv[3];
144 } else
145 usage();
146
147 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) {
148 printf("Can't open %s, because: %s\n", disk, strerror(errno));
149 exit(-1);
150 }
151
152 if (settle_time) {
153 printf("Waiting %d seconds for the system to settle down to "
154 "'normal'\n", settle_time);
155 sleep(settle_time);
156 } else
157 puts("Not waiting for system to settle down");
158
159 signal(SIGINT, ender);
160
161 measure(fd);
162
163 close(fd);
164
165 return 0;
166}
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt
index eeedee11c8c2..2c3c35093023 100644
--- a/Documentation/laptops/laptop-mode.txt
+++ b/Documentation/laptops/laptop-mode.txt
@@ -779,172 +779,4 @@ Monitoring tool
779--------------- 779---------------
780 780
781Bartek Kania submitted this, it can be used to measure how much time your disk 781Bartek Kania submitted this, it can be used to measure how much time your disk
782spends spun up/down. 782spends spun up/down. See Documentation/laptops/dslm.c
783
784---------------------------dslm.c BEGIN-----------------------------------------
785/*
786 * Simple Disk Sleep Monitor
787 * by Bartek Kania
788 * Licenced under the GPL
789 */
790#include <unistd.h>
791#include <stdlib.h>
792#include <stdio.h>
793#include <fcntl.h>
794#include <errno.h>
795#include <time.h>
796#include <string.h>
797#include <signal.h>
798#include <sys/ioctl.h>
799#include <linux/hdreg.h>
800
801#ifdef DEBUG
802#define D(x) x
803#else
804#define D(x)
805#endif
806
807int endit = 0;
808
809/* Check if the disk is in powersave-mode
810 * Most of the code is stolen from hdparm.
811 * 1 = active, 0 = standby/sleep, -1 = unknown */
812int check_powermode(int fd)
813{
814 unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0};
815 int state;
816
817 if (ioctl(fd, HDIO_DRIVE_CMD, &args)
818 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
819 && ioctl(fd, HDIO_DRIVE_CMD, &args)) {
820 if (errno != EIO || args[0] != 0 || args[1] != 0) {
821 state = -1; /* "unknown"; */
822 } else
823 state = 0; /* "sleeping"; */
824 } else {
825 state = (args[2] == 255) ? 1 : 0;
826 }
827 D(printf(" drive state is: %d\n", state));
828
829 return state;
830}
831
832char *state_name(int i)
833{
834 if (i == -1) return "unknown";
835 if (i == 0) return "sleeping";
836 if (i == 1) return "active";
837
838 return "internal error";
839}
840
841char *myctime(time_t time)
842{
843 char *ts = ctime(&time);
844 ts[strlen(ts) - 1] = 0;
845
846 return ts;
847}
848
849void measure(int fd)
850{
851 time_t start_time;
852 int last_state;
853 time_t last_time;
854 int curr_state;
855 time_t curr_time = 0;
856 time_t time_diff;
857 time_t active_time = 0;
858 time_t sleep_time = 0;
859 time_t unknown_time = 0;
860 time_t total_time = 0;
861 int changes = 0;
862 float tmp;
863
864 printf("Starting measurements\n");
865
866 last_state = check_powermode(fd);
867 start_time = last_time = time(0);
868 printf(" System is in state %s\n\n", state_name(last_state));
869
870 while(!endit) {
871 sleep(1);
872 curr_state = check_powermode(fd);
873
874 if (curr_state != last_state || endit) {
875 changes++;
876 curr_time = time(0);
877 time_diff = curr_time - last_time;
878
879 if (last_state == 1) active_time += time_diff;
880 else if (last_state == 0) sleep_time += time_diff;
881 else unknown_time += time_diff;
882
883 last_state = curr_state;
884 last_time = curr_time;
885
886 printf("%s: State-change to %s\n", myctime(curr_time),
887 state_name(curr_state));
888 }
889 }
890 changes--; /* Compensate for SIGINT */
891
892 total_time = time(0) - start_time;
893 printf("\nTotal running time: %lus\n", curr_time - start_time);
894 printf(" State changed %d times\n", changes);
895
896 tmp = (float)sleep_time / (float)total_time * 100;
897 printf(" Time in sleep state: %lus (%.2f%%)\n", sleep_time, tmp);
898 tmp = (float)active_time / (float)total_time * 100;
899 printf(" Time in active state: %lus (%.2f%%)\n", active_time, tmp);
900 tmp = (float)unknown_time / (float)total_time * 100;
901 printf(" Time in unknown state: %lus (%.2f%%)\n", unknown_time, tmp);
902}
903
904void ender(int s)
905{
906 endit = 1;
907}
908
909void usage()
910{
911 puts("usage: dslm [-w <time>] <disk>");
912 exit(0);
913}
914
915int main(int argc, char **argv)
916{
917 int fd;
918 char *disk = 0;
919 int settle_time = 60;
920
921 /* Parse the simple command-line */
922 if (argc == 2)
923 disk = argv[1];
924 else if (argc == 4) {
925 settle_time = atoi(argv[2]);
926 disk = argv[3];
927 } else
928 usage();
929
930 if (!(fd = open(disk, O_RDONLY|O_NONBLOCK))) {
931 printf("Can't open %s, because: %s\n", disk, strerror(errno));
932 exit(-1);
933 }
934
935 if (settle_time) {
936 printf("Waiting %d seconds for the system to settle down to "
937 "'normal'\n", settle_time);
938 sleep(settle_time);
939 } else
940 puts("Not waiting for system to settle down");
941
942 signal(SIGINT, ender);
943
944 measure(fd);
945
946 close(fd);
947
948 return 0;
949}
950---------------------------dslm.c END-------------------------------------------
diff --git a/Documentation/networking/skfp.txt b/Documentation/networking/skfp.txt
index abfddf81e34a..203ec66c9fb4 100644
--- a/Documentation/networking/skfp.txt
+++ b/Documentation/networking/skfp.txt
@@ -68,7 +68,7 @@ Compaq adapters (not tested):
68======================= 68=======================
69 69
70From v2.01 on, the driver is integrated in the linux kernel sources. 70From v2.01 on, the driver is integrated in the linux kernel sources.
71Therefor, the installation is the same as for any other adapter 71Therefore, the installation is the same as for any other adapter
72supported by the kernel. 72supported by the kernel.
73Refer to the manual of your distribution about the installation 73Refer to the manual of your distribution about the installation
74of network adapters. 74of network adapters.
diff --git a/Documentation/networking/timestamping/timestamping.c b/Documentation/networking/timestamping/timestamping.c
index a7936fe8444a..bab619a48214 100644
--- a/Documentation/networking/timestamping/timestamping.c
+++ b/Documentation/networking/timestamping/timestamping.c
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
370 } 370 }
371 371
372 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); 372 sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
373 if (socket < 0) 373 if (sock < 0)
374 bail("socket"); 374 bail("socket");
375 375
376 memset(&device, 0, sizeof(device)); 376 memset(&device, 0, sizeof(device));
diff --git a/Documentation/pnp.txt b/Documentation/pnp.txt
index a327db67782a..763e4659bf18 100644
--- a/Documentation/pnp.txt
+++ b/Documentation/pnp.txt
@@ -57,7 +57,7 @@ PC standard floppy disk controller
57# cat resources 57# cat resources
58DISABLED 58DISABLED
59 59
60- Notice the string "DISABLED". THis means the device is not active. 60- Notice the string "DISABLED". This means the device is not active.
61 61
623.) check the device's possible configurations (optional) 623.) check the device's possible configurations (optional)
63# cat options 63# cat options
@@ -139,7 +139,7 @@ Plug and Play but it is planned to be in the near future.
139 139
140Requirements for a Linux PnP protocol: 140Requirements for a Linux PnP protocol:
1411.) the protocol must use EISA IDs 1411.) the protocol must use EISA IDs
1422.) the protocol must inform the PnP Layer of a devices current configuration 1422.) the protocol must inform the PnP Layer of a device's current configuration
143- the ability to set resources is optional but preferred. 143- the ability to set resources is optional but preferred.
144 144
145The following are PnP protocol related functions: 145The following are PnP protocol related functions:
@@ -158,7 +158,7 @@ pnp_remove_device
158- automatically will free mem used by the device and related structures 158- automatically will free mem used by the device and related structures
159 159
160pnp_add_id 160pnp_add_id
161- adds a EISA ID to the list of supported IDs for the specified device 161- adds an EISA ID to the list of supported IDs for the specified device
162 162
163For more information consult the source of a protocol such as 163For more information consult the source of a protocol such as
164/drivers/pnp/pnpbios/core.c. 164/drivers/pnp/pnpbios/core.c.
@@ -167,7 +167,7 @@ For more information consult the source of a protocol such as
167 167
168Linux Plug and Play Drivers 168Linux Plug and Play Drivers
169--------------------------- 169---------------------------
170 This section contains information for linux PnP driver developers. 170 This section contains information for Linux PnP driver developers.
171 171
172The New Way 172The New Way
173........... 173...........
@@ -235,11 +235,10 @@ static int __init serial8250_pnp_init(void)
235The Old Way 235The Old Way
236........... 236...........
237 237
238a series of compatibility functions have been created to make it easy to convert 238A series of compatibility functions have been created to make it easy to convert
239
240ISAPNP drivers. They should serve as a temporary solution only. 239ISAPNP drivers. They should serve as a temporary solution only.
241 240
242they are as follows: 241They are as follows:
243 242
244struct pnp_card *pnp_find_card(unsigned short vendor, 243struct pnp_card *pnp_find_card(unsigned short vendor,
245 unsigned short device, 244 unsigned short device,
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index ab00eeddecaf..55b859b3bc72 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -256,7 +256,7 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
256 to suspend the device again in future 256 to suspend the device again in future
257 257
258 int pm_runtime_resume(struct device *dev); 258 int pm_runtime_resume(struct device *dev);
259 - execute the subsystem-leve resume callback for the device; returns 0 on 259 - execute the subsystem-level resume callback for the device; returns 0 on
260 success, 1 if the device's run-time PM status was already 'active' or 260 success, 1 if the device's run-time PM status was already 'active' or
261 error code on failure, where -EAGAIN means it may be safe to attempt to 261 error code on failure, where -EAGAIN means it may be safe to attempt to
262 resume the device again in future, but 'power.runtime_error' should be 262 resume the device again in future, but 'power.runtime_error' should be
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt
index 6f5ceb0f09fc..85f3280d7ef6 100644
--- a/Documentation/s390/kvm.txt
+++ b/Documentation/s390/kvm.txt
@@ -102,7 +102,7 @@ args: unsigned long
102see also: include/linux/kvm.h 102see also: include/linux/kvm.h
103This ioctl stores the state of the cpu at the guest real address given as 103This ioctl stores the state of the cpu at the guest real address given as
104argument, unless one of the following values defined in include/linux/kvm.h 104argument, unless one of the following values defined in include/linux/kvm.h
105is given as arguement: 105is given as argument:
106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in 106KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in
107absolute lowcore as defined by the principles of operation 107absolute lowcore as defined by the principles of operation
108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in 108KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in
diff --git a/Documentation/scsi/ChangeLog.lpfc b/Documentation/scsi/ChangeLog.lpfc
index ff19a52fe004..2ffc1148eb95 100644
--- a/Documentation/scsi/ChangeLog.lpfc
+++ b/Documentation/scsi/ChangeLog.lpfc
@@ -989,8 +989,8 @@ Changes from 20040709 to 20040716
989 * Remove redundant port_cmp != 2 check in if 989 * Remove redundant port_cmp != 2 check in if
990 (!port_cmp) { .... if (port_cmp != 2).... } 990 (!port_cmp) { .... if (port_cmp != 2).... }
991 * Clock changes: removed struct clk_data and timerList. 991 * Clock changes: removed struct clk_data and timerList.
992 * Clock changes: seperate nodev_tmo and els_retry_delay into 2 992 * Clock changes: separate nodev_tmo and els_retry_delay into 2
993 seperate timers and convert to 1 argument changed 993 separate timers and convert to 1 argument changed
994 LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert 994 LPFC_NODE_FARP_PEND_t to struct lpfc_node_farp_pend convert
995 ipfarp_tmo to 1 argument convert target struct tmofunc and 995 ipfarp_tmo to 1 argument convert target struct tmofunc and
996 rtplunfunc to 1 argument * cr_count, cr_delay and 996 rtplunfunc to 1 argument * cr_count, cr_delay and
@@ -1514,7 +1514,7 @@ Changes from 20040402 to 20040409
1514 * Remove unused elxclock declaration in elx_sli.h. 1514 * Remove unused elxclock declaration in elx_sli.h.
1515 * Since everywhere IOCB_ENTRY is used, the return value is cast, 1515 * Since everywhere IOCB_ENTRY is used, the return value is cast,
1516 move the cast into the macro. 1516 move the cast into the macro.
1517 * Split ioctls out into seperate files 1517 * Split ioctls out into separate files
1518 1518
1519Changes from 20040326 to 20040402 1519Changes from 20040326 to 20040402
1520 1520
@@ -1534,7 +1534,7 @@ Changes from 20040326 to 20040402
1534 * Unused variable cleanup 1534 * Unused variable cleanup
1535 * Use Linux list macros for DMABUF_t 1535 * Use Linux list macros for DMABUF_t
1536 * Break up ioctls into 3 sections, dfc, util, hbaapi 1536 * Break up ioctls into 3 sections, dfc, util, hbaapi
1537 rearranged code so this could be easily seperated into a 1537 rearranged code so this could be easily separated into a
1538 differnet module later All 3 are currently turned on by 1538 differnet module later All 3 are currently turned on by
1539 defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL, 1539 defines in lpfc_ioctl.c LPFC_DFC_IOCTL, LPFC_UTIL_IOCTL,
1540 LPFC_HBAAPI_IOCTL 1540 LPFC_HBAAPI_IOCTL
@@ -1551,7 +1551,7 @@ Changes from 20040326 to 20040402
1551 started by lpfc_online(). lpfc_offline() only stopped 1551 started by lpfc_online(). lpfc_offline() only stopped
1552 els_timeout routine. It now stops all timeout routines 1552 els_timeout routine. It now stops all timeout routines
1553 associated with that hba. 1553 associated with that hba.
1554 * Replace seperate next and prev pointers in struct 1554 * Replace separate next and prev pointers in struct
1555 lpfc_bindlist with list_head type. In elxHBA_t, replace 1555 lpfc_bindlist with list_head type. In elxHBA_t, replace
1556 fc_nlpbind_start and _end with fc_nlpbind_list and use 1556 fc_nlpbind_start and _end with fc_nlpbind_list and use
1557 list_head macros to access it. 1557 list_head macros to access it.
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt
index 5e5349a4fcd2..7c900507279f 100644
--- a/Documentation/serial/tty.txt
+++ b/Documentation/serial/tty.txt
@@ -105,6 +105,10 @@ write_wakeup() - May be called at any point between open and close.
105 is permitted to call the driver write method from 105 is permitted to call the driver write method from
106 this function. In such a situation defer it. 106 this function. In such a situation defer it.
107 107
108dcd_change() - Report to the tty line the current DCD pin status
109 changes and the relative timestamp. The timestamp
110 can be NULL.
111
108 112
109Driver Access 113Driver Access
110 114
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt
index fc5790d36cd9..6c7d18c53f84 100644
--- a/Documentation/sysctl/vm.txt
+++ b/Documentation/sysctl/vm.txt
@@ -573,11 +573,14 @@ Because other nodes' memory may be free. This means system total status
573may be not fatal yet. 573may be not fatal yet.
574 574
575If this is set to 2, the kernel panics compulsorily even on the 575If this is set to 2, the kernel panics compulsorily even on the
576above-mentioned. 576above-mentioned. Even oom happens under memory cgroup, the whole
577system panics.
577 578
578The default value is 0. 579The default value is 0.
5791 and 2 are for failover of clustering. Please select either 5801 and 2 are for failover of clustering. Please select either
580according to your policy of failover. 581according to your policy of failover.
582panic_on_oom=2+kdump gives you very strong tool to investigate
583why oom happens. You can get snapshot.
581 584
582============================================================= 585=============================================================
583 586
diff --git a/Documentation/timers/00-INDEX b/Documentation/timers/00-INDEX
index 397dc35e1323..a9248da5cdbc 100644
--- a/Documentation/timers/00-INDEX
+++ b/Documentation/timers/00-INDEX
@@ -4,6 +4,8 @@ highres.txt
4 - High resolution timers and dynamic ticks design notes 4 - High resolution timers and dynamic ticks design notes
5hpet.txt 5hpet.txt
6 - High Precision Event Timer Driver for Linux 6 - High Precision Event Timer Driver for Linux
7hpet_example.c
8 - sample hpet timer test program
7hrtimers.txt 9hrtimers.txt
8 - subsystem for high-resolution kernel timers 10 - subsystem for high-resolution kernel timers
9timer_stats.txt 11timer_stats.txt
diff --git a/Documentation/timers/Makefile b/Documentation/timers/Makefile
new file mode 100644
index 000000000000..c85625f4ab25
--- /dev/null
+++ b/Documentation/timers/Makefile
@@ -0,0 +1,8 @@
1# kbuild trick to avoid linker error. Can be omitted if a module is built.
2obj- := dummy.o
3
4# List of programs to build
5hostprogs-y := hpet_example
6
7# Tell kbuild to always build the programs
8always := $(hostprogs-y)
diff --git a/Documentation/timers/hpet.txt b/Documentation/timers/hpet.txt
index 16d25e6b5a00..767392ffd31e 100644
--- a/Documentation/timers/hpet.txt
+++ b/Documentation/timers/hpet.txt
@@ -26,274 +26,5 @@ initialization. An example of this initialization can be found in
26arch/x86/kernel/hpet.c. 26arch/x86/kernel/hpet.c.
27 27
28The driver provides a userspace API which resembles the API found in the 28The driver provides a userspace API which resembles the API found in the
29RTC driver framework. An example user space program is provided below. 29RTC driver framework. An example user space program is provided in
30 30file:Documentation/timers/hpet_example.c
31#include <stdio.h>
32#include <stdlib.h>
33#include <unistd.h>
34#include <fcntl.h>
35#include <string.h>
36#include <memory.h>
37#include <malloc.h>
38#include <time.h>
39#include <ctype.h>
40#include <sys/types.h>
41#include <sys/wait.h>
42#include <signal.h>
43#include <fcntl.h>
44#include <errno.h>
45#include <sys/time.h>
46#include <linux/hpet.h>
47
48
49extern void hpet_open_close(int, const char **);
50extern void hpet_info(int, const char **);
51extern void hpet_poll(int, const char **);
52extern void hpet_fasync(int, const char **);
53extern void hpet_read(int, const char **);
54
55#include <sys/poll.h>
56#include <sys/ioctl.h>
57#include <signal.h>
58
59struct hpet_command {
60 char *command;
61 void (*func)(int argc, const char ** argv);
62} hpet_command[] = {
63 {
64 "open-close",
65 hpet_open_close
66 },
67 {
68 "info",
69 hpet_info
70 },
71 {
72 "poll",
73 hpet_poll
74 },
75 {
76 "fasync",
77 hpet_fasync
78 },
79};
80
81int
82main(int argc, const char ** argv)
83{
84 int i;
85
86 argc--;
87 argv++;
88
89 if (!argc) {
90 fprintf(stderr, "-hpet: requires command\n");
91 return -1;
92 }
93
94
95 for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++)
96 if (!strcmp(argv[0], hpet_command[i].command)) {
97 argc--;
98 argv++;
99 fprintf(stderr, "-hpet: executing %s\n",
100 hpet_command[i].command);
101 hpet_command[i].func(argc, argv);
102 return 0;
103 }
104
105 fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]);
106
107 return -1;
108}
109
110void
111hpet_open_close(int argc, const char **argv)
112{
113 int fd;
114
115 if (argc != 1) {
116 fprintf(stderr, "hpet_open_close: device-name\n");
117 return;
118 }
119
120 fd = open(argv[0], O_RDONLY);
121 if (fd < 0)
122 fprintf(stderr, "hpet_open_close: open failed\n");
123 else
124 close(fd);
125
126 return;
127}
128
129void
130hpet_info(int argc, const char **argv)
131{
132}
133
134void
135hpet_poll(int argc, const char **argv)
136{
137 unsigned long freq;
138 int iterations, i, fd;
139 struct pollfd pfd;
140 struct hpet_info info;
141 struct timeval stv, etv;
142 struct timezone tz;
143 long usec;
144
145 if (argc != 3) {
146 fprintf(stderr, "hpet_poll: device-name freq iterations\n");
147 return;
148 }
149
150 freq = atoi(argv[1]);
151 iterations = atoi(argv[2]);
152
153 fd = open(argv[0], O_RDONLY);
154
155 if (fd < 0) {
156 fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
157 return;
158 }
159
160 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
161 fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n");
162 goto out;
163 }
164
165 if (ioctl(fd, HPET_INFO, &info) < 0) {
166 fprintf(stderr, "hpet_poll: failed to get info\n");
167 goto out;
168 }
169
170 fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags);
171
172 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
173 fprintf(stderr, "hpet_poll: HPET_EPI failed\n");
174 goto out;
175 }
176
177 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
178 fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n");
179 goto out;
180 }
181
182 pfd.fd = fd;
183 pfd.events = POLLIN;
184
185 for (i = 0; i < iterations; i++) {
186 pfd.revents = 0;
187 gettimeofday(&stv, &tz);
188 if (poll(&pfd, 1, -1) < 0)
189 fprintf(stderr, "hpet_poll: poll failed\n");
190 else {
191 long data;
192
193 gettimeofday(&etv, &tz);
194 usec = stv.tv_sec * 1000000 + stv.tv_usec;
195 usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec;
196
197 fprintf(stderr,
198 "hpet_poll: expired time = 0x%lx\n", usec);
199
200 fprintf(stderr, "hpet_poll: revents = 0x%x\n",
201 pfd.revents);
202
203 if (read(fd, &data, sizeof(data)) != sizeof(data)) {
204 fprintf(stderr, "hpet_poll: read failed\n");
205 }
206 else
207 fprintf(stderr, "hpet_poll: data 0x%lx\n",
208 data);
209 }
210 }
211
212out:
213 close(fd);
214 return;
215}
216
217static int hpet_sigio_count;
218
219static void
220hpet_sigio(int val)
221{
222 fprintf(stderr, "hpet_sigio: called\n");
223 hpet_sigio_count++;
224}
225
226void
227hpet_fasync(int argc, const char **argv)
228{
229 unsigned long freq;
230 int iterations, i, fd, value;
231 sig_t oldsig;
232 struct hpet_info info;
233
234 hpet_sigio_count = 0;
235 fd = -1;
236
237 if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) {
238 fprintf(stderr, "hpet_fasync: failed to set signal handler\n");
239 return;
240 }
241
242 if (argc != 3) {
243 fprintf(stderr, "hpet_fasync: device-name freq iterations\n");
244 goto out;
245 }
246
247 fd = open(argv[0], O_RDONLY);
248
249 if (fd < 0) {
250 fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
251 return;
252 }
253
254
255 if ((fcntl(fd, F_SETOWN, getpid()) == 1) ||
256 ((value = fcntl(fd, F_GETFL)) == 1) ||
257 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) {
258 fprintf(stderr, "hpet_fasync: fcntl failed\n");
259 goto out;
260 }
261
262 freq = atoi(argv[1]);
263 iterations = atoi(argv[2]);
264
265 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
266 fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n");
267 goto out;
268 }
269
270 if (ioctl(fd, HPET_INFO, &info) < 0) {
271 fprintf(stderr, "hpet_fasync: failed to get info\n");
272 goto out;
273 }
274
275 fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags);
276
277 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
278 fprintf(stderr, "hpet_fasync: HPET_EPI failed\n");
279 goto out;
280 }
281
282 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
283 fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n");
284 goto out;
285 }
286
287 for (i = 0; i < iterations; i++) {
288 (void) pause();
289 fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count);
290 }
291
292out:
293 signal(SIGIO, oldsig);
294
295 if (fd >= 0)
296 close(fd);
297
298 return;
299}
diff --git a/Documentation/timers/hpet_example.c b/Documentation/timers/hpet_example.c
new file mode 100644
index 000000000000..f9ce2d9fdfd5
--- /dev/null
+++ b/Documentation/timers/hpet_example.c
@@ -0,0 +1,269 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <fcntl.h>
5#include <string.h>
6#include <memory.h>
7#include <malloc.h>
8#include <time.h>
9#include <ctype.h>
10#include <sys/types.h>
11#include <sys/wait.h>
12#include <signal.h>
13#include <fcntl.h>
14#include <errno.h>
15#include <sys/time.h>
16#include <linux/hpet.h>
17
18
19extern void hpet_open_close(int, const char **);
20extern void hpet_info(int, const char **);
21extern void hpet_poll(int, const char **);
22extern void hpet_fasync(int, const char **);
23extern void hpet_read(int, const char **);
24
25#include <sys/poll.h>
26#include <sys/ioctl.h>
27#include <signal.h>
28
29struct hpet_command {
30 char *command;
31 void (*func)(int argc, const char ** argv);
32} hpet_command[] = {
33 {
34 "open-close",
35 hpet_open_close
36 },
37 {
38 "info",
39 hpet_info
40 },
41 {
42 "poll",
43 hpet_poll
44 },
45 {
46 "fasync",
47 hpet_fasync
48 },
49};
50
51int
52main(int argc, const char ** argv)
53{
54 int i;
55
56 argc--;
57 argv++;
58
59 if (!argc) {
60 fprintf(stderr, "-hpet: requires command\n");
61 return -1;
62 }
63
64
65 for (i = 0; i < (sizeof (hpet_command) / sizeof (hpet_command[0])); i++)
66 if (!strcmp(argv[0], hpet_command[i].command)) {
67 argc--;
68 argv++;
69 fprintf(stderr, "-hpet: executing %s\n",
70 hpet_command[i].command);
71 hpet_command[i].func(argc, argv);
72 return 0;
73 }
74
75 fprintf(stderr, "do_hpet: command %s not implemented\n", argv[0]);
76
77 return -1;
78}
79
80void
81hpet_open_close(int argc, const char **argv)
82{
83 int fd;
84
85 if (argc != 1) {
86 fprintf(stderr, "hpet_open_close: device-name\n");
87 return;
88 }
89
90 fd = open(argv[0], O_RDONLY);
91 if (fd < 0)
92 fprintf(stderr, "hpet_open_close: open failed\n");
93 else
94 close(fd);
95
96 return;
97}
98
99void
100hpet_info(int argc, const char **argv)
101{
102}
103
104void
105hpet_poll(int argc, const char **argv)
106{
107 unsigned long freq;
108 int iterations, i, fd;
109 struct pollfd pfd;
110 struct hpet_info info;
111 struct timeval stv, etv;
112 struct timezone tz;
113 long usec;
114
115 if (argc != 3) {
116 fprintf(stderr, "hpet_poll: device-name freq iterations\n");
117 return;
118 }
119
120 freq = atoi(argv[1]);
121 iterations = atoi(argv[2]);
122
123 fd = open(argv[0], O_RDONLY);
124
125 if (fd < 0) {
126 fprintf(stderr, "hpet_poll: open of %s failed\n", argv[0]);
127 return;
128 }
129
130 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
131 fprintf(stderr, "hpet_poll: HPET_IRQFREQ failed\n");
132 goto out;
133 }
134
135 if (ioctl(fd, HPET_INFO, &info) < 0) {
136 fprintf(stderr, "hpet_poll: failed to get info\n");
137 goto out;
138 }
139
140 fprintf(stderr, "hpet_poll: info.hi_flags 0x%lx\n", info.hi_flags);
141
142 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
143 fprintf(stderr, "hpet_poll: HPET_EPI failed\n");
144 goto out;
145 }
146
147 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
148 fprintf(stderr, "hpet_poll, HPET_IE_ON failed\n");
149 goto out;
150 }
151
152 pfd.fd = fd;
153 pfd.events = POLLIN;
154
155 for (i = 0; i < iterations; i++) {
156 pfd.revents = 0;
157 gettimeofday(&stv, &tz);
158 if (poll(&pfd, 1, -1) < 0)
159 fprintf(stderr, "hpet_poll: poll failed\n");
160 else {
161 long data;
162
163 gettimeofday(&etv, &tz);
164 usec = stv.tv_sec * 1000000 + stv.tv_usec;
165 usec = (etv.tv_sec * 1000000 + etv.tv_usec) - usec;
166
167 fprintf(stderr,
168 "hpet_poll: expired time = 0x%lx\n", usec);
169
170 fprintf(stderr, "hpet_poll: revents = 0x%x\n",
171 pfd.revents);
172
173 if (read(fd, &data, sizeof(data)) != sizeof(data)) {
174 fprintf(stderr, "hpet_poll: read failed\n");
175 }
176 else
177 fprintf(stderr, "hpet_poll: data 0x%lx\n",
178 data);
179 }
180 }
181
182out:
183 close(fd);
184 return;
185}
186
187static int hpet_sigio_count;
188
189static void
190hpet_sigio(int val)
191{
192 fprintf(stderr, "hpet_sigio: called\n");
193 hpet_sigio_count++;
194}
195
196void
197hpet_fasync(int argc, const char **argv)
198{
199 unsigned long freq;
200 int iterations, i, fd, value;
201 sig_t oldsig;
202 struct hpet_info info;
203
204 hpet_sigio_count = 0;
205 fd = -1;
206
207 if ((oldsig = signal(SIGIO, hpet_sigio)) == SIG_ERR) {
208 fprintf(stderr, "hpet_fasync: failed to set signal handler\n");
209 return;
210 }
211
212 if (argc != 3) {
213 fprintf(stderr, "hpet_fasync: device-name freq iterations\n");
214 goto out;
215 }
216
217 fd = open(argv[0], O_RDONLY);
218
219 if (fd < 0) {
220 fprintf(stderr, "hpet_fasync: failed to open %s\n", argv[0]);
221 return;
222 }
223
224
225 if ((fcntl(fd, F_SETOWN, getpid()) == 1) ||
226 ((value = fcntl(fd, F_GETFL)) == 1) ||
227 (fcntl(fd, F_SETFL, value | O_ASYNC) == 1)) {
228 fprintf(stderr, "hpet_fasync: fcntl failed\n");
229 goto out;
230 }
231
232 freq = atoi(argv[1]);
233 iterations = atoi(argv[2]);
234
235 if (ioctl(fd, HPET_IRQFREQ, freq) < 0) {
236 fprintf(stderr, "hpet_fasync: HPET_IRQFREQ failed\n");
237 goto out;
238 }
239
240 if (ioctl(fd, HPET_INFO, &info) < 0) {
241 fprintf(stderr, "hpet_fasync: failed to get info\n");
242 goto out;
243 }
244
245 fprintf(stderr, "hpet_fasync: info.hi_flags 0x%lx\n", info.hi_flags);
246
247 if (info.hi_flags && (ioctl(fd, HPET_EPI, 0) < 0)) {
248 fprintf(stderr, "hpet_fasync: HPET_EPI failed\n");
249 goto out;
250 }
251
252 if (ioctl(fd, HPET_IE_ON, 0) < 0) {
253 fprintf(stderr, "hpet_fasync, HPET_IE_ON failed\n");
254 goto out;
255 }
256
257 for (i = 0; i < iterations; i++) {
258 (void) pause();
259 fprintf(stderr, "hpet_fasync: count = %d\n", hpet_sigio_count);
260 }
261
262out:
263 signal(SIGIO, oldsig);
264
265 if (fd >= 0)
266 close(fd);
267
268 return;
269}
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index bab3040da548..03485bfbd797 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -1588,7 +1588,7 @@ module author does not need to worry about it.
1588 1588
1589When tracing is enabled, kstop_machine is called to prevent 1589When tracing is enabled, kstop_machine is called to prevent
1590races with the CPUS executing code being modified (which can 1590races with the CPUS executing code being modified (which can
1591cause the CPU to do undesireable things), and the nops are 1591cause the CPU to do undesirable things), and the nops are
1592patched back to calls. But this time, they do not call mcount 1592patched back to calls. But this time, they do not call mcount
1593(which is just a function stub). They now call into the ftrace 1593(which is just a function stub). They now call into the ftrace
1594infrastructure. 1594infrastructure.
diff --git a/Documentation/vm/00-INDEX b/Documentation/vm/00-INDEX
index e57d6a9dd32b..dca82d7c83d8 100644
--- a/Documentation/vm/00-INDEX
+++ b/Documentation/vm/00-INDEX
@@ -4,23 +4,35 @@ active_mm.txt
4 - An explanation from Linus about tsk->active_mm vs tsk->mm. 4 - An explanation from Linus about tsk->active_mm vs tsk->mm.
5balance 5balance
6 - various information on memory balancing. 6 - various information on memory balancing.
7hugepage-mmap.c
8 - Example app using huge page memory with the mmap system call.
9hugepage-shm.c
10 - Example app using huge page memory with Sys V shared memory system calls.
7hugetlbpage.txt 11hugetlbpage.txt
8 - a brief summary of hugetlbpage support in the Linux kernel. 12 - a brief summary of hugetlbpage support in the Linux kernel.
13hwpoison.txt
14 - explains what hwpoison is
9ksm.txt 15ksm.txt
10 - how to use the Kernel Samepage Merging feature. 16 - how to use the Kernel Samepage Merging feature.
11locking 17locking
12 - info on how locking and synchronization is done in the Linux vm code. 18 - info on how locking and synchronization is done in the Linux vm code.
19map_hugetlb.c
20 - an example program that uses the MAP_HUGETLB mmap flag.
13numa 21numa
14 - information about NUMA specific code in the Linux vm. 22 - information about NUMA specific code in the Linux vm.
15numa_memory_policy.txt 23numa_memory_policy.txt
16 - documentation of concepts and APIs of the 2.6 memory policy support. 24 - documentation of concepts and APIs of the 2.6 memory policy support.
17overcommit-accounting 25overcommit-accounting
18 - description of the Linux kernels overcommit handling modes. 26 - description of the Linux kernels overcommit handling modes.
27page-types.c
28 - Tool for querying page flags
19page_migration 29page_migration
20 - description of page migration in NUMA systems. 30 - description of page migration in NUMA systems.
31pagemap.txt
32 - pagemap, from the userspace perspective
21slabinfo.c 33slabinfo.c
22 - source code for a tool to get reports about slabs. 34 - source code for a tool to get reports about slabs.
23slub.txt 35slub.txt
24 - a short users guide for SLUB. 36 - a short users guide for SLUB.
25map_hugetlb.c 37unevictable-lru.txt
26 - an example program that uses the MAP_HUGETLB mmap flag. 38 - Unevictable LRU infrastructure
diff --git a/Documentation/vm/Makefile b/Documentation/vm/Makefile
index 5bd269b3731a..9dcff328b964 100644
--- a/Documentation/vm/Makefile
+++ b/Documentation/vm/Makefile
@@ -2,7 +2,7 @@
2obj- := dummy.o 2obj- := dummy.o
3 3
4# List of programs to build 4# List of programs to build
5hostprogs-y := slabinfo page-types 5hostprogs-y := slabinfo page-types hugepage-mmap hugepage-shm map_hugetlb
6 6
7# Tell kbuild to always build the programs 7# Tell kbuild to always build the programs
8always := $(hostprogs-y) 8always := $(hostprogs-y)
diff --git a/Documentation/vm/hugepage-mmap.c b/Documentation/vm/hugepage-mmap.c
new file mode 100644
index 000000000000..db0dd9a33d54
--- /dev/null
+++ b/Documentation/vm/hugepage-mmap.c
@@ -0,0 +1,91 @@
1/*
2 * hugepage-mmap:
3 *
4 * Example of using huge page memory in a user application using the mmap
5 * system call. Before running this application, make sure that the
6 * administrator has mounted the hugetlbfs filesystem (on some directory
7 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
8 * example, the app is requesting memory of size 256MB that is backed by
9 * huge pages.
10 *
11 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
12 * huge pages. That means that if one requires a fixed address, a huge page
13 * aligned address starting with 0x800000... will be required. If a fixed
14 * address is not required, the kernel will select an address in the proper
15 * range.
16 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
17 */
18
19#include <stdlib.h>
20#include <stdio.h>
21#include <unistd.h>
22#include <sys/mman.h>
23#include <fcntl.h>
24
25#define FILE_NAME "/mnt/hugepagefile"
26#define LENGTH (256UL*1024*1024)
27#define PROTECTION (PROT_READ | PROT_WRITE)
28
29/* Only ia64 requires this */
30#ifdef __ia64__
31#define ADDR (void *)(0x8000000000000000UL)
32#define FLAGS (MAP_SHARED | MAP_FIXED)
33#else
34#define ADDR (void *)(0x0UL)
35#define FLAGS (MAP_SHARED)
36#endif
37
38static void check_bytes(char *addr)
39{
40 printf("First hex is %x\n", *((unsigned int *)addr));
41}
42
43static void write_bytes(char *addr)
44{
45 unsigned long i;
46
47 for (i = 0; i < LENGTH; i++)
48 *(addr + i) = (char)i;
49}
50
51static void read_bytes(char *addr)
52{
53 unsigned long i;
54
55 check_bytes(addr);
56 for (i = 0; i < LENGTH; i++)
57 if (*(addr + i) != (char)i) {
58 printf("Mismatch at %lu\n", i);
59 break;
60 }
61}
62
63int main(void)
64{
65 void *addr;
66 int fd;
67
68 fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
69 if (fd < 0) {
70 perror("Open failed");
71 exit(1);
72 }
73
74 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
75 if (addr == MAP_FAILED) {
76 perror("mmap");
77 unlink(FILE_NAME);
78 exit(1);
79 }
80
81 printf("Returned address is %p\n", addr);
82 check_bytes(addr);
83 write_bytes(addr);
84 read_bytes(addr);
85
86 munmap(addr, LENGTH);
87 close(fd);
88 unlink(FILE_NAME);
89
90 return 0;
91}
diff --git a/Documentation/vm/hugepage-shm.c b/Documentation/vm/hugepage-shm.c
new file mode 100644
index 000000000000..07956d8592c9
--- /dev/null
+++ b/Documentation/vm/hugepage-shm.c
@@ -0,0 +1,98 @@
1/*
2 * hugepage-shm:
3 *
4 * Example of using huge page memory in a user application using Sys V shared
5 * memory system calls. In this example the app is requesting 256MB of
6 * memory that is backed by huge pages. The application uses the flag
7 * SHM_HUGETLB in the shmget system call to inform the kernel that it is
8 * requesting huge pages.
9 *
10 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
11 * huge pages. That means that if one requires a fixed address, a huge page
12 * aligned address starting with 0x800000... will be required. If a fixed
13 * address is not required, the kernel will select an address in the proper
14 * range.
15 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
16 *
17 * Note: The default shared memory limit is quite low on many kernels,
18 * you may need to increase it via:
19 *
20 * echo 268435456 > /proc/sys/kernel/shmmax
21 *
22 * This will increase the maximum size per shared memory segment to 256MB.
23 * The other limit that you will hit eventually is shmall which is the
24 * total amount of shared memory in pages. To set it to 16GB on a system
25 * with a 4kB pagesize do:
26 *
27 * echo 4194304 > /proc/sys/kernel/shmall
28 */
29
30#include <stdlib.h>
31#include <stdio.h>
32#include <sys/types.h>
33#include <sys/ipc.h>
34#include <sys/shm.h>
35#include <sys/mman.h>
36
37#ifndef SHM_HUGETLB
38#define SHM_HUGETLB 04000
39#endif
40
41#define LENGTH (256UL*1024*1024)
42
43#define dprintf(x) printf(x)
44
45/* Only ia64 requires this */
46#ifdef __ia64__
47#define ADDR (void *)(0x8000000000000000UL)
48#define SHMAT_FLAGS (SHM_RND)
49#else
50#define ADDR (void *)(0x0UL)
51#define SHMAT_FLAGS (0)
52#endif
53
54int main(void)
55{
56 int shmid;
57 unsigned long i;
58 char *shmaddr;
59
60 if ((shmid = shmget(2, LENGTH,
61 SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
62 perror("shmget");
63 exit(1);
64 }
65 printf("shmid: 0x%x\n", shmid);
66
67 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
68 if (shmaddr == (char *)-1) {
69 perror("Shared memory attach failure");
70 shmctl(shmid, IPC_RMID, NULL);
71 exit(2);
72 }
73 printf("shmaddr: %p\n", shmaddr);
74
75 dprintf("Starting the writes:\n");
76 for (i = 0; i < LENGTH; i++) {
77 shmaddr[i] = (char)(i);
78 if (!(i % (1024 * 1024)))
79 dprintf(".");
80 }
81 dprintf("\n");
82
83 dprintf("Starting the Check...");
84 for (i = 0; i < LENGTH; i++)
85 if (shmaddr[i] != (char)i)
86 printf("\nIndex %lu mismatched\n", i);
87 dprintf("Done.\n");
88
89 if (shmdt((const void *)shmaddr) != 0) {
90 perror("Detach failure");
91 shmctl(shmid, IPC_RMID, NULL);
92 exit(3);
93 }
94
95 shmctl(shmid, IPC_RMID, NULL);
96
97 return 0;
98}
diff --git a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt
index bc31636973e3..457634c1e03e 100644
--- a/Documentation/vm/hugetlbpage.txt
+++ b/Documentation/vm/hugetlbpage.txt
@@ -299,176 +299,11 @@ map_hugetlb.c.
299******************************************************************* 299*******************************************************************
300 300
301/* 301/*
302 * Example of using huge page memory in a user application using Sys V shared 302 * hugepage-shm: see Documentation/vm/hugepage-shm.c
303 * memory system calls. In this example the app is requesting 256MB of
304 * memory that is backed by huge pages. The application uses the flag
305 * SHM_HUGETLB in the shmget system call to inform the kernel that it is
306 * requesting huge pages.
307 *
308 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
309 * huge pages. That means that if one requires a fixed address, a huge page
310 * aligned address starting with 0x800000... will be required. If a fixed
311 * address is not required, the kernel will select an address in the proper
312 * range.
313 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
314 *
315 * Note: The default shared memory limit is quite low on many kernels,
316 * you may need to increase it via:
317 *
318 * echo 268435456 > /proc/sys/kernel/shmmax
319 *
320 * This will increase the maximum size per shared memory segment to 256MB.
321 * The other limit that you will hit eventually is shmall which is the
322 * total amount of shared memory in pages. To set it to 16GB on a system
323 * with a 4kB pagesize do:
324 *
325 * echo 4194304 > /proc/sys/kernel/shmall
326 */ 303 */
327#include <stdlib.h>
328#include <stdio.h>
329#include <sys/types.h>
330#include <sys/ipc.h>
331#include <sys/shm.h>
332#include <sys/mman.h>
333
334#ifndef SHM_HUGETLB
335#define SHM_HUGETLB 04000
336#endif
337
338#define LENGTH (256UL*1024*1024)
339
340#define dprintf(x) printf(x)
341
342#define ADDR (void *)(0x0UL) /* let kernel choose address */
343#define SHMAT_FLAGS (0)
344
345int main(void)
346{
347 int shmid;
348 unsigned long i;
349 char *shmaddr;
350
351 if ((shmid = shmget(2, LENGTH,
352 SHM_HUGETLB | IPC_CREAT | SHM_R | SHM_W)) < 0) {
353 perror("shmget");
354 exit(1);
355 }
356 printf("shmid: 0x%x\n", shmid);
357
358 shmaddr = shmat(shmid, ADDR, SHMAT_FLAGS);
359 if (shmaddr == (char *)-1) {
360 perror("Shared memory attach failure");
361 shmctl(shmid, IPC_RMID, NULL);
362 exit(2);
363 }
364 printf("shmaddr: %p\n", shmaddr);
365
366 dprintf("Starting the writes:\n");
367 for (i = 0; i < LENGTH; i++) {
368 shmaddr[i] = (char)(i);
369 if (!(i % (1024 * 1024)))
370 dprintf(".");
371 }
372 dprintf("\n");
373
374 dprintf("Starting the Check...");
375 for (i = 0; i < LENGTH; i++)
376 if (shmaddr[i] != (char)i)
377 printf("\nIndex %lu mismatched\n", i);
378 dprintf("Done.\n");
379
380 if (shmdt((const void *)shmaddr) != 0) {
381 perror("Detach failure");
382 shmctl(shmid, IPC_RMID, NULL);
383 exit(3);
384 }
385
386 shmctl(shmid, IPC_RMID, NULL);
387
388 return 0;
389}
390 304
391******************************************************************* 305*******************************************************************
392 306
393/* 307/*
394 * Example of using huge page memory in a user application using the mmap 308 * hugepage-mmap: see Documentation/vm/hugepage-mmap.c
395 * system call. Before running this application, make sure that the
396 * administrator has mounted the hugetlbfs filesystem (on some directory
397 * like /mnt) using the command mount -t hugetlbfs nodev /mnt. In this
398 * example, the app is requesting memory of size 256MB that is backed by
399 * huge pages.
400 *
401 * For the ia64 architecture, the Linux kernel reserves Region number 4 for
402 * huge pages. That means that if one requires a fixed address, a huge page
403 * aligned address starting with 0x800000... will be required. If a fixed
404 * address is not required, the kernel will select an address in the proper
405 * range.
406 * Other architectures, such as ppc64, i386 or x86_64 are not so constrained.
407 */ 309 */
408#include <stdlib.h>
409#include <stdio.h>
410#include <unistd.h>
411#include <sys/mman.h>
412#include <fcntl.h>
413
414#define FILE_NAME "/mnt/hugepagefile"
415#define LENGTH (256UL*1024*1024)
416#define PROTECTION (PROT_READ | PROT_WRITE)
417
418#define ADDR (void *)(0x0UL) /* let kernel choose address */
419#define FLAGS (MAP_SHARED)
420
421void check_bytes(char *addr)
422{
423 printf("First hex is %x\n", *((unsigned int *)addr));
424}
425
426void write_bytes(char *addr)
427{
428 unsigned long i;
429
430 for (i = 0; i < LENGTH; i++)
431 *(addr + i) = (char)i;
432}
433
434void read_bytes(char *addr)
435{
436 unsigned long i;
437
438 check_bytes(addr);
439 for (i = 0; i < LENGTH; i++)
440 if (*(addr + i) != (char)i) {
441 printf("Mismatch at %lu\n", i);
442 break;
443 }
444}
445
446int main(void)
447{
448 void *addr;
449 int fd;
450
451 fd = open(FILE_NAME, O_CREAT | O_RDWR, 0755);
452 if (fd < 0) {
453 perror("Open failed");
454 exit(1);
455 }
456
457 addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, fd, 0);
458 if (addr == MAP_FAILED) {
459 perror("mmap");
460 unlink(FILE_NAME);
461 exit(1);
462 }
463
464 printf("Returned address is %p\n", addr);
465 check_bytes(addr);
466 write_bytes(addr);
467 read_bytes(addr);
468
469 munmap(addr, LENGTH);
470 close(fd);
471 unlink(FILE_NAME);
472
473 return 0;
474}
diff --git a/Documentation/vm/map_hugetlb.c b/Documentation/vm/map_hugetlb.c
index e2bdae37f499..9969c7d9f985 100644
--- a/Documentation/vm/map_hugetlb.c
+++ b/Documentation/vm/map_hugetlb.c
@@ -31,12 +31,12 @@
31#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB) 31#define FLAGS (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB)
32#endif 32#endif
33 33
34void check_bytes(char *addr) 34static void check_bytes(char *addr)
35{ 35{
36 printf("First hex is %x\n", *((unsigned int *)addr)); 36 printf("First hex is %x\n", *((unsigned int *)addr));
37} 37}
38 38
39void write_bytes(char *addr) 39static void write_bytes(char *addr)
40{ 40{
41 unsigned long i; 41 unsigned long i;
42 42
@@ -44,7 +44,7 @@ void write_bytes(char *addr)
44 *(addr + i) = (char)i; 44 *(addr + i) = (char)i;
45} 45}
46 46
47void read_bytes(char *addr) 47static void read_bytes(char *addr)
48{ 48{
49 unsigned long i; 49 unsigned long i;
50 50
diff --git a/Documentation/voyager.txt b/Documentation/voyager.txt
deleted file mode 100644
index 2749af552cdf..000000000000
--- a/Documentation/voyager.txt
+++ /dev/null
@@ -1,95 +0,0 @@
1Running Linux on the Voyager Architecture
2=========================================
3
4For full details and current project status, see
5
6http://www.hansenpartnership.com/voyager
7
8The voyager architecture was designed by NCR in the mid 80s to be a
9fully SMP capable RAS computing architecture built around intel's 486
10chip set. The voyager came in three levels of architectural
11sophistication: 3,4 and 5 --- 1 and 2 never made it out of prototype.
12The linux patches support only the Level 5 voyager architecture (any
13machine class 3435 and above).
14
15The Voyager Architecture
16------------------------
17
18Voyager machines consist of a Baseboard with a 386 diagnostic
19processor, a Power Supply Interface (PSI) a Primary and possibly
20Secondary Microchannel bus and between 2 and 20 voyager slots. The
21voyager slots can be populated with memory and cpu cards (up to 4GB
22memory and from 1 486 to 32 Pentium Pro processors). Internally, the
23voyager has a dual arbitrated system bus and a configuration and test
24bus (CAT). The voyager bus speed is 40MHz. Therefore (since all
25voyager cards are dual ported for each system bus) the maximum
26transfer rate is 320Mb/s but only if you have your slot configuration
27tuned (only memory cards can communicate with both busses at once, CPU
28cards utilise them one at a time).
29
30Voyager SMP
31-----------
32
33Since voyager was the first intel based SMP system, it is slightly
34more primitive than the Intel IO-APIC approach to SMP. Voyager allows
35arbitrary interrupt routing (including processor affinity routing) of
36all 16 PC type interrupts. However it does this by using a modified
375259 master/slave chip set instead of an APIC bus. Additionally,
38voyager supports Cross Processor Interrupts (CPI) equivalent to the
39APIC IPIs. There are two routed voyager interrupt lines provided to
40each slot.
41
42Processor Cards
43---------------
44
45These come in single, dyadic and quad configurations (the quads are
46problematic--see later). The maximum configuration is 8 quad cards
47for 32 way SMP.
48
49Quad Processors
50---------------
51
52Because voyager only supplies two interrupt lines to each Processor
53card, the Quad processors have to be configured (and Bootstrapped) in
54as a pair of Master/Slave processors.
55
56In fact, most Quad cards only accept one VIC interrupt line, so they
57have one interrupt handling processor (called the VIC extended
58processor) and three non-interrupt handling processors.
59
60Current Status
61--------------
62
63The System will boot on Mono, Dyad and Quad cards. There was
64originally a Quad boot problem which has been fixed by proper gdt
65alignment in the initial boot loader. If you still cannot get your
66voyager system to boot, email me at:
67
68<J.E.J.Bottomley@HansenPartnership.com>
69
70
71The Quad cards now support using the separate Quad CPI vectors instead
72of going through the VIC mailbox system.
73
74The Level 4 architecture (3430 and 3360 Machines) should also work
75fine.
76
77Dump Switch
78-----------
79
80The voyager dump switch sends out a broadcast NMI which the voyager
81code intercepts and does a task dump.
82
83Power Switch
84------------
85
86The front panel power switch is intercepted by the kernel and should
87cause a system shutdown and power off.
88
89A Note About Mixed CPU Systems
90------------------------------
91
92Linux isn't designed to handle mixed CPU systems very well. In order
93to get everything going you *must* make sure that your lowest
94capability CPU is used for booting. Also, mixing CPU classes
95(e.g. 486 and 586) is really not going to work very well at all.
diff --git a/MAINTAINERS b/MAINTAINERS
index c8a8b1fd58b3..fe88b5f732cd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -666,6 +666,12 @@ T: git://git.pengutronix.de/git/imx/linux-2.6.git
666F: arch/arm/mach-mx*/ 666F: arch/arm/mach-mx*/
667F: arch/arm/plat-mxc/ 667F: arch/arm/plat-mxc/
668 668
669ARM/FREESCALE IMX51
670M: Amit Kucheria <amit.kucheria@canonical.com>
671L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
672S: Maintained
673F: arch/arm/mach-mx5/
674
669ARM/GLOMATION GESBC9312SX MACHINE SUPPORT 675ARM/GLOMATION GESBC9312SX MACHINE SUPPORT
670M: Lennert Buytenhek <kernel@wantstofly.org> 676M: Lennert Buytenhek <kernel@wantstofly.org>
671L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 677L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -939,6 +945,16 @@ W: http://www.fluff.org/ben/linux/
939S: Maintained 945S: Maintained
940F: arch/arm/mach-s3c6410/ 946F: arch/arm/mach-s3c6410/
941 947
948ARM/SHMOBILE ARM ARCHITECTURE
949M: Paul Mundt <lethal@linux-sh.org>
950M: Magnus Damm <magnus.damm@gmail.com>
951L: linux-sh@vger.kernel.org
952T: git git://git.kernel.org/pub/scm/linux/kernel/git/lethal/genesis-2.6.git
953W: http://oss.renesas.com
954S: Supported
955F: arch/arm/mach-shmobile/
956F: drivers/sh/
957
942ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT 958ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
943M: Lennert Buytenhek <kernel@wantstofly.org> 959M: Lennert Buytenhek <kernel@wantstofly.org>
944L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 960L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1235,6 +1251,13 @@ W: http://blackfin.uclinux.org
1235S: Supported 1251S: Supported
1236F: drivers/rtc/rtc-bfin.c 1252F: drivers/rtc/rtc-bfin.c
1237 1253
1254BLACKFIN SDH DRIVER
1255M: Cliff Cai <cliff.cai@analog.com>
1256L: uclinux-dist-devel@blackfin.uclinux.org
1257W: http://blackfin.uclinux.org
1258S: Supported
1259F: drivers/mmc/host/bfin_sdh.c
1260
1238BLACKFIN SERIAL DRIVER 1261BLACKFIN SERIAL DRIVER
1239M: Sonic Zhang <sonic.zhang@analog.com> 1262M: Sonic Zhang <sonic.zhang@analog.com>
1240L: uclinux-dist-devel@blackfin.uclinux.org 1263L: uclinux-dist-devel@blackfin.uclinux.org
@@ -2804,7 +2827,7 @@ S: Maintained
2804F: drivers/input/ 2827F: drivers/input/
2805 2828
2806INTEL FRAMEBUFFER DRIVER (excluding 810 and 815) 2829INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
2807M: Sylvain Meyer <sylvain.meyer@worldonline.fr> 2830M: Maik Broemme <mbroemme@plusserver.de>
2808L: linux-fbdev@vger.kernel.org 2831L: linux-fbdev@vger.kernel.org
2809S: Maintained 2832S: Maintained
2810F: Documentation/fb/intelfb.txt 2833F: Documentation/fb/intelfb.txt
@@ -3621,7 +3644,7 @@ F: mm/
3621 3644
3622MEMORY RESOURCE CONTROLLER 3645MEMORY RESOURCE CONTROLLER
3623M: Balbir Singh <balbir@linux.vnet.ibm.com> 3646M: Balbir Singh <balbir@linux.vnet.ibm.com>
3624M: Pavel Emelyanov <xemul@openvz.org> 3647M: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
3625M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> 3648M: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
3626L: linux-mm@kvack.org 3649L: linux-mm@kvack.org
3627S: Maintained 3650S: Maintained
@@ -4495,6 +4518,13 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
4495T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git 4518T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4496S: Maintained 4519S: Maintained
4497 4520
4521MMP2 SUPPORT (aka ARMADA610)
4522M: Haojian Zhuang <haojian.zhuang@marvell.com>
4523M: Eric Miao <eric.y.miao@gmail.com>
4524L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
4525T: git git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6.git
4526S: Maintained
4527
4498PXA MMCI DRIVER 4528PXA MMCI DRIVER
4499S: Orphan 4529S: Orphan
4500 4530
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index bd7261ea8f94..75291fdd379f 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -10,6 +10,7 @@ config ALPHA
10 select HAVE_OPROFILE 10 select HAVE_OPROFILE
11 select HAVE_SYSCALL_WRAPPERS 11 select HAVE_SYSCALL_WRAPPERS
12 select HAVE_PERF_EVENTS 12 select HAVE_PERF_EVENTS
13 select HAVE_DMA_ATTRS
13 help 14 help
14 The Alpha is a 64-bit general-purpose processor designed and 15 The Alpha is a 64-bit general-purpose processor designed and
15 marketed by the Digital Equipment Corporation of blessed memory, 16 marketed by the Digital Equipment Corporation of blessed memory,
@@ -58,6 +59,9 @@ config ZONE_DMA
58 bool 59 bool
59 default y 60 default y
60 61
62config NEED_DMA_MAP_STATE
63 def_bool y
64
61config GENERIC_ISA_DMA 65config GENERIC_ISA_DMA
62 bool 66 bool
63 default y 67 default y
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h
index 04eb5681448c..1bce8169733c 100644
--- a/arch/alpha/include/asm/dma-mapping.h
+++ b/arch/alpha/include/asm/dma-mapping.h
@@ -1,71 +1,49 @@
1#ifndef _ALPHA_DMA_MAPPING_H 1#ifndef _ALPHA_DMA_MAPPING_H
2#define _ALPHA_DMA_MAPPING_H 2#define _ALPHA_DMA_MAPPING_H
3 3
4#include <linux/dma-attrs.h>
4 5
5#ifdef CONFIG_PCI 6extern struct dma_map_ops *dma_ops;
6 7
7#include <linux/pci.h> 8static inline struct dma_map_ops *get_dma_ops(struct device *dev)
9{
10 return dma_ops;
11}
8 12
9#define dma_map_single(dev, va, size, dir) \ 13#include <asm-generic/dma-mapping-common.h>
10 pci_map_single(alpha_gendev_to_pci(dev), va, size, dir)
11#define dma_unmap_single(dev, addr, size, dir) \
12 pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir)
13#define dma_alloc_coherent(dev, size, addr, gfp) \
14 __pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr, gfp)
15#define dma_free_coherent(dev, size, va, addr) \
16 pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr)
17#define dma_map_page(dev, page, off, size, dir) \
18 pci_map_page(alpha_gendev_to_pci(dev), page, off, size, dir)
19#define dma_unmap_page(dev, addr, size, dir) \
20 pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir)
21#define dma_map_sg(dev, sg, nents, dir) \
22 pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
23#define dma_unmap_sg(dev, sg, nents, dir) \
24 pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
25#define dma_supported(dev, mask) \
26 pci_dma_supported(alpha_gendev_to_pci(dev), mask)
27#define dma_mapping_error(dev, addr) \
28 pci_dma_mapping_error(alpha_gendev_to_pci(dev), addr)
29 14
30#else /* no PCI - no IOMMU. */ 15static inline void *dma_alloc_coherent(struct device *dev, size_t size,
16 dma_addr_t *dma_handle, gfp_t gfp)
17{
18 return get_dma_ops(dev)->alloc_coherent(dev, size, dma_handle, gfp);
19}
31 20
32#include <asm/io.h> /* for virt_to_phys() */ 21static inline void dma_free_coherent(struct device *dev, size_t size,
22 void *vaddr, dma_addr_t dma_handle)
23{
24 get_dma_ops(dev)->free_coherent(dev, size, vaddr, dma_handle);
25}
33 26
34struct scatterlist; 27static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
35void *dma_alloc_coherent(struct device *dev, size_t size, 28{
36 dma_addr_t *dma_handle, gfp_t gfp); 29 return get_dma_ops(dev)->mapping_error(dev, dma_addr);
37int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 30}
38 enum dma_data_direction direction);
39 31
40#define dma_free_coherent(dev, size, va, addr) \ 32static inline int dma_supported(struct device *dev, u64 mask)
41 free_pages((unsigned long)va, get_order(size)) 33{
42#define dma_supported(dev, mask) (mask < 0x00ffffffUL ? 0 : 1) 34 return get_dma_ops(dev)->dma_supported(dev, mask);
43#define dma_map_single(dev, va, size, dir) virt_to_phys(va) 35}
44#define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off)
45 36
46#define dma_unmap_single(dev, addr, size, dir) ((void)0) 37static inline int dma_set_mask(struct device *dev, u64 mask)
47#define dma_unmap_page(dev, addr, size, dir) ((void)0) 38{
48#define dma_unmap_sg(dev, sg, nents, dir) ((void)0) 39 return get_dma_ops(dev)->set_dma_mask(dev, mask);
49 40}
50#define dma_mapping_error(dev, addr) (0)
51
52#endif /* !CONFIG_PCI */
53 41
54#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 42#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
55#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 43#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
56#define dma_is_consistent(d, h) (1) 44#define dma_is_consistent(d, h) (1)
57 45
58int dma_set_mask(struct device *dev, u64 mask);
59
60#define dma_sync_single_for_cpu(dev, addr, size, dir) ((void)0)
61#define dma_sync_single_for_device(dev, addr, size, dir) ((void)0)
62#define dma_sync_single_range(dev, addr, off, size, dir) ((void)0)
63#define dma_sync_sg_for_cpu(dev, sg, nents, dir) ((void)0)
64#define dma_sync_sg_for_device(dev, sg, nents, dir) ((void)0)
65#define dma_cache_sync(dev, va, size, dir) ((void)0) 46#define dma_cache_sync(dev, va, size, dir) ((void)0)
66#define dma_sync_single_range_for_cpu(dev, addr, offset, size, dir) ((void)0)
67#define dma_sync_single_range_for_device(dev, addr, offset, size, dir) ((void)0)
68
69#define dma_get_cache_alignment() L1_CACHE_BYTES 47#define dma_get_cache_alignment() L1_CACHE_BYTES
70 48
71#endif /* _ALPHA_DMA_MAPPING_H */ 49#endif /* _ALPHA_DMA_MAPPING_H */
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h
index dd8dcabf160f..28d0497fd3c7 100644
--- a/arch/alpha/include/asm/pci.h
+++ b/arch/alpha/include/asm/pci.h
@@ -70,142 +70,11 @@ extern inline void pcibios_penalize_isa_irq(int irq, int active)
70 decisions. */ 70 decisions. */
71#define PCI_DMA_BUS_IS_PHYS 0 71#define PCI_DMA_BUS_IS_PHYS 0
72 72
73/* Allocate and map kernel buffer using consistent mode DMA for PCI 73#ifdef CONFIG_PCI
74 device. Returns non-NULL cpu-view pointer to the buffer if
75 successful and sets *DMA_ADDRP to the pci side dma address as well,
76 else DMA_ADDRP is undefined. */
77
78extern void *__pci_alloc_consistent(struct pci_dev *, size_t,
79 dma_addr_t *, gfp_t);
80static inline void *
81pci_alloc_consistent(struct pci_dev *dev, size_t size, dma_addr_t *dma)
82{
83 return __pci_alloc_consistent(dev, size, dma, GFP_ATOMIC);
84}
85
86/* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must
87 be values that were returned from pci_alloc_consistent. SIZE must
88 be the same as what as passed into pci_alloc_consistent.
89 References to the memory and mappings associated with CPU_ADDR or
90 DMA_ADDR past this call are illegal. */
91
92extern void pci_free_consistent(struct pci_dev *, size_t, void *, dma_addr_t);
93
94/* Map a single buffer of the indicate size for PCI DMA in streaming mode.
95 The 32-bit PCI bus mastering address to use is returned. Once the device
96 is given the dma address, the device owns this memory until either
97 pci_unmap_single or pci_dma_sync_single_for_cpu is performed. */
98
99extern dma_addr_t pci_map_single(struct pci_dev *, void *, size_t, int);
100
101/* Likewise, but for a page instead of an address. */
102extern dma_addr_t pci_map_page(struct pci_dev *, struct page *,
103 unsigned long, size_t, int);
104
105/* Test for pci_map_single or pci_map_page having generated an error. */
106
107static inline int
108pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
109{
110 return dma_addr == 0;
111}
112
113/* Unmap a single streaming mode DMA translation. The DMA_ADDR and
114 SIZE must match what was provided for in a previous pci_map_single
115 call. All other usages are undefined. After this call, reads by
116 the cpu to the buffer are guaranteed to see whatever the device
117 wrote there. */
118
119extern void pci_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
120extern void pci_unmap_page(struct pci_dev *, dma_addr_t, size_t, int);
121
122/* pci_unmap_{single,page} is not a nop, thus... */
123#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
124 dma_addr_t ADDR_NAME;
125#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
126 __u32 LEN_NAME;
127#define pci_unmap_addr(PTR, ADDR_NAME) \
128 ((PTR)->ADDR_NAME)
129#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
130 (((PTR)->ADDR_NAME) = (VAL))
131#define pci_unmap_len(PTR, LEN_NAME) \
132 ((PTR)->LEN_NAME)
133#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
134 (((PTR)->LEN_NAME) = (VAL))
135
136/* Map a set of buffers described by scatterlist in streaming mode for
137 PCI DMA. This is the scatter-gather version of the above
138 pci_map_single interface. Here the scatter gather list elements
139 are each tagged with the appropriate PCI dma address and length.
140 They are obtained via sg_dma_{address,length}(SG).
141
142 NOTE: An implementation may be able to use a smaller number of DMA
143 address/length pairs than there are SG table elements. (for
144 example via virtual mapping capabilities) The routine returns the
145 number of addr/length pairs actually used, at most nents.
146
147 Device ownership issues as mentioned above for pci_map_single are
148 the same here. */
149
150extern int pci_map_sg(struct pci_dev *, struct scatterlist *, int, int);
151
152/* Unmap a set of streaming mode DMA translations. Again, cpu read
153 rules concerning calls here are the same as for pci_unmap_single()
154 above. */
155
156extern void pci_unmap_sg(struct pci_dev *, struct scatterlist *, int, int);
157
158/* Make physical memory consistent for a single streaming mode DMA
159 translation after a transfer and device currently has ownership
160 of the buffer.
161
162 If you perform a pci_map_single() but wish to interrogate the
163 buffer using the cpu, yet do not wish to teardown the PCI dma
164 mapping, you must call this function before doing so. At the next
165 point you give the PCI dma address back to the card, you must first
166 perform a pci_dma_sync_for_device, and then the device again owns
167 the buffer. */
168
169static inline void
170pci_dma_sync_single_for_cpu(struct pci_dev *dev, dma_addr_t dma_addr,
171 long size, int direction)
172{
173 /* Nothing to do. */
174}
175
176static inline void
177pci_dma_sync_single_for_device(struct pci_dev *dev, dma_addr_t dma_addr,
178 size_t size, int direction)
179{
180 /* Nothing to do. */
181}
182
183/* Make physical memory consistent for a set of streaming mode DMA
184 translations after a transfer. The same as pci_dma_sync_single_*
185 but for a scatter-gather list, same rules and usage. */
186
187static inline void
188pci_dma_sync_sg_for_cpu(struct pci_dev *dev, struct scatterlist *sg,
189 int nents, int direction)
190{
191 /* Nothing to do. */
192}
193
194static inline void
195pci_dma_sync_sg_for_device(struct pci_dev *dev, struct scatterlist *sg,
196 int nents, int direction)
197{
198 /* Nothing to do. */
199}
200
201/* Return whether the given PCI device DMA address mask can
202 be supported properly. For example, if your device can
203 only drive the low 24-bits during PCI bus mastering, then
204 you would pass 0x00ffffff as the mask to this function. */
205 74
206extern int pci_dma_supported(struct pci_dev *hwdev, u64 mask); 75/* implement the pci_ DMA API in terms of the generic device dma_ one */
76#include <asm-generic/pci-dma-compat.h>
207 77
208#ifdef CONFIG_PCI
209static inline void pci_dma_burst_advice(struct pci_dev *pdev, 78static inline void pci_dma_burst_advice(struct pci_dev *pdev,
210 enum pci_dma_burst_strategy *strat, 79 enum pci_dma_burst_strategy *strat,
211 unsigned long *strategy_parameter) 80 unsigned long *strategy_parameter)
@@ -244,8 +113,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
244 return hose->need_domain_info; 113 return hose->need_domain_info;
245} 114}
246 115
247struct pci_dev *alpha_gendev_to_pci(struct device *dev);
248
249#endif /* __KERNEL__ */ 116#endif /* __KERNEL__ */
250 117
251/* Values for the `which' argument to sys_pciconfig_iobase. */ 118/* Values for the `which' argument to sys_pciconfig_iobase. */
diff --git a/arch/alpha/include/asm/ptrace.h b/arch/alpha/include/asm/ptrace.h
index 32c7a5cddd59..65cf3e28e2f4 100644
--- a/arch/alpha/include/asm/ptrace.h
+++ b/arch/alpha/include/asm/ptrace.h
@@ -68,6 +68,7 @@ struct switch_stack {
68 68
69#ifdef __KERNEL__ 69#ifdef __KERNEL__
70 70
71#define arch_has_single_step() (1)
71#define user_mode(regs) (((regs)->ps & 8) != 0) 72#define user_mode(regs) (((regs)->ps & 8) != 0)
72#define instruction_pointer(regs) ((regs)->pc) 73#define instruction_pointer(regs) ((regs)->pc)
73#define profile_pc(regs) instruction_pointer(regs) 74#define profile_pc(regs) instruction_pointer(regs)
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c
index c19a376520f4..823a540f9f5b 100644
--- a/arch/alpha/kernel/pci-noop.c
+++ b/arch/alpha/kernel/pci-noop.c
@@ -106,58 +106,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
106 return -ENODEV; 106 return -ENODEV;
107} 107}
108 108
109/* Stubs for the routines in pci_iommu.c: */ 109static void *alpha_noop_alloc_coherent(struct device *dev, size_t size,
110 110 dma_addr_t *dma_handle, gfp_t gfp)
111void *
112__pci_alloc_consistent(struct pci_dev *pdev, size_t size,
113 dma_addr_t *dma_addrp, gfp_t gfp)
114{
115 return NULL;
116}
117
118void
119pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr,
120 dma_addr_t dma_addr)
121{
122}
123
124dma_addr_t
125pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size,
126 int direction)
127{
128 return (dma_addr_t) 0;
129}
130
131void
132pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
133 int direction)
134{
135}
136
137int
138pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
139 int direction)
140{
141 return 0;
142}
143
144void
145pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
146 int direction)
147{
148}
149
150int
151pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
152{
153 return 0;
154}
155
156/* Generic DMA mapping functions: */
157
158void *
159dma_alloc_coherent(struct device *dev, size_t size,
160 dma_addr_t *dma_handle, gfp_t gfp)
161{ 111{
162 void *ret; 112 void *ret;
163 113
@@ -171,11 +121,22 @@ dma_alloc_coherent(struct device *dev, size_t size,
171 return ret; 121 return ret;
172} 122}
173 123
174EXPORT_SYMBOL(dma_alloc_coherent); 124static void alpha_noop_free_coherent(struct device *dev, size_t size,
125 void *cpu_addr, dma_addr_t dma_addr)
126{
127 free_pages((unsigned long)cpu_addr, get_order(size));
128}
129
130static dma_addr_t alpha_noop_map_page(struct device *dev, struct page *page,
131 unsigned long offset, size_t size,
132 enum dma_data_direction dir,
133 struct dma_attrs *attrs)
134{
135 return page_to_pa(page) + offset;
136}
175 137
176int 138static int alpha_noop_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
177dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, 139 enum dma_data_direction dir, struct dma_attrs *attrs)
178 enum dma_data_direction direction)
179{ 140{
180 int i; 141 int i;
181 struct scatterlist *sg; 142 struct scatterlist *sg;
@@ -192,19 +153,37 @@ dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents,
192 return nents; 153 return nents;
193} 154}
194 155
195EXPORT_SYMBOL(dma_map_sg); 156static int alpha_noop_mapping_error(struct device *dev, dma_addr_t dma_addr)
157{
158 return 0;
159}
160
161static int alpha_noop_supported(struct device *dev, u64 mask)
162{
163 return mask < 0x00ffffffUL ? 0 : 1;
164}
196 165
197int 166static int alpha_noop_set_mask(struct device *dev, u64 mask)
198dma_set_mask(struct device *dev, u64 mask)
199{ 167{
200 if (!dev->dma_mask || !dma_supported(dev, mask)) 168 if (!dev->dma_mask || !dma_supported(dev, mask))
201 return -EIO; 169 return -EIO;
202 170
203 *dev->dma_mask = mask; 171 *dev->dma_mask = mask;
204
205 return 0; 172 return 0;
206} 173}
207EXPORT_SYMBOL(dma_set_mask); 174
175struct dma_map_ops alpha_noop_ops = {
176 .alloc_coherent = alpha_noop_alloc_coherent,
177 .free_coherent = alpha_noop_free_coherent,
178 .map_page = alpha_noop_map_page,
179 .map_sg = alpha_noop_map_sg,
180 .mapping_error = alpha_noop_mapping_error,
181 .dma_supported = alpha_noop_supported,
182 .set_dma_mask = alpha_noop_set_mask,
183};
184
185struct dma_map_ops *dma_ops = &alpha_noop_ops;
186EXPORT_SYMBOL(dma_ops);
208 187
209void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) 188void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
210{ 189{
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index 8449504f5e0b..ce9e54c887fa 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -216,10 +216,30 @@ iommu_arena_free(struct pci_iommu_arena *arena, long ofs, long n)
216 for (i = 0; i < n; ++i) 216 for (i = 0; i < n; ++i)
217 p[i] = 0; 217 p[i] = 0;
218} 218}
219 219
220/* True if the machine supports DAC addressing, and DEV can 220/*
221 make use of it given MASK. */ 221 * True if the machine supports DAC addressing, and DEV can
222static int pci_dac_dma_supported(struct pci_dev *hwdev, u64 mask); 222 * make use of it given MASK.
223 */
224static int pci_dac_dma_supported(struct pci_dev *dev, u64 mask)
225{
226 dma64_addr_t dac_offset = alpha_mv.pci_dac_offset;
227 int ok = 1;
228
229 /* If this is not set, the machine doesn't support DAC at all. */
230 if (dac_offset == 0)
231 ok = 0;
232
233 /* The device has to be able to address our DAC bit. */
234 if ((dac_offset & dev->dma_mask) != dac_offset)
235 ok = 0;
236
237 /* If both conditions above are met, we are fine. */
238 DBGA("pci_dac_dma_supported %s from %p\n",
239 ok ? "yes" : "no", __builtin_return_address(0));
240
241 return ok;
242}
223 243
224/* Map a single buffer of the indicated size for PCI DMA in streaming 244/* Map a single buffer of the indicated size for PCI DMA in streaming
225 mode. The 32-bit PCI bus mastering address to use is returned. 245 mode. The 32-bit PCI bus mastering address to use is returned.
@@ -301,23 +321,36 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size,
301 return ret; 321 return ret;
302} 322}
303 323
304dma_addr_t 324/* Helper for generic DMA-mapping functions. */
305pci_map_single(struct pci_dev *pdev, void *cpu_addr, size_t size, int dir) 325static struct pci_dev *alpha_gendev_to_pci(struct device *dev)
306{ 326{
307 int dac_allowed; 327 if (dev && dev->bus == &pci_bus_type)
328 return to_pci_dev(dev);
308 329
309 if (dir == PCI_DMA_NONE) 330 /* Assume that non-PCI devices asking for DMA are either ISA or EISA,
310 BUG(); 331 BUG() otherwise. */
332 BUG_ON(!isa_bridge);
311 333
312 dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; 334 /* Assume non-busmaster ISA DMA when dma_mask is not set (the ISA
313 return pci_map_single_1(pdev, cpu_addr, size, dac_allowed); 335 bridge is bus master then). */
336 if (!dev || !dev->dma_mask || !*dev->dma_mask)
337 return isa_bridge;
338
339 /* For EISA bus masters, return isa_bridge (it might have smaller
340 dma_mask due to wiring limitations). */
341 if (*dev->dma_mask >= isa_bridge->dma_mask)
342 return isa_bridge;
343
344 /* This assumes ISA bus master with dma_mask 0xffffff. */
345 return NULL;
314} 346}
315EXPORT_SYMBOL(pci_map_single);
316 347
317dma_addr_t 348static dma_addr_t alpha_pci_map_page(struct device *dev, struct page *page,
318pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset, 349 unsigned long offset, size_t size,
319 size_t size, int dir) 350 enum dma_data_direction dir,
351 struct dma_attrs *attrs)
320{ 352{
353 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
321 int dac_allowed; 354 int dac_allowed;
322 355
323 if (dir == PCI_DMA_NONE) 356 if (dir == PCI_DMA_NONE)
@@ -327,7 +360,6 @@ pci_map_page(struct pci_dev *pdev, struct page *page, unsigned long offset,
327 return pci_map_single_1(pdev, (char *)page_address(page) + offset, 360 return pci_map_single_1(pdev, (char *)page_address(page) + offset,
328 size, dac_allowed); 361 size, dac_allowed);
329} 362}
330EXPORT_SYMBOL(pci_map_page);
331 363
332/* Unmap a single streaming mode DMA translation. The DMA_ADDR and 364/* Unmap a single streaming mode DMA translation. The DMA_ADDR and
333 SIZE must match what was provided for in a previous pci_map_single 365 SIZE must match what was provided for in a previous pci_map_single
@@ -335,16 +367,17 @@ EXPORT_SYMBOL(pci_map_page);
335 the cpu to the buffer are guaranteed to see whatever the device 367 the cpu to the buffer are guaranteed to see whatever the device
336 wrote there. */ 368 wrote there. */
337 369
338void 370static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr,
339pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size, 371 size_t size, enum dma_data_direction dir,
340 int direction) 372 struct dma_attrs *attrs)
341{ 373{
342 unsigned long flags; 374 unsigned long flags;
375 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
343 struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose; 376 struct pci_controller *hose = pdev ? pdev->sysdata : pci_isa_hose;
344 struct pci_iommu_arena *arena; 377 struct pci_iommu_arena *arena;
345 long dma_ofs, npages; 378 long dma_ofs, npages;
346 379
347 if (direction == PCI_DMA_NONE) 380 if (dir == PCI_DMA_NONE)
348 BUG(); 381 BUG();
349 382
350 if (dma_addr >= __direct_map_base 383 if (dma_addr >= __direct_map_base
@@ -393,25 +426,16 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
393 DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %p\n", 426 DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %p\n",
394 dma_addr, size, npages, __builtin_return_address(0)); 427 dma_addr, size, npages, __builtin_return_address(0));
395} 428}
396EXPORT_SYMBOL(pci_unmap_single);
397
398void
399pci_unmap_page(struct pci_dev *pdev, dma_addr_t dma_addr,
400 size_t size, int direction)
401{
402 pci_unmap_single(pdev, dma_addr, size, direction);
403}
404EXPORT_SYMBOL(pci_unmap_page);
405 429
406/* Allocate and map kernel buffer using consistent mode DMA for PCI 430/* Allocate and map kernel buffer using consistent mode DMA for PCI
407 device. Returns non-NULL cpu-view pointer to the buffer if 431 device. Returns non-NULL cpu-view pointer to the buffer if
408 successful and sets *DMA_ADDRP to the pci side dma address as well, 432 successful and sets *DMA_ADDRP to the pci side dma address as well,
409 else DMA_ADDRP is undefined. */ 433 else DMA_ADDRP is undefined. */
410 434
411void * 435static void *alpha_pci_alloc_coherent(struct device *dev, size_t size,
412__pci_alloc_consistent(struct pci_dev *pdev, size_t size, 436 dma_addr_t *dma_addrp, gfp_t gfp)
413 dma_addr_t *dma_addrp, gfp_t gfp)
414{ 437{
438 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
415 void *cpu_addr; 439 void *cpu_addr;
416 long order = get_order(size); 440 long order = get_order(size);
417 441
@@ -439,13 +463,12 @@ try_again:
439 gfp |= GFP_DMA; 463 gfp |= GFP_DMA;
440 goto try_again; 464 goto try_again;
441 } 465 }
442 466
443 DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %p\n", 467 DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %p\n",
444 size, cpu_addr, *dma_addrp, __builtin_return_address(0)); 468 size, cpu_addr, *dma_addrp, __builtin_return_address(0));
445 469
446 return cpu_addr; 470 return cpu_addr;
447} 471}
448EXPORT_SYMBOL(__pci_alloc_consistent);
449 472
450/* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must 473/* Free and unmap a consistent DMA buffer. CPU_ADDR and DMA_ADDR must
451 be values that were returned from pci_alloc_consistent. SIZE must 474 be values that were returned from pci_alloc_consistent. SIZE must
@@ -453,17 +476,16 @@ EXPORT_SYMBOL(__pci_alloc_consistent);
453 References to the memory and mappings associated with CPU_ADDR or 476 References to the memory and mappings associated with CPU_ADDR or
454 DMA_ADDR past this call are illegal. */ 477 DMA_ADDR past this call are illegal. */
455 478
456void 479static void alpha_pci_free_coherent(struct device *dev, size_t size,
457pci_free_consistent(struct pci_dev *pdev, size_t size, void *cpu_addr, 480 void *cpu_addr, dma_addr_t dma_addr)
458 dma_addr_t dma_addr)
459{ 481{
482 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
460 pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); 483 pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL);
461 free_pages((unsigned long)cpu_addr, get_order(size)); 484 free_pages((unsigned long)cpu_addr, get_order(size));
462 485
463 DBGA2("pci_free_consistent: [%llx,%zx] from %p\n", 486 DBGA2("pci_free_consistent: [%llx,%zx] from %p\n",
464 dma_addr, size, __builtin_return_address(0)); 487 dma_addr, size, __builtin_return_address(0));
465} 488}
466EXPORT_SYMBOL(pci_free_consistent);
467 489
468/* Classify the elements of the scatterlist. Write dma_address 490/* Classify the elements of the scatterlist. Write dma_address
469 of each element with: 491 of each element with:
@@ -626,23 +648,21 @@ sg_fill(struct device *dev, struct scatterlist *leader, struct scatterlist *end,
626 return 1; 648 return 1;
627} 649}
628 650
629int 651static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg,
630pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, 652 int nents, enum dma_data_direction dir,
631 int direction) 653 struct dma_attrs *attrs)
632{ 654{
655 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
633 struct scatterlist *start, *end, *out; 656 struct scatterlist *start, *end, *out;
634 struct pci_controller *hose; 657 struct pci_controller *hose;
635 struct pci_iommu_arena *arena; 658 struct pci_iommu_arena *arena;
636 dma_addr_t max_dma; 659 dma_addr_t max_dma;
637 int dac_allowed; 660 int dac_allowed;
638 struct device *dev;
639 661
640 if (direction == PCI_DMA_NONE) 662 if (dir == PCI_DMA_NONE)
641 BUG(); 663 BUG();
642 664
643 dac_allowed = pdev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0; 665 dac_allowed = dev ? pci_dac_dma_supported(pdev, pdev->dma_mask) : 0;
644
645 dev = pdev ? &pdev->dev : NULL;
646 666
647 /* Fast path single entry scatterlists. */ 667 /* Fast path single entry scatterlists. */
648 if (nents == 1) { 668 if (nents == 1) {
@@ -699,19 +719,19 @@ pci_map_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
699 /* Some allocation failed while mapping the scatterlist 719 /* Some allocation failed while mapping the scatterlist
700 entries. Unmap them now. */ 720 entries. Unmap them now. */
701 if (out > start) 721 if (out > start)
702 pci_unmap_sg(pdev, start, out - start, direction); 722 pci_unmap_sg(pdev, start, out - start, dir);
703 return 0; 723 return 0;
704} 724}
705EXPORT_SYMBOL(pci_map_sg);
706 725
707/* Unmap a set of streaming mode DMA translations. Again, cpu read 726/* Unmap a set of streaming mode DMA translations. Again, cpu read
708 rules concerning calls here are the same as for pci_unmap_single() 727 rules concerning calls here are the same as for pci_unmap_single()
709 above. */ 728 above. */
710 729
711void 730static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg,
712pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents, 731 int nents, enum dma_data_direction dir,
713 int direction) 732 struct dma_attrs *attrs)
714{ 733{
734 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
715 unsigned long flags; 735 unsigned long flags;
716 struct pci_controller *hose; 736 struct pci_controller *hose;
717 struct pci_iommu_arena *arena; 737 struct pci_iommu_arena *arena;
@@ -719,7 +739,7 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
719 dma_addr_t max_dma; 739 dma_addr_t max_dma;
720 dma_addr_t fbeg, fend; 740 dma_addr_t fbeg, fend;
721 741
722 if (direction == PCI_DMA_NONE) 742 if (dir == PCI_DMA_NONE)
723 BUG(); 743 BUG();
724 744
725 if (! alpha_mv.mv_pci_tbi) 745 if (! alpha_mv.mv_pci_tbi)
@@ -783,15 +803,13 @@ pci_unmap_sg(struct pci_dev *pdev, struct scatterlist *sg, int nents,
783 803
784 DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg)); 804 DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg));
785} 805}
786EXPORT_SYMBOL(pci_unmap_sg);
787
788 806
789/* Return whether the given PCI device DMA address mask can be 807/* Return whether the given PCI device DMA address mask can be
790 supported properly. */ 808 supported properly. */
791 809
792int 810static int alpha_pci_supported(struct device *dev, u64 mask)
793pci_dma_supported(struct pci_dev *pdev, u64 mask)
794{ 811{
812 struct pci_dev *pdev = alpha_gendev_to_pci(dev);
795 struct pci_controller *hose; 813 struct pci_controller *hose;
796 struct pci_iommu_arena *arena; 814 struct pci_iommu_arena *arena;
797 815
@@ -818,7 +836,6 @@ pci_dma_supported(struct pci_dev *pdev, u64 mask)
818 836
819 return 0; 837 return 0;
820} 838}
821EXPORT_SYMBOL(pci_dma_supported);
822 839
823 840
824/* 841/*
@@ -918,66 +935,32 @@ iommu_unbind(struct pci_iommu_arena *arena, long pg_start, long pg_count)
918 return 0; 935 return 0;
919} 936}
920 937
921/* True if the machine supports DAC addressing, and DEV can 938static int alpha_pci_mapping_error(struct device *dev, dma_addr_t dma_addr)
922 make use of it given MASK. */
923
924static int
925pci_dac_dma_supported(struct pci_dev *dev, u64 mask)
926{
927 dma64_addr_t dac_offset = alpha_mv.pci_dac_offset;
928 int ok = 1;
929
930 /* If this is not set, the machine doesn't support DAC at all. */
931 if (dac_offset == 0)
932 ok = 0;
933
934 /* The device has to be able to address our DAC bit. */
935 if ((dac_offset & dev->dma_mask) != dac_offset)
936 ok = 0;
937
938 /* If both conditions above are met, we are fine. */
939 DBGA("pci_dac_dma_supported %s from %p\n",
940 ok ? "yes" : "no", __builtin_return_address(0));
941
942 return ok;
943}
944
945/* Helper for generic DMA-mapping functions. */
946
947struct pci_dev *
948alpha_gendev_to_pci(struct device *dev)
949{ 939{
950 if (dev && dev->bus == &pci_bus_type) 940 return dma_addr == 0;
951 return to_pci_dev(dev);
952
953 /* Assume that non-PCI devices asking for DMA are either ISA or EISA,
954 BUG() otherwise. */
955 BUG_ON(!isa_bridge);
956
957 /* Assume non-busmaster ISA DMA when dma_mask is not set (the ISA
958 bridge is bus master then). */
959 if (!dev || !dev->dma_mask || !*dev->dma_mask)
960 return isa_bridge;
961
962 /* For EISA bus masters, return isa_bridge (it might have smaller
963 dma_mask due to wiring limitations). */
964 if (*dev->dma_mask >= isa_bridge->dma_mask)
965 return isa_bridge;
966
967 /* This assumes ISA bus master with dma_mask 0xffffff. */
968 return NULL;
969} 941}
970EXPORT_SYMBOL(alpha_gendev_to_pci);
971 942
972int 943static int alpha_pci_set_mask(struct device *dev, u64 mask)
973dma_set_mask(struct device *dev, u64 mask)
974{ 944{
975 if (!dev->dma_mask || 945 if (!dev->dma_mask ||
976 !pci_dma_supported(alpha_gendev_to_pci(dev), mask)) 946 !pci_dma_supported(alpha_gendev_to_pci(dev), mask))
977 return -EIO; 947 return -EIO;
978 948
979 *dev->dma_mask = mask; 949 *dev->dma_mask = mask;
980
981 return 0; 950 return 0;
982} 951}
983EXPORT_SYMBOL(dma_set_mask); 952
953struct dma_map_ops alpha_pci_ops = {
954 .alloc_coherent = alpha_pci_alloc_coherent,
955 .free_coherent = alpha_pci_free_coherent,
956 .map_page = alpha_pci_map_page,
957 .unmap_page = alpha_pci_unmap_page,
958 .map_sg = alpha_pci_map_sg,
959 .unmap_sg = alpha_pci_unmap_sg,
960 .mapping_error = alpha_pci_mapping_error,
961 .dma_supported = alpha_pci_supported,
962 .set_dma_mask = alpha_pci_set_mask,
963};
964
965struct dma_map_ops *dma_ops = &alpha_pci_ops;
966EXPORT_SYMBOL(dma_ops);
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index e072041d19f8..9acadc6b16a0 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -249,6 +249,17 @@ ptrace_cancel_bpt(struct task_struct * child)
249 return (nsaved != 0); 249 return (nsaved != 0);
250} 250}
251 251
252void user_enable_single_step(struct task_struct *child)
253{
254 /* Mark single stepping. */
255 task_thread_info(child)->bpt_nsaved = -1;
256}
257
258void user_disable_single_step(struct task_struct *child)
259{
260 ptrace_cancel_bpt(child);
261}
262
252/* 263/*
253 * Called by kernel/ptrace.c when detaching.. 264 * Called by kernel/ptrace.c when detaching..
254 * 265 *
@@ -256,7 +267,7 @@ ptrace_cancel_bpt(struct task_struct * child)
256 */ 267 */
257void ptrace_disable(struct task_struct *child) 268void ptrace_disable(struct task_struct *child)
258{ 269{
259 ptrace_cancel_bpt(child); 270 user_disable_single_step(child);
260} 271}
261 272
262long arch_ptrace(struct task_struct *child, long request, long addr, long data) 273long arch_ptrace(struct task_struct *child, long request, long addr, long data)
@@ -295,52 +306,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
295 DBG(DBG_MEM, ("poke $%ld<-%#lx\n", addr, data)); 306 DBG(DBG_MEM, ("poke $%ld<-%#lx\n", addr, data));
296 ret = put_reg(child, addr, data); 307 ret = put_reg(child, addr, data);
297 break; 308 break;
298
299 case PTRACE_SYSCALL:
300 /* continue and stop at next (return from) syscall */
301 case PTRACE_CONT: /* restart after signal. */
302 ret = -EIO;
303 if (!valid_signal(data))
304 break;
305 if (request == PTRACE_SYSCALL)
306 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
307 else
308 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
309 child->exit_code = data;
310 /* make sure single-step breakpoint is gone. */
311 ptrace_cancel_bpt(child);
312 wake_up_process(child);
313 ret = 0;
314 break;
315
316 /*
317 * Make the child exit. Best I can do is send it a sigkill.
318 * perhaps it should be put in the status that it wants to
319 * exit.
320 */
321 case PTRACE_KILL:
322 ret = 0;
323 if (child->exit_state == EXIT_ZOMBIE)
324 break;
325 child->exit_code = SIGKILL;
326 /* make sure single-step breakpoint is gone. */
327 ptrace_cancel_bpt(child);
328 wake_up_process(child);
329 break;
330
331 case PTRACE_SINGLESTEP: /* execute single instruction. */
332 ret = -EIO;
333 if (!valid_signal(data))
334 break;
335 /* Mark single stepping. */
336 task_thread_info(child)->bpt_nsaved = -1;
337 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
338 child->exit_code = data;
339 wake_up_process(child);
340 /* give it a chance to run. */
341 ret = 0;
342 break;
343
344 default: 309 default:
345 ret = ptrace_request(child, request, addr, data); 310 ret = ptrace_request(child, request, addr, data);
346 break; 311 break;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3b181284970f..cadfe2ee66a5 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -155,6 +155,9 @@ config ARCH_MAY_HAVE_PC_FDC
155config ZONE_DMA 155config ZONE_DMA
156 bool 156 bool
157 157
158config NEED_DMA_MAP_STATE
159 def_bool y
160
158config GENERIC_ISA_DMA 161config GENERIC_ISA_DMA
159 bool 162 bool
160 163
@@ -321,10 +324,9 @@ config ARCH_MXC
321 bool "Freescale MXC/iMX-based" 324 bool "Freescale MXC/iMX-based"
322 select GENERIC_TIME 325 select GENERIC_TIME
323 select GENERIC_CLOCKEVENTS 326 select GENERIC_CLOCKEVENTS
324 select ARCH_MTD_XIP
325 select GENERIC_GPIO
326 select ARCH_REQUIRE_GPIOLIB 327 select ARCH_REQUIRE_GPIOLIB
327 select HAVE_CLK 328 select HAVE_CLK
329 select COMMON_CLKDEV
328 help 330 help
329 Support for Freescale MXC/iMX-based family of processors 331 Support for Freescale MXC/iMX-based family of processors
330 332
@@ -508,7 +510,7 @@ config ARCH_ORION5X
508 Orion-2 (5281), Orion-1-90 (6183). 510 Orion-2 (5281), Orion-1-90 (6183).
509 511
510config ARCH_MMP 512config ARCH_MMP
511 bool "Marvell PXA168/910" 513 bool "Marvell PXA168/910/MMP2"
512 depends on MMU 514 depends on MMU
513 select GENERIC_GPIO 515 select GENERIC_GPIO
514 select ARCH_REQUIRE_GPIOLIB 516 select ARCH_REQUIRE_GPIOLIB
@@ -519,7 +521,7 @@ config ARCH_MMP
519 select TICK_ONESHOT 521 select TICK_ONESHOT
520 select PLAT_PXA 522 select PLAT_PXA
521 help 523 help
522 Support for Marvell's PXA168/910 processor line. 524 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
523 525
524config ARCH_KS8695 526config ARCH_KS8695
525 bool "Micrel/Kendin KS8695" 527 bool "Micrel/Kendin KS8695"
@@ -605,6 +607,11 @@ config ARCH_MSM
605 interface to the ARM9 modem processor which runs the baseband stack 607 interface to the ARM9 modem processor which runs the baseband stack
606 and controls some vital subsystems (clock and power control, etc). 608 and controls some vital subsystems (clock and power control, etc).
607 609
610config ARCH_SHMOBILE
611 bool "Renesas SH-Mobile"
612 help
613 Support for Renesas's SH-Mobile ARM platforms
614
608config ARCH_RPC 615config ARCH_RPC
609 bool "RiscPC" 616 bool "RiscPC"
610 select ARCH_ACORN 617 select ARCH_ACORN
@@ -648,12 +655,43 @@ config ARCH_S3C2410
648 655
649config ARCH_S3C64XX 656config ARCH_S3C64XX
650 bool "Samsung S3C64XX" 657 bool "Samsung S3C64XX"
658 select PLAT_SAMSUNG
659 select CPU_V6
651 select GENERIC_GPIO 660 select GENERIC_GPIO
661 select ARM_VIC
652 select HAVE_CLK 662 select HAVE_CLK
663 select NO_IOPORT
653 select ARCH_HAS_CPUFREQ 664 select ARCH_HAS_CPUFREQ
665 select ARCH_REQUIRE_GPIOLIB
666 select SAMSUNG_CLKSRC
667 select SAMSUNG_IRQ_VIC_TIMER
668 select SAMSUNG_IRQ_UART
669 select S3C_GPIO_TRACK
670 select S3C_GPIO_PULL_UPDOWN
671 select S3C_GPIO_CFG_S3C24XX
672 select S3C_GPIO_CFG_S3C64XX
673 select S3C_DEV_NAND
674 select USB_ARCH_HAS_OHCI
675 select SAMSUNG_GPIOLIB_4BIT
654 help 676 help
655 Samsung S3C64XX series based systems 677 Samsung S3C64XX series based systems
656 678
679config ARCH_S5P6440
680 bool "Samsung S5P6440"
681 select CPU_V6
682 select GENERIC_GPIO
683 select HAVE_CLK
684 help
685 Samsung S5P6440 CPU based systems
686
687config ARCH_S5P6442
688 bool "Samsung S5P6442"
689 select CPU_V6
690 select GENERIC_GPIO
691 select HAVE_CLK
692 help
693 Samsung S5P6442 CPU based systems
694
657config ARCH_S5PC1XX 695config ARCH_S5PC1XX
658 bool "Samsung S5PC1XX" 696 bool "Samsung S5PC1XX"
659 select GENERIC_GPIO 697 select GENERIC_GPIO
@@ -663,6 +701,15 @@ config ARCH_S5PC1XX
663 help 701 help
664 Samsung S5PC1XX series based systems 702 Samsung S5PC1XX series based systems
665 703
704config ARCH_S5PV210
705 bool "Samsung S5PV210/S5PC110"
706 select CPU_V7
707 select GENERIC_GPIO
708 select HAVE_CLK
709 select ARM_L1_CACHE_SHIFT_6
710 help
711 Samsung S5PV210/S5PC110 series based systems
712
666config ARCH_SHARK 713config ARCH_SHARK
667 bool "Shark" 714 bool "Shark"
668 select CPU_SA110 715 select CPU_SA110
@@ -828,8 +875,7 @@ source "arch/arm/mach-sa1100/Kconfig"
828 875
829source "arch/arm/plat-samsung/Kconfig" 876source "arch/arm/plat-samsung/Kconfig"
830source "arch/arm/plat-s3c24xx/Kconfig" 877source "arch/arm/plat-s3c24xx/Kconfig"
831source "arch/arm/plat-s3c64xx/Kconfig" 878source "arch/arm/plat-s5p/Kconfig"
832source "arch/arm/plat-s3c/Kconfig"
833source "arch/arm/plat-s5pc1xx/Kconfig" 879source "arch/arm/plat-s5pc1xx/Kconfig"
834 880
835if ARCH_S3C2410 881if ARCH_S3C2410
@@ -837,21 +883,27 @@ source "arch/arm/mach-s3c2400/Kconfig"
837source "arch/arm/mach-s3c2410/Kconfig" 883source "arch/arm/mach-s3c2410/Kconfig"
838source "arch/arm/mach-s3c2412/Kconfig" 884source "arch/arm/mach-s3c2412/Kconfig"
839source "arch/arm/mach-s3c2440/Kconfig" 885source "arch/arm/mach-s3c2440/Kconfig"
840source "arch/arm/mach-s3c2442/Kconfig"
841source "arch/arm/mach-s3c2443/Kconfig" 886source "arch/arm/mach-s3c2443/Kconfig"
842endif 887endif
843 888
844if ARCH_S3C64XX 889if ARCH_S3C64XX
845source "arch/arm/mach-s3c6400/Kconfig" 890source "arch/arm/mach-s3c64xx/Kconfig"
846source "arch/arm/mach-s3c6410/Kconfig"
847endif 891endif
848 892
849source "arch/arm/plat-stmp3xxx/Kconfig" 893source "arch/arm/mach-s5p6440/Kconfig"
894
895source "arch/arm/mach-s5p6442/Kconfig"
850 896
851if ARCH_S5PC1XX 897if ARCH_S5PC1XX
852source "arch/arm/mach-s5pc100/Kconfig" 898source "arch/arm/mach-s5pc100/Kconfig"
853endif 899endif
854 900
901source "arch/arm/mach-s5pv210/Kconfig"
902
903source "arch/arm/mach-shmobile/Kconfig"
904
905source "arch/arm/plat-stmp3xxx/Kconfig"
906
855source "arch/arm/mach-u300/Kconfig" 907source "arch/arm/mach-u300/Kconfig"
856 908
857source "arch/arm/mach-ux500/Kconfig" 909source "arch/arm/mach-ux500/Kconfig"
@@ -1117,7 +1169,7 @@ source kernel/Kconfig.preempt
1117config HZ 1169config HZ
1118 int 1170 int
1119 default 128 if ARCH_L7200 1171 default 128 if ARCH_L7200
1120 default 200 if ARCH_EBSA110 || ARCH_S3C2410 1172 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210
1121 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER 1173 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
1122 default AT91_TIMER_HZ if ARCH_AT91 1174 default AT91_TIMER_HZ if ARCH_AT91
1123 default 100 1175 default 100
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 5cb9326df7a7..91344af75f39 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -117,7 +117,7 @@ config DEBUG_CLPS711X_UART2
117 cause the debug messages to appear on the first serial port. 117 cause the debug messages to appear on the first serial port.
118 118
119config DEBUG_S3C_UART 119config DEBUG_S3C_UART
120 depends on PLAT_S3C 120 depends on PLAT_SAMSUNG
121 int "S3C UART to use for low-level debug" 121 int "S3C UART to use for low-level debug"
122 default "0" 122 default "0"
123 help 123 help
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 81f54ca30788..ed820e737a8a 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -146,6 +146,7 @@ machine-$(CONFIG_ARCH_MX1) := mx1
146machine-$(CONFIG_ARCH_MX2) := mx2 146machine-$(CONFIG_ARCH_MX2) := mx2
147machine-$(CONFIG_ARCH_MX25) := mx25 147machine-$(CONFIG_ARCH_MX25) := mx25
148machine-$(CONFIG_ARCH_MX3) := mx3 148machine-$(CONFIG_ARCH_MX3) := mx3
149machine-$(CONFIG_ARCH_MX5) := mx5
149machine-$(CONFIG_ARCH_MXC91231) := mxc91231 150machine-$(CONFIG_ARCH_MXC91231) := mxc91231
150machine-$(CONFIG_ARCH_NETX) := netx 151machine-$(CONFIG_ARCH_NETX) := netx
151machine-$(CONFIG_ARCH_NOMADIK) := nomadik 152machine-$(CONFIG_ARCH_NOMADIK) := nomadik
@@ -159,12 +160,16 @@ machine-$(CONFIG_ARCH_PNX4008) := pnx4008
159machine-$(CONFIG_ARCH_PXA) := pxa 160machine-$(CONFIG_ARCH_PXA) := pxa
160machine-$(CONFIG_ARCH_REALVIEW) := realview 161machine-$(CONFIG_ARCH_REALVIEW) := realview
161machine-$(CONFIG_ARCH_RPC) := rpc 162machine-$(CONFIG_ARCH_RPC) := rpc
162machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 163machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2443
163machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 164machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
164machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 165machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
166machine-$(CONFIG_ARCH_S5P6440) := s5p6440
167machine-$(CONFIG_ARCH_S5P6442) := s5p6442
165machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100 168machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
169machine-$(CONFIG_ARCH_S5PV210) := s5pv210
166machine-$(CONFIG_ARCH_SA1100) := sa1100 170machine-$(CONFIG_ARCH_SA1100) := sa1100
167machine-$(CONFIG_ARCH_SHARK) := shark 171machine-$(CONFIG_ARCH_SHARK) := shark
172machine-$(CONFIG_ARCH_SHMOBILE) := shmobile
168machine-$(CONFIG_ARCH_STMP378X) := stmp378x 173machine-$(CONFIG_ARCH_STMP378X) := stmp378x
169machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx 174machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
170machine-$(CONFIG_ARCH_U300) := u300 175machine-$(CONFIG_ARCH_U300) := u300
@@ -178,14 +183,15 @@ machine-$(CONFIG_FOOTBRIDGE) := footbridge
178# by CONFIG_* macro name. 183# by CONFIG_* macro name.
179plat-$(CONFIG_ARCH_MXC) := mxc 184plat-$(CONFIG_ARCH_MXC) := mxc
180plat-$(CONFIG_ARCH_OMAP) := omap 185plat-$(CONFIG_ARCH_OMAP) := omap
186plat-$(CONFIG_ARCH_S3C64XX) := samsung
181plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx 187plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
182plat-$(CONFIG_PLAT_IOP) := iop 188plat-$(CONFIG_PLAT_IOP) := iop
183plat-$(CONFIG_PLAT_NOMADIK) := nomadik 189plat-$(CONFIG_PLAT_NOMADIK) := nomadik
184plat-$(CONFIG_PLAT_ORION) := orion 190plat-$(CONFIG_PLAT_ORION) := orion
185plat-$(CONFIG_PLAT_PXA) := pxa 191plat-$(CONFIG_PLAT_PXA) := pxa
186plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx s3c samsung 192plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung
187plat-$(CONFIG_PLAT_S3C64XX) := s3c64xx s3c samsung 193plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung
188plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx s3c samsung 194plat-$(CONFIG_PLAT_S5P) := s5p samsung
189 195
190ifeq ($(CONFIG_ARCH_EBSA110),y) 196ifeq ($(CONFIG_ARCH_EBSA110),y)
191# This is what happens if you forget the IOCS16 line. 197# This is what happens if you forget the IOCS16 line.
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S
index df7bc7068d0f..8b0de41c3dcb 100644
--- a/arch/arm/boot/bootp/init.S
+++ b/arch/arm/boot/bootp/init.S
@@ -49,7 +49,7 @@ _start: add lr, pc, #-0x8 @ lr = current load addr
49/* 49/*
50 * find the end of the tag list, and then add an INITRD tag on the end. 50 * find the end of the tag list, and then add an INITRD tag on the end.
51 * If there is already an INITRD tag, then we ignore it; the last INITRD 51 * If there is already an INITRD tag, then we ignore it; the last INITRD
52 * tag takes precidence. 52 * tag takes precedence.
53 */ 53 */
54taglist: ldr r10, [r9, #0] @ tag length 54taglist: ldr r10, [r9, #0] @ tag length
55 teq r10, #0 @ last tag (zero length)? 55 teq r10, #0 @ last tag (zero length)?
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 99b75aa1c2ec..535a91daaa53 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -170,8 +170,8 @@ not_angel:
170 170
171 .text 171 .text
172 adr r0, LC0 172 adr r0, LC0
173 ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, ip, sp} ) 173 ARM( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip, sp})
174 THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, ip} ) 174 THUMB( ldmia r0, {r1, r2, r3, r4, r5, r6, r11, ip} )
175 THUMB( ldr sp, [r0, #28] ) 175 THUMB( ldr sp, [r0, #28] )
176 subs r0, r0, r1 @ calculate the delta offset 176 subs r0, r0, r1 @ calculate the delta offset
177 177
@@ -182,12 +182,13 @@ not_angel:
182 /* 182 /*
183 * We're running at a different address. We need to fix 183 * We're running at a different address. We need to fix
184 * up various pointers: 184 * up various pointers:
185 * r5 - zImage base address 185 * r5 - zImage base address (_start)
186 * r6 - GOT start 186 * r6 - size of decompressed image
187 * r11 - GOT start
187 * ip - GOT end 188 * ip - GOT end
188 */ 189 */
189 add r5, r5, r0 190 add r5, r5, r0
190 add r6, r6, r0 191 add r11, r11, r0
191 add ip, ip, r0 192 add ip, ip, r0
192 193
193#ifndef CONFIG_ZBOOT_ROM 194#ifndef CONFIG_ZBOOT_ROM
@@ -205,10 +206,10 @@ not_angel:
205 /* 206 /*
206 * Relocate all entries in the GOT table. 207 * Relocate all entries in the GOT table.
207 */ 208 */
2081: ldr r1, [r6, #0] @ relocate entries in the GOT 2091: ldr r1, [r11, #0] @ relocate entries in the GOT
209 add r1, r1, r0 @ table. This fixes up the 210 add r1, r1, r0 @ table. This fixes up the
210 str r1, [r6], #4 @ C references. 211 str r1, [r11], #4 @ C references.
211 cmp r6, ip 212 cmp r11, ip
212 blo 1b 213 blo 1b
213#else 214#else
214 215
@@ -216,12 +217,12 @@ not_angel:
216 * Relocate entries in the GOT table. We only relocate 217 * Relocate entries in the GOT table. We only relocate
217 * the entries that are outside the (relocated) BSS region. 218 * the entries that are outside the (relocated) BSS region.
218 */ 219 */
2191: ldr r1, [r6, #0] @ relocate entries in the GOT 2201: ldr r1, [r11, #0] @ relocate entries in the GOT
220 cmp r1, r2 @ entry < bss_start || 221 cmp r1, r2 @ entry < bss_start ||
221 cmphs r3, r1 @ _end < entry 222 cmphs r3, r1 @ _end < entry
222 addlo r1, r1, r0 @ table. This fixes up the 223 addlo r1, r1, r0 @ table. This fixes up the
223 str r1, [r6], #4 @ C references. 224 str r1, [r11], #4 @ C references.
224 cmp r6, ip 225 cmp r11, ip
225 blo 1b 226 blo 1b
226#endif 227#endif
227 228
@@ -247,6 +248,7 @@ not_relocated: mov r0, #0
247 * Check to see if we will overwrite ourselves. 248 * Check to see if we will overwrite ourselves.
248 * r4 = final kernel address 249 * r4 = final kernel address
249 * r5 = start of this image 250 * r5 = start of this image
251 * r6 = size of decompressed image
250 * r2 = end of malloc space (and therefore this image) 252 * r2 = end of malloc space (and therefore this image)
251 * We basically want: 253 * We basically want:
252 * r4 >= r2 -> OK 254 * r4 >= r2 -> OK
@@ -254,8 +256,7 @@ not_relocated: mov r0, #0
254 */ 256 */
255 cmp r4, r2 257 cmp r4, r2
256 bhs wont_overwrite 258 bhs wont_overwrite
257 sub r3, sp, r5 @ > compressed kernel size 259 add r0, r4, r6
258 add r0, r4, r3, lsl #2 @ allow for 4x expansion
259 cmp r0, r5 260 cmp r0, r5
260 bls wont_overwrite 261 bls wont_overwrite
261 262
@@ -271,7 +272,6 @@ not_relocated: mov r0, #0
271 * r1-r3 = unused 272 * r1-r3 = unused
272 * r4 = kernel execution address 273 * r4 = kernel execution address
273 * r5 = decompressed kernel start 274 * r5 = decompressed kernel start
274 * r6 = processor ID
275 * r7 = architecture ID 275 * r7 = architecture ID
276 * r8 = atags pointer 276 * r8 = atags pointer
277 * r9-r12,r14 = corrupted 277 * r9-r12,r14 = corrupted
@@ -312,7 +312,8 @@ LC0: .word LC0 @ r1
312 .word _end @ r3 312 .word _end @ r3
313 .word zreladdr @ r4 313 .word zreladdr @ r4
314 .word _start @ r5 314 .word _start @ r5
315 .word _got_start @ r6 315 .word _image_size @ r6
316 .word _got_start @ r11
316 .word _got_end @ ip 317 .word _got_end @ ip
317 .word user_stack+4096 @ sp 318 .word user_stack+4096 @ sp
318LC1: .word reloc_end - reloc_start 319LC1: .word reloc_end - reloc_start
@@ -336,7 +337,6 @@ params: ldr r0, =params_phys
336 * 337 *
337 * On entry, 338 * On entry,
338 * r4 = kernel execution address 339 * r4 = kernel execution address
339 * r6 = processor ID
340 * r7 = architecture number 340 * r7 = architecture number
341 * r8 = atags pointer 341 * r8 = atags pointer
342 * r9 = run-time address of "start" (???) 342 * r9 = run-time address of "start" (???)
@@ -542,7 +542,6 @@ __common_mmu_cache_on:
542 * r1-r3 = unused 542 * r1-r3 = unused
543 * r4 = kernel execution address 543 * r4 = kernel execution address
544 * r5 = decompressed kernel start 544 * r5 = decompressed kernel start
545 * r6 = processor ID
546 * r7 = architecture ID 545 * r7 = architecture ID
547 * r8 = atags pointer 546 * r8 = atags pointer
548 * r9-r12,r14 = corrupted 547 * r9-r12,r14 = corrupted
@@ -581,19 +580,19 @@ call_kernel: bl cache_clean_flush
581 * r1 = corrupted 580 * r1 = corrupted
582 * r2 = corrupted 581 * r2 = corrupted
583 * r3 = block offset 582 * r3 = block offset
584 * r6 = corrupted 583 * r9 = corrupted
585 * r12 = corrupted 584 * r12 = corrupted
586 */ 585 */
587 586
588call_cache_fn: adr r12, proc_types 587call_cache_fn: adr r12, proc_types
589#ifdef CONFIG_CPU_CP15 588#ifdef CONFIG_CPU_CP15
590 mrc p15, 0, r6, c0, c0 @ get processor ID 589 mrc p15, 0, r9, c0, c0 @ get processor ID
591#else 590#else
592 ldr r6, =CONFIG_PROCESSOR_ID 591 ldr r9, =CONFIG_PROCESSOR_ID
593#endif 592#endif
5941: ldr r1, [r12, #0] @ get value 5931: ldr r1, [r12, #0] @ get value
595 ldr r2, [r12, #4] @ get mask 594 ldr r2, [r12, #4] @ get mask
596 eor r1, r1, r6 @ (real ^ match) 595 eor r1, r1, r9 @ (real ^ match)
597 tst r1, r2 @ & mask 596 tst r1, r2 @ & mask
598 ARM( addeq pc, r12, r3 ) @ call cache function 597 ARM( addeq pc, r12, r3 ) @ call cache function
599 THUMB( addeq r12, r3 ) 598 THUMB( addeq r12, r3 )
@@ -778,8 +777,7 @@ proc_types:
778 * Turn off the Cache and MMU. ARMv3 does not support 777 * Turn off the Cache and MMU. ARMv3 does not support
779 * reading the control register, but ARMv4 does. 778 * reading the control register, but ARMv4 does.
780 * 779 *
781 * On entry, r6 = processor ID 780 * On exit, r0, r1, r2, r3, r9, r12 corrupted
782 * On exit, r0, r1, r2, r3, r12 corrupted
783 * This routine must preserve: r4, r6, r7 781 * This routine must preserve: r4, r6, r7
784 */ 782 */
785 .align 5 783 .align 5
@@ -852,10 +850,8 @@ __armv3_mmu_cache_off:
852/* 850/*
853 * Clean and flush the cache to maintain consistency. 851 * Clean and flush the cache to maintain consistency.
854 * 852 *
855 * On entry,
856 * r6 = processor ID
857 * On exit, 853 * On exit,
858 * r1, r2, r3, r11, r12 corrupted 854 * r1, r2, r3, r9, r11, r12 corrupted
859 * This routine must preserve: 855 * This routine must preserve:
860 * r0, r4, r5, r6, r7 856 * r0, r4, r5, r6, r7
861 */ 857 */
@@ -967,7 +963,7 @@ __armv4_mmu_cache_flush:
967 mov r2, #64*1024 @ default: 32K dcache size (*2) 963 mov r2, #64*1024 @ default: 32K dcache size (*2)
968 mov r11, #32 @ default: 32 byte line size 964 mov r11, #32 @ default: 32 byte line size
969 mrc p15, 0, r3, c0, c0, 1 @ read cache type 965 mrc p15, 0, r3, c0, c0, 1 @ read cache type
970 teq r3, r6 @ cache ID register present? 966 teq r3, r9 @ cache ID register present?
971 beq no_cache_id 967 beq no_cache_id
972 mov r1, r3, lsr #18 968 mov r1, r3, lsr #18
973 and r1, r1, #7 969 and r1, r1, #7
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in
index 7ca9ecff652f..d08168941bd6 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.in
+++ b/arch/arm/boot/compressed/vmlinux.lds.in
@@ -43,6 +43,9 @@ SECTIONS
43 43
44 _etext = .; 44 _etext = .;
45 45
46 /* Assume size of decompressed image is 4x the compressed image */
47 _image_size = (_etext - _text) * 4;
48
46 _got_start = .; 49 _got_start = .;
47 .got : { *(.got) } 50 .got : { *(.got) }
48 _got_end = .; 51 _got_end = .;
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c
index 446b696196e3..6416d5b5020d 100644
--- a/arch/arm/common/clkdev.c
+++ b/arch/arm/common/clkdev.c
@@ -32,7 +32,7 @@ static DEFINE_MUTEX(clocks_mutex);
32 * If an entry has a device ID, it must match 32 * If an entry has a device ID, it must match
33 * If an entry has a connection ID, it must match 33 * If an entry has a connection ID, it must match
34 * Then we take the most specific entry - with the following 34 * Then we take the most specific entry - with the following
35 * order of precidence: dev+con > dev only > con only. 35 * order of precedence: dev+con > dev only > con only.
36 */ 36 */
37static struct clk *clk_find(const char *dev_id, const char *con_id) 37static struct clk *clk_find(const char *dev_id, const char *con_id)
38{ 38{
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index 2793447621c3..ee1d3b85eb65 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -272,33 +272,6 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
272 ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); 272 ((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
273} 273}
274 274
275/*
276 * We override these so we properly do dmabounce otherwise drivers
277 * are able to set the dma_mask to 0xffffffff and we can no longer
278 * trap bounces. :(
279 *
280 * We just return true on everyhing except for < 64MB in which case
281 * we will fail miseralby and die since we can't handle that case.
282 */
283int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
284{
285 dev_dbg(&dev->dev, "%s: %llx\n", __func__, mask);
286 if (mask >= PHYS_OFFSET + SZ_64M - 1)
287 return 0;
288
289 return -EIO;
290}
291
292int
293pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
294{
295 dev_dbg(&dev->dev, "%s: %llx\n", __func__, mask);
296 if (mask >= PHYS_OFFSET + SZ_64M - 1)
297 return 0;
298
299 return -EIO;
300}
301
302int __init it8152_pci_setup(int nr, struct pci_sys_data *sys) 275int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
303{ 276{
304 it8152_io.start = IT8152_IO_BASE + 0x12000; 277 it8152_io.start = IT8152_IO_BASE + 0x12000;
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index bd36c778c819..90ae00b631c2 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -32,6 +32,12 @@
32 32
33#include <asm/hardware/locomo.h> 33#include <asm/hardware/locomo.h>
34 34
35/* LoCoMo Interrupts */
36#define IRQ_LOCOMO_KEY (0)
37#define IRQ_LOCOMO_GPIO (1)
38#define IRQ_LOCOMO_LT (2)
39#define IRQ_LOCOMO_SPI (3)
40
35/* M62332 output channel selection */ 41/* M62332 output channel selection */
36#define M62332_EVR_CH 1 /* M62332 volume channel number */ 42#define M62332_EVR_CH 1 /* M62332 volume channel number */
37 /* 0 : CH.1 , 1 : CH. 2 */ 43 /* 0 : CH.1 , 1 : CH. 2 */
@@ -58,6 +64,7 @@ struct locomo {
58 struct device *dev; 64 struct device *dev;
59 unsigned long phys; 65 unsigned long phys;
60 unsigned int irq; 66 unsigned int irq;
67 int irq_base;
61 spinlock_t lock; 68 spinlock_t lock;
62 void __iomem *base; 69 void __iomem *base;
63#ifdef CONFIG_PM 70#ifdef CONFIG_PM
@@ -81,9 +88,7 @@ struct locomo_dev_info {
81static struct locomo_dev_info locomo_devices[] = { 88static struct locomo_dev_info locomo_devices[] = {
82 { 89 {
83 .devid = LOCOMO_DEVID_KEYBOARD, 90 .devid = LOCOMO_DEVID_KEYBOARD,
84 .irq = { 91 .irq = { IRQ_LOCOMO_KEY },
85 IRQ_LOCOMO_KEY,
86 },
87 .name = "locomo-keyboard", 92 .name = "locomo-keyboard",
88 .offset = LOCOMO_KEYBOARD, 93 .offset = LOCOMO_KEYBOARD,
89 .length = 16, 94 .length = 16,
@@ -133,53 +138,20 @@ static struct locomo_dev_info locomo_devices[] = {
133 }, 138 },
134}; 139};
135 140
136
137/** LoCoMo interrupt handling stuff.
138 * NOTE: LoCoMo has a 1 to many mapping on all of its IRQs.
139 * that is, there is only one real hardware interrupt
140 * we determine which interrupt it is by reading some IO memory.
141 * We have two levels of expansion, first in the handler for the
142 * hardware interrupt we generate an interrupt
143 * IRQ_LOCOMO_*_BASE and those handlers generate more interrupts
144 *
145 * hardware irq reads LOCOMO_ICR & 0x0f00
146 * IRQ_LOCOMO_KEY_BASE
147 * IRQ_LOCOMO_GPIO_BASE
148 * IRQ_LOCOMO_LT_BASE
149 * IRQ_LOCOMO_SPI_BASE
150 * IRQ_LOCOMO_KEY_BASE reads LOCOMO_KIC & 0x0001
151 * IRQ_LOCOMO_KEY
152 * IRQ_LOCOMO_GPIO_BASE reads LOCOMO_GIR & LOCOMO_GPD & 0xffff
153 * IRQ_LOCOMO_GPIO[0-15]
154 * IRQ_LOCOMO_LT_BASE reads LOCOMO_LTINT & 0x0001
155 * IRQ_LOCOMO_LT
156 * IRQ_LOCOMO_SPI_BASE reads LOCOMO_SPIIR & 0x000F
157 * IRQ_LOCOMO_SPI_RFR
158 * IRQ_LOCOMO_SPI_RFW
159 * IRQ_LOCOMO_SPI_OVRN
160 * IRQ_LOCOMO_SPI_TEND
161 */
162
163#define LOCOMO_IRQ_START (IRQ_LOCOMO_KEY_BASE)
164#define LOCOMO_IRQ_KEY_START (IRQ_LOCOMO_KEY)
165#define LOCOMO_IRQ_GPIO_START (IRQ_LOCOMO_GPIO0)
166#define LOCOMO_IRQ_LT_START (IRQ_LOCOMO_LT)
167#define LOCOMO_IRQ_SPI_START (IRQ_LOCOMO_SPI_RFR)
168
169static void locomo_handler(unsigned int irq, struct irq_desc *desc) 141static void locomo_handler(unsigned int irq, struct irq_desc *desc)
170{ 142{
143 struct locomo *lchip = get_irq_chip_data(irq);
171 int req, i; 144 int req, i;
172 void __iomem *mapbase = get_irq_chip_data(irq);
173 145
174 /* Acknowledge the parent IRQ */ 146 /* Acknowledge the parent IRQ */
175 desc->chip->ack(irq); 147 desc->chip->ack(irq);
176 148
177 /* check why this interrupt was generated */ 149 /* check why this interrupt was generated */
178 req = locomo_readl(mapbase + LOCOMO_ICR) & 0x0f00; 150 req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00;
179 151
180 if (req) { 152 if (req) {
181 /* generate the next interrupt(s) */ 153 /* generate the next interrupt(s) */
182 irq = LOCOMO_IRQ_START; 154 irq = lchip->irq_base;
183 for (i = 0; i <= 3; i++, irq++) { 155 for (i = 0; i <= 3; i++, irq++) {
184 if (req & (0x0100 << i)) { 156 if (req & (0x0100 << i)) {
185 generic_handle_irq(irq); 157 generic_handle_irq(irq);
@@ -195,20 +167,20 @@ static void locomo_ack_irq(unsigned int irq)
195 167
196static void locomo_mask_irq(unsigned int irq) 168static void locomo_mask_irq(unsigned int irq)
197{ 169{
198 void __iomem *mapbase = get_irq_chip_data(irq); 170 struct locomo *lchip = get_irq_chip_data(irq);
199 unsigned int r; 171 unsigned int r;
200 r = locomo_readl(mapbase + LOCOMO_ICR); 172 r = locomo_readl(lchip->base + LOCOMO_ICR);
201 r &= ~(0x0010 << (irq - LOCOMO_IRQ_START)); 173 r &= ~(0x0010 << (irq - lchip->irq_base));
202 locomo_writel(r, mapbase + LOCOMO_ICR); 174 locomo_writel(r, lchip->base + LOCOMO_ICR);
203} 175}
204 176
205static void locomo_unmask_irq(unsigned int irq) 177static void locomo_unmask_irq(unsigned int irq)
206{ 178{
207 void __iomem *mapbase = get_irq_chip_data(irq); 179 struct locomo *lchip = get_irq_chip_data(irq);
208 unsigned int r; 180 unsigned int r;
209 r = locomo_readl(mapbase + LOCOMO_ICR); 181 r = locomo_readl(lchip->base + LOCOMO_ICR);
210 r |= (0x0010 << (irq - LOCOMO_IRQ_START)); 182 r |= (0x0010 << (irq - lchip->irq_base));
211 locomo_writel(r, mapbase + LOCOMO_ICR); 183 locomo_writel(r, lchip->base + LOCOMO_ICR);
212} 184}
213 185
214static struct irq_chip locomo_chip = { 186static struct irq_chip locomo_chip = {
@@ -218,297 +190,22 @@ static struct irq_chip locomo_chip = {
218 .unmask = locomo_unmask_irq, 190 .unmask = locomo_unmask_irq,
219}; 191};
220 192
221static void locomo_key_handler(unsigned int irq, struct irq_desc *desc)
222{
223 void __iomem *mapbase = get_irq_chip_data(irq);
224
225 if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) {
226 generic_handle_irq(LOCOMO_IRQ_KEY_START);
227 }
228}
229
230static void locomo_key_ack_irq(unsigned int irq)
231{
232 void __iomem *mapbase = get_irq_chip_data(irq);
233 unsigned int r;
234 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
235 r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START));
236 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
237}
238
239static void locomo_key_mask_irq(unsigned int irq)
240{
241 void __iomem *mapbase = get_irq_chip_data(irq);
242 unsigned int r;
243 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
244 r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START));
245 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
246}
247
248static void locomo_key_unmask_irq(unsigned int irq)
249{
250 void __iomem *mapbase = get_irq_chip_data(irq);
251 unsigned int r;
252 r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
253 r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START));
254 locomo_writel(r, mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC);
255}
256
257static struct irq_chip locomo_key_chip = {
258 .name = "LOCOMO-key",
259 .ack = locomo_key_ack_irq,
260 .mask = locomo_key_mask_irq,
261 .unmask = locomo_key_unmask_irq,
262};
263
264static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc)
265{
266 int req, i;
267 void __iomem *mapbase = get_irq_chip_data(irq);
268
269 req = locomo_readl(mapbase + LOCOMO_GIR) &
270 locomo_readl(mapbase + LOCOMO_GPD) &
271 0xffff;
272
273 if (req) {
274 irq = LOCOMO_IRQ_GPIO_START;
275 for (i = 0; i <= 15; i++, irq++) {
276 if (req & (0x0001 << i)) {
277 generic_handle_irq(irq);
278 }
279 }
280 }
281}
282
283static void locomo_gpio_ack_irq(unsigned int irq)
284{
285 void __iomem *mapbase = get_irq_chip_data(irq);
286 unsigned int r;
287 r = locomo_readl(mapbase + LOCOMO_GWE);
288 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
289 locomo_writel(r, mapbase + LOCOMO_GWE);
290
291 r = locomo_readl(mapbase + LOCOMO_GIS);
292 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
293 locomo_writel(r, mapbase + LOCOMO_GIS);
294
295 r = locomo_readl(mapbase + LOCOMO_GWE);
296 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
297 locomo_writel(r, mapbase + LOCOMO_GWE);
298}
299
300static void locomo_gpio_mask_irq(unsigned int irq)
301{
302 void __iomem *mapbase = get_irq_chip_data(irq);
303 unsigned int r;
304 r = locomo_readl(mapbase + LOCOMO_GIE);
305 r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
306 locomo_writel(r, mapbase + LOCOMO_GIE);
307}
308
309static void locomo_gpio_unmask_irq(unsigned int irq)
310{
311 void __iomem *mapbase = get_irq_chip_data(irq);
312 unsigned int r;
313 r = locomo_readl(mapbase + LOCOMO_GIE);
314 r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START));
315 locomo_writel(r, mapbase + LOCOMO_GIE);
316}
317
318static int GPIO_IRQ_rising_edge;
319static int GPIO_IRQ_falling_edge;
320
321static int locomo_gpio_type(unsigned int irq, unsigned int type)
322{
323 unsigned int mask;
324 void __iomem *mapbase = get_irq_chip_data(irq);
325
326 mask = 1 << (irq - LOCOMO_IRQ_GPIO_START);
327
328 if (type == IRQ_TYPE_PROBE) {
329 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
330 return 0;
331 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
332 }
333
334 if (type & IRQ_TYPE_EDGE_RISING)
335 GPIO_IRQ_rising_edge |= mask;
336 else
337 GPIO_IRQ_rising_edge &= ~mask;
338 if (type & IRQ_TYPE_EDGE_FALLING)
339 GPIO_IRQ_falling_edge |= mask;
340 else
341 GPIO_IRQ_falling_edge &= ~mask;
342 locomo_writel(GPIO_IRQ_rising_edge, mapbase + LOCOMO_GRIE);
343 locomo_writel(GPIO_IRQ_falling_edge, mapbase + LOCOMO_GFIE);
344
345 return 0;
346}
347
348static struct irq_chip locomo_gpio_chip = {
349 .name = "LOCOMO-gpio",
350 .ack = locomo_gpio_ack_irq,
351 .mask = locomo_gpio_mask_irq,
352 .unmask = locomo_gpio_unmask_irq,
353 .set_type = locomo_gpio_type,
354};
355
356static void locomo_lt_handler(unsigned int irq, struct irq_desc *desc)
357{
358 void __iomem *mapbase = get_irq_chip_data(irq);
359
360 if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) {
361 generic_handle_irq(LOCOMO_IRQ_LT_START);
362 }
363}
364
365static void locomo_lt_ack_irq(unsigned int irq)
366{
367 void __iomem *mapbase = get_irq_chip_data(irq);
368 unsigned int r;
369 r = locomo_readl(mapbase + LOCOMO_LTINT);
370 r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START));
371 locomo_writel(r, mapbase + LOCOMO_LTINT);
372}
373
374static void locomo_lt_mask_irq(unsigned int irq)
375{
376 void __iomem *mapbase = get_irq_chip_data(irq);
377 unsigned int r;
378 r = locomo_readl(mapbase + LOCOMO_LTINT);
379 r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START));
380 locomo_writel(r, mapbase + LOCOMO_LTINT);
381}
382
383static void locomo_lt_unmask_irq(unsigned int irq)
384{
385 void __iomem *mapbase = get_irq_chip_data(irq);
386 unsigned int r;
387 r = locomo_readl(mapbase + LOCOMO_LTINT);
388 r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START));
389 locomo_writel(r, mapbase + LOCOMO_LTINT);
390}
391
392static struct irq_chip locomo_lt_chip = {
393 .name = "LOCOMO-lt",
394 .ack = locomo_lt_ack_irq,
395 .mask = locomo_lt_mask_irq,
396 .unmask = locomo_lt_unmask_irq,
397};
398
399static void locomo_spi_handler(unsigned int irq, struct irq_desc *desc)
400{
401 int req, i;
402 void __iomem *mapbase = get_irq_chip_data(irq);
403
404 req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F;
405 if (req) {
406 irq = LOCOMO_IRQ_SPI_START;
407
408 for (i = 0; i <= 3; i++, irq++) {
409 if (req & (0x0001 << i)) {
410 generic_handle_irq(irq);
411 }
412 }
413 }
414}
415
416static void locomo_spi_ack_irq(unsigned int irq)
417{
418 void __iomem *mapbase = get_irq_chip_data(irq);
419 unsigned int r;
420 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
421 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
422 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
423
424 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
425 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
426 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIS);
427
428 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
429 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
430 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIWE);
431}
432
433static void locomo_spi_mask_irq(unsigned int irq)
434{
435 void __iomem *mapbase = get_irq_chip_data(irq);
436 unsigned int r;
437 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
438 r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START));
439 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
440}
441
442static void locomo_spi_unmask_irq(unsigned int irq)
443{
444 void __iomem *mapbase = get_irq_chip_data(irq);
445 unsigned int r;
446 r = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
447 r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START));
448 locomo_writel(r, mapbase + LOCOMO_SPI + LOCOMO_SPIIE);
449}
450
451static struct irq_chip locomo_spi_chip = {
452 .name = "LOCOMO-spi",
453 .ack = locomo_spi_ack_irq,
454 .mask = locomo_spi_mask_irq,
455 .unmask = locomo_spi_unmask_irq,
456};
457
458static void locomo_setup_irq(struct locomo *lchip) 193static void locomo_setup_irq(struct locomo *lchip)
459{ 194{
460 int irq; 195 int irq = lchip->irq_base;
461 void __iomem *irqbase = lchip->base;
462 196
463 /* 197 /*
464 * Install handler for IRQ_LOCOMO_HW. 198 * Install handler for IRQ_LOCOMO_HW.
465 */ 199 */
466 set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING); 200 set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING);
467 set_irq_chip_data(lchip->irq, irqbase); 201 set_irq_chip_data(lchip->irq, lchip);
468 set_irq_chained_handler(lchip->irq, locomo_handler); 202 set_irq_chained_handler(lchip->irq, locomo_handler);
469 203
470 /* Install handlers for IRQ_LOCOMO_*_BASE */ 204 /* Install handlers for IRQ_LOCOMO_* */
471 set_irq_chip(IRQ_LOCOMO_KEY_BASE, &locomo_chip); 205 for ( ; irq <= lchip->irq_base + 3; irq++) {
472 set_irq_chip_data(IRQ_LOCOMO_KEY_BASE, irqbase); 206 set_irq_chip(irq, &locomo_chip);
473 set_irq_chained_handler(IRQ_LOCOMO_KEY_BASE, locomo_key_handler); 207 set_irq_chip_data(irq, lchip);
474 208 set_irq_handler(irq, handle_level_irq);
475 set_irq_chip(IRQ_LOCOMO_GPIO_BASE, &locomo_chip);
476 set_irq_chip_data(IRQ_LOCOMO_GPIO_BASE, irqbase);
477 set_irq_chained_handler(IRQ_LOCOMO_GPIO_BASE, locomo_gpio_handler);
478
479 set_irq_chip(IRQ_LOCOMO_LT_BASE, &locomo_chip);
480 set_irq_chip_data(IRQ_LOCOMO_LT_BASE, irqbase);
481 set_irq_chained_handler(IRQ_LOCOMO_LT_BASE, locomo_lt_handler);
482
483 set_irq_chip(IRQ_LOCOMO_SPI_BASE, &locomo_chip);
484 set_irq_chip_data(IRQ_LOCOMO_SPI_BASE, irqbase);
485 set_irq_chained_handler(IRQ_LOCOMO_SPI_BASE, locomo_spi_handler);
486
487 /* install handlers for IRQ_LOCOMO_KEY_BASE generated interrupts */
488 set_irq_chip(LOCOMO_IRQ_KEY_START, &locomo_key_chip);
489 set_irq_chip_data(LOCOMO_IRQ_KEY_START, irqbase);
490 set_irq_handler(LOCOMO_IRQ_KEY_START, handle_edge_irq);
491 set_irq_flags(LOCOMO_IRQ_KEY_START, IRQF_VALID | IRQF_PROBE);
492
493 /* install handlers for IRQ_LOCOMO_GPIO_BASE generated interrupts */
494 for (irq = LOCOMO_IRQ_GPIO_START; irq < LOCOMO_IRQ_GPIO_START + 16; irq++) {
495 set_irq_chip(irq, &locomo_gpio_chip);
496 set_irq_chip_data(irq, irqbase);
497 set_irq_handler(irq, handle_edge_irq);
498 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
499 }
500
501 /* install handlers for IRQ_LOCOMO_LT_BASE generated interrupts */
502 set_irq_chip(LOCOMO_IRQ_LT_START, &locomo_lt_chip);
503 set_irq_chip_data(LOCOMO_IRQ_LT_START, irqbase);
504 set_irq_handler(LOCOMO_IRQ_LT_START, handle_edge_irq);
505 set_irq_flags(LOCOMO_IRQ_LT_START, IRQF_VALID | IRQF_PROBE);
506
507 /* install handlers for IRQ_LOCOMO_SPI_BASE generated interrupts */
508 for (irq = LOCOMO_IRQ_SPI_START; irq < LOCOMO_IRQ_SPI_START + 4; irq++) {
509 set_irq_chip(irq, &locomo_spi_chip);
510 set_irq_chip_data(irq, irqbase);
511 set_irq_handler(irq, handle_edge_irq);
512 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 209 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
513 } 210 }
514} 211}
@@ -555,7 +252,8 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
555 dev->mapbase = 0; 252 dev->mapbase = 0;
556 dev->length = info->length; 253 dev->length = info->length;
557 254
558 memmove(dev->irq, info->irq, sizeof(dev->irq)); 255 dev->irq[0] = (lchip->irq_base == NO_IRQ) ?
256 NO_IRQ : lchip->irq_base + info->irq[0];
559 257
560 ret = device_register(&dev->dev); 258 ret = device_register(&dev->dev);
561 if (ret) { 259 if (ret) {
@@ -672,6 +370,7 @@ static int locomo_resume(struct platform_device *dev)
672static int 370static int
673__locomo_probe(struct device *me, struct resource *mem, int irq) 371__locomo_probe(struct device *me, struct resource *mem, int irq)
674{ 372{
373 struct locomo_platform_data *pdata = me->platform_data;
675 struct locomo *lchip; 374 struct locomo *lchip;
676 unsigned long r; 375 unsigned long r;
677 int i, ret = -ENODEV; 376 int i, ret = -ENODEV;
@@ -687,6 +386,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
687 386
688 lchip->phys = mem->start; 387 lchip->phys = mem->start;
689 lchip->irq = irq; 388 lchip->irq = irq;
389 lchip->irq_base = (pdata) ? pdata->irq_base : NO_IRQ;
690 390
691 /* 391 /*
692 * Map the whole region. This also maps the 392 * Map the whole region. This also maps the
@@ -753,7 +453,7 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
753 * The interrupt controller must be initialised before any 453 * The interrupt controller must be initialised before any
754 * other device to ensure that the interrupts are available. 454 * other device to ensure that the interrupts are available.
755 */ 455 */
756 if (lchip->irq != NO_IRQ) 456 if (lchip->irq != NO_IRQ && lchip->irq_base != NO_IRQ)
757 locomo_setup_irq(lchip); 457 locomo_setup_irq(lchip);
758 458
759 for (i = 0; i < ARRAY_SIZE(locomo_devices); i++) 459 for (i = 0; i < ARRAY_SIZE(locomo_devices); i++)
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 8ba7044c554d..a52a27c1d9be 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -35,6 +35,58 @@
35 35
36#include <asm/hardware/sa1111.h> 36#include <asm/hardware/sa1111.h>
37 37
38/* SA1111 IRQs */
39#define IRQ_GPAIN0 (0)
40#define IRQ_GPAIN1 (1)
41#define IRQ_GPAIN2 (2)
42#define IRQ_GPAIN3 (3)
43#define IRQ_GPBIN0 (4)
44#define IRQ_GPBIN1 (5)
45#define IRQ_GPBIN2 (6)
46#define IRQ_GPBIN3 (7)
47#define IRQ_GPBIN4 (8)
48#define IRQ_GPBIN5 (9)
49#define IRQ_GPCIN0 (10)
50#define IRQ_GPCIN1 (11)
51#define IRQ_GPCIN2 (12)
52#define IRQ_GPCIN3 (13)
53#define IRQ_GPCIN4 (14)
54#define IRQ_GPCIN5 (15)
55#define IRQ_GPCIN6 (16)
56#define IRQ_GPCIN7 (17)
57#define IRQ_MSTXINT (18)
58#define IRQ_MSRXINT (19)
59#define IRQ_MSSTOPERRINT (20)
60#define IRQ_TPTXINT (21)
61#define IRQ_TPRXINT (22)
62#define IRQ_TPSTOPERRINT (23)
63#define SSPXMTINT (24)
64#define SSPRCVINT (25)
65#define SSPROR (26)
66#define AUDXMTDMADONEA (32)
67#define AUDRCVDMADONEA (33)
68#define AUDXMTDMADONEB (34)
69#define AUDRCVDMADONEB (35)
70#define AUDTFSR (36)
71#define AUDRFSR (37)
72#define AUDTUR (38)
73#define AUDROR (39)
74#define AUDDTS (40)
75#define AUDRDD (41)
76#define AUDSTO (42)
77#define IRQ_USBPWR (43)
78#define IRQ_HCIM (44)
79#define IRQ_HCIBUFFACC (45)
80#define IRQ_HCIRMTWKP (46)
81#define IRQ_NHCIMFCIR (47)
82#define IRQ_USB_PORT_RESUME (48)
83#define IRQ_S0_READY_NINT (49)
84#define IRQ_S1_READY_NINT (50)
85#define IRQ_S0_CD_VALID (51)
86#define IRQ_S1_CD_VALID (52)
87#define IRQ_S0_BVD1_STSCHG (53)
88#define IRQ_S1_BVD1_STSCHG (54)
89
38extern void __init sa1110_mb_enable(void); 90extern void __init sa1110_mb_enable(void);
39 91
40/* 92/*
@@ -49,6 +101,7 @@ struct sa1111 {
49 struct clk *clk; 101 struct clk *clk;
50 unsigned long phys; 102 unsigned long phys;
51 int irq; 103 int irq;
104 int irq_base; /* base for cascaded on-chip IRQs */
52 spinlock_t lock; 105 spinlock_t lock;
53 void __iomem *base; 106 void __iomem *base;
54#ifdef CONFIG_PM 107#ifdef CONFIG_PM
@@ -152,36 +205,37 @@ static void
152sa1111_irq_handler(unsigned int irq, struct irq_desc *desc) 205sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
153{ 206{
154 unsigned int stat0, stat1, i; 207 unsigned int stat0, stat1, i;
155 void __iomem *base = get_irq_data(irq); 208 struct sa1111 *sachip = get_irq_data(irq);
209 void __iomem *mapbase = sachip->base + SA1111_INTC;
156 210
157 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0); 211 stat0 = sa1111_readl(mapbase + SA1111_INTSTATCLR0);
158 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1); 212 stat1 = sa1111_readl(mapbase + SA1111_INTSTATCLR1);
159 213
160 sa1111_writel(stat0, base + SA1111_INTSTATCLR0); 214 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0);
161 215
162 desc->chip->ack(irq); 216 desc->chip->ack(irq);
163 217
164 sa1111_writel(stat1, base + SA1111_INTSTATCLR1); 218 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1);
165 219
166 if (stat0 == 0 && stat1 == 0) { 220 if (stat0 == 0 && stat1 == 0) {
167 do_bad_IRQ(irq, desc); 221 do_bad_IRQ(irq, desc);
168 return; 222 return;
169 } 223 }
170 224
171 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) 225 for (i = 0; stat0; i++, stat0 >>= 1)
172 if (stat0 & 1) 226 if (stat0 & 1)
173 handle_edge_irq(i, irq_desc + i); 227 generic_handle_irq(i + sachip->irq_base);
174 228
175 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) 229 for (i = 32; stat1; i++, stat1 >>= 1)
176 if (stat1 & 1) 230 if (stat1 & 1)
177 handle_edge_irq(i, irq_desc + i); 231 generic_handle_irq(i + sachip->irq_base);
178 232
179 /* For level-based interrupts */ 233 /* For level-based interrupts */
180 desc->chip->unmask(irq); 234 desc->chip->unmask(irq);
181} 235}
182 236
183#define SA1111_IRQMASK_LO(x) (1 << (x - IRQ_SA1111_START)) 237#define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base))
184#define SA1111_IRQMASK_HI(x) (1 << (x - IRQ_SA1111_START - 32)) 238#define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32))
185 239
186static void sa1111_ack_irq(unsigned int irq) 240static void sa1111_ack_irq(unsigned int irq)
187{ 241{
@@ -189,7 +243,8 @@ static void sa1111_ack_irq(unsigned int irq)
189 243
190static void sa1111_mask_lowirq(unsigned int irq) 244static void sa1111_mask_lowirq(unsigned int irq)
191{ 245{
192 void __iomem *mapbase = get_irq_chip_data(irq); 246 struct sa1111 *sachip = get_irq_chip_data(irq);
247 void __iomem *mapbase = sachip->base + SA1111_INTC;
193 unsigned long ie0; 248 unsigned long ie0;
194 249
195 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 250 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -199,7 +254,8 @@ static void sa1111_mask_lowirq(unsigned int irq)
199 254
200static void sa1111_unmask_lowirq(unsigned int irq) 255static void sa1111_unmask_lowirq(unsigned int irq)
201{ 256{
202 void __iomem *mapbase = get_irq_chip_data(irq); 257 struct sa1111 *sachip = get_irq_chip_data(irq);
258 void __iomem *mapbase = sachip->base + SA1111_INTC;
203 unsigned long ie0; 259 unsigned long ie0;
204 260
205 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 261 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
@@ -216,8 +272,9 @@ static void sa1111_unmask_lowirq(unsigned int irq)
216 */ 272 */
217static int sa1111_retrigger_lowirq(unsigned int irq) 273static int sa1111_retrigger_lowirq(unsigned int irq)
218{ 274{
275 struct sa1111 *sachip = get_irq_chip_data(irq);
276 void __iomem *mapbase = sachip->base + SA1111_INTC;
219 unsigned int mask = SA1111_IRQMASK_LO(irq); 277 unsigned int mask = SA1111_IRQMASK_LO(irq);
220 void __iomem *mapbase = get_irq_chip_data(irq);
221 unsigned long ip0; 278 unsigned long ip0;
222 int i; 279 int i;
223 280
@@ -237,8 +294,9 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
237 294
238static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) 295static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
239{ 296{
297 struct sa1111 *sachip = get_irq_chip_data(irq);
298 void __iomem *mapbase = sachip->base + SA1111_INTC;
240 unsigned int mask = SA1111_IRQMASK_LO(irq); 299 unsigned int mask = SA1111_IRQMASK_LO(irq);
241 void __iomem *mapbase = get_irq_chip_data(irq);
242 unsigned long ip0; 300 unsigned long ip0;
243 301
244 if (flags == IRQ_TYPE_PROBE) 302 if (flags == IRQ_TYPE_PROBE)
@@ -260,8 +318,9 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
260 318
261static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) 319static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
262{ 320{
321 struct sa1111 *sachip = get_irq_chip_data(irq);
322 void __iomem *mapbase = sachip->base + SA1111_INTC;
263 unsigned int mask = SA1111_IRQMASK_LO(irq); 323 unsigned int mask = SA1111_IRQMASK_LO(irq);
264 void __iomem *mapbase = get_irq_chip_data(irq);
265 unsigned long we0; 324 unsigned long we0;
266 325
267 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); 326 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
@@ -286,7 +345,8 @@ static struct irq_chip sa1111_low_chip = {
286 345
287static void sa1111_mask_highirq(unsigned int irq) 346static void sa1111_mask_highirq(unsigned int irq)
288{ 347{
289 void __iomem *mapbase = get_irq_chip_data(irq); 348 struct sa1111 *sachip = get_irq_chip_data(irq);
349 void __iomem *mapbase = sachip->base + SA1111_INTC;
290 unsigned long ie1; 350 unsigned long ie1;
291 351
292 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 352 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -296,7 +356,8 @@ static void sa1111_mask_highirq(unsigned int irq)
296 356
297static void sa1111_unmask_highirq(unsigned int irq) 357static void sa1111_unmask_highirq(unsigned int irq)
298{ 358{
299 void __iomem *mapbase = get_irq_chip_data(irq); 359 struct sa1111 *sachip = get_irq_chip_data(irq);
360 void __iomem *mapbase = sachip->base + SA1111_INTC;
300 unsigned long ie1; 361 unsigned long ie1;
301 362
302 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 363 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
@@ -313,8 +374,9 @@ static void sa1111_unmask_highirq(unsigned int irq)
313 */ 374 */
314static int sa1111_retrigger_highirq(unsigned int irq) 375static int sa1111_retrigger_highirq(unsigned int irq)
315{ 376{
377 struct sa1111 *sachip = get_irq_chip_data(irq);
378 void __iomem *mapbase = sachip->base + SA1111_INTC;
316 unsigned int mask = SA1111_IRQMASK_HI(irq); 379 unsigned int mask = SA1111_IRQMASK_HI(irq);
317 void __iomem *mapbase = get_irq_chip_data(irq);
318 unsigned long ip1; 380 unsigned long ip1;
319 int i; 381 int i;
320 382
@@ -334,8 +396,9 @@ static int sa1111_retrigger_highirq(unsigned int irq)
334 396
335static int sa1111_type_highirq(unsigned int irq, unsigned int flags) 397static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
336{ 398{
399 struct sa1111 *sachip = get_irq_chip_data(irq);
400 void __iomem *mapbase = sachip->base + SA1111_INTC;
337 unsigned int mask = SA1111_IRQMASK_HI(irq); 401 unsigned int mask = SA1111_IRQMASK_HI(irq);
338 void __iomem *mapbase = get_irq_chip_data(irq);
339 unsigned long ip1; 402 unsigned long ip1;
340 403
341 if (flags == IRQ_TYPE_PROBE) 404 if (flags == IRQ_TYPE_PROBE)
@@ -357,8 +420,9 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
357 420
358static int sa1111_wake_highirq(unsigned int irq, unsigned int on) 421static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
359{ 422{
423 struct sa1111 *sachip = get_irq_chip_data(irq);
424 void __iomem *mapbase = sachip->base + SA1111_INTC;
360 unsigned int mask = SA1111_IRQMASK_HI(irq); 425 unsigned int mask = SA1111_IRQMASK_HI(irq);
361 void __iomem *mapbase = get_irq_chip_data(irq);
362 unsigned long we1; 426 unsigned long we1;
363 427
364 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); 428 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
@@ -412,14 +476,14 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
412 476
413 for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) { 477 for (irq = IRQ_GPAIN0; irq <= SSPROR; irq++) {
414 set_irq_chip(irq, &sa1111_low_chip); 478 set_irq_chip(irq, &sa1111_low_chip);
415 set_irq_chip_data(irq, irqbase); 479 set_irq_chip_data(irq, sachip);
416 set_irq_handler(irq, handle_edge_irq); 480 set_irq_handler(irq, handle_edge_irq);
417 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 481 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
418 } 482 }
419 483
420 for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) { 484 for (irq = AUDXMTDMADONEA; irq <= IRQ_S1_BVD1_STSCHG; irq++) {
421 set_irq_chip(irq, &sa1111_high_chip); 485 set_irq_chip(irq, &sa1111_high_chip);
422 set_irq_chip_data(irq, irqbase); 486 set_irq_chip_data(irq, sachip);
423 set_irq_handler(irq, handle_edge_irq); 487 set_irq_handler(irq, handle_edge_irq);
424 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 488 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
425 } 489 }
@@ -428,7 +492,7 @@ static void sa1111_setup_irq(struct sa1111 *sachip)
428 * Register SA1111 interrupt 492 * Register SA1111 interrupt
429 */ 493 */
430 set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING); 494 set_irq_type(sachip->irq, IRQ_TYPE_EDGE_RISING);
431 set_irq_data(sachip->irq, irqbase); 495 set_irq_data(sachip->irq, sachip);
432 set_irq_chained_handler(sachip->irq, sa1111_irq_handler); 496 set_irq_chained_handler(sachip->irq, sa1111_irq_handler);
433} 497}
434 498
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 37bda5f3dde3..9012004321dd 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -140,6 +140,7 @@ EXPORT_SYMBOL(reset_scoop);
140EXPORT_SYMBOL(read_scoop_reg); 140EXPORT_SYMBOL(read_scoop_reg);
141EXPORT_SYMBOL(write_scoop_reg); 141EXPORT_SYMBOL(write_scoop_reg);
142 142
143#ifdef CONFIG_PM
143static void check_scoop_reg(struct scoop_dev *sdev) 144static void check_scoop_reg(struct scoop_dev *sdev)
144{ 145{
145 unsigned short mcr; 146 unsigned short mcr;
@@ -149,7 +150,6 @@ static void check_scoop_reg(struct scoop_dev *sdev)
149 iowrite16(0x0101, sdev->base + SCOOP_MCR); 150 iowrite16(0x0101, sdev->base + SCOOP_MCR);
150} 151}
151 152
152#ifdef CONFIG_PM
153static int scoop_suspend(struct platform_device *dev, pm_message_t state) 153static int scoop_suspend(struct platform_device *dev, pm_message_t state)
154{ 154{
155 struct scoop_dev *sdev = platform_get_drvdata(dev); 155 struct scoop_dev *sdev = platform_get_drvdata(dev);
diff --git a/arch/arm/configs/ap4evb_defconfig b/arch/arm/configs/ap4evb_defconfig
new file mode 100644
index 000000000000..e14229be7676
--- /dev/null
+++ b/arch/arm/configs/ap4evb_defconfig
@@ -0,0 +1,779 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc7
4# Mon Feb 8 12:25:36 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_TIME=y
9CONFIG_GENERIC_CLOCKEVENTS=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_HAVE_KERNEL_GZIP=y
34CONFIG_HAVE_KERNEL_LZO=y
35CONFIG_KERNEL_GZIP=y
36# CONFIG_KERNEL_BZIP2 is not set
37# CONFIG_KERNEL_LZMA is not set
38# CONFIG_KERNEL_LZO is not set
39CONFIG_SWAP=y
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_BSD_PROCESS_ACCT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_TINY_RCU is not set
50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
53# CONFIG_TREE_RCU_TRACE is not set
54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=16
57CONFIG_GROUP_SCHED=y
58CONFIG_FAIR_GROUP_SCHED=y
59# CONFIG_RT_GROUP_SCHED is not set
60CONFIG_USER_SCHED=y
61# CONFIG_CGROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
63# CONFIG_SYSFS_DEPRECATED_V2 is not set
64# CONFIG_RELAY is not set
65CONFIG_NAMESPACES=y
66# CONFIG_UTS_NS is not set
67# CONFIG_IPC_NS is not set
68# CONFIG_USER_NS is not set
69# CONFIG_PID_NS is not set
70CONFIG_BLK_DEV_INITRD=y
71CONFIG_INITRAMFS_SOURCE=""
72CONFIG_RD_GZIP=y
73CONFIG_RD_BZIP2=y
74CONFIG_RD_LZMA=y
75CONFIG_RD_LZO=y
76CONFIG_CC_OPTIMIZE_FOR_SIZE=y
77CONFIG_SYSCTL=y
78CONFIG_ANON_INODES=y
79# CONFIG_EMBEDDED is not set
80CONFIG_UID16=y
81CONFIG_SYSCTL_SYSCALL=y
82CONFIG_KALLSYMS=y
83# CONFIG_KALLSYMS_ALL is not set
84# CONFIG_KALLSYMS_EXTRA_PASS is not set
85CONFIG_HOTPLUG=y
86CONFIG_PRINTK=y
87CONFIG_BUG=y
88CONFIG_ELF_CORE=y
89CONFIG_BASE_FULL=y
90CONFIG_FUTEX=y
91CONFIG_EPOLL=y
92CONFIG_SIGNALFD=y
93CONFIG_TIMERFD=y
94CONFIG_EVENTFD=y
95CONFIG_SHMEM=y
96CONFIG_AIO=y
97
98#
99# Kernel Performance Events And Counters
100#
101CONFIG_VM_EVENT_COUNTERS=y
102CONFIG_COMPAT_BRK=y
103CONFIG_SLAB=y
104# CONFIG_SLUB is not set
105# CONFIG_SLOB is not set
106# CONFIG_PROFILING is not set
107CONFIG_HAVE_OPROFILE=y
108CONFIG_HAVE_KPROBES=y
109CONFIG_HAVE_KRETPROBES=y
110CONFIG_HAVE_CLK=y
111
112#
113# GCOV-based kernel profiling
114#
115# CONFIG_SLOW_WORK is not set
116CONFIG_HAVE_GENERIC_DMA_COHERENT=y
117CONFIG_SLABINFO=y
118CONFIG_RT_MUTEXES=y
119CONFIG_BASE_SMALL=0
120# CONFIG_MODULES is not set
121CONFIG_BLOCK=y
122CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
125
126#
127# IO Schedulers
128#
129CONFIG_IOSCHED_NOOP=y
130# CONFIG_IOSCHED_DEADLINE is not set
131# CONFIG_IOSCHED_CFQ is not set
132# CONFIG_DEFAULT_DEADLINE is not set
133# CONFIG_DEFAULT_CFQ is not set
134CONFIG_DEFAULT_NOOP=y
135CONFIG_DEFAULT_IOSCHED="noop"
136# CONFIG_INLINE_SPIN_TRYLOCK is not set
137# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
138# CONFIG_INLINE_SPIN_LOCK is not set
139# CONFIG_INLINE_SPIN_LOCK_BH is not set
140# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
141# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
142CONFIG_INLINE_SPIN_UNLOCK=y
143# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
144CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
145# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
146# CONFIG_INLINE_READ_TRYLOCK is not set
147# CONFIG_INLINE_READ_LOCK is not set
148# CONFIG_INLINE_READ_LOCK_BH is not set
149# CONFIG_INLINE_READ_LOCK_IRQ is not set
150# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
151CONFIG_INLINE_READ_UNLOCK=y
152# CONFIG_INLINE_READ_UNLOCK_BH is not set
153CONFIG_INLINE_READ_UNLOCK_IRQ=y
154# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
155# CONFIG_INLINE_WRITE_TRYLOCK is not set
156# CONFIG_INLINE_WRITE_LOCK is not set
157# CONFIG_INLINE_WRITE_LOCK_BH is not set
158# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
159# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
160CONFIG_INLINE_WRITE_UNLOCK=y
161# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
162CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
163# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
164# CONFIG_MUTEX_SPIN_ON_OWNER is not set
165# CONFIG_FREEZER is not set
166
167#
168# System Type
169#
170CONFIG_MMU=y
171# CONFIG_ARCH_AAEC2000 is not set
172# CONFIG_ARCH_INTEGRATOR is not set
173# CONFIG_ARCH_REALVIEW is not set
174# CONFIG_ARCH_VERSATILE is not set
175# CONFIG_ARCH_AT91 is not set
176# CONFIG_ARCH_CLPS711X is not set
177# CONFIG_ARCH_GEMINI is not set
178# CONFIG_ARCH_EBSA110 is not set
179# CONFIG_ARCH_EP93XX is not set
180# CONFIG_ARCH_FOOTBRIDGE is not set
181# CONFIG_ARCH_MXC is not set
182# CONFIG_ARCH_STMP3XXX is not set
183# CONFIG_ARCH_NETX is not set
184# CONFIG_ARCH_H720X is not set
185# CONFIG_ARCH_NOMADIK is not set
186# CONFIG_ARCH_IOP13XX is not set
187# CONFIG_ARCH_IOP32X is not set
188# CONFIG_ARCH_IOP33X is not set
189# CONFIG_ARCH_IXP23XX is not set
190# CONFIG_ARCH_IXP2000 is not set
191# CONFIG_ARCH_IXP4XX is not set
192# CONFIG_ARCH_L7200 is not set
193# CONFIG_ARCH_DOVE is not set
194# CONFIG_ARCH_KIRKWOOD is not set
195# CONFIG_ARCH_LOKI is not set
196# CONFIG_ARCH_MV78XX0 is not set
197# CONFIG_ARCH_ORION5X is not set
198# CONFIG_ARCH_MMP is not set
199# CONFIG_ARCH_KS8695 is not set
200# CONFIG_ARCH_NS9XXX is not set
201# CONFIG_ARCH_W90X900 is not set
202# CONFIG_ARCH_PNX4008 is not set
203# CONFIG_ARCH_PXA is not set
204# CONFIG_ARCH_MSM is not set
205CONFIG_ARCH_SHMOBILE=y
206# CONFIG_ARCH_RPC is not set
207# CONFIG_ARCH_SA1100 is not set
208# CONFIG_ARCH_S3C2410 is not set
209# CONFIG_ARCH_S3C64XX is not set
210# CONFIG_ARCH_S5PC1XX is not set
211# CONFIG_ARCH_SHARK is not set
212# CONFIG_ARCH_LH7A40X is not set
213# CONFIG_ARCH_U300 is not set
214# CONFIG_ARCH_DAVINCI is not set
215# CONFIG_ARCH_OMAP is not set
216# CONFIG_ARCH_BCMRING is not set
217# CONFIG_ARCH_U8500 is not set
218
219#
220# SH-Mobile System Type
221#
222# CONFIG_ARCH_SH7367 is not set
223# CONFIG_ARCH_SH7377 is not set
224CONFIG_ARCH_SH7372=y
225
226#
227# SH-Mobile Board Type
228#
229CONFIG_MACH_AP4EVB=y
230
231#
232# SH-Mobile System Configuration
233#
234
235#
236# Memory configuration
237#
238CONFIG_MEMORY_START=0x40000000
239CONFIG_MEMORY_SIZE=0x10000000
240
241#
242# Timer and clock configuration
243#
244CONFIG_SH_TIMER_CMT=y
245
246#
247# Processor Type
248#
249CONFIG_CPU_32v6K=y
250CONFIG_CPU_V7=y
251CONFIG_CPU_32v7=y
252CONFIG_CPU_ABRT_EV7=y
253CONFIG_CPU_PABRT_V7=y
254CONFIG_CPU_CACHE_V7=y
255CONFIG_CPU_CACHE_VIPT=y
256CONFIG_CPU_COPY_V6=y
257CONFIG_CPU_TLB_V7=y
258CONFIG_CPU_HAS_ASID=y
259CONFIG_CPU_CP15=y
260CONFIG_CPU_CP15_MMU=y
261
262#
263# Processor Features
264#
265CONFIG_ARM_THUMB=y
266# CONFIG_ARM_THUMBEE is not set
267# CONFIG_CPU_ICACHE_DISABLE is not set
268# CONFIG_CPU_DCACHE_DISABLE is not set
269# CONFIG_CPU_BPREDICT_DISABLE is not set
270CONFIG_HAS_TLS_REG=y
271CONFIG_ARM_L1_CACHE_SHIFT=5
272# CONFIG_ARM_ERRATA_430973 is not set
273# CONFIG_ARM_ERRATA_458693 is not set
274# CONFIG_ARM_ERRATA_460075 is not set
275CONFIG_COMMON_CLKDEV=y
276
277#
278# Bus support
279#
280# CONFIG_PCI_SYSCALL is not set
281# CONFIG_ARCH_SUPPORTS_MSI is not set
282# CONFIG_PCCARD is not set
283
284#
285# Kernel Features
286#
287# CONFIG_NO_HZ is not set
288# CONFIG_HIGH_RES_TIMERS is not set
289CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
290CONFIG_VMSPLIT_3G=y
291# CONFIG_VMSPLIT_2G is not set
292# CONFIG_VMSPLIT_1G is not set
293CONFIG_PAGE_OFFSET=0xC0000000
294CONFIG_PREEMPT_NONE=y
295# CONFIG_PREEMPT_VOLUNTARY is not set
296# CONFIG_PREEMPT is not set
297CONFIG_HZ=100
298# CONFIG_THUMB2_KERNEL is not set
299CONFIG_AEABI=y
300# CONFIG_OABI_COMPAT is not set
301# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
302# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
303# CONFIG_HIGHMEM is not set
304CONFIG_SELECT_MEMORY_MODEL=y
305CONFIG_FLATMEM_MANUAL=y
306# CONFIG_DISCONTIGMEM_MANUAL is not set
307# CONFIG_SPARSEMEM_MANUAL is not set
308CONFIG_FLATMEM=y
309CONFIG_FLAT_NODE_MEM_MAP=y
310CONFIG_PAGEFLAGS_EXTENDED=y
311CONFIG_SPLIT_PTLOCK_CPUS=4
312# CONFIG_PHYS_ADDR_T_64BIT is not set
313CONFIG_ZONE_DMA_FLAG=0
314CONFIG_VIRT_TO_BUS=y
315# CONFIG_KSM is not set
316CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
317CONFIG_ALIGNMENT_TRAP=y
318# CONFIG_UACCESS_WITH_MEMCPY is not set
319
320#
321# Boot options
322#
323CONFIG_ZBOOT_ROM_TEXT=0x0
324CONFIG_ZBOOT_ROM_BSS=0x0
325CONFIG_CMDLINE="console=ttySC0,115200 earlyprintk=sh-sci.0,115200"
326# CONFIG_XIP_KERNEL is not set
327CONFIG_KEXEC=y
328CONFIG_ATAGS_PROC=y
329
330#
331# CPU Power Management
332#
333# CONFIG_CPU_IDLE is not set
334
335#
336# Floating point emulation
337#
338
339#
340# At least one emulation must be selected
341#
342# CONFIG_VFP is not set
343
344#
345# Userspace binary formats
346#
347CONFIG_BINFMT_ELF=y
348# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
349CONFIG_HAVE_AOUT=y
350# CONFIG_BINFMT_AOUT is not set
351# CONFIG_BINFMT_MISC is not set
352
353#
354# Power management options
355#
356CONFIG_PM=y
357# CONFIG_PM_DEBUG is not set
358# CONFIG_SUSPEND is not set
359# CONFIG_APM_EMULATION is not set
360# CONFIG_PM_RUNTIME is not set
361CONFIG_ARCH_SUSPEND_POSSIBLE=y
362# CONFIG_NET is not set
363
364#
365# Device Drivers
366#
367
368#
369# Generic Driver Options
370#
371CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
372# CONFIG_DEVTMPFS is not set
373CONFIG_STANDALONE=y
374CONFIG_PREVENT_FIRMWARE_BUILD=y
375CONFIG_FW_LOADER=y
376# CONFIG_FIRMWARE_IN_KERNEL is not set
377CONFIG_EXTRA_FIRMWARE=""
378# CONFIG_DEBUG_DRIVER is not set
379# CONFIG_DEBUG_DEVRES is not set
380# CONFIG_SYS_HYPERVISOR is not set
381CONFIG_MTD=y
382# CONFIG_MTD_DEBUG is not set
383CONFIG_MTD_CONCAT=y
384CONFIG_MTD_PARTITIONS=y
385# CONFIG_MTD_REDBOOT_PARTS is not set
386# CONFIG_MTD_CMDLINE_PARTS is not set
387# CONFIG_MTD_AFS_PARTS is not set
388# CONFIG_MTD_AR7_PARTS is not set
389
390#
391# User Modules And Translation Layers
392#
393CONFIG_MTD_CHAR=y
394CONFIG_MTD_BLKDEVS=y
395CONFIG_MTD_BLOCK=y
396# CONFIG_FTL is not set
397# CONFIG_NFTL is not set
398# CONFIG_INFTL is not set
399# CONFIG_RFD_FTL is not set
400# CONFIG_SSFDC is not set
401# CONFIG_MTD_OOPS is not set
402
403#
404# RAM/ROM/Flash chip drivers
405#
406CONFIG_MTD_CFI=y
407# CONFIG_MTD_JEDECPROBE is not set
408CONFIG_MTD_GEN_PROBE=y
409# CONFIG_MTD_CFI_ADV_OPTIONS is not set
410CONFIG_MTD_MAP_BANK_WIDTH_1=y
411CONFIG_MTD_MAP_BANK_WIDTH_2=y
412CONFIG_MTD_MAP_BANK_WIDTH_4=y
413# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
414# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
415# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
416CONFIG_MTD_CFI_I1=y
417CONFIG_MTD_CFI_I2=y
418# CONFIG_MTD_CFI_I4 is not set
419# CONFIG_MTD_CFI_I8 is not set
420CONFIG_MTD_CFI_INTELEXT=y
421# CONFIG_MTD_CFI_AMDSTD is not set
422# CONFIG_MTD_CFI_STAA is not set
423CONFIG_MTD_CFI_UTIL=y
424# CONFIG_MTD_RAM is not set
425# CONFIG_MTD_ROM is not set
426# CONFIG_MTD_ABSENT is not set
427
428#
429# Mapping drivers for chip access
430#
431# CONFIG_MTD_COMPLEX_MAPPINGS is not set
432CONFIG_MTD_PHYSMAP=y
433# CONFIG_MTD_PHYSMAP_COMPAT is not set
434# CONFIG_MTD_ARM_INTEGRATOR is not set
435# CONFIG_MTD_PLATRAM is not set
436
437#
438# Self-contained MTD device drivers
439#
440# CONFIG_MTD_SLRAM is not set
441# CONFIG_MTD_PHRAM is not set
442# CONFIG_MTD_MTDRAM is not set
443# CONFIG_MTD_BLOCK2MTD is not set
444
445#
446# Disk-On-Chip Device Drivers
447#
448# CONFIG_MTD_DOC2000 is not set
449# CONFIG_MTD_DOC2001 is not set
450# CONFIG_MTD_DOC2001PLUS is not set
451CONFIG_MTD_NAND=y
452# CONFIG_MTD_NAND_VERIFY_WRITE is not set
453# CONFIG_MTD_NAND_ECC_SMC is not set
454# CONFIG_MTD_NAND_MUSEUM_IDS is not set
455CONFIG_MTD_NAND_IDS=y
456# CONFIG_MTD_NAND_DISKONCHIP is not set
457# CONFIG_MTD_NAND_NANDSIM is not set
458# CONFIG_MTD_NAND_PLATFORM is not set
459# CONFIG_MTD_ONENAND is not set
460
461#
462# LPDDR flash memory drivers
463#
464# CONFIG_MTD_LPDDR is not set
465
466#
467# UBI - Unsorted block images
468#
469# CONFIG_MTD_UBI is not set
470# CONFIG_PARPORT is not set
471# CONFIG_BLK_DEV is not set
472# CONFIG_MISC_DEVICES is not set
473CONFIG_HAVE_IDE=y
474# CONFIG_IDE is not set
475
476#
477# SCSI device support
478#
479# CONFIG_RAID_ATTRS is not set
480# CONFIG_SCSI is not set
481# CONFIG_SCSI_DMA is not set
482# CONFIG_SCSI_NETLINK is not set
483# CONFIG_ATA is not set
484# CONFIG_MD is not set
485# CONFIG_PHONE is not set
486
487#
488# Input device support
489#
490CONFIG_INPUT=y
491# CONFIG_INPUT_FF_MEMLESS is not set
492# CONFIG_INPUT_POLLDEV is not set
493# CONFIG_INPUT_SPARSEKMAP is not set
494
495#
496# Userland interfaces
497#
498CONFIG_INPUT_MOUSEDEV=y
499# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
500CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
501CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
502# CONFIG_INPUT_JOYDEV is not set
503# CONFIG_INPUT_EVDEV is not set
504# CONFIG_INPUT_EVBUG is not set
505
506#
507# Input Device Drivers
508#
509# CONFIG_INPUT_KEYBOARD is not set
510# CONFIG_INPUT_MOUSE is not set
511# CONFIG_INPUT_JOYSTICK is not set
512# CONFIG_INPUT_TABLET is not set
513# CONFIG_INPUT_TOUCHSCREEN is not set
514# CONFIG_INPUT_MISC is not set
515
516#
517# Hardware I/O ports
518#
519# CONFIG_SERIO is not set
520# CONFIG_GAMEPORT is not set
521
522#
523# Character devices
524#
525CONFIG_VT=y
526CONFIG_CONSOLE_TRANSLATIONS=y
527CONFIG_VT_CONSOLE=y
528CONFIG_HW_CONSOLE=y
529# CONFIG_VT_HW_CONSOLE_BINDING is not set
530CONFIG_DEVKMEM=y
531# CONFIG_SERIAL_NONSTANDARD is not set
532
533#
534# Serial drivers
535#
536# CONFIG_SERIAL_8250 is not set
537
538#
539# Non-8250 serial port support
540#
541CONFIG_SERIAL_SH_SCI=y
542CONFIG_SERIAL_SH_SCI_NR_UARTS=8
543CONFIG_SERIAL_SH_SCI_CONSOLE=y
544CONFIG_SERIAL_CORE=y
545CONFIG_SERIAL_CORE_CONSOLE=y
546CONFIG_UNIX98_PTYS=y
547# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
548# CONFIG_LEGACY_PTYS is not set
549# CONFIG_IPMI_HANDLER is not set
550# CONFIG_HW_RANDOM is not set
551# CONFIG_R3964 is not set
552# CONFIG_RAW_DRIVER is not set
553# CONFIG_TCG_TPM is not set
554# CONFIG_I2C is not set
555# CONFIG_SPI is not set
556
557#
558# PPS support
559#
560# CONFIG_PPS is not set
561# CONFIG_W1 is not set
562# CONFIG_POWER_SUPPLY is not set
563# CONFIG_HWMON is not set
564# CONFIG_THERMAL is not set
565# CONFIG_WATCHDOG is not set
566CONFIG_SSB_POSSIBLE=y
567
568#
569# Sonics Silicon Backplane
570#
571# CONFIG_SSB is not set
572
573#
574# Multifunction device drivers
575#
576# CONFIG_MFD_CORE is not set
577# CONFIG_MFD_SM501 is not set
578# CONFIG_HTC_PASIC3 is not set
579# CONFIG_MFD_TMIO is not set
580# CONFIG_MFD_T7L66XB is not set
581# CONFIG_MFD_TC6387XB is not set
582# CONFIG_REGULATOR is not set
583# CONFIG_MEDIA_SUPPORT is not set
584
585#
586# Graphics support
587#
588# CONFIG_VGASTATE is not set
589# CONFIG_VIDEO_OUTPUT_CONTROL is not set
590# CONFIG_FB is not set
591# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
592
593#
594# Display device support
595#
596# CONFIG_DISPLAY_SUPPORT is not set
597
598#
599# Console display driver support
600#
601# CONFIG_VGA_CONSOLE is not set
602CONFIG_DUMMY_CONSOLE=y
603# CONFIG_SOUND is not set
604# CONFIG_HID_SUPPORT is not set
605# CONFIG_USB_SUPPORT is not set
606# CONFIG_MMC is not set
607# CONFIG_MEMSTICK is not set
608# CONFIG_NEW_LEDS is not set
609# CONFIG_ACCESSIBILITY is not set
610CONFIG_RTC_LIB=y
611# CONFIG_RTC_CLASS is not set
612# CONFIG_DMADEVICES is not set
613# CONFIG_AUXDISPLAY is not set
614# CONFIG_UIO is not set
615
616#
617# TI VLYNQ
618#
619# CONFIG_STAGING is not set
620
621#
622# File systems
623#
624# CONFIG_EXT2_FS is not set
625# CONFIG_EXT3_FS is not set
626# CONFIG_EXT4_FS is not set
627# CONFIG_REISERFS_FS is not set
628# CONFIG_JFS_FS is not set
629# CONFIG_FS_POSIX_ACL is not set
630# CONFIG_XFS_FS is not set
631# CONFIG_GFS2_FS is not set
632# CONFIG_BTRFS_FS is not set
633# CONFIG_NILFS2_FS is not set
634CONFIG_FILE_LOCKING=y
635# CONFIG_FSNOTIFY is not set
636# CONFIG_DNOTIFY is not set
637# CONFIG_INOTIFY is not set
638# CONFIG_INOTIFY_USER is not set
639# CONFIG_QUOTA is not set
640# CONFIG_AUTOFS_FS is not set
641# CONFIG_AUTOFS4_FS is not set
642# CONFIG_FUSE_FS is not set
643
644#
645# Caches
646#
647# CONFIG_FSCACHE is not set
648
649#
650# CD-ROM/DVD Filesystems
651#
652# CONFIG_ISO9660_FS is not set
653# CONFIG_UDF_FS is not set
654
655#
656# DOS/FAT/NT Filesystems
657#
658# CONFIG_MSDOS_FS is not set
659# CONFIG_VFAT_FS is not set
660# CONFIG_NTFS_FS is not set
661
662#
663# Pseudo filesystems
664#
665CONFIG_PROC_FS=y
666CONFIG_PROC_SYSCTL=y
667CONFIG_PROC_PAGE_MONITOR=y
668CONFIG_SYSFS=y
669CONFIG_TMPFS=y
670# CONFIG_TMPFS_POSIX_ACL is not set
671# CONFIG_HUGETLB_PAGE is not set
672# CONFIG_CONFIGFS_FS is not set
673# CONFIG_MISC_FILESYSTEMS is not set
674
675#
676# Partition Types
677#
678# CONFIG_PARTITION_ADVANCED is not set
679CONFIG_MSDOS_PARTITION=y
680# CONFIG_NLS is not set
681
682#
683# Kernel hacking
684#
685# CONFIG_PRINTK_TIME is not set
686CONFIG_ENABLE_WARN_DEPRECATED=y
687CONFIG_ENABLE_MUST_CHECK=y
688CONFIG_FRAME_WARN=1024
689CONFIG_MAGIC_SYSRQ=y
690# CONFIG_STRIP_ASM_SYMS is not set
691# CONFIG_UNUSED_SYMBOLS is not set
692# CONFIG_DEBUG_FS is not set
693# CONFIG_HEADERS_CHECK is not set
694CONFIG_DEBUG_KERNEL=y
695# CONFIG_DEBUG_SHIRQ is not set
696# CONFIG_DETECT_SOFTLOCKUP is not set
697# CONFIG_DETECT_HUNG_TASK is not set
698CONFIG_SCHED_DEBUG=y
699# CONFIG_SCHEDSTATS is not set
700# CONFIG_TIMER_STATS is not set
701# CONFIG_DEBUG_OBJECTS is not set
702# CONFIG_DEBUG_SLAB is not set
703# CONFIG_DEBUG_KMEMLEAK is not set
704# CONFIG_DEBUG_RT_MUTEXES is not set
705# CONFIG_RT_MUTEX_TESTER is not set
706# CONFIG_DEBUG_SPINLOCK is not set
707# CONFIG_DEBUG_MUTEXES is not set
708# CONFIG_DEBUG_LOCK_ALLOC is not set
709# CONFIG_PROVE_LOCKING is not set
710# CONFIG_LOCK_STAT is not set
711# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
712# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
713# CONFIG_DEBUG_KOBJECT is not set
714CONFIG_DEBUG_BUGVERBOSE=y
715# CONFIG_DEBUG_INFO is not set
716# CONFIG_DEBUG_VM is not set
717# CONFIG_DEBUG_WRITECOUNT is not set
718CONFIG_DEBUG_MEMORY_INIT=y
719# CONFIG_DEBUG_LIST is not set
720# CONFIG_DEBUG_SG is not set
721# CONFIG_DEBUG_NOTIFIERS is not set
722# CONFIG_DEBUG_CREDENTIALS is not set
723# CONFIG_BOOT_PRINTK_DELAY is not set
724# CONFIG_RCU_TORTURE_TEST is not set
725# CONFIG_RCU_CPU_STALL_DETECTOR is not set
726# CONFIG_BACKTRACE_SELF_TEST is not set
727# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
728# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
729# CONFIG_FAULT_INJECTION is not set
730# CONFIG_LATENCYTOP is not set
731# CONFIG_SYSCTL_SYSCALL_CHECK is not set
732# CONFIG_PAGE_POISONING is not set
733CONFIG_HAVE_FUNCTION_TRACER=y
734CONFIG_TRACING_SUPPORT=y
735# CONFIG_FTRACE is not set
736# CONFIG_SAMPLES is not set
737CONFIG_HAVE_ARCH_KGDB=y
738# CONFIG_KGDB is not set
739CONFIG_ARM_UNWIND=y
740# CONFIG_DEBUG_USER is not set
741# CONFIG_DEBUG_ERRORS is not set
742# CONFIG_DEBUG_STACK_USAGE is not set
743# CONFIG_DEBUG_LL is not set
744# CONFIG_OC_ETM is not set
745
746#
747# Security options
748#
749# CONFIG_KEYS is not set
750# CONFIG_SECURITY is not set
751# CONFIG_SECURITYFS is not set
752# CONFIG_DEFAULT_SECURITY_SELINUX is not set
753# CONFIG_DEFAULT_SECURITY_SMACK is not set
754# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
755CONFIG_DEFAULT_SECURITY_DAC=y
756CONFIG_DEFAULT_SECURITY=""
757# CONFIG_CRYPTO is not set
758# CONFIG_BINARY_PRINTF is not set
759
760#
761# Library routines
762#
763CONFIG_GENERIC_FIND_LAST_BIT=y
764# CONFIG_CRC_CCITT is not set
765# CONFIG_CRC16 is not set
766# CONFIG_CRC_T10DIF is not set
767# CONFIG_CRC_ITU_T is not set
768# CONFIG_CRC32 is not set
769# CONFIG_CRC7 is not set
770# CONFIG_LIBCRC32C is not set
771CONFIG_ZLIB_INFLATE=y
772CONFIG_LZO_DECOMPRESS=y
773CONFIG_DECOMPRESS_GZIP=y
774CONFIG_DECOMPRESS_BZIP2=y
775CONFIG_DECOMPRESS_LZMA=y
776CONFIG_DECOMPRESS_LZO=y
777CONFIG_HAS_IOMEM=y
778CONFIG_HAS_IOPORT=y
779CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/g3evm_defconfig b/arch/arm/configs/g3evm_defconfig
new file mode 100644
index 000000000000..3c19031961db
--- /dev/null
+++ b/arch/arm/configs/g3evm_defconfig
@@ -0,0 +1,774 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc7
4# Mon Feb 8 12:20:01 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_TIME=y
9CONFIG_GENERIC_CLOCKEVENTS=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_HAVE_KERNEL_GZIP=y
34CONFIG_HAVE_KERNEL_LZO=y
35CONFIG_KERNEL_GZIP=y
36# CONFIG_KERNEL_BZIP2 is not set
37# CONFIG_KERNEL_LZMA is not set
38# CONFIG_KERNEL_LZO is not set
39CONFIG_SWAP=y
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_BSD_PROCESS_ACCT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_TINY_RCU is not set
50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
53# CONFIG_TREE_RCU_TRACE is not set
54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=16
57CONFIG_GROUP_SCHED=y
58CONFIG_FAIR_GROUP_SCHED=y
59# CONFIG_RT_GROUP_SCHED is not set
60CONFIG_USER_SCHED=y
61# CONFIG_CGROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
63# CONFIG_SYSFS_DEPRECATED_V2 is not set
64# CONFIG_RELAY is not set
65CONFIG_NAMESPACES=y
66# CONFIG_UTS_NS is not set
67# CONFIG_IPC_NS is not set
68# CONFIG_USER_NS is not set
69# CONFIG_PID_NS is not set
70CONFIG_BLK_DEV_INITRD=y
71CONFIG_INITRAMFS_SOURCE=""
72CONFIG_RD_GZIP=y
73CONFIG_RD_BZIP2=y
74CONFIG_RD_LZMA=y
75CONFIG_RD_LZO=y
76CONFIG_CC_OPTIMIZE_FOR_SIZE=y
77CONFIG_SYSCTL=y
78CONFIG_ANON_INODES=y
79# CONFIG_EMBEDDED is not set
80CONFIG_UID16=y
81CONFIG_SYSCTL_SYSCALL=y
82CONFIG_KALLSYMS=y
83# CONFIG_KALLSYMS_ALL is not set
84# CONFIG_KALLSYMS_EXTRA_PASS is not set
85CONFIG_HOTPLUG=y
86CONFIG_PRINTK=y
87CONFIG_BUG=y
88CONFIG_ELF_CORE=y
89CONFIG_BASE_FULL=y
90CONFIG_FUTEX=y
91CONFIG_EPOLL=y
92CONFIG_SIGNALFD=y
93CONFIG_TIMERFD=y
94CONFIG_EVENTFD=y
95CONFIG_SHMEM=y
96CONFIG_AIO=y
97
98#
99# Kernel Performance Events And Counters
100#
101CONFIG_VM_EVENT_COUNTERS=y
102CONFIG_COMPAT_BRK=y
103CONFIG_SLAB=y
104# CONFIG_SLUB is not set
105# CONFIG_SLOB is not set
106# CONFIG_PROFILING is not set
107CONFIG_HAVE_OPROFILE=y
108CONFIG_HAVE_KPROBES=y
109CONFIG_HAVE_KRETPROBES=y
110CONFIG_HAVE_CLK=y
111
112#
113# GCOV-based kernel profiling
114#
115# CONFIG_SLOW_WORK is not set
116CONFIG_HAVE_GENERIC_DMA_COHERENT=y
117CONFIG_SLABINFO=y
118CONFIG_RT_MUTEXES=y
119CONFIG_BASE_SMALL=0
120# CONFIG_MODULES is not set
121CONFIG_BLOCK=y
122CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
125
126#
127# IO Schedulers
128#
129CONFIG_IOSCHED_NOOP=y
130# CONFIG_IOSCHED_DEADLINE is not set
131# CONFIG_IOSCHED_CFQ is not set
132# CONFIG_DEFAULT_DEADLINE is not set
133# CONFIG_DEFAULT_CFQ is not set
134CONFIG_DEFAULT_NOOP=y
135CONFIG_DEFAULT_IOSCHED="noop"
136# CONFIG_INLINE_SPIN_TRYLOCK is not set
137# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
138# CONFIG_INLINE_SPIN_LOCK is not set
139# CONFIG_INLINE_SPIN_LOCK_BH is not set
140# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
141# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
142CONFIG_INLINE_SPIN_UNLOCK=y
143# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
144CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
145# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
146# CONFIG_INLINE_READ_TRYLOCK is not set
147# CONFIG_INLINE_READ_LOCK is not set
148# CONFIG_INLINE_READ_LOCK_BH is not set
149# CONFIG_INLINE_READ_LOCK_IRQ is not set
150# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
151CONFIG_INLINE_READ_UNLOCK=y
152# CONFIG_INLINE_READ_UNLOCK_BH is not set
153CONFIG_INLINE_READ_UNLOCK_IRQ=y
154# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
155# CONFIG_INLINE_WRITE_TRYLOCK is not set
156# CONFIG_INLINE_WRITE_LOCK is not set
157# CONFIG_INLINE_WRITE_LOCK_BH is not set
158# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
159# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
160CONFIG_INLINE_WRITE_UNLOCK=y
161# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
162CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
163# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
164# CONFIG_MUTEX_SPIN_ON_OWNER is not set
165# CONFIG_FREEZER is not set
166
167#
168# System Type
169#
170CONFIG_MMU=y
171# CONFIG_ARCH_AAEC2000 is not set
172# CONFIG_ARCH_INTEGRATOR is not set
173# CONFIG_ARCH_REALVIEW is not set
174# CONFIG_ARCH_VERSATILE is not set
175# CONFIG_ARCH_AT91 is not set
176# CONFIG_ARCH_CLPS711X is not set
177# CONFIG_ARCH_GEMINI is not set
178# CONFIG_ARCH_EBSA110 is not set
179# CONFIG_ARCH_EP93XX is not set
180# CONFIG_ARCH_FOOTBRIDGE is not set
181# CONFIG_ARCH_MXC is not set
182# CONFIG_ARCH_STMP3XXX is not set
183# CONFIG_ARCH_NETX is not set
184# CONFIG_ARCH_H720X is not set
185# CONFIG_ARCH_NOMADIK is not set
186# CONFIG_ARCH_IOP13XX is not set
187# CONFIG_ARCH_IOP32X is not set
188# CONFIG_ARCH_IOP33X is not set
189# CONFIG_ARCH_IXP23XX is not set
190# CONFIG_ARCH_IXP2000 is not set
191# CONFIG_ARCH_IXP4XX is not set
192# CONFIG_ARCH_L7200 is not set
193# CONFIG_ARCH_DOVE is not set
194# CONFIG_ARCH_KIRKWOOD is not set
195# CONFIG_ARCH_LOKI is not set
196# CONFIG_ARCH_MV78XX0 is not set
197# CONFIG_ARCH_ORION5X is not set
198# CONFIG_ARCH_MMP is not set
199# CONFIG_ARCH_KS8695 is not set
200# CONFIG_ARCH_NS9XXX is not set
201# CONFIG_ARCH_W90X900 is not set
202# CONFIG_ARCH_PNX4008 is not set
203# CONFIG_ARCH_PXA is not set
204# CONFIG_ARCH_MSM is not set
205CONFIG_ARCH_SHMOBILE=y
206# CONFIG_ARCH_RPC is not set
207# CONFIG_ARCH_SA1100 is not set
208# CONFIG_ARCH_S3C2410 is not set
209# CONFIG_ARCH_S3C64XX is not set
210# CONFIG_ARCH_S5PC1XX is not set
211# CONFIG_ARCH_SHARK is not set
212# CONFIG_ARCH_LH7A40X is not set
213# CONFIG_ARCH_U300 is not set
214# CONFIG_ARCH_DAVINCI is not set
215# CONFIG_ARCH_OMAP is not set
216# CONFIG_ARCH_BCMRING is not set
217# CONFIG_ARCH_U8500 is not set
218
219#
220# SH-Mobile System Type
221#
222CONFIG_ARCH_SH7367=y
223# CONFIG_ARCH_SH7377 is not set
224# CONFIG_ARCH_SH7372 is not set
225
226#
227# SH-Mobile Board Type
228#
229CONFIG_MACH_G3EVM=y
230
231#
232# SH-Mobile System Configuration
233#
234
235#
236# Memory configuration
237#
238CONFIG_MEMORY_START=0x50000000
239CONFIG_MEMORY_SIZE=0x08000000
240
241#
242# Timer and clock configuration
243#
244CONFIG_SH_TIMER_CMT=y
245
246#
247# Processor Type
248#
249CONFIG_CPU_V6=y
250# CONFIG_CPU_32v6K is not set
251CONFIG_CPU_32v6=y
252CONFIG_CPU_ABRT_EV6=y
253CONFIG_CPU_PABRT_V6=y
254CONFIG_CPU_CACHE_V6=y
255CONFIG_CPU_CACHE_VIPT=y
256CONFIG_CPU_COPY_V6=y
257CONFIG_CPU_TLB_V6=y
258CONFIG_CPU_HAS_ASID=y
259CONFIG_CPU_CP15=y
260CONFIG_CPU_CP15_MMU=y
261
262#
263# Processor Features
264#
265CONFIG_ARM_THUMB=y
266# CONFIG_CPU_ICACHE_DISABLE is not set
267# CONFIG_CPU_DCACHE_DISABLE is not set
268# CONFIG_CPU_BPREDICT_DISABLE is not set
269CONFIG_ARM_L1_CACHE_SHIFT=5
270# CONFIG_ARM_ERRATA_411920 is not set
271CONFIG_COMMON_CLKDEV=y
272
273#
274# Bus support
275#
276# CONFIG_PCI_SYSCALL is not set
277# CONFIG_ARCH_SUPPORTS_MSI is not set
278# CONFIG_PCCARD is not set
279
280#
281# Kernel Features
282#
283# CONFIG_NO_HZ is not set
284# CONFIG_HIGH_RES_TIMERS is not set
285CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
286CONFIG_VMSPLIT_3G=y
287# CONFIG_VMSPLIT_2G is not set
288# CONFIG_VMSPLIT_1G is not set
289CONFIG_PAGE_OFFSET=0xC0000000
290CONFIG_PREEMPT_NONE=y
291# CONFIG_PREEMPT_VOLUNTARY is not set
292# CONFIG_PREEMPT is not set
293CONFIG_HZ=100
294CONFIG_AEABI=y
295# CONFIG_OABI_COMPAT is not set
296# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
297# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
298# CONFIG_HIGHMEM is not set
299CONFIG_SELECT_MEMORY_MODEL=y
300CONFIG_FLATMEM_MANUAL=y
301# CONFIG_DISCONTIGMEM_MANUAL is not set
302# CONFIG_SPARSEMEM_MANUAL is not set
303CONFIG_FLATMEM=y
304CONFIG_FLAT_NODE_MEM_MAP=y
305CONFIG_PAGEFLAGS_EXTENDED=y
306CONFIG_SPLIT_PTLOCK_CPUS=4
307# CONFIG_PHYS_ADDR_T_64BIT is not set
308CONFIG_ZONE_DMA_FLAG=0
309CONFIG_VIRT_TO_BUS=y
310# CONFIG_KSM is not set
311CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
312CONFIG_ALIGNMENT_TRAP=y
313# CONFIG_UACCESS_WITH_MEMCPY is not set
314
315#
316# Boot options
317#
318CONFIG_ZBOOT_ROM_TEXT=0x0
319CONFIG_ZBOOT_ROM_BSS=0x0
320CONFIG_CMDLINE="console=ttySC1,115200 earlyprintk=sh-sci.1,115200"
321# CONFIG_XIP_KERNEL is not set
322CONFIG_KEXEC=y
323CONFIG_ATAGS_PROC=y
324
325#
326# CPU Power Management
327#
328# CONFIG_CPU_IDLE is not set
329
330#
331# Floating point emulation
332#
333
334#
335# At least one emulation must be selected
336#
337# CONFIG_VFP is not set
338
339#
340# Userspace binary formats
341#
342CONFIG_BINFMT_ELF=y
343# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
344CONFIG_HAVE_AOUT=y
345# CONFIG_BINFMT_AOUT is not set
346# CONFIG_BINFMT_MISC is not set
347
348#
349# Power management options
350#
351CONFIG_PM=y
352# CONFIG_PM_DEBUG is not set
353# CONFIG_SUSPEND is not set
354# CONFIG_APM_EMULATION is not set
355# CONFIG_PM_RUNTIME is not set
356CONFIG_ARCH_SUSPEND_POSSIBLE=y
357# CONFIG_NET is not set
358
359#
360# Device Drivers
361#
362
363#
364# Generic Driver Options
365#
366CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
367# CONFIG_DEVTMPFS is not set
368CONFIG_STANDALONE=y
369CONFIG_PREVENT_FIRMWARE_BUILD=y
370CONFIG_FW_LOADER=y
371# CONFIG_FIRMWARE_IN_KERNEL is not set
372CONFIG_EXTRA_FIRMWARE=""
373# CONFIG_DEBUG_DRIVER is not set
374# CONFIG_DEBUG_DEVRES is not set
375# CONFIG_SYS_HYPERVISOR is not set
376CONFIG_MTD=y
377# CONFIG_MTD_DEBUG is not set
378CONFIG_MTD_CONCAT=y
379CONFIG_MTD_PARTITIONS=y
380# CONFIG_MTD_REDBOOT_PARTS is not set
381# CONFIG_MTD_CMDLINE_PARTS is not set
382# CONFIG_MTD_AFS_PARTS is not set
383# CONFIG_MTD_AR7_PARTS is not set
384
385#
386# User Modules And Translation Layers
387#
388CONFIG_MTD_CHAR=y
389CONFIG_MTD_BLKDEVS=y
390CONFIG_MTD_BLOCK=y
391# CONFIG_FTL is not set
392# CONFIG_NFTL is not set
393# CONFIG_INFTL is not set
394# CONFIG_RFD_FTL is not set
395# CONFIG_SSFDC is not set
396# CONFIG_MTD_OOPS is not set
397
398#
399# RAM/ROM/Flash chip drivers
400#
401CONFIG_MTD_CFI=y
402# CONFIG_MTD_JEDECPROBE is not set
403CONFIG_MTD_GEN_PROBE=y
404# CONFIG_MTD_CFI_ADV_OPTIONS is not set
405CONFIG_MTD_MAP_BANK_WIDTH_1=y
406CONFIG_MTD_MAP_BANK_WIDTH_2=y
407CONFIG_MTD_MAP_BANK_WIDTH_4=y
408# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
409# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
410# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
411CONFIG_MTD_CFI_I1=y
412CONFIG_MTD_CFI_I2=y
413# CONFIG_MTD_CFI_I4 is not set
414# CONFIG_MTD_CFI_I8 is not set
415CONFIG_MTD_CFI_INTELEXT=y
416# CONFIG_MTD_CFI_AMDSTD is not set
417# CONFIG_MTD_CFI_STAA is not set
418CONFIG_MTD_CFI_UTIL=y
419# CONFIG_MTD_RAM is not set
420# CONFIG_MTD_ROM is not set
421# CONFIG_MTD_ABSENT is not set
422
423#
424# Mapping drivers for chip access
425#
426# CONFIG_MTD_COMPLEX_MAPPINGS is not set
427CONFIG_MTD_PHYSMAP=y
428# CONFIG_MTD_PHYSMAP_COMPAT is not set
429# CONFIG_MTD_ARM_INTEGRATOR is not set
430# CONFIG_MTD_PLATRAM is not set
431
432#
433# Self-contained MTD device drivers
434#
435# CONFIG_MTD_SLRAM is not set
436# CONFIG_MTD_PHRAM is not set
437# CONFIG_MTD_MTDRAM is not set
438# CONFIG_MTD_BLOCK2MTD is not set
439
440#
441# Disk-On-Chip Device Drivers
442#
443# CONFIG_MTD_DOC2000 is not set
444# CONFIG_MTD_DOC2001 is not set
445# CONFIG_MTD_DOC2001PLUS is not set
446CONFIG_MTD_NAND=y
447# CONFIG_MTD_NAND_VERIFY_WRITE is not set
448# CONFIG_MTD_NAND_ECC_SMC is not set
449# CONFIG_MTD_NAND_MUSEUM_IDS is not set
450CONFIG_MTD_NAND_IDS=y
451# CONFIG_MTD_NAND_DISKONCHIP is not set
452# CONFIG_MTD_NAND_NANDSIM is not set
453# CONFIG_MTD_NAND_PLATFORM is not set
454# CONFIG_MTD_ONENAND is not set
455
456#
457# LPDDR flash memory drivers
458#
459# CONFIG_MTD_LPDDR is not set
460
461#
462# UBI - Unsorted block images
463#
464# CONFIG_MTD_UBI is not set
465# CONFIG_PARPORT is not set
466# CONFIG_BLK_DEV is not set
467# CONFIG_MISC_DEVICES is not set
468CONFIG_HAVE_IDE=y
469# CONFIG_IDE is not set
470
471#
472# SCSI device support
473#
474# CONFIG_RAID_ATTRS is not set
475# CONFIG_SCSI is not set
476# CONFIG_SCSI_DMA is not set
477# CONFIG_SCSI_NETLINK is not set
478# CONFIG_ATA is not set
479# CONFIG_MD is not set
480# CONFIG_PHONE is not set
481
482#
483# Input device support
484#
485CONFIG_INPUT=y
486# CONFIG_INPUT_FF_MEMLESS is not set
487# CONFIG_INPUT_POLLDEV is not set
488# CONFIG_INPUT_SPARSEKMAP is not set
489
490#
491# Userland interfaces
492#
493CONFIG_INPUT_MOUSEDEV=y
494# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
495CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
496CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
497# CONFIG_INPUT_JOYDEV is not set
498# CONFIG_INPUT_EVDEV is not set
499# CONFIG_INPUT_EVBUG is not set
500
501#
502# Input Device Drivers
503#
504# CONFIG_INPUT_KEYBOARD is not set
505# CONFIG_INPUT_MOUSE is not set
506# CONFIG_INPUT_JOYSTICK is not set
507# CONFIG_INPUT_TABLET is not set
508# CONFIG_INPUT_TOUCHSCREEN is not set
509# CONFIG_INPUT_MISC is not set
510
511#
512# Hardware I/O ports
513#
514# CONFIG_SERIO is not set
515# CONFIG_GAMEPORT is not set
516
517#
518# Character devices
519#
520CONFIG_VT=y
521CONFIG_CONSOLE_TRANSLATIONS=y
522CONFIG_VT_CONSOLE=y
523CONFIG_HW_CONSOLE=y
524# CONFIG_VT_HW_CONSOLE_BINDING is not set
525CONFIG_DEVKMEM=y
526# CONFIG_SERIAL_NONSTANDARD is not set
527
528#
529# Serial drivers
530#
531# CONFIG_SERIAL_8250 is not set
532
533#
534# Non-8250 serial port support
535#
536CONFIG_SERIAL_SH_SCI=y
537CONFIG_SERIAL_SH_SCI_NR_UARTS=8
538CONFIG_SERIAL_SH_SCI_CONSOLE=y
539CONFIG_SERIAL_CORE=y
540CONFIG_SERIAL_CORE_CONSOLE=y
541CONFIG_UNIX98_PTYS=y
542# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
543# CONFIG_LEGACY_PTYS is not set
544# CONFIG_IPMI_HANDLER is not set
545# CONFIG_HW_RANDOM is not set
546# CONFIG_R3964 is not set
547# CONFIG_RAW_DRIVER is not set
548# CONFIG_TCG_TPM is not set
549# CONFIG_I2C is not set
550# CONFIG_SPI is not set
551
552#
553# PPS support
554#
555# CONFIG_PPS is not set
556# CONFIG_W1 is not set
557# CONFIG_POWER_SUPPLY is not set
558# CONFIG_HWMON is not set
559# CONFIG_THERMAL is not set
560# CONFIG_WATCHDOG is not set
561CONFIG_SSB_POSSIBLE=y
562
563#
564# Sonics Silicon Backplane
565#
566# CONFIG_SSB is not set
567
568#
569# Multifunction device drivers
570#
571# CONFIG_MFD_CORE is not set
572# CONFIG_MFD_SM501 is not set
573# CONFIG_HTC_PASIC3 is not set
574# CONFIG_MFD_TMIO is not set
575# CONFIG_MFD_T7L66XB is not set
576# CONFIG_MFD_TC6387XB is not set
577# CONFIG_REGULATOR is not set
578# CONFIG_MEDIA_SUPPORT is not set
579
580#
581# Graphics support
582#
583# CONFIG_VGASTATE is not set
584# CONFIG_VIDEO_OUTPUT_CONTROL is not set
585# CONFIG_FB is not set
586# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
587
588#
589# Display device support
590#
591# CONFIG_DISPLAY_SUPPORT is not set
592
593#
594# Console display driver support
595#
596# CONFIG_VGA_CONSOLE is not set
597CONFIG_DUMMY_CONSOLE=y
598# CONFIG_SOUND is not set
599# CONFIG_HID_SUPPORT is not set
600# CONFIG_USB_SUPPORT is not set
601# CONFIG_MMC is not set
602# CONFIG_MEMSTICK is not set
603# CONFIG_NEW_LEDS is not set
604# CONFIG_ACCESSIBILITY is not set
605CONFIG_RTC_LIB=y
606# CONFIG_RTC_CLASS is not set
607# CONFIG_DMADEVICES is not set
608# CONFIG_AUXDISPLAY is not set
609# CONFIG_UIO is not set
610
611#
612# TI VLYNQ
613#
614# CONFIG_STAGING is not set
615
616#
617# File systems
618#
619# CONFIG_EXT2_FS is not set
620# CONFIG_EXT3_FS is not set
621# CONFIG_EXT4_FS is not set
622# CONFIG_REISERFS_FS is not set
623# CONFIG_JFS_FS is not set
624# CONFIG_FS_POSIX_ACL is not set
625# CONFIG_XFS_FS is not set
626# CONFIG_GFS2_FS is not set
627# CONFIG_BTRFS_FS is not set
628# CONFIG_NILFS2_FS is not set
629CONFIG_FILE_LOCKING=y
630# CONFIG_FSNOTIFY is not set
631# CONFIG_DNOTIFY is not set
632# CONFIG_INOTIFY is not set
633# CONFIG_INOTIFY_USER is not set
634# CONFIG_QUOTA is not set
635# CONFIG_AUTOFS_FS is not set
636# CONFIG_AUTOFS4_FS is not set
637# CONFIG_FUSE_FS is not set
638
639#
640# Caches
641#
642# CONFIG_FSCACHE is not set
643
644#
645# CD-ROM/DVD Filesystems
646#
647# CONFIG_ISO9660_FS is not set
648# CONFIG_UDF_FS is not set
649
650#
651# DOS/FAT/NT Filesystems
652#
653# CONFIG_MSDOS_FS is not set
654# CONFIG_VFAT_FS is not set
655# CONFIG_NTFS_FS is not set
656
657#
658# Pseudo filesystems
659#
660CONFIG_PROC_FS=y
661CONFIG_PROC_SYSCTL=y
662CONFIG_PROC_PAGE_MONITOR=y
663CONFIG_SYSFS=y
664CONFIG_TMPFS=y
665# CONFIG_TMPFS_POSIX_ACL is not set
666# CONFIG_HUGETLB_PAGE is not set
667# CONFIG_CONFIGFS_FS is not set
668# CONFIG_MISC_FILESYSTEMS is not set
669
670#
671# Partition Types
672#
673# CONFIG_PARTITION_ADVANCED is not set
674CONFIG_MSDOS_PARTITION=y
675# CONFIG_NLS is not set
676
677#
678# Kernel hacking
679#
680# CONFIG_PRINTK_TIME is not set
681CONFIG_ENABLE_WARN_DEPRECATED=y
682CONFIG_ENABLE_MUST_CHECK=y
683CONFIG_FRAME_WARN=1024
684CONFIG_MAGIC_SYSRQ=y
685# CONFIG_STRIP_ASM_SYMS is not set
686# CONFIG_UNUSED_SYMBOLS is not set
687# CONFIG_DEBUG_FS is not set
688# CONFIG_HEADERS_CHECK is not set
689CONFIG_DEBUG_KERNEL=y
690# CONFIG_DEBUG_SHIRQ is not set
691# CONFIG_DETECT_SOFTLOCKUP is not set
692# CONFIG_DETECT_HUNG_TASK is not set
693CONFIG_SCHED_DEBUG=y
694# CONFIG_SCHEDSTATS is not set
695# CONFIG_TIMER_STATS is not set
696# CONFIG_DEBUG_OBJECTS is not set
697# CONFIG_DEBUG_SLAB is not set
698# CONFIG_DEBUG_KMEMLEAK is not set
699# CONFIG_DEBUG_RT_MUTEXES is not set
700# CONFIG_RT_MUTEX_TESTER is not set
701# CONFIG_DEBUG_SPINLOCK is not set
702# CONFIG_DEBUG_MUTEXES is not set
703# CONFIG_DEBUG_LOCK_ALLOC is not set
704# CONFIG_PROVE_LOCKING is not set
705# CONFIG_LOCK_STAT is not set
706# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
707# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
708# CONFIG_DEBUG_KOBJECT is not set
709CONFIG_DEBUG_BUGVERBOSE=y
710# CONFIG_DEBUG_INFO is not set
711# CONFIG_DEBUG_VM is not set
712# CONFIG_DEBUG_WRITECOUNT is not set
713CONFIG_DEBUG_MEMORY_INIT=y
714# CONFIG_DEBUG_LIST is not set
715# CONFIG_DEBUG_SG is not set
716# CONFIG_DEBUG_NOTIFIERS is not set
717# CONFIG_DEBUG_CREDENTIALS is not set
718# CONFIG_BOOT_PRINTK_DELAY is not set
719# CONFIG_RCU_TORTURE_TEST is not set
720# CONFIG_RCU_CPU_STALL_DETECTOR is not set
721# CONFIG_BACKTRACE_SELF_TEST is not set
722# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
723# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
724# CONFIG_FAULT_INJECTION is not set
725# CONFIG_LATENCYTOP is not set
726# CONFIG_SYSCTL_SYSCALL_CHECK is not set
727# CONFIG_PAGE_POISONING is not set
728CONFIG_HAVE_FUNCTION_TRACER=y
729CONFIG_TRACING_SUPPORT=y
730# CONFIG_FTRACE is not set
731# CONFIG_SAMPLES is not set
732CONFIG_HAVE_ARCH_KGDB=y
733# CONFIG_KGDB is not set
734CONFIG_ARM_UNWIND=y
735# CONFIG_DEBUG_USER is not set
736# CONFIG_DEBUG_ERRORS is not set
737# CONFIG_DEBUG_STACK_USAGE is not set
738# CONFIG_DEBUG_LL is not set
739# CONFIG_OC_ETM is not set
740
741#
742# Security options
743#
744# CONFIG_KEYS is not set
745# CONFIG_SECURITY is not set
746# CONFIG_SECURITYFS is not set
747# CONFIG_DEFAULT_SECURITY_SELINUX is not set
748# CONFIG_DEFAULT_SECURITY_SMACK is not set
749# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
750CONFIG_DEFAULT_SECURITY_DAC=y
751CONFIG_DEFAULT_SECURITY=""
752# CONFIG_CRYPTO is not set
753# CONFIG_BINARY_PRINTF is not set
754
755#
756# Library routines
757#
758CONFIG_GENERIC_FIND_LAST_BIT=y
759# CONFIG_CRC_CCITT is not set
760# CONFIG_CRC16 is not set
761# CONFIG_CRC_T10DIF is not set
762# CONFIG_CRC_ITU_T is not set
763# CONFIG_CRC32 is not set
764# CONFIG_CRC7 is not set
765# CONFIG_LIBCRC32C is not set
766CONFIG_ZLIB_INFLATE=y
767CONFIG_LZO_DECOMPRESS=y
768CONFIG_DECOMPRESS_GZIP=y
769CONFIG_DECOMPRESS_BZIP2=y
770CONFIG_DECOMPRESS_LZMA=y
771CONFIG_DECOMPRESS_LZO=y
772CONFIG_HAS_IOMEM=y
773CONFIG_HAS_IOPORT=y
774CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/g4evm_defconfig b/arch/arm/configs/g4evm_defconfig
new file mode 100644
index 000000000000..8ee79a537134
--- /dev/null
+++ b/arch/arm/configs/g4evm_defconfig
@@ -0,0 +1,779 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc7
4# Mon Feb 8 12:21:35 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_TIME=y
9CONFIG_GENERIC_CLOCKEVENTS=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_HAVE_KERNEL_GZIP=y
34CONFIG_HAVE_KERNEL_LZO=y
35CONFIG_KERNEL_GZIP=y
36# CONFIG_KERNEL_BZIP2 is not set
37# CONFIG_KERNEL_LZMA is not set
38# CONFIG_KERNEL_LZO is not set
39CONFIG_SWAP=y
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_BSD_PROCESS_ACCT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_TINY_RCU is not set
50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
53# CONFIG_TREE_RCU_TRACE is not set
54CONFIG_IKCONFIG=y
55CONFIG_IKCONFIG_PROC=y
56CONFIG_LOG_BUF_SHIFT=16
57CONFIG_GROUP_SCHED=y
58CONFIG_FAIR_GROUP_SCHED=y
59# CONFIG_RT_GROUP_SCHED is not set
60CONFIG_USER_SCHED=y
61# CONFIG_CGROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
63# CONFIG_SYSFS_DEPRECATED_V2 is not set
64# CONFIG_RELAY is not set
65CONFIG_NAMESPACES=y
66# CONFIG_UTS_NS is not set
67# CONFIG_IPC_NS is not set
68# CONFIG_USER_NS is not set
69# CONFIG_PID_NS is not set
70CONFIG_BLK_DEV_INITRD=y
71CONFIG_INITRAMFS_SOURCE=""
72CONFIG_RD_GZIP=y
73CONFIG_RD_BZIP2=y
74CONFIG_RD_LZMA=y
75CONFIG_RD_LZO=y
76CONFIG_CC_OPTIMIZE_FOR_SIZE=y
77CONFIG_SYSCTL=y
78CONFIG_ANON_INODES=y
79# CONFIG_EMBEDDED is not set
80CONFIG_UID16=y
81CONFIG_SYSCTL_SYSCALL=y
82CONFIG_KALLSYMS=y
83# CONFIG_KALLSYMS_ALL is not set
84# CONFIG_KALLSYMS_EXTRA_PASS is not set
85CONFIG_HOTPLUG=y
86CONFIG_PRINTK=y
87CONFIG_BUG=y
88CONFIG_ELF_CORE=y
89CONFIG_BASE_FULL=y
90CONFIG_FUTEX=y
91CONFIG_EPOLL=y
92CONFIG_SIGNALFD=y
93CONFIG_TIMERFD=y
94CONFIG_EVENTFD=y
95CONFIG_SHMEM=y
96CONFIG_AIO=y
97
98#
99# Kernel Performance Events And Counters
100#
101CONFIG_VM_EVENT_COUNTERS=y
102CONFIG_COMPAT_BRK=y
103CONFIG_SLAB=y
104# CONFIG_SLUB is not set
105# CONFIG_SLOB is not set
106# CONFIG_PROFILING is not set
107CONFIG_HAVE_OPROFILE=y
108CONFIG_HAVE_KPROBES=y
109CONFIG_HAVE_KRETPROBES=y
110CONFIG_HAVE_CLK=y
111
112#
113# GCOV-based kernel profiling
114#
115# CONFIG_SLOW_WORK is not set
116CONFIG_HAVE_GENERIC_DMA_COHERENT=y
117CONFIG_SLABINFO=y
118CONFIG_RT_MUTEXES=y
119CONFIG_BASE_SMALL=0
120# CONFIG_MODULES is not set
121CONFIG_BLOCK=y
122CONFIG_LBDAF=y
123# CONFIG_BLK_DEV_BSG is not set
124# CONFIG_BLK_DEV_INTEGRITY is not set
125
126#
127# IO Schedulers
128#
129CONFIG_IOSCHED_NOOP=y
130# CONFIG_IOSCHED_DEADLINE is not set
131# CONFIG_IOSCHED_CFQ is not set
132# CONFIG_DEFAULT_DEADLINE is not set
133# CONFIG_DEFAULT_CFQ is not set
134CONFIG_DEFAULT_NOOP=y
135CONFIG_DEFAULT_IOSCHED="noop"
136# CONFIG_INLINE_SPIN_TRYLOCK is not set
137# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
138# CONFIG_INLINE_SPIN_LOCK is not set
139# CONFIG_INLINE_SPIN_LOCK_BH is not set
140# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
141# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
142CONFIG_INLINE_SPIN_UNLOCK=y
143# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
144CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
145# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
146# CONFIG_INLINE_READ_TRYLOCK is not set
147# CONFIG_INLINE_READ_LOCK is not set
148# CONFIG_INLINE_READ_LOCK_BH is not set
149# CONFIG_INLINE_READ_LOCK_IRQ is not set
150# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
151CONFIG_INLINE_READ_UNLOCK=y
152# CONFIG_INLINE_READ_UNLOCK_BH is not set
153CONFIG_INLINE_READ_UNLOCK_IRQ=y
154# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
155# CONFIG_INLINE_WRITE_TRYLOCK is not set
156# CONFIG_INLINE_WRITE_LOCK is not set
157# CONFIG_INLINE_WRITE_LOCK_BH is not set
158# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
159# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
160CONFIG_INLINE_WRITE_UNLOCK=y
161# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
162CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
163# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
164# CONFIG_MUTEX_SPIN_ON_OWNER is not set
165# CONFIG_FREEZER is not set
166
167#
168# System Type
169#
170CONFIG_MMU=y
171# CONFIG_ARCH_AAEC2000 is not set
172# CONFIG_ARCH_INTEGRATOR is not set
173# CONFIG_ARCH_REALVIEW is not set
174# CONFIG_ARCH_VERSATILE is not set
175# CONFIG_ARCH_AT91 is not set
176# CONFIG_ARCH_CLPS711X is not set
177# CONFIG_ARCH_GEMINI is not set
178# CONFIG_ARCH_EBSA110 is not set
179# CONFIG_ARCH_EP93XX is not set
180# CONFIG_ARCH_FOOTBRIDGE is not set
181# CONFIG_ARCH_MXC is not set
182# CONFIG_ARCH_STMP3XXX is not set
183# CONFIG_ARCH_NETX is not set
184# CONFIG_ARCH_H720X is not set
185# CONFIG_ARCH_NOMADIK is not set
186# CONFIG_ARCH_IOP13XX is not set
187# CONFIG_ARCH_IOP32X is not set
188# CONFIG_ARCH_IOP33X is not set
189# CONFIG_ARCH_IXP23XX is not set
190# CONFIG_ARCH_IXP2000 is not set
191# CONFIG_ARCH_IXP4XX is not set
192# CONFIG_ARCH_L7200 is not set
193# CONFIG_ARCH_DOVE is not set
194# CONFIG_ARCH_KIRKWOOD is not set
195# CONFIG_ARCH_LOKI is not set
196# CONFIG_ARCH_MV78XX0 is not set
197# CONFIG_ARCH_ORION5X is not set
198# CONFIG_ARCH_MMP is not set
199# CONFIG_ARCH_KS8695 is not set
200# CONFIG_ARCH_NS9XXX is not set
201# CONFIG_ARCH_W90X900 is not set
202# CONFIG_ARCH_PNX4008 is not set
203# CONFIG_ARCH_PXA is not set
204# CONFIG_ARCH_MSM is not set
205CONFIG_ARCH_SHMOBILE=y
206# CONFIG_ARCH_RPC is not set
207# CONFIG_ARCH_SA1100 is not set
208# CONFIG_ARCH_S3C2410 is not set
209# CONFIG_ARCH_S3C64XX is not set
210# CONFIG_ARCH_S5PC1XX is not set
211# CONFIG_ARCH_SHARK is not set
212# CONFIG_ARCH_LH7A40X is not set
213# CONFIG_ARCH_U300 is not set
214# CONFIG_ARCH_DAVINCI is not set
215# CONFIG_ARCH_OMAP is not set
216# CONFIG_ARCH_BCMRING is not set
217# CONFIG_ARCH_U8500 is not set
218
219#
220# SH-Mobile System Type
221#
222# CONFIG_ARCH_SH7367 is not set
223CONFIG_ARCH_SH7377=y
224# CONFIG_ARCH_SH7372 is not set
225
226#
227# SH-Mobile Board Type
228#
229CONFIG_MACH_G4EVM=y
230
231#
232# SH-Mobile System Configuration
233#
234
235#
236# Memory configuration
237#
238CONFIG_MEMORY_START=0x40000000
239CONFIG_MEMORY_SIZE=0x08000000
240
241#
242# Timer and clock configuration
243#
244CONFIG_SH_TIMER_CMT=y
245
246#
247# Processor Type
248#
249CONFIG_CPU_32v6K=y
250CONFIG_CPU_V7=y
251CONFIG_CPU_32v7=y
252CONFIG_CPU_ABRT_EV7=y
253CONFIG_CPU_PABRT_V7=y
254CONFIG_CPU_CACHE_V7=y
255CONFIG_CPU_CACHE_VIPT=y
256CONFIG_CPU_COPY_V6=y
257CONFIG_CPU_TLB_V7=y
258CONFIG_CPU_HAS_ASID=y
259CONFIG_CPU_CP15=y
260CONFIG_CPU_CP15_MMU=y
261
262#
263# Processor Features
264#
265CONFIG_ARM_THUMB=y
266# CONFIG_ARM_THUMBEE is not set
267# CONFIG_CPU_ICACHE_DISABLE is not set
268# CONFIG_CPU_DCACHE_DISABLE is not set
269# CONFIG_CPU_BPREDICT_DISABLE is not set
270CONFIG_HAS_TLS_REG=y
271CONFIG_ARM_L1_CACHE_SHIFT=5
272# CONFIG_ARM_ERRATA_430973 is not set
273# CONFIG_ARM_ERRATA_458693 is not set
274# CONFIG_ARM_ERRATA_460075 is not set
275CONFIG_COMMON_CLKDEV=y
276
277#
278# Bus support
279#
280# CONFIG_PCI_SYSCALL is not set
281# CONFIG_ARCH_SUPPORTS_MSI is not set
282# CONFIG_PCCARD is not set
283
284#
285# Kernel Features
286#
287# CONFIG_NO_HZ is not set
288# CONFIG_HIGH_RES_TIMERS is not set
289CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
290CONFIG_VMSPLIT_3G=y
291# CONFIG_VMSPLIT_2G is not set
292# CONFIG_VMSPLIT_1G is not set
293CONFIG_PAGE_OFFSET=0xC0000000
294CONFIG_PREEMPT_NONE=y
295# CONFIG_PREEMPT_VOLUNTARY is not set
296# CONFIG_PREEMPT is not set
297CONFIG_HZ=100
298# CONFIG_THUMB2_KERNEL is not set
299CONFIG_AEABI=y
300# CONFIG_OABI_COMPAT is not set
301# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
302# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
303# CONFIG_HIGHMEM is not set
304CONFIG_SELECT_MEMORY_MODEL=y
305CONFIG_FLATMEM_MANUAL=y
306# CONFIG_DISCONTIGMEM_MANUAL is not set
307# CONFIG_SPARSEMEM_MANUAL is not set
308CONFIG_FLATMEM=y
309CONFIG_FLAT_NODE_MEM_MAP=y
310CONFIG_PAGEFLAGS_EXTENDED=y
311CONFIG_SPLIT_PTLOCK_CPUS=4
312# CONFIG_PHYS_ADDR_T_64BIT is not set
313CONFIG_ZONE_DMA_FLAG=0
314CONFIG_VIRT_TO_BUS=y
315# CONFIG_KSM is not set
316CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
317CONFIG_ALIGNMENT_TRAP=y
318# CONFIG_UACCESS_WITH_MEMCPY is not set
319
320#
321# Boot options
322#
323CONFIG_ZBOOT_ROM_TEXT=0x0
324CONFIG_ZBOOT_ROM_BSS=0x0
325CONFIG_CMDLINE="console=ttySC4,115200 earlyprintk=sh-sci.4,115200"
326# CONFIG_XIP_KERNEL is not set
327CONFIG_KEXEC=y
328CONFIG_ATAGS_PROC=y
329
330#
331# CPU Power Management
332#
333# CONFIG_CPU_IDLE is not set
334
335#
336# Floating point emulation
337#
338
339#
340# At least one emulation must be selected
341#
342# CONFIG_VFP is not set
343
344#
345# Userspace binary formats
346#
347CONFIG_BINFMT_ELF=y
348# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
349CONFIG_HAVE_AOUT=y
350# CONFIG_BINFMT_AOUT is not set
351# CONFIG_BINFMT_MISC is not set
352
353#
354# Power management options
355#
356CONFIG_PM=y
357# CONFIG_PM_DEBUG is not set
358# CONFIG_SUSPEND is not set
359# CONFIG_APM_EMULATION is not set
360# CONFIG_PM_RUNTIME is not set
361CONFIG_ARCH_SUSPEND_POSSIBLE=y
362# CONFIG_NET is not set
363
364#
365# Device Drivers
366#
367
368#
369# Generic Driver Options
370#
371CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
372# CONFIG_DEVTMPFS is not set
373CONFIG_STANDALONE=y
374CONFIG_PREVENT_FIRMWARE_BUILD=y
375CONFIG_FW_LOADER=y
376# CONFIG_FIRMWARE_IN_KERNEL is not set
377CONFIG_EXTRA_FIRMWARE=""
378# CONFIG_DEBUG_DRIVER is not set
379# CONFIG_DEBUG_DEVRES is not set
380# CONFIG_SYS_HYPERVISOR is not set
381CONFIG_MTD=y
382# CONFIG_MTD_DEBUG is not set
383CONFIG_MTD_CONCAT=y
384CONFIG_MTD_PARTITIONS=y
385# CONFIG_MTD_REDBOOT_PARTS is not set
386# CONFIG_MTD_CMDLINE_PARTS is not set
387# CONFIG_MTD_AFS_PARTS is not set
388# CONFIG_MTD_AR7_PARTS is not set
389
390#
391# User Modules And Translation Layers
392#
393CONFIG_MTD_CHAR=y
394CONFIG_MTD_BLKDEVS=y
395CONFIG_MTD_BLOCK=y
396# CONFIG_FTL is not set
397# CONFIG_NFTL is not set
398# CONFIG_INFTL is not set
399# CONFIG_RFD_FTL is not set
400# CONFIG_SSFDC is not set
401# CONFIG_MTD_OOPS is not set
402
403#
404# RAM/ROM/Flash chip drivers
405#
406CONFIG_MTD_CFI=y
407# CONFIG_MTD_JEDECPROBE is not set
408CONFIG_MTD_GEN_PROBE=y
409# CONFIG_MTD_CFI_ADV_OPTIONS is not set
410CONFIG_MTD_MAP_BANK_WIDTH_1=y
411CONFIG_MTD_MAP_BANK_WIDTH_2=y
412CONFIG_MTD_MAP_BANK_WIDTH_4=y
413# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
414# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
415# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
416CONFIG_MTD_CFI_I1=y
417CONFIG_MTD_CFI_I2=y
418# CONFIG_MTD_CFI_I4 is not set
419# CONFIG_MTD_CFI_I8 is not set
420CONFIG_MTD_CFI_INTELEXT=y
421# CONFIG_MTD_CFI_AMDSTD is not set
422# CONFIG_MTD_CFI_STAA is not set
423CONFIG_MTD_CFI_UTIL=y
424# CONFIG_MTD_RAM is not set
425# CONFIG_MTD_ROM is not set
426# CONFIG_MTD_ABSENT is not set
427
428#
429# Mapping drivers for chip access
430#
431# CONFIG_MTD_COMPLEX_MAPPINGS is not set
432CONFIG_MTD_PHYSMAP=y
433# CONFIG_MTD_PHYSMAP_COMPAT is not set
434# CONFIG_MTD_ARM_INTEGRATOR is not set
435# CONFIG_MTD_PLATRAM is not set
436
437#
438# Self-contained MTD device drivers
439#
440# CONFIG_MTD_SLRAM is not set
441# CONFIG_MTD_PHRAM is not set
442# CONFIG_MTD_MTDRAM is not set
443# CONFIG_MTD_BLOCK2MTD is not set
444
445#
446# Disk-On-Chip Device Drivers
447#
448# CONFIG_MTD_DOC2000 is not set
449# CONFIG_MTD_DOC2001 is not set
450# CONFIG_MTD_DOC2001PLUS is not set
451CONFIG_MTD_NAND=y
452# CONFIG_MTD_NAND_VERIFY_WRITE is not set
453# CONFIG_MTD_NAND_ECC_SMC is not set
454# CONFIG_MTD_NAND_MUSEUM_IDS is not set
455CONFIG_MTD_NAND_IDS=y
456# CONFIG_MTD_NAND_DISKONCHIP is not set
457# CONFIG_MTD_NAND_NANDSIM is not set
458# CONFIG_MTD_NAND_PLATFORM is not set
459# CONFIG_MTD_ONENAND is not set
460
461#
462# LPDDR flash memory drivers
463#
464# CONFIG_MTD_LPDDR is not set
465
466#
467# UBI - Unsorted block images
468#
469# CONFIG_MTD_UBI is not set
470# CONFIG_PARPORT is not set
471# CONFIG_BLK_DEV is not set
472# CONFIG_MISC_DEVICES is not set
473CONFIG_HAVE_IDE=y
474# CONFIG_IDE is not set
475
476#
477# SCSI device support
478#
479# CONFIG_RAID_ATTRS is not set
480# CONFIG_SCSI is not set
481# CONFIG_SCSI_DMA is not set
482# CONFIG_SCSI_NETLINK is not set
483# CONFIG_ATA is not set
484# CONFIG_MD is not set
485# CONFIG_PHONE is not set
486
487#
488# Input device support
489#
490CONFIG_INPUT=y
491# CONFIG_INPUT_FF_MEMLESS is not set
492# CONFIG_INPUT_POLLDEV is not set
493# CONFIG_INPUT_SPARSEKMAP is not set
494
495#
496# Userland interfaces
497#
498CONFIG_INPUT_MOUSEDEV=y
499# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
500CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
501CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
502# CONFIG_INPUT_JOYDEV is not set
503# CONFIG_INPUT_EVDEV is not set
504# CONFIG_INPUT_EVBUG is not set
505
506#
507# Input Device Drivers
508#
509# CONFIG_INPUT_KEYBOARD is not set
510# CONFIG_INPUT_MOUSE is not set
511# CONFIG_INPUT_JOYSTICK is not set
512# CONFIG_INPUT_TABLET is not set
513# CONFIG_INPUT_TOUCHSCREEN is not set
514# CONFIG_INPUT_MISC is not set
515
516#
517# Hardware I/O ports
518#
519# CONFIG_SERIO is not set
520# CONFIG_GAMEPORT is not set
521
522#
523# Character devices
524#
525CONFIG_VT=y
526CONFIG_CONSOLE_TRANSLATIONS=y
527CONFIG_VT_CONSOLE=y
528CONFIG_HW_CONSOLE=y
529# CONFIG_VT_HW_CONSOLE_BINDING is not set
530CONFIG_DEVKMEM=y
531# CONFIG_SERIAL_NONSTANDARD is not set
532
533#
534# Serial drivers
535#
536# CONFIG_SERIAL_8250 is not set
537
538#
539# Non-8250 serial port support
540#
541CONFIG_SERIAL_SH_SCI=y
542CONFIG_SERIAL_SH_SCI_NR_UARTS=8
543CONFIG_SERIAL_SH_SCI_CONSOLE=y
544CONFIG_SERIAL_CORE=y
545CONFIG_SERIAL_CORE_CONSOLE=y
546CONFIG_UNIX98_PTYS=y
547# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
548# CONFIG_LEGACY_PTYS is not set
549# CONFIG_IPMI_HANDLER is not set
550# CONFIG_HW_RANDOM is not set
551# CONFIG_R3964 is not set
552# CONFIG_RAW_DRIVER is not set
553# CONFIG_TCG_TPM is not set
554# CONFIG_I2C is not set
555# CONFIG_SPI is not set
556
557#
558# PPS support
559#
560# CONFIG_PPS is not set
561# CONFIG_W1 is not set
562# CONFIG_POWER_SUPPLY is not set
563# CONFIG_HWMON is not set
564# CONFIG_THERMAL is not set
565# CONFIG_WATCHDOG is not set
566CONFIG_SSB_POSSIBLE=y
567
568#
569# Sonics Silicon Backplane
570#
571# CONFIG_SSB is not set
572
573#
574# Multifunction device drivers
575#
576# CONFIG_MFD_CORE is not set
577# CONFIG_MFD_SM501 is not set
578# CONFIG_HTC_PASIC3 is not set
579# CONFIG_MFD_TMIO is not set
580# CONFIG_MFD_T7L66XB is not set
581# CONFIG_MFD_TC6387XB is not set
582# CONFIG_REGULATOR is not set
583# CONFIG_MEDIA_SUPPORT is not set
584
585#
586# Graphics support
587#
588# CONFIG_VGASTATE is not set
589# CONFIG_VIDEO_OUTPUT_CONTROL is not set
590# CONFIG_FB is not set
591# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
592
593#
594# Display device support
595#
596# CONFIG_DISPLAY_SUPPORT is not set
597
598#
599# Console display driver support
600#
601# CONFIG_VGA_CONSOLE is not set
602CONFIG_DUMMY_CONSOLE=y
603# CONFIG_SOUND is not set
604# CONFIG_HID_SUPPORT is not set
605# CONFIG_USB_SUPPORT is not set
606# CONFIG_MMC is not set
607# CONFIG_MEMSTICK is not set
608# CONFIG_NEW_LEDS is not set
609# CONFIG_ACCESSIBILITY is not set
610CONFIG_RTC_LIB=y
611# CONFIG_RTC_CLASS is not set
612# CONFIG_DMADEVICES is not set
613# CONFIG_AUXDISPLAY is not set
614# CONFIG_UIO is not set
615
616#
617# TI VLYNQ
618#
619# CONFIG_STAGING is not set
620
621#
622# File systems
623#
624# CONFIG_EXT2_FS is not set
625# CONFIG_EXT3_FS is not set
626# CONFIG_EXT4_FS is not set
627# CONFIG_REISERFS_FS is not set
628# CONFIG_JFS_FS is not set
629# CONFIG_FS_POSIX_ACL is not set
630# CONFIG_XFS_FS is not set
631# CONFIG_GFS2_FS is not set
632# CONFIG_BTRFS_FS is not set
633# CONFIG_NILFS2_FS is not set
634CONFIG_FILE_LOCKING=y
635# CONFIG_FSNOTIFY is not set
636# CONFIG_DNOTIFY is not set
637# CONFIG_INOTIFY is not set
638# CONFIG_INOTIFY_USER is not set
639# CONFIG_QUOTA is not set
640# CONFIG_AUTOFS_FS is not set
641# CONFIG_AUTOFS4_FS is not set
642# CONFIG_FUSE_FS is not set
643
644#
645# Caches
646#
647# CONFIG_FSCACHE is not set
648
649#
650# CD-ROM/DVD Filesystems
651#
652# CONFIG_ISO9660_FS is not set
653# CONFIG_UDF_FS is not set
654
655#
656# DOS/FAT/NT Filesystems
657#
658# CONFIG_MSDOS_FS is not set
659# CONFIG_VFAT_FS is not set
660# CONFIG_NTFS_FS is not set
661
662#
663# Pseudo filesystems
664#
665CONFIG_PROC_FS=y
666CONFIG_PROC_SYSCTL=y
667CONFIG_PROC_PAGE_MONITOR=y
668CONFIG_SYSFS=y
669CONFIG_TMPFS=y
670# CONFIG_TMPFS_POSIX_ACL is not set
671# CONFIG_HUGETLB_PAGE is not set
672# CONFIG_CONFIGFS_FS is not set
673# CONFIG_MISC_FILESYSTEMS is not set
674
675#
676# Partition Types
677#
678# CONFIG_PARTITION_ADVANCED is not set
679CONFIG_MSDOS_PARTITION=y
680# CONFIG_NLS is not set
681
682#
683# Kernel hacking
684#
685# CONFIG_PRINTK_TIME is not set
686CONFIG_ENABLE_WARN_DEPRECATED=y
687CONFIG_ENABLE_MUST_CHECK=y
688CONFIG_FRAME_WARN=1024
689CONFIG_MAGIC_SYSRQ=y
690# CONFIG_STRIP_ASM_SYMS is not set
691# CONFIG_UNUSED_SYMBOLS is not set
692# CONFIG_DEBUG_FS is not set
693# CONFIG_HEADERS_CHECK is not set
694CONFIG_DEBUG_KERNEL=y
695# CONFIG_DEBUG_SHIRQ is not set
696# CONFIG_DETECT_SOFTLOCKUP is not set
697# CONFIG_DETECT_HUNG_TASK is not set
698CONFIG_SCHED_DEBUG=y
699# CONFIG_SCHEDSTATS is not set
700# CONFIG_TIMER_STATS is not set
701# CONFIG_DEBUG_OBJECTS is not set
702# CONFIG_DEBUG_SLAB is not set
703# CONFIG_DEBUG_KMEMLEAK is not set
704# CONFIG_DEBUG_RT_MUTEXES is not set
705# CONFIG_RT_MUTEX_TESTER is not set
706# CONFIG_DEBUG_SPINLOCK is not set
707# CONFIG_DEBUG_MUTEXES is not set
708# CONFIG_DEBUG_LOCK_ALLOC is not set
709# CONFIG_PROVE_LOCKING is not set
710# CONFIG_LOCK_STAT is not set
711# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
712# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
713# CONFIG_DEBUG_KOBJECT is not set
714CONFIG_DEBUG_BUGVERBOSE=y
715# CONFIG_DEBUG_INFO is not set
716# CONFIG_DEBUG_VM is not set
717# CONFIG_DEBUG_WRITECOUNT is not set
718CONFIG_DEBUG_MEMORY_INIT=y
719# CONFIG_DEBUG_LIST is not set
720# CONFIG_DEBUG_SG is not set
721# CONFIG_DEBUG_NOTIFIERS is not set
722# CONFIG_DEBUG_CREDENTIALS is not set
723# CONFIG_BOOT_PRINTK_DELAY is not set
724# CONFIG_RCU_TORTURE_TEST is not set
725# CONFIG_RCU_CPU_STALL_DETECTOR is not set
726# CONFIG_BACKTRACE_SELF_TEST is not set
727# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
728# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
729# CONFIG_FAULT_INJECTION is not set
730# CONFIG_LATENCYTOP is not set
731# CONFIG_SYSCTL_SYSCALL_CHECK is not set
732# CONFIG_PAGE_POISONING is not set
733CONFIG_HAVE_FUNCTION_TRACER=y
734CONFIG_TRACING_SUPPORT=y
735# CONFIG_FTRACE is not set
736# CONFIG_SAMPLES is not set
737CONFIG_HAVE_ARCH_KGDB=y
738# CONFIG_KGDB is not set
739CONFIG_ARM_UNWIND=y
740# CONFIG_DEBUG_USER is not set
741# CONFIG_DEBUG_ERRORS is not set
742# CONFIG_DEBUG_STACK_USAGE is not set
743# CONFIG_DEBUG_LL is not set
744# CONFIG_OC_ETM is not set
745
746#
747# Security options
748#
749# CONFIG_KEYS is not set
750# CONFIG_SECURITY is not set
751# CONFIG_SECURITYFS is not set
752# CONFIG_DEFAULT_SECURITY_SELINUX is not set
753# CONFIG_DEFAULT_SECURITY_SMACK is not set
754# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
755CONFIG_DEFAULT_SECURITY_DAC=y
756CONFIG_DEFAULT_SECURITY=""
757# CONFIG_CRYPTO is not set
758# CONFIG_BINARY_PRINTF is not set
759
760#
761# Library routines
762#
763CONFIG_GENERIC_FIND_LAST_BIT=y
764# CONFIG_CRC_CCITT is not set
765# CONFIG_CRC16 is not set
766# CONFIG_CRC_T10DIF is not set
767# CONFIG_CRC_ITU_T is not set
768# CONFIG_CRC32 is not set
769# CONFIG_CRC7 is not set
770# CONFIG_LIBCRC32C is not set
771CONFIG_ZLIB_INFLATE=y
772CONFIG_LZO_DECOMPRESS=y
773CONFIG_DECOMPRESS_GZIP=y
774CONFIG_DECOMPRESS_BZIP2=y
775CONFIG_DECOMPRESS_LZMA=y
776CONFIG_DECOMPRESS_LZO=y
777CONFIG_HAS_IOMEM=y
778CONFIG_HAS_IOPORT=y
779CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/imote2_defconfig b/arch/arm/configs/imote2_defconfig
new file mode 100644
index 000000000000..95d2becfc664
--- /dev/null
+++ b/arch/arm/configs/imote2_defconfig
@@ -0,0 +1,2077 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc8
4# Sat Feb 13 21:48:53 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_ARCH_HAS_CPUFREQ=y
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_ARCH_MTD_XIP=y
23CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
24CONFIG_VECTORS_BASE=0xffff0000
25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26CONFIG_CONSTRUCTORS=y
27
28#
29# General setup
30#
31CONFIG_EXPERIMENTAL=y
32CONFIG_BROKEN_ON_SMP=y
33CONFIG_LOCK_KERNEL=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36# CONFIG_LOCALVERSION_AUTO is not set
37CONFIG_HAVE_KERNEL_GZIP=y
38CONFIG_HAVE_KERNEL_LZO=y
39CONFIG_KERNEL_GZIP=y
40# CONFIG_KERNEL_BZIP2 is not set
41# CONFIG_KERNEL_LZMA is not set
42# CONFIG_KERNEL_LZO is not set
43CONFIG_SWAP=y
44CONFIG_SYSVIPC=y
45CONFIG_SYSVIPC_SYSCTL=y
46# CONFIG_POSIX_MQUEUE is not set
47# CONFIG_BSD_PROCESS_ACCT is not set
48# CONFIG_TASKSTATS is not set
49# CONFIG_AUDIT is not set
50
51#
52# RCU Subsystem
53#
54CONFIG_TREE_RCU=y
55# CONFIG_TREE_PREEMPT_RCU is not set
56# CONFIG_TINY_RCU is not set
57# CONFIG_RCU_TRACE is not set
58CONFIG_RCU_FANOUT=32
59# CONFIG_RCU_FANOUT_EXACT is not set
60# CONFIG_TREE_RCU_TRACE is not set
61# CONFIG_IKCONFIG is not set
62CONFIG_LOG_BUF_SHIFT=14
63CONFIG_GROUP_SCHED=y
64CONFIG_FAIR_GROUP_SCHED=y
65# CONFIG_RT_GROUP_SCHED is not set
66CONFIG_USER_SCHED=y
67# CONFIG_CGROUP_SCHED is not set
68# CONFIG_CGROUPS is not set
69CONFIG_SYSFS_DEPRECATED=y
70CONFIG_SYSFS_DEPRECATED_V2=y
71# CONFIG_RELAY is not set
72# CONFIG_NAMESPACES is not set
73CONFIG_BLK_DEV_INITRD=y
74CONFIG_INITRAMFS_SOURCE=""
75CONFIG_RD_GZIP=y
76CONFIG_RD_BZIP2=y
77CONFIG_RD_LZMA=y
78# CONFIG_RD_LZO is not set
79CONFIG_CC_OPTIMIZE_FOR_SIZE=y
80CONFIG_SYSCTL=y
81CONFIG_ANON_INODES=y
82CONFIG_EMBEDDED=y
83CONFIG_UID16=y
84CONFIG_SYSCTL_SYSCALL=y
85CONFIG_KALLSYMS=y
86CONFIG_KALLSYMS_ALL=y
87# CONFIG_KALLSYMS_EXTRA_PASS is not set
88CONFIG_HOTPLUG=y
89CONFIG_PRINTK=y
90CONFIG_BUG=y
91CONFIG_ELF_CORE=y
92CONFIG_BASE_FULL=y
93CONFIG_FUTEX=y
94CONFIG_EPOLL=y
95CONFIG_SIGNALFD=y
96CONFIG_TIMERFD=y
97CONFIG_EVENTFD=y
98CONFIG_SHMEM=y
99CONFIG_AIO=y
100
101#
102# Kernel Performance Events And Counters
103#
104CONFIG_VM_EVENT_COUNTERS=y
105# CONFIG_COMPAT_BRK is not set
106CONFIG_SLAB=y
107# CONFIG_SLUB is not set
108# CONFIG_SLOB is not set
109# CONFIG_PROFILING is not set
110CONFIG_HAVE_OPROFILE=y
111# CONFIG_KPROBES is not set
112CONFIG_HAVE_KPROBES=y
113CONFIG_HAVE_KRETPROBES=y
114CONFIG_HAVE_CLK=y
115
116#
117# GCOV-based kernel profiling
118#
119# CONFIG_GCOV_KERNEL is not set
120CONFIG_SLOW_WORK=y
121# CONFIG_SLOW_WORK_DEBUG is not set
122CONFIG_HAVE_GENERIC_DMA_COHERENT=y
123CONFIG_SLABINFO=y
124CONFIG_RT_MUTEXES=y
125CONFIG_BASE_SMALL=0
126CONFIG_MODULES=y
127# CONFIG_MODULE_FORCE_LOAD is not set
128CONFIG_MODULE_UNLOAD=y
129CONFIG_MODULE_FORCE_UNLOAD=y
130CONFIG_MODVERSIONS=y
131# CONFIG_MODULE_SRCVERSION_ALL is not set
132CONFIG_BLOCK=y
133# CONFIG_LBDAF is not set
134# CONFIG_BLK_DEV_BSG is not set
135# CONFIG_BLK_DEV_INTEGRITY is not set
136
137#
138# IO Schedulers
139#
140CONFIG_IOSCHED_NOOP=y
141CONFIG_IOSCHED_DEADLINE=y
142# CONFIG_IOSCHED_CFQ is not set
143CONFIG_DEFAULT_DEADLINE=y
144# CONFIG_DEFAULT_CFQ is not set
145# CONFIG_DEFAULT_NOOP is not set
146CONFIG_DEFAULT_IOSCHED="deadline"
147# CONFIG_INLINE_SPIN_TRYLOCK is not set
148# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
149# CONFIG_INLINE_SPIN_LOCK is not set
150# CONFIG_INLINE_SPIN_LOCK_BH is not set
151# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
152# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
153# CONFIG_INLINE_SPIN_UNLOCK is not set
154# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
155# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
156# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
157# CONFIG_INLINE_READ_TRYLOCK is not set
158# CONFIG_INLINE_READ_LOCK is not set
159# CONFIG_INLINE_READ_LOCK_BH is not set
160# CONFIG_INLINE_READ_LOCK_IRQ is not set
161# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
162# CONFIG_INLINE_READ_UNLOCK is not set
163# CONFIG_INLINE_READ_UNLOCK_BH is not set
164# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
165# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
166# CONFIG_INLINE_WRITE_TRYLOCK is not set
167# CONFIG_INLINE_WRITE_LOCK is not set
168# CONFIG_INLINE_WRITE_LOCK_BH is not set
169# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
170# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
171# CONFIG_INLINE_WRITE_UNLOCK is not set
172# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
173# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
174# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
175# CONFIG_MUTEX_SPIN_ON_OWNER is not set
176CONFIG_FREEZER=y
177
178#
179# System Type
180#
181CONFIG_MMU=y
182# CONFIG_ARCH_AAEC2000 is not set
183# CONFIG_ARCH_INTEGRATOR is not set
184# CONFIG_ARCH_REALVIEW is not set
185# CONFIG_ARCH_VERSATILE is not set
186# CONFIG_ARCH_AT91 is not set
187# CONFIG_ARCH_CLPS711X is not set
188# CONFIG_ARCH_GEMINI is not set
189# CONFIG_ARCH_EBSA110 is not set
190# CONFIG_ARCH_EP93XX is not set
191# CONFIG_ARCH_FOOTBRIDGE is not set
192# CONFIG_ARCH_MXC is not set
193# CONFIG_ARCH_STMP3XXX is not set
194# CONFIG_ARCH_NETX is not set
195# CONFIG_ARCH_H720X is not set
196# CONFIG_ARCH_NOMADIK is not set
197# CONFIG_ARCH_IOP13XX is not set
198# CONFIG_ARCH_IOP32X is not set
199# CONFIG_ARCH_IOP33X is not set
200# CONFIG_ARCH_IXP23XX is not set
201# CONFIG_ARCH_IXP2000 is not set
202# CONFIG_ARCH_IXP4XX is not set
203# CONFIG_ARCH_L7200 is not set
204# CONFIG_ARCH_DOVE is not set
205# CONFIG_ARCH_KIRKWOOD is not set
206# CONFIG_ARCH_LOKI is not set
207# CONFIG_ARCH_MV78XX0 is not set
208# CONFIG_ARCH_ORION5X is not set
209# CONFIG_ARCH_MMP is not set
210# CONFIG_ARCH_KS8695 is not set
211# CONFIG_ARCH_NS9XXX is not set
212# CONFIG_ARCH_W90X900 is not set
213# CONFIG_ARCH_PNX4008 is not set
214CONFIG_ARCH_PXA=y
215# CONFIG_ARCH_MSM is not set
216# CONFIG_ARCH_RPC is not set
217# CONFIG_ARCH_SA1100 is not set
218# CONFIG_ARCH_S3C2410 is not set
219# CONFIG_ARCH_S3C64XX is not set
220# CONFIG_ARCH_S5PC1XX is not set
221# CONFIG_ARCH_SHARK is not set
222# CONFIG_ARCH_LH7A40X is not set
223# CONFIG_ARCH_U300 is not set
224# CONFIG_ARCH_DAVINCI is not set
225# CONFIG_ARCH_OMAP is not set
226# CONFIG_ARCH_BCMRING is not set
227# CONFIG_ARCH_U8500 is not set
228
229#
230# Intel PXA2xx/PXA3xx Implementations
231#
232
233#
234# Intel/Marvell Dev Platforms (sorted by hardware release time)
235#
236# CONFIG_ARCH_LUBBOCK is not set
237# CONFIG_MACH_MAINSTONE is not set
238# CONFIG_MACH_ZYLONITE300 is not set
239# CONFIG_MACH_ZYLONITE320 is not set
240# CONFIG_MACH_LITTLETON is not set
241# CONFIG_MACH_TAVOREVB is not set
242# CONFIG_MACH_SAAR is not set
243
244#
245# Third Party Dev Platforms (sorted by vendor name)
246#
247# CONFIG_ARCH_PXA_IDP is not set
248# CONFIG_ARCH_VIPER is not set
249# CONFIG_MACH_ARCOM_ZEUS is not set
250# CONFIG_MACH_BALLOON3 is not set
251# CONFIG_MACH_CSB726 is not set
252# CONFIG_MACH_ARMCORE is not set
253# CONFIG_MACH_EM_X270 is not set
254# CONFIG_MACH_EXEDA is not set
255# CONFIG_MACH_CM_X300 is not set
256# CONFIG_ARCH_GUMSTIX is not set
257CONFIG_MACH_INTELMOTE2=y
258# CONFIG_MACH_STARGATE2 is not set
259# CONFIG_MACH_XCEP is not set
260# CONFIG_TRIZEPS_PXA is not set
261# CONFIG_MACH_LOGICPD_PXA270 is not set
262# CONFIG_MACH_PCM027 is not set
263# CONFIG_MACH_COLIBRI is not set
264# CONFIG_MACH_COLIBRI300 is not set
265# CONFIG_MACH_COLIBRI320 is not set
266
267#
268# End-user Products (sorted by vendor name)
269#
270# CONFIG_MACH_H4700 is not set
271# CONFIG_MACH_H5000 is not set
272# CONFIG_MACH_HIMALAYA is not set
273# CONFIG_MACH_MAGICIAN is not set
274# CONFIG_MACH_MIOA701 is not set
275# CONFIG_PXA_EZX is not set
276# CONFIG_MACH_MP900C is not set
277# CONFIG_ARCH_PXA_PALM is not set
278# CONFIG_PXA_SHARPSL is not set
279# CONFIG_ARCH_PXA_ESERIES is not set
280CONFIG_PXA27x=y
281CONFIG_PXA_SSP=y
282CONFIG_PXA_HAVE_BOARD_IRQS=y
283CONFIG_PLAT_PXA=y
284
285#
286# Processor Type
287#
288CONFIG_CPU_XSCALE=y
289CONFIG_CPU_32v5=y
290CONFIG_CPU_ABRT_EV5T=y
291CONFIG_CPU_PABRT_LEGACY=y
292CONFIG_CPU_CACHE_VIVT=y
293CONFIG_CPU_TLB_V4WBI=y
294CONFIG_CPU_CP15=y
295CONFIG_CPU_CP15_MMU=y
296
297#
298# Processor Features
299#
300CONFIG_ARM_THUMB=y
301# CONFIG_CPU_DCACHE_DISABLE is not set
302CONFIG_ARM_L1_CACHE_SHIFT=5
303CONFIG_IWMMXT=y
304CONFIG_XSCALE_PMU=y
305CONFIG_COMMON_CLKDEV=y
306
307#
308# Bus support
309#
310# CONFIG_PCI_SYSCALL is not set
311# CONFIG_ARCH_SUPPORTS_MSI is not set
312# CONFIG_PCCARD is not set
313
314#
315# Kernel Features
316#
317CONFIG_TICK_ONESHOT=y
318CONFIG_NO_HZ=y
319CONFIG_HIGH_RES_TIMERS=y
320CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
321CONFIG_VMSPLIT_3G=y
322# CONFIG_VMSPLIT_2G is not set
323# CONFIG_VMSPLIT_1G is not set
324CONFIG_PAGE_OFFSET=0xC0000000
325# CONFIG_PREEMPT_NONE is not set
326# CONFIG_PREEMPT_VOLUNTARY is not set
327CONFIG_PREEMPT=y
328CONFIG_HZ=100
329CONFIG_AEABI=y
330CONFIG_OABI_COMPAT=y
331# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
332# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
333# CONFIG_HIGHMEM is not set
334CONFIG_SELECT_MEMORY_MODEL=y
335CONFIG_FLATMEM_MANUAL=y
336# CONFIG_DISCONTIGMEM_MANUAL is not set
337# CONFIG_SPARSEMEM_MANUAL is not set
338CONFIG_FLATMEM=y
339CONFIG_FLAT_NODE_MEM_MAP=y
340CONFIG_PAGEFLAGS_EXTENDED=y
341CONFIG_SPLIT_PTLOCK_CPUS=999999
342# CONFIG_PHYS_ADDR_T_64BIT is not set
343CONFIG_ZONE_DMA_FLAG=0
344CONFIG_VIRT_TO_BUS=y
345# CONFIG_KSM is not set
346CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
347CONFIG_ALIGNMENT_TRAP=y
348# CONFIG_UACCESS_WITH_MEMCPY is not set
349
350#
351# Boot options
352#
353CONFIG_ZBOOT_ROM_TEXT=0x0
354CONFIG_ZBOOT_ROM_BSS=0x0
355CONFIG_CMDLINE="console=tty1 root=/dev/mmcblk0p2 rootfstype=ext2 rootdelay=3 ip=192.168.0.202:192.168.0.200:192.168.0.200:255.255.255.0 debug"
356# CONFIG_XIP_KERNEL is not set
357CONFIG_KEXEC=y
358CONFIG_ATAGS_PROC=y
359
360#
361# CPU Power Management
362#
363CONFIG_CPU_FREQ=y
364CONFIG_CPU_FREQ_TABLE=y
365CONFIG_CPU_FREQ_DEBUG=y
366CONFIG_CPU_FREQ_STAT=y
367# CONFIG_CPU_FREQ_STAT_DETAILS is not set
368CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
369# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
370# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
371# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
372# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
373CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
374CONFIG_CPU_FREQ_GOV_POWERSAVE=m
375CONFIG_CPU_FREQ_GOV_USERSPACE=m
376CONFIG_CPU_FREQ_GOV_ONDEMAND=m
377CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
378CONFIG_CPU_IDLE=y
379CONFIG_CPU_IDLE_GOV_LADDER=y
380CONFIG_CPU_IDLE_GOV_MENU=y
381
382#
383# Floating point emulation
384#
385
386#
387# At least one emulation must be selected
388#
389CONFIG_FPE_NWFPE=y
390# CONFIG_FPE_NWFPE_XP is not set
391# CONFIG_FPE_FASTFPE is not set
392
393#
394# Userspace binary formats
395#
396CONFIG_BINFMT_ELF=y
397# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
398CONFIG_HAVE_AOUT=y
399CONFIG_BINFMT_AOUT=m
400CONFIG_BINFMT_MISC=m
401
402#
403# Power management options
404#
405CONFIG_PM=y
406# CONFIG_PM_DEBUG is not set
407CONFIG_PM_SLEEP=y
408CONFIG_SUSPEND=y
409CONFIG_SUSPEND_FREEZER=y
410CONFIG_APM_EMULATION=y
411CONFIG_PM_RUNTIME=y
412CONFIG_ARCH_SUSPEND_POSSIBLE=y
413CONFIG_NET=y
414
415#
416# Networking options
417#
418CONFIG_PACKET=y
419CONFIG_PACKET_MMAP=y
420CONFIG_UNIX=y
421CONFIG_XFRM=y
422# CONFIG_XFRM_USER is not set
423# CONFIG_XFRM_SUB_POLICY is not set
424# CONFIG_XFRM_MIGRATE is not set
425# CONFIG_XFRM_STATISTICS is not set
426CONFIG_XFRM_IPCOMP=m
427# CONFIG_NET_KEY is not set
428CONFIG_INET=y
429# CONFIG_IP_MULTICAST is not set
430# CONFIG_IP_ADVANCED_ROUTER is not set
431CONFIG_IP_FIB_HASH=y
432CONFIG_IP_PNP=y
433CONFIG_IP_PNP_DHCP=y
434CONFIG_IP_PNP_BOOTP=y
435CONFIG_IP_PNP_RARP=y
436# CONFIG_NET_IPIP is not set
437# CONFIG_NET_IPGRE is not set
438# CONFIG_ARPD is not set
439CONFIG_SYN_COOKIES=y
440# CONFIG_INET_AH is not set
441# CONFIG_INET_ESP is not set
442# CONFIG_INET_IPCOMP is not set
443# CONFIG_INET_XFRM_TUNNEL is not set
444CONFIG_INET_TUNNEL=m
445# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
446# CONFIG_INET_XFRM_MODE_TUNNEL is not set
447# CONFIG_INET_XFRM_MODE_BEET is not set
448# CONFIG_INET_LRO is not set
449# CONFIG_INET_DIAG is not set
450# CONFIG_TCP_CONG_ADVANCED is not set
451CONFIG_TCP_CONG_CUBIC=y
452CONFIG_DEFAULT_TCP_CONG="cubic"
453# CONFIG_TCP_MD5SIG is not set
454CONFIG_IPV6=m
455# CONFIG_IPV6_PRIVACY is not set
456# CONFIG_IPV6_ROUTER_PREF is not set
457# CONFIG_IPV6_OPTIMISTIC_DAD is not set
458CONFIG_INET6_AH=m
459CONFIG_INET6_ESP=m
460CONFIG_INET6_IPCOMP=m
461CONFIG_IPV6_MIP6=m
462CONFIG_INET6_XFRM_TUNNEL=m
463CONFIG_INET6_TUNNEL=m
464CONFIG_INET6_XFRM_MODE_TRANSPORT=m
465CONFIG_INET6_XFRM_MODE_TUNNEL=m
466CONFIG_INET6_XFRM_MODE_BEET=m
467# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
468CONFIG_IPV6_SIT=m
469# CONFIG_IPV6_SIT_6RD is not set
470CONFIG_IPV6_NDISC_NODETYPE=y
471CONFIG_IPV6_TUNNEL=m
472CONFIG_IPV6_MULTIPLE_TABLES=y
473CONFIG_IPV6_SUBTREES=y
474# CONFIG_IPV6_MROUTE is not set
475# CONFIG_NETWORK_SECMARK is not set
476CONFIG_NETFILTER=y
477# CONFIG_NETFILTER_DEBUG is not set
478CONFIG_NETFILTER_ADVANCED=y
479CONFIG_BRIDGE_NETFILTER=y
480
481#
482# Core Netfilter Configuration
483#
484CONFIG_NETFILTER_NETLINK=m
485CONFIG_NETFILTER_NETLINK_QUEUE=m
486CONFIG_NETFILTER_NETLINK_LOG=m
487CONFIG_NF_CONNTRACK=m
488CONFIG_NF_CT_ACCT=y
489CONFIG_NF_CONNTRACK_MARK=y
490CONFIG_NF_CONNTRACK_EVENTS=y
491# CONFIG_NF_CT_PROTO_DCCP is not set
492CONFIG_NF_CT_PROTO_GRE=m
493CONFIG_NF_CT_PROTO_SCTP=m
494CONFIG_NF_CT_PROTO_UDPLITE=m
495CONFIG_NF_CONNTRACK_AMANDA=m
496CONFIG_NF_CONNTRACK_FTP=m
497CONFIG_NF_CONNTRACK_H323=m
498CONFIG_NF_CONNTRACK_IRC=m
499CONFIG_NF_CONNTRACK_NETBIOS_NS=m
500CONFIG_NF_CONNTRACK_PPTP=m
501CONFIG_NF_CONNTRACK_SANE=m
502CONFIG_NF_CONNTRACK_SIP=m
503CONFIG_NF_CONNTRACK_TFTP=m
504CONFIG_NF_CT_NETLINK=m
505# CONFIG_NETFILTER_TPROXY is not set
506CONFIG_NETFILTER_XTABLES=m
507CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
508# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
509# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
510CONFIG_NETFILTER_XT_TARGET_HL=m
511CONFIG_NETFILTER_XT_TARGET_LED=m
512CONFIG_NETFILTER_XT_TARGET_MARK=m
513CONFIG_NETFILTER_XT_TARGET_NFLOG=m
514CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
515# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
516# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
517# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
518CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
519# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
520# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
521CONFIG_NETFILTER_XT_MATCH_COMMENT=m
522CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
523CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
524CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
525CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
526CONFIG_NETFILTER_XT_MATCH_DCCP=m
527CONFIG_NETFILTER_XT_MATCH_DSCP=m
528CONFIG_NETFILTER_XT_MATCH_ESP=m
529CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
530CONFIG_NETFILTER_XT_MATCH_HELPER=m
531CONFIG_NETFILTER_XT_MATCH_HL=m
532# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set
533CONFIG_NETFILTER_XT_MATCH_LENGTH=m
534CONFIG_NETFILTER_XT_MATCH_LIMIT=m
535CONFIG_NETFILTER_XT_MATCH_MAC=m
536CONFIG_NETFILTER_XT_MATCH_MARK=m
537CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
538# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
539CONFIG_NETFILTER_XT_MATCH_POLICY=m
540# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
541CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
542CONFIG_NETFILTER_XT_MATCH_QUOTA=m
543# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
544CONFIG_NETFILTER_XT_MATCH_REALM=m
545# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
546CONFIG_NETFILTER_XT_MATCH_SCTP=m
547CONFIG_NETFILTER_XT_MATCH_STATE=m
548CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
549CONFIG_NETFILTER_XT_MATCH_STRING=m
550CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
551CONFIG_NETFILTER_XT_MATCH_TIME=m
552CONFIG_NETFILTER_XT_MATCH_U32=m
553# CONFIG_NETFILTER_XT_MATCH_OSF is not set
554# CONFIG_IP_VS is not set
555
556#
557# IP: Netfilter Configuration
558#
559CONFIG_NF_DEFRAG_IPV4=m
560CONFIG_NF_CONNTRACK_IPV4=m
561CONFIG_NF_CONNTRACK_PROC_COMPAT=y
562CONFIG_IP_NF_QUEUE=m
563CONFIG_IP_NF_IPTABLES=m
564CONFIG_IP_NF_MATCH_ADDRTYPE=m
565CONFIG_IP_NF_MATCH_AH=m
566CONFIG_IP_NF_MATCH_ECN=m
567CONFIG_IP_NF_MATCH_TTL=m
568CONFIG_IP_NF_FILTER=m
569CONFIG_IP_NF_TARGET_REJECT=m
570CONFIG_IP_NF_TARGET_LOG=m
571CONFIG_IP_NF_TARGET_ULOG=m
572CONFIG_NF_NAT=m
573CONFIG_NF_NAT_NEEDED=y
574CONFIG_IP_NF_TARGET_MASQUERADE=m
575CONFIG_IP_NF_TARGET_NETMAP=m
576CONFIG_IP_NF_TARGET_REDIRECT=m
577CONFIG_NF_NAT_SNMP_BASIC=m
578CONFIG_NF_NAT_PROTO_GRE=m
579CONFIG_NF_NAT_PROTO_UDPLITE=m
580CONFIG_NF_NAT_PROTO_SCTP=m
581CONFIG_NF_NAT_FTP=m
582CONFIG_NF_NAT_IRC=m
583CONFIG_NF_NAT_TFTP=m
584CONFIG_NF_NAT_AMANDA=m
585CONFIG_NF_NAT_PPTP=m
586CONFIG_NF_NAT_H323=m
587CONFIG_NF_NAT_SIP=m
588CONFIG_IP_NF_MANGLE=m
589CONFIG_IP_NF_TARGET_CLUSTERIP=m
590CONFIG_IP_NF_TARGET_ECN=m
591CONFIG_IP_NF_TARGET_TTL=m
592CONFIG_IP_NF_RAW=m
593CONFIG_IP_NF_ARPTABLES=m
594CONFIG_IP_NF_ARPFILTER=m
595CONFIG_IP_NF_ARP_MANGLE=m
596
597#
598# IPv6: Netfilter Configuration
599#
600CONFIG_NF_CONNTRACK_IPV6=m
601CONFIG_IP6_NF_QUEUE=m
602CONFIG_IP6_NF_IPTABLES=m
603CONFIG_IP6_NF_MATCH_AH=m
604CONFIG_IP6_NF_MATCH_EUI64=m
605CONFIG_IP6_NF_MATCH_FRAG=m
606CONFIG_IP6_NF_MATCH_OPTS=m
607CONFIG_IP6_NF_MATCH_HL=m
608CONFIG_IP6_NF_MATCH_IPV6HEADER=m
609CONFIG_IP6_NF_MATCH_MH=m
610CONFIG_IP6_NF_MATCH_RT=m
611CONFIG_IP6_NF_TARGET_HL=m
612CONFIG_IP6_NF_TARGET_LOG=m
613CONFIG_IP6_NF_FILTER=m
614CONFIG_IP6_NF_TARGET_REJECT=m
615CONFIG_IP6_NF_MANGLE=m
616CONFIG_IP6_NF_RAW=m
617# CONFIG_BRIDGE_NF_EBTABLES is not set
618# CONFIG_IP_DCCP is not set
619# CONFIG_IP_SCTP is not set
620# CONFIG_RDS is not set
621# CONFIG_TIPC is not set
622# CONFIG_ATM is not set
623CONFIG_STP=m
624CONFIG_BRIDGE=m
625# CONFIG_NET_DSA is not set
626# CONFIG_VLAN_8021Q is not set
627# CONFIG_DECNET is not set
628CONFIG_LLC=m
629# CONFIG_LLC2 is not set
630# CONFIG_IPX is not set
631# CONFIG_ATALK is not set
632# CONFIG_X25 is not set
633# CONFIG_LAPB is not set
634# CONFIG_ECONET is not set
635# CONFIG_WAN_ROUTER is not set
636# CONFIG_PHONET is not set
637CONFIG_IEEE802154=y
638# CONFIG_NET_SCHED is not set
639CONFIG_NET_CLS_ROUTE=y
640# CONFIG_DCB is not set
641
642#
643# Network testing
644#
645# CONFIG_NET_PKTGEN is not set
646# CONFIG_HAMRADIO is not set
647# CONFIG_CAN is not set
648# CONFIG_IRDA is not set
649CONFIG_BT=y
650CONFIG_BT_L2CAP=y
651CONFIG_BT_SCO=y
652CONFIG_BT_RFCOMM=y
653CONFIG_BT_RFCOMM_TTY=y
654CONFIG_BT_BNEP=y
655CONFIG_BT_BNEP_MC_FILTER=y
656CONFIG_BT_BNEP_PROTO_FILTER=y
657CONFIG_BT_HIDP=y
658
659#
660# Bluetooth device drivers
661#
662CONFIG_BT_HCIBTUSB=m
663CONFIG_BT_HCIBTSDIO=m
664CONFIG_BT_HCIUART=y
665CONFIG_BT_HCIUART_H4=y
666# CONFIG_BT_HCIUART_BCSP is not set
667# CONFIG_BT_HCIUART_LL is not set
668CONFIG_BT_HCIBCM203X=m
669CONFIG_BT_HCIBPA10X=m
670CONFIG_BT_HCIBFUSB=m
671CONFIG_BT_HCIVHCI=m
672CONFIG_BT_MRVL=m
673CONFIG_BT_MRVL_SDIO=m
674# CONFIG_BT_ATH3K is not set
675# CONFIG_AF_RXRPC is not set
676CONFIG_FIB_RULES=y
677# CONFIG_WIRELESS is not set
678# CONFIG_WIMAX is not set
679# CONFIG_RFKILL is not set
680# CONFIG_NET_9P is not set
681
682#
683# Device Drivers
684#
685
686#
687# Generic Driver Options
688#
689CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
690# CONFIG_DEVTMPFS is not set
691CONFIG_STANDALONE=y
692CONFIG_PREVENT_FIRMWARE_BUILD=y
693CONFIG_FW_LOADER=m
694CONFIG_FIRMWARE_IN_KERNEL=y
695CONFIG_EXTRA_FIRMWARE=""
696# CONFIG_DEBUG_DRIVER is not set
697# CONFIG_DEBUG_DEVRES is not set
698# CONFIG_SYS_HYPERVISOR is not set
699CONFIG_CONNECTOR=m
700CONFIG_MTD=y
701# CONFIG_MTD_DEBUG is not set
702# CONFIG_MTD_TESTS is not set
703# CONFIG_MTD_CONCAT is not set
704CONFIG_MTD_PARTITIONS=y
705# CONFIG_MTD_REDBOOT_PARTS is not set
706# CONFIG_MTD_CMDLINE_PARTS is not set
707# CONFIG_MTD_AFS_PARTS is not set
708# CONFIG_MTD_AR7_PARTS is not set
709
710#
711# User Modules And Translation Layers
712#
713CONFIG_MTD_CHAR=y
714CONFIG_HAVE_MTD_OTP=y
715CONFIG_MTD_BLKDEVS=y
716CONFIG_MTD_BLOCK=y
717# CONFIG_FTL is not set
718# CONFIG_NFTL is not set
719# CONFIG_INFTL is not set
720# CONFIG_RFD_FTL is not set
721# CONFIG_SSFDC is not set
722# CONFIG_MTD_OOPS is not set
723
724#
725# RAM/ROM/Flash chip drivers
726#
727CONFIG_MTD_CFI=y
728# CONFIG_MTD_JEDECPROBE is not set
729CONFIG_MTD_GEN_PROBE=y
730CONFIG_MTD_CFI_ADV_OPTIONS=y
731CONFIG_MTD_CFI_NOSWAP=y
732# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
733# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
734CONFIG_MTD_CFI_GEOMETRY=y
735# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
736CONFIG_MTD_MAP_BANK_WIDTH_2=y
737# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
738# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
739# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
740# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
741CONFIG_MTD_CFI_I1=y
742# CONFIG_MTD_CFI_I2 is not set
743# CONFIG_MTD_CFI_I4 is not set
744# CONFIG_MTD_CFI_I8 is not set
745CONFIG_MTD_OTP=y
746CONFIG_MTD_CFI_INTELEXT=y
747# CONFIG_MTD_CFI_AMDSTD is not set
748# CONFIG_MTD_CFI_STAA is not set
749CONFIG_MTD_CFI_UTIL=y
750# CONFIG_MTD_RAM is not set
751# CONFIG_MTD_ROM is not set
752# CONFIG_MTD_ABSENT is not set
753# CONFIG_MTD_XIP is not set
754
755#
756# Mapping drivers for chip access
757#
758# CONFIG_MTD_COMPLEX_MAPPINGS is not set
759# CONFIG_MTD_PHYSMAP is not set
760CONFIG_MTD_PXA2XX=y
761# CONFIG_MTD_ARM_INTEGRATOR is not set
762# CONFIG_MTD_PLATRAM is not set
763
764#
765# Self-contained MTD device drivers
766#
767# CONFIG_MTD_DATAFLASH is not set
768# CONFIG_MTD_M25P80 is not set
769# CONFIG_MTD_SST25L is not set
770# CONFIG_MTD_SLRAM is not set
771# CONFIG_MTD_PHRAM is not set
772# CONFIG_MTD_MTDRAM is not set
773# CONFIG_MTD_BLOCK2MTD is not set
774
775#
776# Disk-On-Chip Device Drivers
777#
778# CONFIG_MTD_DOC2000 is not set
779# CONFIG_MTD_DOC2001 is not set
780# CONFIG_MTD_DOC2001PLUS is not set
781# CONFIG_MTD_NAND is not set
782# CONFIG_MTD_ONENAND is not set
783
784#
785# LPDDR flash memory drivers
786#
787# CONFIG_MTD_LPDDR is not set
788
789#
790# UBI - Unsorted block images
791#
792# CONFIG_MTD_UBI is not set
793# CONFIG_PARPORT is not set
794CONFIG_BLK_DEV=y
795# CONFIG_BLK_DEV_COW_COMMON is not set
796CONFIG_BLK_DEV_LOOP=m
797CONFIG_BLK_DEV_CRYPTOLOOP=m
798# CONFIG_BLK_DEV_DRBD is not set
799CONFIG_BLK_DEV_NBD=m
800# CONFIG_BLK_DEV_UB is not set
801CONFIG_BLK_DEV_RAM=y
802CONFIG_BLK_DEV_RAM_COUNT=16
803CONFIG_BLK_DEV_RAM_SIZE=4096
804# CONFIG_BLK_DEV_XIP is not set
805# CONFIG_CDROM_PKTCDVD is not set
806# CONFIG_ATA_OVER_ETH is not set
807# CONFIG_MG_DISK is not set
808# CONFIG_MISC_DEVICES is not set
809CONFIG_HAVE_IDE=y
810# CONFIG_IDE is not set
811
812#
813# SCSI device support
814#
815# CONFIG_RAID_ATTRS is not set
816# CONFIG_SCSI is not set
817# CONFIG_SCSI_DMA is not set
818# CONFIG_SCSI_NETLINK is not set
819# CONFIG_ATA is not set
820# CONFIG_MD is not set
821CONFIG_NETDEVICES=y
822CONFIG_DUMMY=y
823# CONFIG_BONDING is not set
824# CONFIG_MACVLAN is not set
825# CONFIG_EQUALIZER is not set
826# CONFIG_TUN is not set
827# CONFIG_VETH is not set
828# CONFIG_NET_ETHERNET is not set
829# CONFIG_NETDEV_1000 is not set
830# CONFIG_NETDEV_10000 is not set
831# CONFIG_WLAN is not set
832
833#
834# Enable WiMAX (Networking options) to see the WiMAX drivers
835#
836
837#
838# USB Network Adapters
839#
840# CONFIG_USB_CATC is not set
841# CONFIG_USB_KAWETH is not set
842# CONFIG_USB_PEGASUS is not set
843# CONFIG_USB_RTL8150 is not set
844# CONFIG_USB_USBNET is not set
845# CONFIG_WAN is not set
846CONFIG_IEEE802154_DRIVERS=y
847# CONFIG_IEEE802154_FAKEHARD is not set
848CONFIG_PPP=m
849CONFIG_PPP_MULTILINK=y
850CONFIG_PPP_FILTER=y
851CONFIG_PPP_ASYNC=m
852CONFIG_PPP_SYNC_TTY=m
853CONFIG_PPP_DEFLATE=m
854CONFIG_PPP_BSDCOMP=m
855# CONFIG_PPP_MPPE is not set
856# CONFIG_PPPOE is not set
857# CONFIG_PPPOL2TP is not set
858# CONFIG_SLIP is not set
859CONFIG_SLHC=m
860# CONFIG_NETCONSOLE is not set
861# CONFIG_NETPOLL is not set
862# CONFIG_NET_POLL_CONTROLLER is not set
863# CONFIG_ISDN is not set
864# CONFIG_PHONE is not set
865
866#
867# Input device support
868#
869CONFIG_INPUT=y
870# CONFIG_INPUT_FF_MEMLESS is not set
871# CONFIG_INPUT_POLLDEV is not set
872# CONFIG_INPUT_SPARSEKMAP is not set
873
874#
875# Userland interfaces
876#
877# CONFIG_INPUT_MOUSEDEV is not set
878# CONFIG_INPUT_JOYDEV is not set
879CONFIG_INPUT_EVDEV=y
880# CONFIG_INPUT_EVBUG is not set
881# CONFIG_INPUT_APMPOWER is not set
882
883#
884# Input Device Drivers
885#
886CONFIG_INPUT_KEYBOARD=y
887# CONFIG_KEYBOARD_ADP5588 is not set
888# CONFIG_KEYBOARD_ATKBD is not set
889# CONFIG_QT2160 is not set
890# CONFIG_KEYBOARD_LKKBD is not set
891CONFIG_KEYBOARD_GPIO=y
892# CONFIG_KEYBOARD_MATRIX is not set
893# CONFIG_KEYBOARD_LM8323 is not set
894# CONFIG_KEYBOARD_MAX7359 is not set
895# CONFIG_KEYBOARD_NEWTON is not set
896# CONFIG_KEYBOARD_OPENCORES is not set
897CONFIG_KEYBOARD_PXA27x=y
898# CONFIG_KEYBOARD_STOWAWAY is not set
899# CONFIG_KEYBOARD_SUNKBD is not set
900# CONFIG_KEYBOARD_XTKBD is not set
901# CONFIG_INPUT_MOUSE is not set
902# CONFIG_INPUT_JOYSTICK is not set
903# CONFIG_INPUT_TABLET is not set
904CONFIG_INPUT_TOUCHSCREEN=y
905# CONFIG_TOUCHSCREEN_ADS7846 is not set
906# CONFIG_TOUCHSCREEN_AD7877 is not set
907# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
908# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
909# CONFIG_TOUCHSCREEN_AD7879 is not set
910CONFIG_TOUCHSCREEN_DA9034=y
911# CONFIG_TOUCHSCREEN_DYNAPRO is not set
912# CONFIG_TOUCHSCREEN_EETI is not set
913# CONFIG_TOUCHSCREEN_FUJITSU is not set
914# CONFIG_TOUCHSCREEN_GUNZE is not set
915# CONFIG_TOUCHSCREEN_ELO is not set
916# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
917# CONFIG_TOUCHSCREEN_MCS5000 is not set
918# CONFIG_TOUCHSCREEN_MTOUCH is not set
919# CONFIG_TOUCHSCREEN_INEXIO is not set
920# CONFIG_TOUCHSCREEN_MK712 is not set
921# CONFIG_TOUCHSCREEN_PENMOUNT is not set
922# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
923# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
924# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
925# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
926# CONFIG_TOUCHSCREEN_TSC2007 is not set
927# CONFIG_TOUCHSCREEN_W90X900 is not set
928CONFIG_INPUT_MISC=y
929# CONFIG_INPUT_ATI_REMOTE is not set
930# CONFIG_INPUT_ATI_REMOTE2 is not set
931# CONFIG_INPUT_KEYSPAN_REMOTE is not set
932# CONFIG_INPUT_POWERMATE is not set
933# CONFIG_INPUT_YEALINK is not set
934# CONFIG_INPUT_CM109 is not set
935CONFIG_INPUT_UINPUT=y
936# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
937
938#
939# Hardware I/O ports
940#
941# CONFIG_SERIO is not set
942# CONFIG_GAMEPORT is not set
943
944#
945# Character devices
946#
947CONFIG_VT=y
948CONFIG_CONSOLE_TRANSLATIONS=y
949CONFIG_VT_CONSOLE=y
950CONFIG_HW_CONSOLE=y
951# CONFIG_VT_HW_CONSOLE_BINDING is not set
952CONFIG_DEVKMEM=y
953# CONFIG_SERIAL_NONSTANDARD is not set
954
955#
956# Serial drivers
957#
958# CONFIG_SERIAL_8250 is not set
959
960#
961# Non-8250 serial port support
962#
963# CONFIG_SERIAL_MAX3100 is not set
964CONFIG_SERIAL_PXA=y
965CONFIG_SERIAL_PXA_CONSOLE=y
966CONFIG_SERIAL_CORE=y
967CONFIG_SERIAL_CORE_CONSOLE=y
968CONFIG_UNIX98_PTYS=y
969# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
970CONFIG_LEGACY_PTYS=y
971CONFIG_LEGACY_PTY_COUNT=8
972# CONFIG_IPMI_HANDLER is not set
973# CONFIG_HW_RANDOM is not set
974# CONFIG_R3964 is not set
975# CONFIG_RAW_DRIVER is not set
976# CONFIG_TCG_TPM is not set
977CONFIG_I2C=y
978CONFIG_I2C_BOARDINFO=y
979CONFIG_I2C_COMPAT=y
980CONFIG_I2C_CHARDEV=y
981CONFIG_I2C_HELPER_AUTO=y
982
983#
984# I2C Hardware Bus support
985#
986
987#
988# I2C system bus drivers (mostly embedded / system-on-chip)
989#
990# CONFIG_I2C_DESIGNWARE is not set
991# CONFIG_I2C_GPIO is not set
992# CONFIG_I2C_OCORES is not set
993CONFIG_I2C_PXA=y
994# CONFIG_I2C_PXA_SLAVE is not set
995# CONFIG_I2C_SIMTEC is not set
996
997#
998# External I2C/SMBus adapter drivers
999#
1000# CONFIG_I2C_PARPORT_LIGHT is not set
1001# CONFIG_I2C_TAOS_EVM is not set
1002# CONFIG_I2C_TINY_USB is not set
1003
1004#
1005# Other I2C/SMBus bus drivers
1006#
1007# CONFIG_I2C_PCA_PLATFORM is not set
1008# CONFIG_I2C_STUB is not set
1009
1010#
1011# Miscellaneous I2C Chip support
1012#
1013# CONFIG_SENSORS_TSL2550 is not set
1014# CONFIG_I2C_DEBUG_CORE is not set
1015# CONFIG_I2C_DEBUG_ALGO is not set
1016# CONFIG_I2C_DEBUG_BUS is not set
1017# CONFIG_I2C_DEBUG_CHIP is not set
1018CONFIG_SPI=y
1019# CONFIG_SPI_DEBUG is not set
1020CONFIG_SPI_MASTER=y
1021
1022#
1023# SPI Master Controller Drivers
1024#
1025# CONFIG_SPI_BITBANG is not set
1026# CONFIG_SPI_GPIO is not set
1027CONFIG_SPI_PXA2XX=y
1028# CONFIG_SPI_XILINX is not set
1029# CONFIG_SPI_DESIGNWARE is not set
1030
1031#
1032# SPI Protocol Masters
1033#
1034# CONFIG_SPI_SPIDEV is not set
1035# CONFIG_SPI_TLE62X0 is not set
1036
1037#
1038# PPS support
1039#
1040# CONFIG_PPS is not set
1041CONFIG_ARCH_REQUIRE_GPIOLIB=y
1042CONFIG_GPIOLIB=y
1043# CONFIG_DEBUG_GPIO is not set
1044CONFIG_GPIO_SYSFS=y
1045
1046#
1047# Memory mapped GPIO expanders:
1048#
1049
1050#
1051# I2C GPIO expanders:
1052#
1053# CONFIG_GPIO_MAX732X is not set
1054# CONFIG_GPIO_PCA953X is not set
1055# CONFIG_GPIO_PCF857X is not set
1056# CONFIG_GPIO_ADP5588 is not set
1057
1058#
1059# PCI GPIO expanders:
1060#
1061
1062#
1063# SPI GPIO expanders:
1064#
1065# CONFIG_GPIO_MAX7301 is not set
1066# CONFIG_GPIO_MCP23S08 is not set
1067# CONFIG_GPIO_MC33880 is not set
1068
1069#
1070# AC97 GPIO expanders:
1071#
1072# CONFIG_W1 is not set
1073CONFIG_POWER_SUPPLY=y
1074# CONFIG_POWER_SUPPLY_DEBUG is not set
1075# CONFIG_PDA_POWER is not set
1076# CONFIG_APM_POWER is not set
1077# CONFIG_BATTERY_DS2760 is not set
1078# CONFIG_BATTERY_DS2782 is not set
1079# CONFIG_BATTERY_BQ27x00 is not set
1080# CONFIG_BATTERY_DA9030 is not set
1081# CONFIG_BATTERY_MAX17040 is not set
1082# CONFIG_HWMON is not set
1083# CONFIG_THERMAL is not set
1084# CONFIG_WATCHDOG is not set
1085CONFIG_SSB_POSSIBLE=y
1086
1087#
1088# Sonics Silicon Backplane
1089#
1090# CONFIG_SSB is not set
1091
1092#
1093# Multifunction device drivers
1094#
1095# CONFIG_MFD_CORE is not set
1096# CONFIG_MFD_SM501 is not set
1097# CONFIG_MFD_ASIC3 is not set
1098# CONFIG_HTC_EGPIO is not set
1099# CONFIG_HTC_PASIC3 is not set
1100# CONFIG_TPS65010 is not set
1101# CONFIG_TWL4030_CORE is not set
1102# CONFIG_MFD_TMIO is not set
1103# CONFIG_MFD_T7L66XB is not set
1104# CONFIG_MFD_TC6387XB is not set
1105# CONFIG_MFD_TC6393XB is not set
1106CONFIG_PMIC_DA903X=y
1107# CONFIG_PMIC_ADP5520 is not set
1108# CONFIG_MFD_WM8400 is not set
1109# CONFIG_MFD_WM831X is not set
1110# CONFIG_MFD_WM8350_I2C is not set
1111# CONFIG_MFD_PCF50633 is not set
1112# CONFIG_MFD_MC13783 is not set
1113# CONFIG_AB3100_CORE is not set
1114# CONFIG_EZX_PCAP is not set
1115# CONFIG_MFD_88PM8607 is not set
1116# CONFIG_AB4500_CORE is not set
1117CONFIG_REGULATOR=y
1118CONFIG_REGULATOR_DEBUG=y
1119# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
1120CONFIG_REGULATOR_VIRTUAL_CONSUMER=y
1121CONFIG_REGULATOR_USERSPACE_CONSUMER=y
1122# CONFIG_REGULATOR_BQ24022 is not set
1123# CONFIG_REGULATOR_MAX1586 is not set
1124# CONFIG_REGULATOR_MAX8660 is not set
1125CONFIG_REGULATOR_DA903X=y
1126# CONFIG_REGULATOR_LP3971 is not set
1127# CONFIG_REGULATOR_TPS65023 is not set
1128# CONFIG_REGULATOR_TPS6507X is not set
1129CONFIG_MEDIA_SUPPORT=y
1130
1131#
1132# Multimedia core support
1133#
1134CONFIG_VIDEO_DEV=y
1135CONFIG_VIDEO_V4L2_COMMON=y
1136CONFIG_VIDEO_ALLOW_V4L1=y
1137CONFIG_VIDEO_V4L1_COMPAT=y
1138# CONFIG_DVB_CORE is not set
1139CONFIG_VIDEO_MEDIA=y
1140
1141#
1142# Multimedia drivers
1143#
1144CONFIG_IR_CORE=y
1145CONFIG_VIDEO_IR=y
1146# CONFIG_MEDIA_ATTACH is not set
1147CONFIG_MEDIA_TUNER=y
1148CONFIG_MEDIA_TUNER_CUSTOMISE=y
1149# CONFIG_MEDIA_TUNER_SIMPLE is not set
1150# CONFIG_MEDIA_TUNER_TDA8290 is not set
1151# CONFIG_MEDIA_TUNER_TDA827X is not set
1152# CONFIG_MEDIA_TUNER_TDA18271 is not set
1153# CONFIG_MEDIA_TUNER_TDA9887 is not set
1154# CONFIG_MEDIA_TUNER_TEA5761 is not set
1155# CONFIG_MEDIA_TUNER_TEA5767 is not set
1156# CONFIG_MEDIA_TUNER_MT20XX is not set
1157# CONFIG_MEDIA_TUNER_MT2060 is not set
1158# CONFIG_MEDIA_TUNER_MT2266 is not set
1159# CONFIG_MEDIA_TUNER_MT2131 is not set
1160# CONFIG_MEDIA_TUNER_QT1010 is not set
1161# CONFIG_MEDIA_TUNER_XC2028 is not set
1162# CONFIG_MEDIA_TUNER_XC5000 is not set
1163# CONFIG_MEDIA_TUNER_MXL5005S is not set
1164# CONFIG_MEDIA_TUNER_MXL5007T is not set
1165# CONFIG_MEDIA_TUNER_MC44S803 is not set
1166CONFIG_MEDIA_TUNER_MAX2165=m
1167CONFIG_VIDEO_V4L2=y
1168CONFIG_VIDEO_V4L1=y
1169CONFIG_VIDEOBUF_GEN=y
1170CONFIG_VIDEOBUF_DMA_SG=y
1171CONFIG_VIDEO_CAPTURE_DRIVERS=y
1172# CONFIG_VIDEO_ADV_DEBUG is not set
1173# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
1174# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
1175CONFIG_VIDEO_IR_I2C=y
1176
1177#
1178# Encoders/decoders and other helper chips
1179#
1180
1181#
1182# Audio decoders
1183#
1184# CONFIG_VIDEO_TVAUDIO is not set
1185# CONFIG_VIDEO_TDA7432 is not set
1186# CONFIG_VIDEO_TDA9840 is not set
1187# CONFIG_VIDEO_TDA9875 is not set
1188# CONFIG_VIDEO_TEA6415C is not set
1189# CONFIG_VIDEO_TEA6420 is not set
1190# CONFIG_VIDEO_MSP3400 is not set
1191# CONFIG_VIDEO_CS5345 is not set
1192# CONFIG_VIDEO_CS53L32A is not set
1193# CONFIG_VIDEO_M52790 is not set
1194# CONFIG_VIDEO_TLV320AIC23B is not set
1195# CONFIG_VIDEO_WM8775 is not set
1196# CONFIG_VIDEO_WM8739 is not set
1197# CONFIG_VIDEO_VP27SMPX is not set
1198
1199#
1200# RDS decoders
1201#
1202# CONFIG_VIDEO_SAA6588 is not set
1203
1204#
1205# Video decoders
1206#
1207# CONFIG_VIDEO_ADV7180 is not set
1208# CONFIG_VIDEO_BT819 is not set
1209# CONFIG_VIDEO_BT856 is not set
1210# CONFIG_VIDEO_BT866 is not set
1211# CONFIG_VIDEO_KS0127 is not set
1212# CONFIG_VIDEO_OV7670 is not set
1213# CONFIG_VIDEO_MT9V011 is not set
1214# CONFIG_VIDEO_TCM825X is not set
1215# CONFIG_VIDEO_SAA7110 is not set
1216# CONFIG_VIDEO_SAA711X is not set
1217# CONFIG_VIDEO_SAA717X is not set
1218# CONFIG_VIDEO_SAA7191 is not set
1219# CONFIG_VIDEO_TVP514X is not set
1220# CONFIG_VIDEO_TVP5150 is not set
1221# CONFIG_VIDEO_VPX3220 is not set
1222
1223#
1224# Video and audio decoders
1225#
1226# CONFIG_VIDEO_CX25840 is not set
1227
1228#
1229# MPEG video encoders
1230#
1231# CONFIG_VIDEO_CX2341X is not set
1232
1233#
1234# Video encoders
1235#
1236# CONFIG_VIDEO_SAA7127 is not set
1237# CONFIG_VIDEO_SAA7185 is not set
1238# CONFIG_VIDEO_ADV7170 is not set
1239# CONFIG_VIDEO_ADV7175 is not set
1240# CONFIG_VIDEO_THS7303 is not set
1241# CONFIG_VIDEO_ADV7343 is not set
1242
1243#
1244# Video improvement chips
1245#
1246# CONFIG_VIDEO_UPD64031A is not set
1247# CONFIG_VIDEO_UPD64083 is not set
1248# CONFIG_VIDEO_VIVI is not set
1249# CONFIG_VIDEO_CPIA is not set
1250# CONFIG_VIDEO_CPIA2 is not set
1251# CONFIG_VIDEO_SAA5246A is not set
1252# CONFIG_VIDEO_SAA5249 is not set
1253CONFIG_SOC_CAMERA=y
1254# CONFIG_SOC_CAMERA_MT9M001 is not set
1255CONFIG_SOC_CAMERA_MT9M111=y
1256# CONFIG_SOC_CAMERA_MT9T031 is not set
1257# CONFIG_SOC_CAMERA_MT9T112 is not set
1258# CONFIG_SOC_CAMERA_MT9V022 is not set
1259# CONFIG_SOC_CAMERA_RJ54N1 is not set
1260# CONFIG_SOC_CAMERA_TW9910 is not set
1261# CONFIG_SOC_CAMERA_PLATFORM is not set
1262# CONFIG_SOC_CAMERA_OV772X is not set
1263# CONFIG_SOC_CAMERA_OV9640 is not set
1264CONFIG_VIDEO_PXA27x=y
1265# CONFIG_VIDEO_SH_MOBILE_CEU is not set
1266# CONFIG_V4L_USB_DRIVERS is not set
1267CONFIG_RADIO_ADAPTERS=y
1268# CONFIG_I2C_SI4713 is not set
1269# CONFIG_RADIO_SI4713 is not set
1270# CONFIG_USB_DSBR is not set
1271# CONFIG_RADIO_SI470X is not set
1272# CONFIG_USB_MR800 is not set
1273CONFIG_RADIO_TEA5764=y
1274CONFIG_RADIO_TEA5764_XTAL=y
1275# CONFIG_RADIO_TEF6862 is not set
1276# CONFIG_DAB is not set
1277
1278#
1279# Graphics support
1280#
1281# CONFIG_VGASTATE is not set
1282# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1283CONFIG_FB=y
1284# CONFIG_FIRMWARE_EDID is not set
1285# CONFIG_FB_DDC is not set
1286# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1287CONFIG_FB_CFB_FILLRECT=y
1288CONFIG_FB_CFB_COPYAREA=y
1289CONFIG_FB_CFB_IMAGEBLIT=y
1290# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1291# CONFIG_FB_SYS_FILLRECT is not set
1292# CONFIG_FB_SYS_COPYAREA is not set
1293# CONFIG_FB_SYS_IMAGEBLIT is not set
1294# CONFIG_FB_FOREIGN_ENDIAN is not set
1295# CONFIG_FB_SYS_FOPS is not set
1296# CONFIG_FB_SVGALIB is not set
1297# CONFIG_FB_MACMODES is not set
1298# CONFIG_FB_BACKLIGHT is not set
1299# CONFIG_FB_MODE_HELPERS is not set
1300# CONFIG_FB_TILEBLITTING is not set
1301
1302#
1303# Frame buffer hardware drivers
1304#
1305# CONFIG_FB_UVESA is not set
1306# CONFIG_FB_S1D13XXX is not set
1307CONFIG_FB_PXA=y
1308CONFIG_FB_PXA_OVERLAY=y
1309# CONFIG_FB_PXA_SMARTPANEL is not set
1310CONFIG_FB_PXA_PARAMETERS=y
1311# CONFIG_FB_MBX is not set
1312# CONFIG_FB_W100 is not set
1313# CONFIG_FB_VIRTUAL is not set
1314# CONFIG_FB_METRONOME is not set
1315# CONFIG_FB_MB862XX is not set
1316# CONFIG_FB_BROADSHEET is not set
1317CONFIG_BACKLIGHT_LCD_SUPPORT=y
1318# CONFIG_LCD_CLASS_DEVICE is not set
1319CONFIG_BACKLIGHT_CLASS_DEVICE=y
1320CONFIG_BACKLIGHT_GENERIC=y
1321# CONFIG_BACKLIGHT_DA903X is not set
1322
1323#
1324# Display device support
1325#
1326# CONFIG_DISPLAY_SUPPORT is not set
1327
1328#
1329# Console display driver support
1330#
1331# CONFIG_VGA_CONSOLE is not set
1332CONFIG_DUMMY_CONSOLE=y
1333CONFIG_FRAMEBUFFER_CONSOLE=y
1334# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1335# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1336CONFIG_FONTS=y
1337# CONFIG_FONT_8x8 is not set
1338# CONFIG_FONT_8x16 is not set
1339# CONFIG_FONT_6x11 is not set
1340# CONFIG_FONT_7x14 is not set
1341# CONFIG_FONT_PEARL_8x8 is not set
1342# CONFIG_FONT_ACORN_8x8 is not set
1343CONFIG_FONT_MINI_4x6=y
1344# CONFIG_FONT_SUN8x16 is not set
1345# CONFIG_FONT_SUN12x22 is not set
1346# CONFIG_FONT_10x18 is not set
1347# CONFIG_LOGO is not set
1348CONFIG_SOUND=y
1349CONFIG_SOUND_OSS_CORE=y
1350CONFIG_SOUND_OSS_CORE_PRECLAIM=y
1351CONFIG_SND=y
1352CONFIG_SND_TIMER=y
1353CONFIG_SND_PCM=y
1354CONFIG_SND_JACK=y
1355# CONFIG_SND_SEQUENCER is not set
1356CONFIG_SND_OSSEMUL=y
1357CONFIG_SND_MIXER_OSS=y
1358CONFIG_SND_PCM_OSS=y
1359CONFIG_SND_PCM_OSS_PLUGINS=y
1360# CONFIG_SND_HRTIMER is not set
1361# CONFIG_SND_DYNAMIC_MINORS is not set
1362CONFIG_SND_SUPPORT_OLD_API=y
1363CONFIG_SND_VERBOSE_PROCFS=y
1364# CONFIG_SND_VERBOSE_PRINTK is not set
1365# CONFIG_SND_DEBUG is not set
1366# CONFIG_SND_RAWMIDI_SEQ is not set
1367# CONFIG_SND_OPL3_LIB_SEQ is not set
1368# CONFIG_SND_OPL4_LIB_SEQ is not set
1369# CONFIG_SND_SBAWE_SEQ is not set
1370# CONFIG_SND_EMU10K1_SEQ is not set
1371# CONFIG_SND_DRIVERS is not set
1372# CONFIG_SND_ARM is not set
1373CONFIG_SND_PXA2XX_LIB=y
1374# CONFIG_SND_SPI is not set
1375# CONFIG_SND_USB is not set
1376CONFIG_SND_SOC=y
1377CONFIG_SND_PXA2XX_SOC=y
1378# CONFIG_SND_PXA2XX_SOC_IMOTE2 is not set
1379CONFIG_SND_SOC_I2C_AND_SPI=y
1380# CONFIG_SND_SOC_ALL_CODECS is not set
1381# CONFIG_SOUND_PRIME is not set
1382CONFIG_HID_SUPPORT=y
1383CONFIG_HID=y
1384# CONFIG_HIDRAW is not set
1385
1386#
1387# USB Input Devices
1388#
1389# CONFIG_USB_HID is not set
1390# CONFIG_HID_PID is not set
1391
1392#
1393# USB HID Boot Protocol drivers
1394#
1395# CONFIG_USB_KBD is not set
1396# CONFIG_USB_MOUSE is not set
1397
1398#
1399# Special HID drivers
1400#
1401CONFIG_HID_APPLE=m
1402# CONFIG_HID_WACOM is not set
1403CONFIG_USB_SUPPORT=y
1404CONFIG_USB_ARCH_HAS_HCD=y
1405CONFIG_USB_ARCH_HAS_OHCI=y
1406# CONFIG_USB_ARCH_HAS_EHCI is not set
1407CONFIG_USB=y
1408# CONFIG_USB_DEBUG is not set
1409# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1410
1411#
1412# Miscellaneous USB options
1413#
1414# CONFIG_USB_DEVICEFS is not set
1415# CONFIG_USB_DEVICE_CLASS is not set
1416# CONFIG_USB_DYNAMIC_MINORS is not set
1417# CONFIG_USB_SUSPEND is not set
1418# CONFIG_USB_OTG is not set
1419# CONFIG_USB_OTG_WHITELIST is not set
1420# CONFIG_USB_OTG_BLACKLIST_HUB is not set
1421# CONFIG_USB_MON is not set
1422# CONFIG_USB_WUSB is not set
1423# CONFIG_USB_WUSB_CBAF is not set
1424
1425#
1426# USB Host Controller Drivers
1427#
1428# CONFIG_USB_C67X00_HCD is not set
1429# CONFIG_USB_OXU210HP_HCD is not set
1430# CONFIG_USB_ISP116X_HCD is not set
1431# CONFIG_USB_ISP1760_HCD is not set
1432# CONFIG_USB_ISP1362_HCD is not set
1433CONFIG_USB_OHCI_HCD=y
1434# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1435# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1436CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1437# CONFIG_USB_SL811_HCD is not set
1438# CONFIG_USB_R8A66597_HCD is not set
1439# CONFIG_USB_HWA_HCD is not set
1440# CONFIG_USB_MUSB_HDRC is not set
1441# CONFIG_USB_GADGET_MUSB_HDRC is not set
1442
1443#
1444# USB Device Class drivers
1445#
1446# CONFIG_USB_ACM is not set
1447# CONFIG_USB_PRINTER is not set
1448# CONFIG_USB_WDM is not set
1449# CONFIG_USB_TMC is not set
1450
1451#
1452# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1453#
1454
1455#
1456# also be needed; see USB_STORAGE Help for more info
1457#
1458# CONFIG_USB_LIBUSUAL is not set
1459
1460#
1461# USB Imaging devices
1462#
1463# CONFIG_USB_MDC800 is not set
1464
1465#
1466# USB port drivers
1467#
1468# CONFIG_USB_SERIAL is not set
1469
1470#
1471# USB Miscellaneous drivers
1472#
1473# CONFIG_USB_EMI62 is not set
1474# CONFIG_USB_EMI26 is not set
1475# CONFIG_USB_ADUTUX is not set
1476# CONFIG_USB_SEVSEG is not set
1477# CONFIG_USB_RIO500 is not set
1478# CONFIG_USB_LEGOTOWER is not set
1479# CONFIG_USB_LCD is not set
1480# CONFIG_USB_BERRY_CHARGE is not set
1481# CONFIG_USB_LED is not set
1482# CONFIG_USB_CYPRESS_CY7C63 is not set
1483# CONFIG_USB_CYTHERM is not set
1484# CONFIG_USB_IDMOUSE is not set
1485# CONFIG_USB_FTDI_ELAN is not set
1486# CONFIG_USB_APPLEDISPLAY is not set
1487# CONFIG_USB_LD is not set
1488# CONFIG_USB_TRANCEVIBRATOR is not set
1489# CONFIG_USB_IOWARRIOR is not set
1490# CONFIG_USB_TEST is not set
1491# CONFIG_USB_ISIGHTFW is not set
1492# CONFIG_USB_VST is not set
1493CONFIG_USB_GADGET=y
1494# CONFIG_USB_GADGET_DEBUG is not set
1495# CONFIG_USB_GADGET_DEBUG_FILES is not set
1496# CONFIG_USB_GADGET_DEBUG_FS is not set
1497CONFIG_USB_GADGET_VBUS_DRAW=2
1498CONFIG_USB_GADGET_SELECTED=y
1499# CONFIG_USB_GADGET_AT91 is not set
1500# CONFIG_USB_GADGET_ATMEL_USBA is not set
1501# CONFIG_USB_GADGET_FSL_USB2 is not set
1502# CONFIG_USB_GADGET_LH7A40X is not set
1503# CONFIG_USB_GADGET_OMAP is not set
1504# CONFIG_USB_GADGET_PXA25X is not set
1505# CONFIG_USB_GADGET_R8A66597 is not set
1506CONFIG_USB_GADGET_PXA27X=y
1507CONFIG_USB_PXA27X=y
1508# CONFIG_USB_GADGET_S3C_HSOTG is not set
1509# CONFIG_USB_GADGET_IMX is not set
1510# CONFIG_USB_GADGET_S3C2410 is not set
1511# CONFIG_USB_GADGET_M66592 is not set
1512# CONFIG_USB_GADGET_AMD5536UDC is not set
1513# CONFIG_USB_GADGET_FSL_QE is not set
1514# CONFIG_USB_GADGET_CI13XXX is not set
1515# CONFIG_USB_GADGET_NET2280 is not set
1516# CONFIG_USB_GADGET_GOKU is not set
1517# CONFIG_USB_GADGET_LANGWELL is not set
1518# CONFIG_USB_GADGET_DUMMY_HCD is not set
1519# CONFIG_USB_GADGET_DUALSPEED is not set
1520# CONFIG_USB_ZERO is not set
1521# CONFIG_USB_AUDIO is not set
1522CONFIG_USB_ETH=y
1523# CONFIG_USB_ETH_RNDIS is not set
1524# CONFIG_USB_ETH_EEM is not set
1525# CONFIG_USB_GADGETFS is not set
1526# CONFIG_USB_FILE_STORAGE is not set
1527# CONFIG_USB_MASS_STORAGE is not set
1528# CONFIG_USB_G_SERIAL is not set
1529# CONFIG_USB_MIDI_GADGET is not set
1530# CONFIG_USB_G_PRINTER is not set
1531# CONFIG_USB_CDC_COMPOSITE is not set
1532# CONFIG_USB_G_MULTI is not set
1533
1534#
1535# OTG and related infrastructure
1536#
1537CONFIG_USB_OTG_UTILS=y
1538# CONFIG_USB_GPIO_VBUS is not set
1539# CONFIG_USB_ULPI is not set
1540# CONFIG_NOP_USB_XCEIV is not set
1541CONFIG_MMC=y
1542# CONFIG_MMC_DEBUG is not set
1543CONFIG_MMC_UNSAFE_RESUME=y
1544
1545#
1546# MMC/SD/SDIO Card Drivers
1547#
1548CONFIG_MMC_BLOCK=y
1549CONFIG_MMC_BLOCK_BOUNCE=y
1550CONFIG_SDIO_UART=m
1551# CONFIG_MMC_TEST is not set
1552
1553#
1554# MMC/SD/SDIO Host Controller Drivers
1555#
1556CONFIG_MMC_PXA=y
1557# CONFIG_MMC_SDHCI is not set
1558# CONFIG_MMC_AT91 is not set
1559# CONFIG_MMC_ATMELMCI is not set
1560CONFIG_MMC_SPI=y
1561# CONFIG_MEMSTICK is not set
1562CONFIG_NEW_LEDS=y
1563CONFIG_LEDS_CLASS=y
1564
1565#
1566# LED drivers
1567#
1568# CONFIG_LEDS_PCA9532 is not set
1569# CONFIG_LEDS_GPIO is not set
1570CONFIG_LEDS_LP3944=y
1571# CONFIG_LEDS_PCA955X is not set
1572# CONFIG_LEDS_DA903X is not set
1573# CONFIG_LEDS_DAC124S085 is not set
1574# CONFIG_LEDS_REGULATOR is not set
1575# CONFIG_LEDS_BD2802 is not set
1576# CONFIG_LEDS_LT3593 is not set
1577
1578#
1579# LED Triggers
1580#
1581CONFIG_LEDS_TRIGGERS=y
1582CONFIG_LEDS_TRIGGER_TIMER=y
1583CONFIG_LEDS_TRIGGER_HEARTBEAT=y
1584CONFIG_LEDS_TRIGGER_BACKLIGHT=y
1585CONFIG_LEDS_TRIGGER_GPIO=y
1586CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
1587
1588#
1589# iptables trigger is under Netfilter config (LED target)
1590#
1591# CONFIG_ACCESSIBILITY is not set
1592CONFIG_RTC_LIB=y
1593CONFIG_RTC_CLASS=y
1594CONFIG_RTC_HCTOSYS=y
1595CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1596# CONFIG_RTC_DEBUG is not set
1597
1598#
1599# RTC interfaces
1600#
1601CONFIG_RTC_INTF_SYSFS=y
1602CONFIG_RTC_INTF_PROC=y
1603CONFIG_RTC_INTF_DEV=y
1604# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1605# CONFIG_RTC_DRV_TEST is not set
1606
1607#
1608# I2C RTC drivers
1609#
1610# CONFIG_RTC_DRV_DS1307 is not set
1611# CONFIG_RTC_DRV_DS1374 is not set
1612# CONFIG_RTC_DRV_DS1672 is not set
1613# CONFIG_RTC_DRV_MAX6900 is not set
1614# CONFIG_RTC_DRV_RS5C372 is not set
1615# CONFIG_RTC_DRV_ISL1208 is not set
1616# CONFIG_RTC_DRV_X1205 is not set
1617# CONFIG_RTC_DRV_PCF8563 is not set
1618# CONFIG_RTC_DRV_PCF8583 is not set
1619# CONFIG_RTC_DRV_M41T80 is not set
1620# CONFIG_RTC_DRV_BQ32K is not set
1621# CONFIG_RTC_DRV_S35390A is not set
1622# CONFIG_RTC_DRV_FM3130 is not set
1623# CONFIG_RTC_DRV_RX8581 is not set
1624# CONFIG_RTC_DRV_RX8025 is not set
1625
1626#
1627# SPI RTC drivers
1628#
1629# CONFIG_RTC_DRV_M41T94 is not set
1630# CONFIG_RTC_DRV_DS1305 is not set
1631# CONFIG_RTC_DRV_DS1390 is not set
1632# CONFIG_RTC_DRV_MAX6902 is not set
1633# CONFIG_RTC_DRV_R9701 is not set
1634# CONFIG_RTC_DRV_RS5C348 is not set
1635# CONFIG_RTC_DRV_DS3234 is not set
1636# CONFIG_RTC_DRV_PCF2123 is not set
1637
1638#
1639# Platform RTC drivers
1640#
1641# CONFIG_RTC_DRV_CMOS is not set
1642# CONFIG_RTC_DRV_DS1286 is not set
1643# CONFIG_RTC_DRV_DS1511 is not set
1644# CONFIG_RTC_DRV_DS1553 is not set
1645# CONFIG_RTC_DRV_DS1742 is not set
1646# CONFIG_RTC_DRV_STK17TA8 is not set
1647# CONFIG_RTC_DRV_M48T86 is not set
1648# CONFIG_RTC_DRV_M48T35 is not set
1649# CONFIG_RTC_DRV_M48T59 is not set
1650# CONFIG_RTC_DRV_MSM6242 is not set
1651# CONFIG_RTC_DRV_BQ4802 is not set
1652# CONFIG_RTC_DRV_RP5C01 is not set
1653# CONFIG_RTC_DRV_V3020 is not set
1654
1655#
1656# on-CPU RTC drivers
1657#
1658# CONFIG_RTC_DRV_SA1100 is not set
1659# CONFIG_RTC_DRV_PXA is not set
1660# CONFIG_DMADEVICES is not set
1661# CONFIG_AUXDISPLAY is not set
1662# CONFIG_UIO is not set
1663
1664#
1665# TI VLYNQ
1666#
1667# CONFIG_STAGING is not set
1668
1669#
1670# File systems
1671#
1672CONFIG_EXT2_FS=y
1673# CONFIG_EXT2_FS_XATTR is not set
1674# CONFIG_EXT2_FS_XIP is not set
1675CONFIG_EXT3_FS=m
1676# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1677CONFIG_EXT3_FS_XATTR=y
1678# CONFIG_EXT3_FS_POSIX_ACL is not set
1679# CONFIG_EXT3_FS_SECURITY is not set
1680# CONFIG_EXT4_FS is not set
1681CONFIG_JBD=m
1682# CONFIG_JBD_DEBUG is not set
1683CONFIG_FS_MBCACHE=m
1684CONFIG_REISERFS_FS=m
1685# CONFIG_REISERFS_CHECK is not set
1686# CONFIG_REISERFS_PROC_INFO is not set
1687CONFIG_REISERFS_FS_XATTR=y
1688CONFIG_REISERFS_FS_POSIX_ACL=y
1689CONFIG_REISERFS_FS_SECURITY=y
1690# CONFIG_JFS_FS is not set
1691CONFIG_FS_POSIX_ACL=y
1692CONFIG_XFS_FS=m
1693# CONFIG_XFS_QUOTA is not set
1694# CONFIG_XFS_POSIX_ACL is not set
1695# CONFIG_XFS_RT is not set
1696# CONFIG_XFS_DEBUG is not set
1697# CONFIG_OCFS2_FS is not set
1698# CONFIG_BTRFS_FS is not set
1699# CONFIG_NILFS2_FS is not set
1700CONFIG_FILE_LOCKING=y
1701CONFIG_FSNOTIFY=y
1702CONFIG_DNOTIFY=y
1703CONFIG_INOTIFY=y
1704CONFIG_INOTIFY_USER=y
1705# CONFIG_QUOTA is not set
1706CONFIG_AUTOFS_FS=y
1707CONFIG_AUTOFS4_FS=y
1708CONFIG_FUSE_FS=m
1709CONFIG_CUSE=m
1710
1711#
1712# Caches
1713#
1714# CONFIG_FSCACHE is not set
1715
1716#
1717# CD-ROM/DVD Filesystems
1718#
1719CONFIG_ISO9660_FS=m
1720CONFIG_JOLIET=y
1721CONFIG_ZISOFS=y
1722# CONFIG_UDF_FS is not set
1723
1724#
1725# DOS/FAT/NT Filesystems
1726#
1727CONFIG_FAT_FS=m
1728CONFIG_MSDOS_FS=m
1729CONFIG_VFAT_FS=m
1730CONFIG_FAT_DEFAULT_CODEPAGE=437
1731CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1732# CONFIG_NTFS_FS is not set
1733
1734#
1735# Pseudo filesystems
1736#
1737CONFIG_PROC_FS=y
1738CONFIG_PROC_SYSCTL=y
1739CONFIG_PROC_PAGE_MONITOR=y
1740CONFIG_SYSFS=y
1741CONFIG_TMPFS=y
1742# CONFIG_TMPFS_POSIX_ACL is not set
1743# CONFIG_HUGETLB_PAGE is not set
1744# CONFIG_CONFIGFS_FS is not set
1745CONFIG_MISC_FILESYSTEMS=y
1746# CONFIG_ADFS_FS is not set
1747# CONFIG_AFFS_FS is not set
1748# CONFIG_HFS_FS is not set
1749# CONFIG_HFSPLUS_FS is not set
1750# CONFIG_BEFS_FS is not set
1751# CONFIG_BFS_FS is not set
1752# CONFIG_EFS_FS is not set
1753CONFIG_JFFS2_FS=m
1754CONFIG_JFFS2_FS_DEBUG=0
1755CONFIG_JFFS2_FS_WRITEBUFFER=y
1756# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1757# CONFIG_JFFS2_SUMMARY is not set
1758# CONFIG_JFFS2_FS_XATTR is not set
1759CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1760CONFIG_JFFS2_ZLIB=y
1761CONFIG_JFFS2_LZO=y
1762CONFIG_JFFS2_RTIME=y
1763CONFIG_JFFS2_RUBIN=y
1764# CONFIG_JFFS2_CMODE_NONE is not set
1765CONFIG_JFFS2_CMODE_PRIORITY=y
1766# CONFIG_JFFS2_CMODE_SIZE is not set
1767# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
1768CONFIG_CRAMFS=m
1769CONFIG_SQUASHFS=m
1770# CONFIG_SQUASHFS_EMBEDDED is not set
1771CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
1772# CONFIG_VXFS_FS is not set
1773# CONFIG_MINIX_FS is not set
1774# CONFIG_OMFS_FS is not set
1775# CONFIG_HPFS_FS is not set
1776# CONFIG_QNX4FS_FS is not set
1777CONFIG_ROMFS_FS=m
1778CONFIG_ROMFS_BACKED_BY_BLOCK=y
1779# CONFIG_ROMFS_BACKED_BY_MTD is not set
1780# CONFIG_ROMFS_BACKED_BY_BOTH is not set
1781CONFIG_ROMFS_ON_BLOCK=y
1782# CONFIG_SYSV_FS is not set
1783# CONFIG_UFS_FS is not set
1784CONFIG_NETWORK_FILESYSTEMS=y
1785CONFIG_NFS_FS=y
1786CONFIG_NFS_V3=y
1787CONFIG_NFS_V3_ACL=y
1788# CONFIG_NFS_V4 is not set
1789# CONFIG_ROOT_NFS is not set
1790CONFIG_NFSD=m
1791CONFIG_NFSD_V2_ACL=y
1792CONFIG_NFSD_V3=y
1793CONFIG_NFSD_V3_ACL=y
1794# CONFIG_NFSD_V4 is not set
1795CONFIG_LOCKD=y
1796CONFIG_LOCKD_V4=y
1797CONFIG_EXPORTFS=m
1798CONFIG_NFS_ACL_SUPPORT=y
1799CONFIG_NFS_COMMON=y
1800CONFIG_SUNRPC=y
1801# CONFIG_RPCSEC_GSS_KRB5 is not set
1802# CONFIG_RPCSEC_GSS_SPKM3 is not set
1803CONFIG_SMB_FS=m
1804# CONFIG_SMB_NLS_DEFAULT is not set
1805CONFIG_CIFS=m
1806CONFIG_CIFS_STATS=y
1807# CONFIG_CIFS_STATS2 is not set
1808CONFIG_CIFS_WEAK_PW_HASH=y
1809CONFIG_CIFS_XATTR=y
1810CONFIG_CIFS_POSIX=y
1811# CONFIG_CIFS_DEBUG2 is not set
1812# CONFIG_CIFS_EXPERIMENTAL is not set
1813# CONFIG_NCP_FS is not set
1814# CONFIG_CODA_FS is not set
1815# CONFIG_AFS_FS is not set
1816
1817#
1818# Partition Types
1819#
1820# CONFIG_PARTITION_ADVANCED is not set
1821CONFIG_MSDOS_PARTITION=y
1822CONFIG_NLS=y
1823CONFIG_NLS_DEFAULT="iso8859-1"
1824CONFIG_NLS_CODEPAGE_437=m
1825CONFIG_NLS_CODEPAGE_737=m
1826CONFIG_NLS_CODEPAGE_775=m
1827CONFIG_NLS_CODEPAGE_850=m
1828CONFIG_NLS_CODEPAGE_852=m
1829CONFIG_NLS_CODEPAGE_855=m
1830CONFIG_NLS_CODEPAGE_857=m
1831CONFIG_NLS_CODEPAGE_860=m
1832CONFIG_NLS_CODEPAGE_861=m
1833CONFIG_NLS_CODEPAGE_862=m
1834CONFIG_NLS_CODEPAGE_863=m
1835CONFIG_NLS_CODEPAGE_864=m
1836CONFIG_NLS_CODEPAGE_865=m
1837CONFIG_NLS_CODEPAGE_866=m
1838CONFIG_NLS_CODEPAGE_869=m
1839CONFIG_NLS_CODEPAGE_936=m
1840CONFIG_NLS_CODEPAGE_950=m
1841CONFIG_NLS_CODEPAGE_932=m
1842CONFIG_NLS_CODEPAGE_949=m
1843CONFIG_NLS_CODEPAGE_874=m
1844CONFIG_NLS_ISO8859_8=m
1845CONFIG_NLS_CODEPAGE_1250=m
1846CONFIG_NLS_CODEPAGE_1251=m
1847CONFIG_NLS_ASCII=m
1848CONFIG_NLS_ISO8859_1=m
1849CONFIG_NLS_ISO8859_2=m
1850CONFIG_NLS_ISO8859_3=m
1851CONFIG_NLS_ISO8859_4=m
1852CONFIG_NLS_ISO8859_5=m
1853CONFIG_NLS_ISO8859_6=m
1854CONFIG_NLS_ISO8859_7=m
1855CONFIG_NLS_ISO8859_9=m
1856CONFIG_NLS_ISO8859_13=m
1857CONFIG_NLS_ISO8859_14=m
1858CONFIG_NLS_ISO8859_15=m
1859CONFIG_NLS_KOI8_R=m
1860CONFIG_NLS_KOI8_U=m
1861CONFIG_NLS_UTF8=m
1862# CONFIG_DLM is not set
1863
1864#
1865# Kernel hacking
1866#
1867CONFIG_PRINTK_TIME=y
1868CONFIG_ENABLE_WARN_DEPRECATED=y
1869CONFIG_ENABLE_MUST_CHECK=y
1870CONFIG_FRAME_WARN=1024
1871# CONFIG_MAGIC_SYSRQ is not set
1872# CONFIG_STRIP_ASM_SYMS is not set
1873# CONFIG_UNUSED_SYMBOLS is not set
1874CONFIG_DEBUG_FS=y
1875# CONFIG_HEADERS_CHECK is not set
1876CONFIG_DEBUG_KERNEL=y
1877# CONFIG_DEBUG_SHIRQ is not set
1878CONFIG_DETECT_SOFTLOCKUP=y
1879# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1880CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1881CONFIG_DETECT_HUNG_TASK=y
1882# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1883CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1884# CONFIG_SCHED_DEBUG is not set
1885# CONFIG_SCHEDSTATS is not set
1886# CONFIG_TIMER_STATS is not set
1887# CONFIG_DEBUG_OBJECTS is not set
1888# CONFIG_DEBUG_SLAB is not set
1889# CONFIG_DEBUG_KMEMLEAK is not set
1890CONFIG_DEBUG_PREEMPT=y
1891CONFIG_DEBUG_RT_MUTEXES=y
1892CONFIG_DEBUG_PI_LIST=y
1893# CONFIG_RT_MUTEX_TESTER is not set
1894CONFIG_DEBUG_SPINLOCK=y
1895CONFIG_DEBUG_MUTEXES=y
1896CONFIG_DEBUG_LOCK_ALLOC=y
1897CONFIG_PROVE_LOCKING=y
1898CONFIG_LOCKDEP=y
1899# CONFIG_LOCK_STAT is not set
1900# CONFIG_DEBUG_LOCKDEP is not set
1901CONFIG_TRACE_IRQFLAGS=y
1902# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1903# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1904CONFIG_STACKTRACE=y
1905# CONFIG_DEBUG_KOBJECT is not set
1906CONFIG_DEBUG_BUGVERBOSE=y
1907# CONFIG_DEBUG_INFO is not set
1908# CONFIG_DEBUG_VM is not set
1909# CONFIG_DEBUG_WRITECOUNT is not set
1910# CONFIG_DEBUG_MEMORY_INIT is not set
1911# CONFIG_DEBUG_LIST is not set
1912# CONFIG_DEBUG_SG is not set
1913# CONFIG_DEBUG_NOTIFIERS is not set
1914# CONFIG_DEBUG_CREDENTIALS is not set
1915# CONFIG_BOOT_PRINTK_DELAY is not set
1916# CONFIG_RCU_TORTURE_TEST is not set
1917# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1918# CONFIG_BACKTRACE_SELF_TEST is not set
1919# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1920# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1921# CONFIG_FAULT_INJECTION is not set
1922# CONFIG_LATENCYTOP is not set
1923# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1924# CONFIG_PAGE_POISONING is not set
1925CONFIG_HAVE_FUNCTION_TRACER=y
1926CONFIG_TRACING_SUPPORT=y
1927# CONFIG_FTRACE is not set
1928# CONFIG_DYNAMIC_DEBUG is not set
1929# CONFIG_SAMPLES is not set
1930CONFIG_HAVE_ARCH_KGDB=y
1931# CONFIG_KGDB is not set
1932CONFIG_ARM_UNWIND=y
1933CONFIG_DEBUG_USER=y
1934CONFIG_DEBUG_ERRORS=y
1935# CONFIG_DEBUG_STACK_USAGE is not set
1936# CONFIG_DEBUG_LL is not set
1937# CONFIG_OC_ETM is not set
1938
1939#
1940# Security options
1941#
1942# CONFIG_KEYS is not set
1943# CONFIG_SECURITY is not set
1944# CONFIG_SECURITYFS is not set
1945# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1946# CONFIG_DEFAULT_SECURITY_SMACK is not set
1947# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1948CONFIG_DEFAULT_SECURITY_DAC=y
1949CONFIG_DEFAULT_SECURITY=""
1950CONFIG_CRYPTO=y
1951
1952#
1953# Crypto core or helper
1954#
1955CONFIG_CRYPTO_ALGAPI=m
1956CONFIG_CRYPTO_ALGAPI2=m
1957CONFIG_CRYPTO_AEAD=m
1958CONFIG_CRYPTO_AEAD2=m
1959CONFIG_CRYPTO_BLKCIPHER=m
1960CONFIG_CRYPTO_BLKCIPHER2=m
1961CONFIG_CRYPTO_HASH=m
1962CONFIG_CRYPTO_HASH2=m
1963CONFIG_CRYPTO_RNG2=m
1964CONFIG_CRYPTO_PCOMP=m
1965CONFIG_CRYPTO_MANAGER=m
1966CONFIG_CRYPTO_MANAGER2=m
1967CONFIG_CRYPTO_GF128MUL=m
1968CONFIG_CRYPTO_NULL=m
1969CONFIG_CRYPTO_WORKQUEUE=m
1970CONFIG_CRYPTO_CRYPTD=m
1971CONFIG_CRYPTO_AUTHENC=m
1972CONFIG_CRYPTO_TEST=m
1973
1974#
1975# Authenticated Encryption with Associated Data
1976#
1977# CONFIG_CRYPTO_CCM is not set
1978# CONFIG_CRYPTO_GCM is not set
1979# CONFIG_CRYPTO_SEQIV is not set
1980
1981#
1982# Block modes
1983#
1984CONFIG_CRYPTO_CBC=m
1985# CONFIG_CRYPTO_CTR is not set
1986# CONFIG_CRYPTO_CTS is not set
1987CONFIG_CRYPTO_ECB=m
1988CONFIG_CRYPTO_LRW=m
1989CONFIG_CRYPTO_PCBC=m
1990CONFIG_CRYPTO_XTS=m
1991
1992#
1993# Hash modes
1994#
1995CONFIG_CRYPTO_HMAC=m
1996CONFIG_CRYPTO_XCBC=m
1997CONFIG_CRYPTO_VMAC=m
1998
1999#
2000# Digest
2001#
2002CONFIG_CRYPTO_CRC32C=m
2003CONFIG_CRYPTO_GHASH=m
2004CONFIG_CRYPTO_MD4=m
2005CONFIG_CRYPTO_MD5=m
2006CONFIG_CRYPTO_MICHAEL_MIC=m
2007# CONFIG_CRYPTO_RMD128 is not set
2008# CONFIG_CRYPTO_RMD160 is not set
2009# CONFIG_CRYPTO_RMD256 is not set
2010# CONFIG_CRYPTO_RMD320 is not set
2011CONFIG_CRYPTO_SHA1=m
2012CONFIG_CRYPTO_SHA256=m
2013CONFIG_CRYPTO_SHA512=m
2014CONFIG_CRYPTO_TGR192=m
2015# CONFIG_CRYPTO_WP512 is not set
2016
2017#
2018# Ciphers
2019#
2020CONFIG_CRYPTO_AES=m
2021# CONFIG_CRYPTO_ANUBIS is not set
2022CONFIG_CRYPTO_ARC4=m
2023CONFIG_CRYPTO_BLOWFISH=m
2024# CONFIG_CRYPTO_CAMELLIA is not set
2025CONFIG_CRYPTO_CAST5=m
2026CONFIG_CRYPTO_CAST6=m
2027CONFIG_CRYPTO_DES=m
2028CONFIG_CRYPTO_FCRYPT=m
2029CONFIG_CRYPTO_KHAZAD=m
2030# CONFIG_CRYPTO_SALSA20 is not set
2031CONFIG_CRYPTO_SEED=m
2032CONFIG_CRYPTO_SERPENT=m
2033CONFIG_CRYPTO_TEA=m
2034CONFIG_CRYPTO_TWOFISH=m
2035CONFIG_CRYPTO_TWOFISH_COMMON=m
2036
2037#
2038# Compression
2039#
2040CONFIG_CRYPTO_DEFLATE=m
2041# CONFIG_CRYPTO_ZLIB is not set
2042# CONFIG_CRYPTO_LZO is not set
2043
2044#
2045# Random Number Generation
2046#
2047# CONFIG_CRYPTO_ANSI_CPRNG is not set
2048CONFIG_CRYPTO_HW=y
2049# CONFIG_BINARY_PRINTF is not set
2050
2051#
2052# Library routines
2053#
2054CONFIG_BITREVERSE=y
2055CONFIG_GENERIC_FIND_LAST_BIT=y
2056CONFIG_CRC_CCITT=m
2057CONFIG_CRC16=y
2058# CONFIG_CRC_T10DIF is not set
2059CONFIG_CRC_ITU_T=y
2060CONFIG_CRC32=y
2061CONFIG_CRC7=y
2062CONFIG_LIBCRC32C=m
2063CONFIG_ZLIB_INFLATE=y
2064CONFIG_ZLIB_DEFLATE=m
2065CONFIG_LZO_COMPRESS=m
2066CONFIG_LZO_DECOMPRESS=m
2067CONFIG_DECOMPRESS_GZIP=y
2068CONFIG_DECOMPRESS_BZIP2=y
2069CONFIG_DECOMPRESS_LZMA=y
2070CONFIG_TEXTSEARCH=y
2071CONFIG_TEXTSEARCH_KMP=m
2072CONFIG_TEXTSEARCH_BM=m
2073CONFIG_TEXTSEARCH_FSM=m
2074CONFIG_HAS_IOMEM=y
2075CONFIG_HAS_IOPORT=y
2076CONFIG_HAS_DMA=y
2077CONFIG_NLATTR=y
diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig
index 5fc44c94b0ad..4611d3ce451a 100644
--- a/arch/arm/configs/kirkwood_defconfig
+++ b/arch/arm/configs/kirkwood_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6 3# Linux kernel version: 2.6.33-rc6
4# Sat Nov 7 20:31:18 2009 4# Thu Feb 4 23:08:54 2010
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -32,6 +32,12 @@ CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32 32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION="" 33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y 34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
35CONFIG_SWAP=y 41CONFIG_SWAP=y
36CONFIG_SYSVIPC=y 42CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y 43CONFIG_SYSVIPC_SYSCTL=y
@@ -45,6 +51,7 @@ CONFIG_SYSVIPC_SYSCTL=y
45# 51#
46CONFIG_TREE_RCU=y 52CONFIG_TREE_RCU=y
47# CONFIG_TREE_PREEMPT_RCU is not set 53# CONFIG_TREE_PREEMPT_RCU is not set
54# CONFIG_TINY_RCU is not set
48# CONFIG_RCU_TRACE is not set 55# CONFIG_RCU_TRACE is not set
49CONFIG_RCU_FANOUT=32 56CONFIG_RCU_FANOUT=32
50# CONFIG_RCU_FANOUT_EXACT is not set 57# CONFIG_RCU_FANOUT_EXACT is not set
@@ -127,14 +134,41 @@ CONFIG_LBDAF=y
127# IO Schedulers 134# IO Schedulers
128# 135#
129CONFIG_IOSCHED_NOOP=y 136CONFIG_IOSCHED_NOOP=y
130CONFIG_IOSCHED_AS=y
131CONFIG_IOSCHED_DEADLINE=y 137CONFIG_IOSCHED_DEADLINE=y
132CONFIG_IOSCHED_CFQ=y 138CONFIG_IOSCHED_CFQ=y
133# CONFIG_DEFAULT_AS is not set
134# CONFIG_DEFAULT_DEADLINE is not set 139# CONFIG_DEFAULT_DEADLINE is not set
135CONFIG_DEFAULT_CFQ=y 140CONFIG_DEFAULT_CFQ=y
136# CONFIG_DEFAULT_NOOP is not set 141# CONFIG_DEFAULT_NOOP is not set
137CONFIG_DEFAULT_IOSCHED="cfq" 142CONFIG_DEFAULT_IOSCHED="cfq"
143# CONFIG_INLINE_SPIN_TRYLOCK is not set
144# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
145# CONFIG_INLINE_SPIN_LOCK is not set
146# CONFIG_INLINE_SPIN_LOCK_BH is not set
147# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
148# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
149# CONFIG_INLINE_SPIN_UNLOCK is not set
150# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
151# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
152# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
153# CONFIG_INLINE_READ_TRYLOCK is not set
154# CONFIG_INLINE_READ_LOCK is not set
155# CONFIG_INLINE_READ_LOCK_BH is not set
156# CONFIG_INLINE_READ_LOCK_IRQ is not set
157# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
158# CONFIG_INLINE_READ_UNLOCK is not set
159# CONFIG_INLINE_READ_UNLOCK_BH is not set
160# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
161# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
162# CONFIG_INLINE_WRITE_TRYLOCK is not set
163# CONFIG_INLINE_WRITE_LOCK is not set
164# CONFIG_INLINE_WRITE_LOCK_BH is not set
165# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
166# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
167# CONFIG_INLINE_WRITE_UNLOCK is not set
168# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
169# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
170# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
171# CONFIG_MUTEX_SPIN_ON_OWNER is not set
138# CONFIG_FREEZER is not set 172# CONFIG_FREEZER is not set
139 173
140# 174#
@@ -163,6 +197,7 @@ CONFIG_MMU=y
163# CONFIG_ARCH_IXP2000 is not set 197# CONFIG_ARCH_IXP2000 is not set
164# CONFIG_ARCH_IXP4XX is not set 198# CONFIG_ARCH_IXP4XX is not set
165# CONFIG_ARCH_L7200 is not set 199# CONFIG_ARCH_L7200 is not set
200# CONFIG_ARCH_DOVE is not set
166CONFIG_ARCH_KIRKWOOD=y 201CONFIG_ARCH_KIRKWOOD=y
167# CONFIG_ARCH_LOKI is not set 202# CONFIG_ARCH_LOKI is not set
168# CONFIG_ARCH_MV78XX0 is not set 203# CONFIG_ARCH_MV78XX0 is not set
@@ -185,6 +220,7 @@ CONFIG_ARCH_KIRKWOOD=y
185# CONFIG_ARCH_DAVINCI is not set 220# CONFIG_ARCH_DAVINCI is not set
186# CONFIG_ARCH_OMAP is not set 221# CONFIG_ARCH_OMAP is not set
187# CONFIG_ARCH_BCMRING is not set 222# CONFIG_ARCH_BCMRING is not set
223# CONFIG_ARCH_U8500 is not set
188 224
189# 225#
190# Marvell Kirkwood Implementations 226# Marvell Kirkwood Implementations
@@ -195,7 +231,11 @@ CONFIG_MACH_RD88F6281=y
195CONFIG_MACH_MV88F6281GTW_GE=y 231CONFIG_MACH_MV88F6281GTW_GE=y
196CONFIG_MACH_SHEEVAPLUG=y 232CONFIG_MACH_SHEEVAPLUG=y
197CONFIG_MACH_TS219=y 233CONFIG_MACH_TS219=y
234CONFIG_MACH_TS41X=y
235CONFIG_MACH_OPENRD=y
198CONFIG_MACH_OPENRD_BASE=y 236CONFIG_MACH_OPENRD_BASE=y
237CONFIG_MACH_OPENRD_CLIENT=y
238CONFIG_MACH_NETSPACE_V2=y
199CONFIG_PLAT_ORION=y 239CONFIG_PLAT_ORION=y
200 240
201# 241#
@@ -262,12 +302,10 @@ CONFIG_FLATMEM_MANUAL=y
262CONFIG_FLATMEM=y 302CONFIG_FLATMEM=y
263CONFIG_FLAT_NODE_MEM_MAP=y 303CONFIG_FLAT_NODE_MEM_MAP=y
264CONFIG_PAGEFLAGS_EXTENDED=y 304CONFIG_PAGEFLAGS_EXTENDED=y
265CONFIG_SPLIT_PTLOCK_CPUS=4096 305CONFIG_SPLIT_PTLOCK_CPUS=999999
266# CONFIG_PHYS_ADDR_T_64BIT is not set 306# CONFIG_PHYS_ADDR_T_64BIT is not set
267CONFIG_ZONE_DMA_FLAG=0 307CONFIG_ZONE_DMA_FLAG=0
268CONFIG_VIRT_TO_BUS=y 308CONFIG_VIRT_TO_BUS=y
269CONFIG_HAVE_MLOCK=y
270CONFIG_HAVE_MLOCKED_PAGE_BIT=y
271# CONFIG_KSM is not set 309# CONFIG_KSM is not set
272CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 310CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
273CONFIG_ALIGNMENT_TRAP=y 311CONFIG_ALIGNMENT_TRAP=y
@@ -398,15 +436,18 @@ CONFIG_NET_PKTGEN=m
398# CONFIG_BT is not set 436# CONFIG_BT is not set
399# CONFIG_AF_RXRPC is not set 437# CONFIG_AF_RXRPC is not set
400CONFIG_WIRELESS=y 438CONFIG_WIRELESS=y
439CONFIG_WIRELESS_EXT=y
440CONFIG_WEXT_CORE=y
441CONFIG_WEXT_PROC=y
442CONFIG_WEXT_SPY=y
401CONFIG_CFG80211=y 443CONFIG_CFG80211=y
402# CONFIG_NL80211_TESTMODE is not set 444# CONFIG_NL80211_TESTMODE is not set
403# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set 445# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
404# CONFIG_CFG80211_REG_DEBUG is not set 446# CONFIG_CFG80211_REG_DEBUG is not set
405CONFIG_CFG80211_DEFAULT_PS=y 447CONFIG_CFG80211_DEFAULT_PS=y
406CONFIG_CFG80211_DEFAULT_PS_VALUE=1
407# CONFIG_CFG80211_DEBUGFS is not set 448# CONFIG_CFG80211_DEBUGFS is not set
408CONFIG_WIRELESS_OLD_REGULATORY=y 449CONFIG_WIRELESS_OLD_REGULATORY=y
409CONFIG_WIRELESS_EXT=y 450CONFIG_CFG80211_WEXT=y
410CONFIG_WIRELESS_EXT_SYSFS=y 451CONFIG_WIRELESS_EXT_SYSFS=y
411CONFIG_LIB80211=y 452CONFIG_LIB80211=y
412# CONFIG_LIB80211_DEBUG is not set 453# CONFIG_LIB80211_DEBUG is not set
@@ -556,6 +597,10 @@ CONFIG_BLK_DEV=y
556# CONFIG_BLK_DEV_COW_COMMON is not set 597# CONFIG_BLK_DEV_COW_COMMON is not set
557CONFIG_BLK_DEV_LOOP=y 598CONFIG_BLK_DEV_LOOP=y
558# CONFIG_BLK_DEV_CRYPTOLOOP is not set 599# CONFIG_BLK_DEV_CRYPTOLOOP is not set
600
601#
602# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
603#
559# CONFIG_BLK_DEV_NBD is not set 604# CONFIG_BLK_DEV_NBD is not set
560# CONFIG_BLK_DEV_SX8 is not set 605# CONFIG_BLK_DEV_SX8 is not set
561# CONFIG_BLK_DEV_UB is not set 606# CONFIG_BLK_DEV_UB is not set
@@ -606,7 +651,9 @@ CONFIG_SCSI_LOWLEVEL=y
606# CONFIG_SCSI_BNX2_ISCSI is not set 651# CONFIG_SCSI_BNX2_ISCSI is not set
607# CONFIG_BE2ISCSI is not set 652# CONFIG_BE2ISCSI is not set
608# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 653# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
654# CONFIG_SCSI_HPSA is not set
609# CONFIG_SCSI_3W_9XXX is not set 655# CONFIG_SCSI_3W_9XXX is not set
656# CONFIG_SCSI_3W_SAS is not set
610# CONFIG_SCSI_ACARD is not set 657# CONFIG_SCSI_ACARD is not set
611# CONFIG_SCSI_AACRAID is not set 658# CONFIG_SCSI_AACRAID is not set
612# CONFIG_SCSI_AIC7XXX is not set 659# CONFIG_SCSI_AIC7XXX is not set
@@ -642,6 +689,7 @@ CONFIG_SCSI_LOWLEVEL=y
642# CONFIG_SCSI_NSP32 is not set 689# CONFIG_SCSI_NSP32 is not set
643# CONFIG_SCSI_DEBUG is not set 690# CONFIG_SCSI_DEBUG is not set
644# CONFIG_SCSI_PMCRAID is not set 691# CONFIG_SCSI_PMCRAID is not set
692# CONFIG_SCSI_PM8001 is not set
645# CONFIG_SCSI_SRP is not set 693# CONFIG_SCSI_SRP is not set
646# CONFIG_SCSI_BFA_FC is not set 694# CONFIG_SCSI_BFA_FC is not set
647# CONFIG_SCSI_DH is not set 695# CONFIG_SCSI_DH is not set
@@ -696,15 +744,16 @@ CONFIG_SATA_MV=y
696# CONFIG_PATA_NS87415 is not set 744# CONFIG_PATA_NS87415 is not set
697# CONFIG_PATA_OPTI is not set 745# CONFIG_PATA_OPTI is not set
698# CONFIG_PATA_OPTIDMA is not set 746# CONFIG_PATA_OPTIDMA is not set
747# CONFIG_PATA_PDC2027X is not set
699# CONFIG_PATA_PDC_OLD is not set 748# CONFIG_PATA_PDC_OLD is not set
700# CONFIG_PATA_RADISYS is not set 749# CONFIG_PATA_RADISYS is not set
701# CONFIG_PATA_RDC is not set 750# CONFIG_PATA_RDC is not set
702# CONFIG_PATA_RZ1000 is not set 751# CONFIG_PATA_RZ1000 is not set
703# CONFIG_PATA_SC1200 is not set 752# CONFIG_PATA_SC1200 is not set
704# CONFIG_PATA_SERVERWORKS is not set 753# CONFIG_PATA_SERVERWORKS is not set
705# CONFIG_PATA_PDC2027X is not set
706# CONFIG_PATA_SIL680 is not set 754# CONFIG_PATA_SIL680 is not set
707# CONFIG_PATA_SIS is not set 755# CONFIG_PATA_SIS is not set
756# CONFIG_PATA_TOSHIBA is not set
708# CONFIG_PATA_VIA is not set 757# CONFIG_PATA_VIA is not set
709# CONFIG_PATA_WINBOND is not set 758# CONFIG_PATA_WINBOND is not set
710# CONFIG_PATA_SCH is not set 759# CONFIG_PATA_SCH is not set
@@ -720,7 +769,7 @@ CONFIG_SATA_MV=y
720# 769#
721 770
722# 771#
723# See the help texts for more information. 772# The newer stack is recommended.
724# 773#
725# CONFIG_FIREWIRE is not set 774# CONFIG_FIREWIRE is not set
726# CONFIG_IEEE1394 is not set 775# CONFIG_IEEE1394 is not set
@@ -828,13 +877,6 @@ CONFIG_MV643XX_ETH=y
828# CONFIG_NETDEV_10000 is not set 877# CONFIG_NETDEV_10000 is not set
829# CONFIG_TR is not set 878# CONFIG_TR is not set
830CONFIG_WLAN=y 879CONFIG_WLAN=y
831# CONFIG_WLAN_PRE80211 is not set
832CONFIG_WLAN_80211=y
833CONFIG_LIBERTAS=y
834# CONFIG_LIBERTAS_USB is not set
835CONFIG_LIBERTAS_SDIO=y
836# CONFIG_LIBERTAS_SPI is not set
837# CONFIG_LIBERTAS_DEBUG is not set
838# CONFIG_LIBERTAS_THINFIRM is not set 880# CONFIG_LIBERTAS_THINFIRM is not set
839# CONFIG_ATMEL is not set 881# CONFIG_ATMEL is not set
840# CONFIG_AT76C50X_USB is not set 882# CONFIG_AT76C50X_USB is not set
@@ -846,19 +888,24 @@ CONFIG_LIBERTAS_SDIO=y
846# CONFIG_ADM8211 is not set 888# CONFIG_ADM8211 is not set
847# CONFIG_MAC80211_HWSIM is not set 889# CONFIG_MAC80211_HWSIM is not set
848# CONFIG_MWL8K is not set 890# CONFIG_MWL8K is not set
849# CONFIG_P54_COMMON is not set
850# CONFIG_ATH_COMMON is not set 891# CONFIG_ATH_COMMON is not set
892# CONFIG_B43 is not set
893# CONFIG_B43LEGACY is not set
894# CONFIG_HOSTAP is not set
851# CONFIG_IPW2100 is not set 895# CONFIG_IPW2100 is not set
852# CONFIG_IPW2200 is not set 896# CONFIG_IPW2200 is not set
853# CONFIG_IWLWIFI is not set 897# CONFIG_IWLWIFI is not set
854# CONFIG_HOSTAP is not set 898# CONFIG_IWM is not set
855# CONFIG_B43 is not set 899CONFIG_LIBERTAS=y
856# CONFIG_B43LEGACY is not set 900# CONFIG_LIBERTAS_USB is not set
857# CONFIG_ZD1211RW is not set 901CONFIG_LIBERTAS_SDIO=y
858# CONFIG_RT2X00 is not set 902# CONFIG_LIBERTAS_SPI is not set
903# CONFIG_LIBERTAS_DEBUG is not set
859# CONFIG_HERMES is not set 904# CONFIG_HERMES is not set
905# CONFIG_P54_COMMON is not set
906# CONFIG_RT2X00 is not set
860# CONFIG_WL12XX is not set 907# CONFIG_WL12XX is not set
861# CONFIG_IWM is not set 908# CONFIG_ZD1211RW is not set
862 909
863# 910#
864# Enable WiMAX (Networking options) to see the WiMAX drivers 911# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -881,6 +928,7 @@ CONFIG_LIBERTAS_SDIO=y
881# CONFIG_NETCONSOLE is not set 928# CONFIG_NETCONSOLE is not set
882# CONFIG_NETPOLL is not set 929# CONFIG_NETPOLL is not set
883# CONFIG_NET_POLL_CONTROLLER is not set 930# CONFIG_NET_POLL_CONTROLLER is not set
931# CONFIG_VMXNET3 is not set
884# CONFIG_ISDN is not set 932# CONFIG_ISDN is not set
885# CONFIG_PHONE is not set 933# CONFIG_PHONE is not set
886 934
@@ -890,6 +938,7 @@ CONFIG_LIBERTAS_SDIO=y
890CONFIG_INPUT=y 938CONFIG_INPUT=y
891# CONFIG_INPUT_FF_MEMLESS is not set 939# CONFIG_INPUT_FF_MEMLESS is not set
892# CONFIG_INPUT_POLLDEV is not set 940# CONFIG_INPUT_POLLDEV is not set
941# CONFIG_INPUT_SPARSEKMAP is not set
893 942
894# 943#
895# Userland interfaces 944# Userland interfaces
@@ -933,6 +982,7 @@ CONFIG_SERIO_SERPORT=y
933# CONFIG_SERIO_PCIPS2 is not set 982# CONFIG_SERIO_PCIPS2 is not set
934CONFIG_SERIO_LIBPS2=y 983CONFIG_SERIO_LIBPS2=y
935# CONFIG_SERIO_RAW is not set 984# CONFIG_SERIO_RAW is not set
985# CONFIG_SERIO_ALTERA_PS2 is not set
936# CONFIG_GAMEPORT is not set 986# CONFIG_GAMEPORT is not set
937 987
938# 988#
@@ -1019,11 +1069,6 @@ CONFIG_I2C_MV64XXX=y
1019# CONFIG_I2C_TINY_USB is not set 1069# CONFIG_I2C_TINY_USB is not set
1020 1070
1021# 1071#
1022# Graphics adapter I2C/DDC channel drivers
1023#
1024# CONFIG_I2C_VOODOO3 is not set
1025
1026#
1027# Other I2C/SMBus bus drivers 1072# Other I2C/SMBus bus drivers
1028# 1073#
1029# CONFIG_I2C_PCA_PLATFORM is not set 1074# CONFIG_I2C_PCA_PLATFORM is not set
@@ -1032,7 +1077,6 @@ CONFIG_I2C_MV64XXX=y
1032# 1077#
1033# Miscellaneous I2C Chip support 1078# Miscellaneous I2C Chip support
1034# 1079#
1035# CONFIG_DS1682 is not set
1036# CONFIG_SENSORS_TSL2550 is not set 1080# CONFIG_SENSORS_TSL2550 is not set
1037# CONFIG_I2C_DEBUG_CORE is not set 1081# CONFIG_I2C_DEBUG_CORE is not set
1038# CONFIG_I2C_DEBUG_ALGO is not set 1082# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1048,6 +1092,8 @@ CONFIG_SPI_MASTER=y
1048# CONFIG_SPI_BITBANG is not set 1092# CONFIG_SPI_BITBANG is not set
1049# CONFIG_SPI_GPIO is not set 1093# CONFIG_SPI_GPIO is not set
1050CONFIG_SPI_ORION=y 1094CONFIG_SPI_ORION=y
1095# CONFIG_SPI_XILINX is not set
1096# CONFIG_SPI_DESIGNWARE is not set
1051 1097
1052# 1098#
1053# SPI Protocol Masters 1099# SPI Protocol Masters
@@ -1074,10 +1120,12 @@ CONFIG_GPIO_SYSFS=y
1074# CONFIG_GPIO_MAX732X is not set 1120# CONFIG_GPIO_MAX732X is not set
1075# CONFIG_GPIO_PCA953X is not set 1121# CONFIG_GPIO_PCA953X is not set
1076# CONFIG_GPIO_PCF857X is not set 1122# CONFIG_GPIO_PCF857X is not set
1123# CONFIG_GPIO_ADP5588 is not set
1077 1124
1078# 1125#
1079# PCI GPIO expanders: 1126# PCI GPIO expanders:
1080# 1127#
1128# CONFIG_GPIO_CS5535 is not set
1081# CONFIG_GPIO_BT8XX is not set 1129# CONFIG_GPIO_BT8XX is not set
1082# CONFIG_GPIO_LANGWELL is not set 1130# CONFIG_GPIO_LANGWELL is not set
1083 1131
@@ -1116,6 +1164,7 @@ CONFIG_SSB_POSSIBLE=y
1116# CONFIG_MFD_TMIO is not set 1164# CONFIG_MFD_TMIO is not set
1117# CONFIG_MFD_TC6393XB is not set 1165# CONFIG_MFD_TC6393XB is not set
1118# CONFIG_PMIC_DA903X is not set 1166# CONFIG_PMIC_DA903X is not set
1167# CONFIG_PMIC_ADP5520 is not set
1119# CONFIG_MFD_WM8400 is not set 1168# CONFIG_MFD_WM8400 is not set
1120# CONFIG_MFD_WM831X is not set 1169# CONFIG_MFD_WM831X is not set
1121# CONFIG_MFD_WM8350_I2C is not set 1170# CONFIG_MFD_WM8350_I2C is not set
@@ -1123,6 +1172,8 @@ CONFIG_SSB_POSSIBLE=y
1123# CONFIG_MFD_MC13783 is not set 1172# CONFIG_MFD_MC13783 is not set
1124# CONFIG_AB3100_CORE is not set 1173# CONFIG_AB3100_CORE is not set
1125# CONFIG_EZX_PCAP is not set 1174# CONFIG_EZX_PCAP is not set
1175# CONFIG_MFD_88PM8607 is not set
1176# CONFIG_AB4500_CORE is not set
1126# CONFIG_REGULATOR is not set 1177# CONFIG_REGULATOR is not set
1127# CONFIG_MEDIA_SUPPORT is not set 1178# CONFIG_MEDIA_SUPPORT is not set
1128 1179
@@ -1305,6 +1356,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
1305# OTG and related infrastructure 1356# OTG and related infrastructure
1306# 1357#
1307# CONFIG_USB_GPIO_VBUS is not set 1358# CONFIG_USB_GPIO_VBUS is not set
1359# CONFIG_USB_ULPI is not set
1308# CONFIG_NOP_USB_XCEIV is not set 1360# CONFIG_NOP_USB_XCEIV is not set
1309# CONFIG_UWB is not set 1361# CONFIG_UWB is not set
1310CONFIG_MMC=y 1362CONFIG_MMC=y
@@ -1344,6 +1396,7 @@ CONFIG_LEDS_GPIO_PLATFORM=y
1344# CONFIG_LEDS_PCA955X is not set 1396# CONFIG_LEDS_PCA955X is not set
1345# CONFIG_LEDS_DAC124S085 is not set 1397# CONFIG_LEDS_DAC124S085 is not set
1346# CONFIG_LEDS_BD2802 is not set 1398# CONFIG_LEDS_BD2802 is not set
1399# CONFIG_LEDS_LT3593 is not set
1347 1400
1348# 1401#
1349# LED Triggers 1402# LED Triggers
@@ -1388,6 +1441,7 @@ CONFIG_RTC_INTF_DEV=y
1388# CONFIG_RTC_DRV_PCF8563 is not set 1441# CONFIG_RTC_DRV_PCF8563 is not set
1389# CONFIG_RTC_DRV_PCF8583 is not set 1442# CONFIG_RTC_DRV_PCF8583 is not set
1390# CONFIG_RTC_DRV_M41T80 is not set 1443# CONFIG_RTC_DRV_M41T80 is not set
1444# CONFIG_RTC_DRV_BQ32K is not set
1391CONFIG_RTC_DRV_S35390A=y 1445CONFIG_RTC_DRV_S35390A=y
1392# CONFIG_RTC_DRV_FM3130 is not set 1446# CONFIG_RTC_DRV_FM3130 is not set
1393# CONFIG_RTC_DRV_RX8581 is not set 1447# CONFIG_RTC_DRV_RX8581 is not set
@@ -1417,7 +1471,9 @@ CONFIG_RTC_DRV_S35390A=y
1417# CONFIG_RTC_DRV_M48T86 is not set 1471# CONFIG_RTC_DRV_M48T86 is not set
1418# CONFIG_RTC_DRV_M48T35 is not set 1472# CONFIG_RTC_DRV_M48T35 is not set
1419# CONFIG_RTC_DRV_M48T59 is not set 1473# CONFIG_RTC_DRV_M48T59 is not set
1474# CONFIG_RTC_DRV_MSM6242 is not set
1420# CONFIG_RTC_DRV_BQ4802 is not set 1475# CONFIG_RTC_DRV_BQ4802 is not set
1476# CONFIG_RTC_DRV_RP5C01 is not set
1421# CONFIG_RTC_DRV_V3020 is not set 1477# CONFIG_RTC_DRV_V3020 is not set
1422 1478
1423# 1479#
@@ -1684,7 +1740,9 @@ CONFIG_DEBUG_USER=y
1684CONFIG_DEBUG_ERRORS=y 1740CONFIG_DEBUG_ERRORS=y
1685# CONFIG_DEBUG_STACK_USAGE is not set 1741# CONFIG_DEBUG_STACK_USAGE is not set
1686CONFIG_DEBUG_LL=y 1742CONFIG_DEBUG_LL=y
1743# CONFIG_EARLY_PRINTK is not set
1687# CONFIG_DEBUG_ICEDCC is not set 1744# CONFIG_DEBUG_ICEDCC is not set
1745# CONFIG_OC_ETM is not set
1688 1746
1689# 1747#
1690# Security options 1748# Security options
@@ -1692,7 +1750,11 @@ CONFIG_DEBUG_LL=y
1692# CONFIG_KEYS is not set 1750# CONFIG_KEYS is not set
1693# CONFIG_SECURITY is not set 1751# CONFIG_SECURITY is not set
1694# CONFIG_SECURITYFS is not set 1752# CONFIG_SECURITYFS is not set
1695# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1753# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1754# CONFIG_DEFAULT_SECURITY_SMACK is not set
1755# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1756CONFIG_DEFAULT_SECURITY_DAC=y
1757CONFIG_DEFAULT_SECURITY=""
1696CONFIG_CRYPTO=y 1758CONFIG_CRYPTO=y
1697 1759
1698# 1760#
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index d2a90eb844a9..ff44bd1615c0 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -184,7 +184,7 @@ CONFIG_S3C24XX_PWM=y
184CONFIG_S3C24XX_GPIO_EXTRA=0 184CONFIG_S3C24XX_GPIO_EXTRA=0
185CONFIG_S3C2410_DMA=y 185CONFIG_S3C2410_DMA=y
186# CONFIG_S3C2410_DMA_DEBUG is not set 186# CONFIG_S3C2410_DMA_DEBUG is not set
187CONFIG_S3C24XX_ADC=y 187CONFIG_S3C_ADC=y
188CONFIG_PLAT_S3C=y 188CONFIG_PLAT_S3C=y
189CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y 189CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
190CONFIG_CPU_LLSERIAL_S3C2440=y 190CONFIG_CPU_LLSERIAL_S3C2440=y
@@ -199,8 +199,8 @@ CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
199# 199#
200# Power management 200# Power management
201# 201#
202# CONFIG_S3C2410_PM_DEBUG is not set 202# CONFIG_SAMSUNG_PM_DEBUG is not set
203# CONFIG_S3C2410_PM_CHECK is not set 203# CONFIG_SAMSUNG_PM_CHECK is not set
204CONFIG_S3C_LOWLEVEL_UART_PORT=0 204CONFIG_S3C_LOWLEVEL_UART_PORT=0
205CONFIG_S3C_GPIO_SPACE=0 205CONFIG_S3C_GPIO_SPACE=0
206 206
diff --git a/arch/arm/configs/mmp2_defconfig b/arch/arm/configs/mmp2_defconfig
new file mode 100644
index 000000000000..03f76cfc941c
--- /dev/null
+++ b/arch/arm/configs/mmp2_defconfig
@@ -0,0 +1,1194 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc2
4# Tue Jan 5 13:55:22 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_SWAP=y
36CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y
38# CONFIG_POSIX_MQUEUE is not set
39# CONFIG_BSD_PROCESS_ACCT is not set
40# CONFIG_TASKSTATS is not set
41# CONFIG_AUDIT is not set
42
43#
44# RCU Subsystem
45#
46CONFIG_TREE_RCU=y
47# CONFIG_TREE_PREEMPT_RCU is not set
48# CONFIG_TINY_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=14
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57CONFIG_SYSFS_DEPRECATED=y
58CONFIG_SYSFS_DEPRECATED_V2=y
59# CONFIG_RELAY is not set
60CONFIG_NAMESPACES=y
61# CONFIG_UTS_NS is not set
62# CONFIG_IPC_NS is not set
63# CONFIG_USER_NS is not set
64# CONFIG_PID_NS is not set
65# CONFIG_NET_NS is not set
66# CONFIG_BLK_DEV_INITRD is not set
67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
70# CONFIG_EMBEDDED is not set
71CONFIG_UID16=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74# CONFIG_KALLSYMS_ALL is not set
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80CONFIG_BASE_FULL=y
81CONFIG_FUTEX=y
82CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y
86CONFIG_SHMEM=y
87CONFIG_AIO=y
88
89#
90# Kernel Performance Events And Counters
91#
92CONFIG_VM_EVENT_COUNTERS=y
93CONFIG_COMPAT_BRK=y
94CONFIG_SLAB=y
95# CONFIG_SLUB is not set
96# CONFIG_SLOB is not set
97# CONFIG_PROFILING is not set
98CONFIG_HAVE_OPROFILE=y
99# CONFIG_KPROBES is not set
100CONFIG_HAVE_KPROBES=y
101CONFIG_HAVE_KRETPROBES=y
102CONFIG_HAVE_CLK=y
103
104#
105# GCOV-based kernel profiling
106#
107# CONFIG_SLOW_WORK is not set
108CONFIG_HAVE_GENERIC_DMA_COHERENT=y
109CONFIG_SLABINFO=y
110CONFIG_RT_MUTEXES=y
111CONFIG_BASE_SMALL=0
112CONFIG_MODULES=y
113# CONFIG_MODULE_FORCE_LOAD is not set
114CONFIG_MODULE_UNLOAD=y
115CONFIG_MODULE_FORCE_UNLOAD=y
116# CONFIG_MODVERSIONS is not set
117# CONFIG_MODULE_SRCVERSION_ALL is not set
118CONFIG_BLOCK=y
119CONFIG_LBDAF=y
120# CONFIG_BLK_DEV_BSG is not set
121# CONFIG_BLK_DEV_INTEGRITY is not set
122
123#
124# IO Schedulers
125#
126CONFIG_IOSCHED_NOOP=y
127CONFIG_IOSCHED_DEADLINE=y
128CONFIG_IOSCHED_CFQ=y
129# CONFIG_DEFAULT_DEADLINE is not set
130CONFIG_DEFAULT_CFQ=y
131# CONFIG_DEFAULT_NOOP is not set
132CONFIG_DEFAULT_IOSCHED="cfq"
133# CONFIG_INLINE_SPIN_TRYLOCK is not set
134# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
135# CONFIG_INLINE_SPIN_LOCK is not set
136# CONFIG_INLINE_SPIN_LOCK_BH is not set
137# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
138# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
139# CONFIG_INLINE_SPIN_UNLOCK is not set
140# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
141# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
142# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
143# CONFIG_INLINE_READ_TRYLOCK is not set
144# CONFIG_INLINE_READ_LOCK is not set
145# CONFIG_INLINE_READ_LOCK_BH is not set
146# CONFIG_INLINE_READ_LOCK_IRQ is not set
147# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
148# CONFIG_INLINE_READ_UNLOCK is not set
149# CONFIG_INLINE_READ_UNLOCK_BH is not set
150# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
151# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
152# CONFIG_INLINE_WRITE_TRYLOCK is not set
153# CONFIG_INLINE_WRITE_LOCK is not set
154# CONFIG_INLINE_WRITE_LOCK_BH is not set
155# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
156# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
157# CONFIG_INLINE_WRITE_UNLOCK is not set
158# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
159# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
160# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
161# CONFIG_MUTEX_SPIN_ON_OWNER is not set
162# CONFIG_FREEZER is not set
163
164#
165# System Type
166#
167CONFIG_MMU=y
168# CONFIG_ARCH_AAEC2000 is not set
169# CONFIG_ARCH_INTEGRATOR is not set
170# CONFIG_ARCH_REALVIEW is not set
171# CONFIG_ARCH_VERSATILE is not set
172# CONFIG_ARCH_AT91 is not set
173# CONFIG_ARCH_CLPS711X is not set
174# CONFIG_ARCH_GEMINI is not set
175# CONFIG_ARCH_EBSA110 is not set
176# CONFIG_ARCH_EP93XX is not set
177# CONFIG_ARCH_FOOTBRIDGE is not set
178# CONFIG_ARCH_MXC is not set
179# CONFIG_ARCH_STMP3XXX is not set
180# CONFIG_ARCH_NETX is not set
181# CONFIG_ARCH_H720X is not set
182# CONFIG_ARCH_NOMADIK is not set
183# CONFIG_ARCH_IOP13XX is not set
184# CONFIG_ARCH_IOP32X is not set
185# CONFIG_ARCH_IOP33X is not set
186# CONFIG_ARCH_IXP23XX is not set
187# CONFIG_ARCH_IXP2000 is not set
188# CONFIG_ARCH_IXP4XX is not set
189# CONFIG_ARCH_L7200 is not set
190# CONFIG_ARCH_DOVE is not set
191# CONFIG_ARCH_KIRKWOOD is not set
192# CONFIG_ARCH_LOKI is not set
193# CONFIG_ARCH_MV78XX0 is not set
194# CONFIG_ARCH_ORION5X is not set
195CONFIG_ARCH_MMP=y
196# CONFIG_ARCH_KS8695 is not set
197# CONFIG_ARCH_NS9XXX is not set
198# CONFIG_ARCH_W90X900 is not set
199# CONFIG_ARCH_PNX4008 is not set
200# CONFIG_ARCH_PXA is not set
201# CONFIG_ARCH_MSM is not set
202# CONFIG_ARCH_RPC is not set
203# CONFIG_ARCH_SA1100 is not set
204# CONFIG_ARCH_S3C2410 is not set
205# CONFIG_ARCH_S3C64XX is not set
206# CONFIG_ARCH_S5PC1XX is not set
207# CONFIG_ARCH_SHARK is not set
208# CONFIG_ARCH_LH7A40X is not set
209# CONFIG_ARCH_U300 is not set
210# CONFIG_ARCH_DAVINCI is not set
211# CONFIG_ARCH_OMAP is not set
212# CONFIG_ARCH_BCMRING is not set
213# CONFIG_ARCH_U8500 is not set
214# CONFIG_MACH_TAVOREVB is not set
215
216#
217# Marvell PXA168/910/MMP2 Implmentations
218#
219# CONFIG_MACH_ASPENITE is not set
220# CONFIG_MACH_ZYLONITE2 is not set
221# CONFIG_MACH_TTC_DKB is not set
222CONFIG_MACH_FLINT=y
223CONFIG_CPU_MMP2=y
224CONFIG_PLAT_PXA=y
225
226#
227# Processor Type
228#
229CONFIG_CPU_V6=y
230CONFIG_CPU_32v6K=y
231CONFIG_CPU_32v6=y
232CONFIG_CPU_ABRT_EV6=y
233CONFIG_CPU_PABRT_V6=y
234CONFIG_CPU_CACHE_V6=y
235CONFIG_CPU_CACHE_VIPT=y
236CONFIG_CPU_COPY_V6=y
237CONFIG_CPU_TLB_V6=y
238CONFIG_CPU_HAS_ASID=y
239CONFIG_CPU_CP15=y
240CONFIG_CPU_CP15_MMU=y
241
242#
243# Processor Features
244#
245CONFIG_ARM_THUMB=y
246# CONFIG_CPU_ICACHE_DISABLE is not set
247# CONFIG_CPU_DCACHE_DISABLE is not set
248# CONFIG_CPU_BPREDICT_DISABLE is not set
249CONFIG_ARM_L1_CACHE_SHIFT=5
250# CONFIG_ARM_ERRATA_411920 is not set
251CONFIG_COMMON_CLKDEV=y
252
253#
254# Bus support
255#
256# CONFIG_PCI_SYSCALL is not set
257# CONFIG_ARCH_SUPPORTS_MSI is not set
258# CONFIG_PCCARD is not set
259
260#
261# Kernel Features
262#
263CONFIG_TICK_ONESHOT=y
264# CONFIG_NO_HZ is not set
265CONFIG_HIGH_RES_TIMERS=y
266CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
267CONFIG_VMSPLIT_3G=y
268# CONFIG_VMSPLIT_2G is not set
269# CONFIG_VMSPLIT_1G is not set
270CONFIG_PAGE_OFFSET=0xC0000000
271# CONFIG_PREEMPT_NONE is not set
272# CONFIG_PREEMPT_VOLUNTARY is not set
273CONFIG_PREEMPT=y
274CONFIG_HZ=100
275CONFIG_AEABI=y
276CONFIG_OABI_COMPAT=y
277# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
278# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
279# CONFIG_HIGHMEM is not set
280CONFIG_SELECT_MEMORY_MODEL=y
281CONFIG_FLATMEM_MANUAL=y
282# CONFIG_DISCONTIGMEM_MANUAL is not set
283# CONFIG_SPARSEMEM_MANUAL is not set
284CONFIG_FLATMEM=y
285CONFIG_FLAT_NODE_MEM_MAP=y
286CONFIG_PAGEFLAGS_EXTENDED=y
287CONFIG_SPLIT_PTLOCK_CPUS=4
288# CONFIG_PHYS_ADDR_T_64BIT is not set
289CONFIG_ZONE_DMA_FLAG=0
290CONFIG_VIRT_TO_BUS=y
291# CONFIG_KSM is not set
292CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
293CONFIG_ALIGNMENT_TRAP=y
294# CONFIG_UACCESS_WITH_MEMCPY is not set
295
296#
297# Boot options
298#
299CONFIG_ZBOOT_ROM_TEXT=0x0
300CONFIG_ZBOOT_ROM_BSS=0x0
301CONFIG_CMDLINE="root=/dev/nfs rootfstype=nfs nfsroot=192.168.1.100:/nfsroot/ ip=192.168.1.101:192.168.1.100::255.255.255.0::eth0:on console=ttyS0,115200 mem=128M user_debug=255"
302# CONFIG_XIP_KERNEL is not set
303# CONFIG_KEXEC is not set
304
305#
306# CPU Power Management
307#
308# CONFIG_CPU_IDLE is not set
309
310#
311# Floating point emulation
312#
313
314#
315# At least one emulation must be selected
316#
317# CONFIG_FPE_NWFPE is not set
318# CONFIG_FPE_FASTFPE is not set
319CONFIG_VFP=y
320
321#
322# Userspace binary formats
323#
324CONFIG_BINFMT_ELF=y
325# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
326CONFIG_HAVE_AOUT=y
327# CONFIG_BINFMT_AOUT is not set
328# CONFIG_BINFMT_MISC is not set
329
330#
331# Power management options
332#
333# CONFIG_PM is not set
334CONFIG_ARCH_SUSPEND_POSSIBLE=y
335CONFIG_NET=y
336
337#
338# Networking options
339#
340CONFIG_PACKET=y
341# CONFIG_PACKET_MMAP is not set
342CONFIG_UNIX=y
343CONFIG_XFRM=y
344# CONFIG_XFRM_USER is not set
345# CONFIG_XFRM_SUB_POLICY is not set
346# CONFIG_XFRM_MIGRATE is not set
347# CONFIG_XFRM_STATISTICS is not set
348# CONFIG_NET_KEY is not set
349CONFIG_INET=y
350# CONFIG_IP_MULTICAST is not set
351# CONFIG_IP_ADVANCED_ROUTER is not set
352CONFIG_IP_FIB_HASH=y
353CONFIG_IP_PNP=y
354# CONFIG_IP_PNP_DHCP is not set
355# CONFIG_IP_PNP_BOOTP is not set
356# CONFIG_IP_PNP_RARP is not set
357# CONFIG_NET_IPIP is not set
358# CONFIG_NET_IPGRE is not set
359# CONFIG_ARPD is not set
360# CONFIG_SYN_COOKIES is not set
361# CONFIG_INET_AH is not set
362# CONFIG_INET_ESP is not set
363# CONFIG_INET_IPCOMP is not set
364# CONFIG_INET_XFRM_TUNNEL is not set
365# CONFIG_INET_TUNNEL is not set
366CONFIG_INET_XFRM_MODE_TRANSPORT=y
367CONFIG_INET_XFRM_MODE_TUNNEL=y
368CONFIG_INET_XFRM_MODE_BEET=y
369# CONFIG_INET_LRO is not set
370CONFIG_INET_DIAG=y
371CONFIG_INET_TCP_DIAG=y
372# CONFIG_TCP_CONG_ADVANCED is not set
373CONFIG_TCP_CONG_CUBIC=y
374CONFIG_DEFAULT_TCP_CONG="cubic"
375# CONFIG_TCP_MD5SIG is not set
376# CONFIG_IPV6 is not set
377# CONFIG_NETWORK_SECMARK is not set
378# CONFIG_NETFILTER is not set
379# CONFIG_IP_DCCP is not set
380# CONFIG_IP_SCTP is not set
381# CONFIG_RDS is not set
382# CONFIG_TIPC is not set
383# CONFIG_ATM is not set
384# CONFIG_BRIDGE is not set
385# CONFIG_NET_DSA is not set
386# CONFIG_VLAN_8021Q is not set
387# CONFIG_DECNET is not set
388# CONFIG_LLC2 is not set
389# CONFIG_IPX is not set
390# CONFIG_ATALK is not set
391# CONFIG_X25 is not set
392# CONFIG_LAPB is not set
393# CONFIG_ECONET is not set
394# CONFIG_WAN_ROUTER is not set
395# CONFIG_PHONET is not set
396# CONFIG_IEEE802154 is not set
397# CONFIG_NET_SCHED is not set
398# CONFIG_DCB is not set
399
400#
401# Network testing
402#
403# CONFIG_NET_PKTGEN is not set
404# CONFIG_HAMRADIO is not set
405# CONFIG_CAN is not set
406# CONFIG_IRDA is not set
407# CONFIG_BT is not set
408# CONFIG_AF_RXRPC is not set
409CONFIG_WIRELESS=y
410# CONFIG_CFG80211 is not set
411# CONFIG_LIB80211 is not set
412
413#
414# CFG80211 needs to be enabled for MAC80211
415#
416# CONFIG_WIMAX is not set
417# CONFIG_RFKILL is not set
418# CONFIG_NET_9P is not set
419
420#
421# Device Drivers
422#
423
424#
425# Generic Driver Options
426#
427CONFIG_UEVENT_HELPER_PATH=""
428# CONFIG_DEVTMPFS is not set
429# CONFIG_STANDALONE is not set
430# CONFIG_PREVENT_FIRMWARE_BUILD is not set
431CONFIG_FW_LOADER=y
432CONFIG_FIRMWARE_IN_KERNEL=y
433CONFIG_EXTRA_FIRMWARE=""
434# CONFIG_DEBUG_DRIVER is not set
435# CONFIG_DEBUG_DEVRES is not set
436# CONFIG_SYS_HYPERVISOR is not set
437# CONFIG_CONNECTOR is not set
438CONFIG_MTD=y
439# CONFIG_MTD_DEBUG is not set
440# CONFIG_MTD_TESTS is not set
441# CONFIG_MTD_CONCAT is not set
442CONFIG_MTD_PARTITIONS=y
443# CONFIG_MTD_REDBOOT_PARTS is not set
444CONFIG_MTD_CMDLINE_PARTS=y
445# CONFIG_MTD_AFS_PARTS is not set
446# CONFIG_MTD_AR7_PARTS is not set
447
448#
449# User Modules And Translation Layers
450#
451# CONFIG_MTD_CHAR is not set
452CONFIG_MTD_BLKDEVS=y
453CONFIG_MTD_BLOCK=y
454# CONFIG_FTL is not set
455# CONFIG_NFTL is not set
456# CONFIG_INFTL is not set
457# CONFIG_RFD_FTL is not set
458# CONFIG_SSFDC is not set
459# CONFIG_MTD_OOPS is not set
460
461#
462# RAM/ROM/Flash chip drivers
463#
464# CONFIG_MTD_CFI is not set
465# CONFIG_MTD_JEDECPROBE is not set
466CONFIG_MTD_MAP_BANK_WIDTH_1=y
467CONFIG_MTD_MAP_BANK_WIDTH_2=y
468CONFIG_MTD_MAP_BANK_WIDTH_4=y
469# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
470# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
471# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
472CONFIG_MTD_CFI_I1=y
473CONFIG_MTD_CFI_I2=y
474# CONFIG_MTD_CFI_I4 is not set
475# CONFIG_MTD_CFI_I8 is not set
476# CONFIG_MTD_RAM is not set
477# CONFIG_MTD_ROM is not set
478# CONFIG_MTD_ABSENT is not set
479
480#
481# Mapping drivers for chip access
482#
483# CONFIG_MTD_COMPLEX_MAPPINGS is not set
484# CONFIG_MTD_PLATRAM is not set
485
486#
487# Self-contained MTD device drivers
488#
489# CONFIG_MTD_SLRAM is not set
490# CONFIG_MTD_PHRAM is not set
491# CONFIG_MTD_MTDRAM is not set
492# CONFIG_MTD_BLOCK2MTD is not set
493
494#
495# Disk-On-Chip Device Drivers
496#
497# CONFIG_MTD_DOC2000 is not set
498# CONFIG_MTD_DOC2001 is not set
499# CONFIG_MTD_DOC2001PLUS is not set
500CONFIG_MTD_NAND=y
501# CONFIG_MTD_NAND_VERIFY_WRITE is not set
502# CONFIG_MTD_NAND_ECC_SMC is not set
503# CONFIG_MTD_NAND_MUSEUM_IDS is not set
504# CONFIG_MTD_NAND_GPIO is not set
505CONFIG_MTD_NAND_IDS=y
506# CONFIG_MTD_NAND_DISKONCHIP is not set
507# CONFIG_MTD_NAND_PXA3xx is not set
508# CONFIG_MTD_NAND_NANDSIM is not set
509# CONFIG_MTD_NAND_PLATFORM is not set
510CONFIG_MTD_ONENAND=y
511# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
512CONFIG_MTD_ONENAND_GENERIC=y
513# CONFIG_MTD_ONENAND_OTP is not set
514# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
515# CONFIG_MTD_ONENAND_SIM is not set
516
517#
518# LPDDR flash memory drivers
519#
520# CONFIG_MTD_LPDDR is not set
521
522#
523# UBI - Unsorted block images
524#
525# CONFIG_MTD_UBI is not set
526# CONFIG_PARPORT is not set
527# CONFIG_BLK_DEV is not set
528# CONFIG_MISC_DEVICES is not set
529CONFIG_HAVE_IDE=y
530# CONFIG_IDE is not set
531
532#
533# SCSI device support
534#
535# CONFIG_RAID_ATTRS is not set
536# CONFIG_SCSI is not set
537# CONFIG_SCSI_DMA is not set
538# CONFIG_SCSI_NETLINK is not set
539# CONFIG_ATA is not set
540# CONFIG_MD is not set
541CONFIG_NETDEVICES=y
542# CONFIG_DUMMY is not set
543# CONFIG_BONDING is not set
544# CONFIG_MACVLAN is not set
545# CONFIG_EQUALIZER is not set
546# CONFIG_TUN is not set
547# CONFIG_VETH is not set
548# CONFIG_PHYLIB is not set
549CONFIG_NET_ETHERNET=y
550CONFIG_MII=y
551# CONFIG_AX88796 is not set
552CONFIG_SMC91X=y
553# CONFIG_DM9000 is not set
554# CONFIG_ETHOC is not set
555# CONFIG_SMC911X is not set
556# CONFIG_SMSC911X is not set
557# CONFIG_DNET is not set
558# CONFIG_IBM_NEW_EMAC_ZMII is not set
559# CONFIG_IBM_NEW_EMAC_RGMII is not set
560# CONFIG_IBM_NEW_EMAC_TAH is not set
561# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
562# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
563# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
564# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
565# CONFIG_B44 is not set
566# CONFIG_KS8842 is not set
567# CONFIG_KS8851_MLL is not set
568# CONFIG_NETDEV_1000 is not set
569# CONFIG_NETDEV_10000 is not set
570CONFIG_WLAN=y
571# CONFIG_HOSTAP is not set
572
573#
574# Enable WiMAX (Networking options) to see the WiMAX drivers
575#
576# CONFIG_WAN is not set
577# CONFIG_PPP is not set
578# CONFIG_SLIP is not set
579# CONFIG_NETCONSOLE is not set
580# CONFIG_NETPOLL is not set
581# CONFIG_NET_POLL_CONTROLLER is not set
582# CONFIG_ISDN is not set
583# CONFIG_PHONE is not set
584
585#
586# Input device support
587#
588CONFIG_INPUT=y
589# CONFIG_INPUT_FF_MEMLESS is not set
590# CONFIG_INPUT_POLLDEV is not set
591# CONFIG_INPUT_SPARSEKMAP is not set
592
593#
594# Userland interfaces
595#
596CONFIG_INPUT_MOUSEDEV=y
597# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
598CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
599CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
600# CONFIG_INPUT_JOYDEV is not set
601# CONFIG_INPUT_EVDEV is not set
602# CONFIG_INPUT_EVBUG is not set
603
604#
605# Input Device Drivers
606#
607# CONFIG_INPUT_KEYBOARD is not set
608# CONFIG_INPUT_MOUSE is not set
609# CONFIG_INPUT_JOYSTICK is not set
610# CONFIG_INPUT_TABLET is not set
611# CONFIG_INPUT_TOUCHSCREEN is not set
612# CONFIG_INPUT_MISC is not set
613
614#
615# Hardware I/O ports
616#
617# CONFIG_SERIO is not set
618# CONFIG_GAMEPORT is not set
619
620#
621# Character devices
622#
623CONFIG_VT=y
624CONFIG_CONSOLE_TRANSLATIONS=y
625CONFIG_VT_CONSOLE=y
626CONFIG_HW_CONSOLE=y
627# CONFIG_VT_HW_CONSOLE_BINDING is not set
628CONFIG_DEVKMEM=y
629# CONFIG_SERIAL_NONSTANDARD is not set
630
631#
632# Serial drivers
633#
634# CONFIG_SERIAL_8250 is not set
635
636#
637# Non-8250 serial port support
638#
639CONFIG_SERIAL_PXA=y
640CONFIG_SERIAL_PXA_CONSOLE=y
641CONFIG_SERIAL_CORE=y
642CONFIG_SERIAL_CORE_CONSOLE=y
643CONFIG_UNIX98_PTYS=y
644# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
645# CONFIG_LEGACY_PTYS is not set
646# CONFIG_IPMI_HANDLER is not set
647# CONFIG_HW_RANDOM is not set
648# CONFIG_R3964 is not set
649# CONFIG_RAW_DRIVER is not set
650# CONFIG_TCG_TPM is not set
651CONFIG_I2C=y
652CONFIG_I2C_BOARDINFO=y
653CONFIG_I2C_COMPAT=y
654# CONFIG_I2C_CHARDEV is not set
655CONFIG_I2C_HELPER_AUTO=y
656
657#
658# I2C Hardware Bus support
659#
660
661#
662# I2C system bus drivers (mostly embedded / system-on-chip)
663#
664# CONFIG_I2C_DESIGNWARE is not set
665# CONFIG_I2C_GPIO is not set
666# CONFIG_I2C_OCORES is not set
667CONFIG_I2C_PXA=y
668# CONFIG_I2C_PXA_SLAVE is not set
669# CONFIG_I2C_SIMTEC is not set
670
671#
672# External I2C/SMBus adapter drivers
673#
674# CONFIG_I2C_PARPORT_LIGHT is not set
675# CONFIG_I2C_TAOS_EVM is not set
676
677#
678# Other I2C/SMBus bus drivers
679#
680# CONFIG_I2C_PCA_PLATFORM is not set
681# CONFIG_I2C_STUB is not set
682
683#
684# Miscellaneous I2C Chip support
685#
686# CONFIG_SENSORS_TSL2550 is not set
687# CONFIG_I2C_DEBUG_CORE is not set
688# CONFIG_I2C_DEBUG_ALGO is not set
689# CONFIG_I2C_DEBUG_BUS is not set
690# CONFIG_I2C_DEBUG_CHIP is not set
691# CONFIG_SPI is not set
692
693#
694# PPS support
695#
696# CONFIG_PPS is not set
697CONFIG_ARCH_REQUIRE_GPIOLIB=y
698CONFIG_GPIOLIB=y
699# CONFIG_DEBUG_GPIO is not set
700# CONFIG_GPIO_SYSFS is not set
701
702#
703# Memory mapped GPIO expanders:
704#
705
706#
707# I2C GPIO expanders:
708#
709# CONFIG_GPIO_MAX732X is not set
710# CONFIG_GPIO_PCA953X is not set
711# CONFIG_GPIO_PCF857X is not set
712
713#
714# PCI GPIO expanders:
715#
716
717#
718# SPI GPIO expanders:
719#
720
721#
722# AC97 GPIO expanders:
723#
724# CONFIG_W1 is not set
725# CONFIG_POWER_SUPPLY is not set
726# CONFIG_HWMON is not set
727# CONFIG_THERMAL is not set
728# CONFIG_WATCHDOG is not set
729CONFIG_SSB_POSSIBLE=y
730
731#
732# Sonics Silicon Backplane
733#
734# CONFIG_SSB is not set
735
736#
737# Multifunction device drivers
738#
739CONFIG_MFD_CORE=y
740# CONFIG_MFD_SM501 is not set
741# CONFIG_MFD_ASIC3 is not set
742# CONFIG_HTC_EGPIO is not set
743# CONFIG_HTC_PASIC3 is not set
744# CONFIG_TPS65010 is not set
745# CONFIG_TWL4030_CORE is not set
746# CONFIG_MFD_TMIO is not set
747# CONFIG_MFD_T7L66XB is not set
748# CONFIG_MFD_TC6387XB is not set
749# CONFIG_MFD_TC6393XB is not set
750# CONFIG_PMIC_DA903X is not set
751# CONFIG_PMIC_ADP5520 is not set
752# CONFIG_MFD_WM8400 is not set
753# CONFIG_MFD_WM831X is not set
754# CONFIG_MFD_WM8350_I2C is not set
755# CONFIG_MFD_PCF50633 is not set
756# CONFIG_AB3100_CORE is not set
757CONFIG_MFD_88PM8607=y
758CONFIG_REGULATOR=y
759# CONFIG_REGULATOR_DEBUG is not set
760# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
761# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
762# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
763# CONFIG_REGULATOR_BQ24022 is not set
764# CONFIG_REGULATOR_MAX1586 is not set
765CONFIG_REGULATOR_MAX8660=y
766# CONFIG_REGULATOR_LP3971 is not set
767# CONFIG_REGULATOR_TPS65023 is not set
768# CONFIG_REGULATOR_TPS6507X is not set
769CONFIG_REGULATOR_88PM8607=y
770# CONFIG_MEDIA_SUPPORT is not set
771
772#
773# Graphics support
774#
775# CONFIG_VGASTATE is not set
776# CONFIG_VIDEO_OUTPUT_CONTROL is not set
777# CONFIG_FB is not set
778CONFIG_BACKLIGHT_LCD_SUPPORT=y
779CONFIG_LCD_CLASS_DEVICE=y
780# CONFIG_LCD_ILI9320 is not set
781# CONFIG_LCD_PLATFORM is not set
782CONFIG_BACKLIGHT_CLASS_DEVICE=y
783CONFIG_BACKLIGHT_GENERIC=y
784
785#
786# Display device support
787#
788# CONFIG_DISPLAY_SUPPORT is not set
789
790#
791# Console display driver support
792#
793# CONFIG_VGA_CONSOLE is not set
794CONFIG_DUMMY_CONSOLE=y
795# CONFIG_SOUND is not set
796# CONFIG_HID_SUPPORT is not set
797# CONFIG_USB_SUPPORT is not set
798# CONFIG_MMC is not set
799# CONFIG_MEMSTICK is not set
800# CONFIG_NEW_LEDS is not set
801# CONFIG_ACCESSIBILITY is not set
802CONFIG_RTC_LIB=y
803CONFIG_RTC_CLASS=y
804CONFIG_RTC_HCTOSYS=y
805CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
806# CONFIG_RTC_DEBUG is not set
807
808#
809# RTC interfaces
810#
811CONFIG_RTC_INTF_SYSFS=y
812CONFIG_RTC_INTF_PROC=y
813CONFIG_RTC_INTF_DEV=y
814# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
815# CONFIG_RTC_DRV_TEST is not set
816
817#
818# I2C RTC drivers
819#
820# CONFIG_RTC_DRV_DS1307 is not set
821# CONFIG_RTC_DRV_DS1374 is not set
822# CONFIG_RTC_DRV_DS1672 is not set
823# CONFIG_RTC_DRV_MAX6900 is not set
824# CONFIG_RTC_DRV_RS5C372 is not set
825# CONFIG_RTC_DRV_ISL1208 is not set
826# CONFIG_RTC_DRV_X1205 is not set
827# CONFIG_RTC_DRV_PCF8563 is not set
828# CONFIG_RTC_DRV_PCF8583 is not set
829# CONFIG_RTC_DRV_M41T80 is not set
830# CONFIG_RTC_DRV_BQ32K is not set
831# CONFIG_RTC_DRV_S35390A is not set
832# CONFIG_RTC_DRV_FM3130 is not set
833# CONFIG_RTC_DRV_RX8581 is not set
834# CONFIG_RTC_DRV_RX8025 is not set
835
836#
837# SPI RTC drivers
838#
839
840#
841# Platform RTC drivers
842#
843# CONFIG_RTC_DRV_CMOS is not set
844# CONFIG_RTC_DRV_DS1286 is not set
845# CONFIG_RTC_DRV_DS1511 is not set
846# CONFIG_RTC_DRV_DS1553 is not set
847# CONFIG_RTC_DRV_DS1742 is not set
848# CONFIG_RTC_DRV_STK17TA8 is not set
849# CONFIG_RTC_DRV_M48T86 is not set
850# CONFIG_RTC_DRV_M48T35 is not set
851# CONFIG_RTC_DRV_M48T59 is not set
852# CONFIG_RTC_DRV_MSM6242 is not set
853# CONFIG_RTC_DRV_BQ4802 is not set
854# CONFIG_RTC_DRV_RP5C01 is not set
855# CONFIG_RTC_DRV_V3020 is not set
856
857#
858# on-CPU RTC drivers
859#
860# CONFIG_DMADEVICES is not set
861# CONFIG_AUXDISPLAY is not set
862# CONFIG_UIO is not set
863
864#
865# TI VLYNQ
866#
867# CONFIG_STAGING is not set
868
869#
870# File systems
871#
872# CONFIG_EXT2_FS is not set
873# CONFIG_EXT3_FS is not set
874# CONFIG_EXT4_FS is not set
875CONFIG_EXT4_USE_FOR_EXT23=y
876# CONFIG_REISERFS_FS is not set
877# CONFIG_JFS_FS is not set
878CONFIG_FS_POSIX_ACL=y
879# CONFIG_XFS_FS is not set
880# CONFIG_GFS2_FS is not set
881# CONFIG_OCFS2_FS is not set
882# CONFIG_BTRFS_FS is not set
883# CONFIG_NILFS2_FS is not set
884CONFIG_FILE_LOCKING=y
885CONFIG_FSNOTIFY=y
886CONFIG_DNOTIFY=y
887CONFIG_INOTIFY=y
888CONFIG_INOTIFY_USER=y
889# CONFIG_QUOTA is not set
890# CONFIG_AUTOFS_FS is not set
891# CONFIG_AUTOFS4_FS is not set
892# CONFIG_FUSE_FS is not set
893CONFIG_GENERIC_ACL=y
894
895#
896# Caches
897#
898# CONFIG_FSCACHE is not set
899
900#
901# CD-ROM/DVD Filesystems
902#
903# CONFIG_ISO9660_FS is not set
904# CONFIG_UDF_FS is not set
905
906#
907# DOS/FAT/NT Filesystems
908#
909# CONFIG_MSDOS_FS is not set
910# CONFIG_VFAT_FS is not set
911# CONFIG_NTFS_FS is not set
912
913#
914# Pseudo filesystems
915#
916CONFIG_PROC_FS=y
917CONFIG_PROC_SYSCTL=y
918CONFIG_PROC_PAGE_MONITOR=y
919CONFIG_SYSFS=y
920CONFIG_TMPFS=y
921CONFIG_TMPFS_POSIX_ACL=y
922# CONFIG_HUGETLB_PAGE is not set
923# CONFIG_CONFIGFS_FS is not set
924CONFIG_MISC_FILESYSTEMS=y
925# CONFIG_ADFS_FS is not set
926# CONFIG_AFFS_FS is not set
927# CONFIG_HFS_FS is not set
928# CONFIG_HFSPLUS_FS is not set
929# CONFIG_BEFS_FS is not set
930# CONFIG_BFS_FS is not set
931# CONFIG_EFS_FS is not set
932CONFIG_JFFS2_FS=y
933CONFIG_JFFS2_FS_DEBUG=0
934CONFIG_JFFS2_FS_WRITEBUFFER=y
935# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
936# CONFIG_JFFS2_SUMMARY is not set
937# CONFIG_JFFS2_FS_XATTR is not set
938# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
939CONFIG_JFFS2_ZLIB=y
940# CONFIG_JFFS2_LZO is not set
941CONFIG_JFFS2_RTIME=y
942# CONFIG_JFFS2_RUBIN is not set
943CONFIG_CRAMFS=y
944# CONFIG_SQUASHFS is not set
945# CONFIG_VXFS_FS is not set
946# CONFIG_MINIX_FS is not set
947# CONFIG_OMFS_FS is not set
948# CONFIG_HPFS_FS is not set
949# CONFIG_QNX4FS_FS is not set
950# CONFIG_ROMFS_FS is not set
951# CONFIG_SYSV_FS is not set
952# CONFIG_UFS_FS is not set
953CONFIG_NETWORK_FILESYSTEMS=y
954CONFIG_NFS_FS=y
955CONFIG_NFS_V3=y
956CONFIG_NFS_V3_ACL=y
957CONFIG_NFS_V4=y
958# CONFIG_NFS_V4_1 is not set
959CONFIG_ROOT_NFS=y
960# CONFIG_NFSD is not set
961CONFIG_LOCKD=y
962CONFIG_LOCKD_V4=y
963CONFIG_NFS_ACL_SUPPORT=y
964CONFIG_NFS_COMMON=y
965CONFIG_SUNRPC=y
966CONFIG_SUNRPC_GSS=y
967CONFIG_RPCSEC_GSS_KRB5=y
968# CONFIG_RPCSEC_GSS_SPKM3 is not set
969# CONFIG_SMB_FS is not set
970# CONFIG_CIFS is not set
971# CONFIG_NCP_FS is not set
972# CONFIG_CODA_FS is not set
973# CONFIG_AFS_FS is not set
974
975#
976# Partition Types
977#
978# CONFIG_PARTITION_ADVANCED is not set
979CONFIG_MSDOS_PARTITION=y
980# CONFIG_NLS is not set
981# CONFIG_DLM is not set
982
983#
984# Kernel hacking
985#
986CONFIG_PRINTK_TIME=y
987CONFIG_ENABLE_WARN_DEPRECATED=y
988CONFIG_ENABLE_MUST_CHECK=y
989CONFIG_FRAME_WARN=1024
990CONFIG_MAGIC_SYSRQ=y
991# CONFIG_STRIP_ASM_SYMS is not set
992# CONFIG_UNUSED_SYMBOLS is not set
993# CONFIG_DEBUG_FS is not set
994# CONFIG_HEADERS_CHECK is not set
995CONFIG_DEBUG_KERNEL=y
996# CONFIG_DEBUG_SHIRQ is not set
997CONFIG_DETECT_SOFTLOCKUP=y
998# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
999CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1000CONFIG_DETECT_HUNG_TASK=y
1001# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1002CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1003CONFIG_SCHED_DEBUG=y
1004# CONFIG_SCHEDSTATS is not set
1005# CONFIG_TIMER_STATS is not set
1006# CONFIG_DEBUG_OBJECTS is not set
1007# CONFIG_DEBUG_SLAB is not set
1008# CONFIG_DEBUG_KMEMLEAK is not set
1009# CONFIG_DEBUG_PREEMPT is not set
1010# CONFIG_DEBUG_RT_MUTEXES is not set
1011# CONFIG_RT_MUTEX_TESTER is not set
1012# CONFIG_DEBUG_SPINLOCK is not set
1013# CONFIG_DEBUG_MUTEXES is not set
1014# CONFIG_DEBUG_LOCK_ALLOC is not set
1015# CONFIG_PROVE_LOCKING is not set
1016# CONFIG_LOCK_STAT is not set
1017# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1018# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1019# CONFIG_DEBUG_KOBJECT is not set
1020CONFIG_DEBUG_BUGVERBOSE=y
1021CONFIG_DEBUG_INFO=y
1022# CONFIG_DEBUG_VM is not set
1023# CONFIG_DEBUG_WRITECOUNT is not set
1024CONFIG_DEBUG_MEMORY_INIT=y
1025# CONFIG_DEBUG_LIST is not set
1026# CONFIG_DEBUG_SG is not set
1027# CONFIG_DEBUG_NOTIFIERS is not set
1028# CONFIG_DEBUG_CREDENTIALS is not set
1029# CONFIG_BOOT_PRINTK_DELAY is not set
1030# CONFIG_RCU_TORTURE_TEST is not set
1031# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1032# CONFIG_BACKTRACE_SELF_TEST is not set
1033# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1034# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1035# CONFIG_FAULT_INJECTION is not set
1036# CONFIG_LATENCYTOP is not set
1037# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1038# CONFIG_PAGE_POISONING is not set
1039CONFIG_HAVE_FUNCTION_TRACER=y
1040CONFIG_TRACING_SUPPORT=y
1041CONFIG_FTRACE=y
1042# CONFIG_FUNCTION_TRACER is not set
1043# CONFIG_IRQSOFF_TRACER is not set
1044# CONFIG_PREEMPT_TRACER is not set
1045# CONFIG_SCHED_TRACER is not set
1046# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1047# CONFIG_BOOT_TRACER is not set
1048CONFIG_BRANCH_PROFILE_NONE=y
1049# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1050# CONFIG_PROFILE_ALL_BRANCHES is not set
1051# CONFIG_STACK_TRACER is not set
1052# CONFIG_KMEMTRACE is not set
1053# CONFIG_WORKQUEUE_TRACER is not set
1054# CONFIG_BLK_DEV_IO_TRACE is not set
1055# CONFIG_SAMPLES is not set
1056CONFIG_HAVE_ARCH_KGDB=y
1057# CONFIG_KGDB is not set
1058CONFIG_ARM_UNWIND=y
1059CONFIG_DEBUG_USER=y
1060CONFIG_DEBUG_ERRORS=y
1061# CONFIG_DEBUG_STACK_USAGE is not set
1062CONFIG_DEBUG_LL=y
1063# CONFIG_EARLY_PRINTK is not set
1064# CONFIG_DEBUG_ICEDCC is not set
1065# CONFIG_OC_ETM is not set
1066
1067#
1068# Security options
1069#
1070# CONFIG_KEYS is not set
1071# CONFIG_SECURITY is not set
1072# CONFIG_SECURITYFS is not set
1073# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1074# CONFIG_DEFAULT_SECURITY_SMACK is not set
1075# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1076CONFIG_DEFAULT_SECURITY_DAC=y
1077CONFIG_DEFAULT_SECURITY=""
1078CONFIG_CRYPTO=y
1079
1080#
1081# Crypto core or helper
1082#
1083CONFIG_CRYPTO_ALGAPI=y
1084CONFIG_CRYPTO_ALGAPI2=y
1085CONFIG_CRYPTO_AEAD2=y
1086CONFIG_CRYPTO_BLKCIPHER=y
1087CONFIG_CRYPTO_BLKCIPHER2=y
1088CONFIG_CRYPTO_HASH=y
1089CONFIG_CRYPTO_HASH2=y
1090CONFIG_CRYPTO_RNG2=y
1091CONFIG_CRYPTO_PCOMP=y
1092CONFIG_CRYPTO_MANAGER=y
1093CONFIG_CRYPTO_MANAGER2=y
1094# CONFIG_CRYPTO_GF128MUL is not set
1095# CONFIG_CRYPTO_NULL is not set
1096CONFIG_CRYPTO_WORKQUEUE=y
1097# CONFIG_CRYPTO_CRYPTD is not set
1098# CONFIG_CRYPTO_AUTHENC is not set
1099# CONFIG_CRYPTO_TEST is not set
1100
1101#
1102# Authenticated Encryption with Associated Data
1103#
1104# CONFIG_CRYPTO_CCM is not set
1105# CONFIG_CRYPTO_GCM is not set
1106# CONFIG_CRYPTO_SEQIV is not set
1107
1108#
1109# Block modes
1110#
1111CONFIG_CRYPTO_CBC=y
1112# CONFIG_CRYPTO_CTR is not set
1113# CONFIG_CRYPTO_CTS is not set
1114# CONFIG_CRYPTO_ECB is not set
1115# CONFIG_CRYPTO_LRW is not set
1116# CONFIG_CRYPTO_PCBC is not set
1117# CONFIG_CRYPTO_XTS is not set
1118
1119#
1120# Hash modes
1121#
1122# CONFIG_CRYPTO_HMAC is not set
1123# CONFIG_CRYPTO_XCBC is not set
1124# CONFIG_CRYPTO_VMAC is not set
1125
1126#
1127# Digest
1128#
1129# CONFIG_CRYPTO_CRC32C is not set
1130# CONFIG_CRYPTO_GHASH is not set
1131# CONFIG_CRYPTO_MD4 is not set
1132CONFIG_CRYPTO_MD5=y
1133# CONFIG_CRYPTO_MICHAEL_MIC is not set
1134# CONFIG_CRYPTO_RMD128 is not set
1135# CONFIG_CRYPTO_RMD160 is not set
1136# CONFIG_CRYPTO_RMD256 is not set
1137# CONFIG_CRYPTO_RMD320 is not set
1138# CONFIG_CRYPTO_SHA1 is not set
1139# CONFIG_CRYPTO_SHA256 is not set
1140# CONFIG_CRYPTO_SHA512 is not set
1141# CONFIG_CRYPTO_TGR192 is not set
1142# CONFIG_CRYPTO_WP512 is not set
1143
1144#
1145# Ciphers
1146#
1147# CONFIG_CRYPTO_AES is not set
1148# CONFIG_CRYPTO_ANUBIS is not set
1149# CONFIG_CRYPTO_ARC4 is not set
1150# CONFIG_CRYPTO_BLOWFISH is not set
1151# CONFIG_CRYPTO_CAMELLIA is not set
1152# CONFIG_CRYPTO_CAST5 is not set
1153# CONFIG_CRYPTO_CAST6 is not set
1154CONFIG_CRYPTO_DES=y
1155# CONFIG_CRYPTO_FCRYPT is not set
1156# CONFIG_CRYPTO_KHAZAD is not set
1157# CONFIG_CRYPTO_SALSA20 is not set
1158# CONFIG_CRYPTO_SEED is not set
1159# CONFIG_CRYPTO_SERPENT is not set
1160# CONFIG_CRYPTO_TEA is not set
1161# CONFIG_CRYPTO_TWOFISH is not set
1162
1163#
1164# Compression
1165#
1166# CONFIG_CRYPTO_DEFLATE is not set
1167# CONFIG_CRYPTO_ZLIB is not set
1168# CONFIG_CRYPTO_LZO is not set
1169
1170#
1171# Random Number Generation
1172#
1173# CONFIG_CRYPTO_ANSI_CPRNG is not set
1174CONFIG_CRYPTO_HW=y
1175# CONFIG_BINARY_PRINTF is not set
1176
1177#
1178# Library routines
1179#
1180CONFIG_BITREVERSE=y
1181CONFIG_GENERIC_FIND_LAST_BIT=y
1182CONFIG_CRC_CCITT=y
1183# CONFIG_CRC16 is not set
1184# CONFIG_CRC_T10DIF is not set
1185# CONFIG_CRC_ITU_T is not set
1186CONFIG_CRC32=y
1187# CONFIG_CRC7 is not set
1188# CONFIG_LIBCRC32C is not set
1189CONFIG_ZLIB_INFLATE=y
1190CONFIG_ZLIB_DEFLATE=y
1191CONFIG_HAS_IOMEM=y
1192CONFIG_HAS_IOPORT=y
1193CONFIG_HAS_DMA=y
1194CONFIG_NLATTR=y
diff --git a/arch/arm/configs/mv78xx0_defconfig b/arch/arm/configs/mv78xx0_defconfig
index 6afa2c108eaa..da4710dd1da1 100644
--- a/arch/arm/configs/mv78xx0_defconfig
+++ b/arch/arm/configs/mv78xx0_defconfig
@@ -176,6 +176,7 @@ CONFIG_ARCH_MV78XX0=y
176# 176#
177CONFIG_MACH_DB78X00_BP=y 177CONFIG_MACH_DB78X00_BP=y
178CONFIG_MACH_RD78X00_MASA=y 178CONFIG_MACH_RD78X00_MASA=y
179CONFIG_MACH_TERASTATION_WXL=y
179CONFIG_PLAT_ORION=y 180CONFIG_PLAT_ORION=y
180 181
181# 182#
diff --git a/arch/arm/configs/mx1ads_defconfig b/arch/arm/configs/mx1ads_defconfig
deleted file mode 100644
index 3cabbb6d9276..000000000000
--- a/arch/arm/configs/mx1ads_defconfig
+++ /dev/null
@@ -1,742 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 02:15:46 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19CONFIG_LOCK_KERNEL=y
20
21#
22# General setup
23#
24CONFIG_LOCALVERSION=""
25CONFIG_SWAP=y
26CONFIG_SYSVIPC=y
27# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set
29# CONFIG_SYSCTL is not set
30# CONFIG_AUDIT is not set
31# CONFIG_HOTPLUG is not set
32CONFIG_KOBJECT_UEVENT=y
33# CONFIG_IKCONFIG is not set
34CONFIG_EMBEDDED=y
35# CONFIG_KALLSYMS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52CONFIG_MODULE_UNLOAD=y
53# CONFIG_MODULE_FORCE_UNLOAD is not set
54CONFIG_OBSOLETE_MODPARM=y
55# CONFIG_MODVERSIONS is not set
56# CONFIG_MODULE_SRCVERSION_ALL is not set
57CONFIG_KMOD=y
58
59#
60# System Type
61#
62# CONFIG_ARCH_CLPS7500 is not set
63# CONFIG_ARCH_CLPS711X is not set
64# CONFIG_ARCH_CO285 is not set
65# CONFIG_ARCH_EBSA110 is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74# CONFIG_ARCH_SA1100 is not set
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80CONFIG_ARCH_IMX=y
81# CONFIG_ARCH_H720X is not set
82
83#
84# IMX Implementations
85#
86CONFIG_ARCH_MX1ADS=y
87
88#
89# Processor Type
90#
91CONFIG_CPU_ARM920T=y
92CONFIG_CPU_32v4=y
93CONFIG_CPU_ABRT_EV4T=y
94CONFIG_CPU_CACHE_V4WT=y
95CONFIG_CPU_CACHE_VIVT=y
96CONFIG_CPU_COPY_V4WB=y
97CONFIG_CPU_TLB_V4WBI=y
98
99#
100# Processor Features
101#
102# CONFIG_ARM_THUMB is not set
103# CONFIG_CPU_ICACHE_DISABLE is not set
104# CONFIG_CPU_DCACHE_DISABLE is not set
105# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
106
107#
108# Bus support
109#
110CONFIG_ISA=y
111
112#
113# PCCARD (PCMCIA/CardBus) support
114#
115# CONFIG_PCCARD is not set
116
117#
118# Kernel Features
119#
120CONFIG_PREEMPT=y
121# CONFIG_LEDS is not set
122CONFIG_ALIGNMENT_TRAP=y
123
124#
125# Boot options
126#
127CONFIG_ZBOOT_ROM_TEXT=0x0
128CONFIG_ZBOOT_ROM_BSS=0x0
129CONFIG_CMDLINE="console=ttySMX0,57600n8 ip=bootp root=/dev/nfs"
130# CONFIG_XIP_KERNEL is not set
131
132#
133# Floating point emulation
134#
135
136#
137# At least one emulation must be selected
138#
139CONFIG_FPE_NWFPE=y
140CONFIG_FPE_NWFPE_XP=y
141CONFIG_FPE_FASTFPE=y
142
143#
144# Userspace binary formats
145#
146CONFIG_BINFMT_ELF=y
147# CONFIG_BINFMT_AOUT is not set
148# CONFIG_BINFMT_MISC is not set
149# CONFIG_ARTHUR is not set
150
151#
152# Power management options
153#
154# CONFIG_PM is not set
155
156#
157# Device Drivers
158#
159
160#
161# Generic Driver Options
162#
163CONFIG_STANDALONE=y
164CONFIG_PREVENT_FIRMWARE_BUILD=y
165# CONFIG_FW_LOADER is not set
166# CONFIG_DEBUG_DRIVER is not set
167
168#
169# Memory Technology Devices (MTD)
170#
171CONFIG_MTD=y
172# CONFIG_MTD_DEBUG is not set
173# CONFIG_MTD_CONCAT is not set
174CONFIG_MTD_PARTITIONS=y
175# CONFIG_MTD_REDBOOT_PARTS is not set
176# CONFIG_MTD_CMDLINE_PARTS is not set
177# CONFIG_MTD_AFS_PARTS is not set
178
179#
180# User Modules And Translation Layers
181#
182CONFIG_MTD_CHAR=y
183CONFIG_MTD_BLOCK=y
184# CONFIG_FTL is not set
185# CONFIG_NFTL is not set
186# CONFIG_INFTL is not set
187
188#
189# RAM/ROM/Flash chip drivers
190#
191# CONFIG_MTD_CFI is not set
192# CONFIG_MTD_JEDECPROBE is not set
193CONFIG_MTD_MAP_BANK_WIDTH_1=y
194CONFIG_MTD_MAP_BANK_WIDTH_2=y
195CONFIG_MTD_MAP_BANK_WIDTH_4=y
196# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
197# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
198# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
199CONFIG_MTD_CFI_I1=y
200CONFIG_MTD_CFI_I2=y
201# CONFIG_MTD_CFI_I4 is not set
202# CONFIG_MTD_CFI_I8 is not set
203# CONFIG_MTD_RAM is not set
204CONFIG_MTD_ROM=y
205# CONFIG_MTD_ABSENT is not set
206
207#
208# Mapping drivers for chip access
209#
210# CONFIG_MTD_COMPLEX_MAPPINGS is not set
211
212#
213# Self-contained MTD device drivers
214#
215# CONFIG_MTD_SLRAM is not set
216# CONFIG_MTD_PHRAM is not set
217# CONFIG_MTD_MTDRAM is not set
218# CONFIG_MTD_BLKMTD is not set
219# CONFIG_MTD_BLOCK2MTD is not set
220
221#
222# Disk-On-Chip Device Drivers
223#
224# CONFIG_MTD_DOC2000 is not set
225# CONFIG_MTD_DOC2001 is not set
226# CONFIG_MTD_DOC2001PLUS is not set
227
228#
229# NAND Flash Device Drivers
230#
231# CONFIG_MTD_NAND is not set
232
233#
234# Parallel port support
235#
236# CONFIG_PARPORT is not set
237
238#
239# Plug and Play support
240#
241# CONFIG_PNP is not set
242
243#
244# Block devices
245#
246# CONFIG_BLK_DEV_FD is not set
247# CONFIG_BLK_DEV_XD is not set
248# CONFIG_BLK_DEV_COW_COMMON is not set
249CONFIG_BLK_DEV_LOOP=y
250# CONFIG_BLK_DEV_CRYPTOLOOP is not set
251# CONFIG_BLK_DEV_NBD is not set
252# CONFIG_BLK_DEV_RAM is not set
253CONFIG_BLK_DEV_RAM_COUNT=16
254CONFIG_INITRAMFS_SOURCE=""
255# CONFIG_CDROM_PKTCDVD is not set
256
257#
258# IO Schedulers
259#
260CONFIG_IOSCHED_NOOP=y
261# CONFIG_IOSCHED_AS is not set
262CONFIG_IOSCHED_DEADLINE=y
263CONFIG_IOSCHED_CFQ=y
264# CONFIG_ATA_OVER_ETH is not set
265
266#
267# SCSI device support
268#
269# CONFIG_SCSI is not set
270
271#
272# Multi-device support (RAID and LVM)
273#
274# CONFIG_MD is not set
275
276#
277# Fusion MPT device support
278#
279
280#
281# IEEE 1394 (FireWire) support
282#
283
284#
285# I2O device support
286#
287
288#
289# Networking support
290#
291CONFIG_NET=y
292
293#
294# Networking options
295#
296CONFIG_PACKET=m
297CONFIG_PACKET_MMAP=y
298# CONFIG_NETLINK_DEV is not set
299CONFIG_UNIX=y
300# CONFIG_NET_KEY is not set
301CONFIG_INET=y
302# CONFIG_IP_MULTICAST is not set
303# CONFIG_IP_ADVANCED_ROUTER is not set
304CONFIG_IP_PNP=y
305CONFIG_IP_PNP_DHCP=y
306CONFIG_IP_PNP_BOOTP=y
307# CONFIG_IP_PNP_RARP is not set
308# CONFIG_NET_IPIP is not set
309# CONFIG_NET_IPGRE is not set
310# CONFIG_ARPD is not set
311# CONFIG_SYN_COOKIES is not set
312# CONFIG_INET_AH is not set
313# CONFIG_INET_ESP is not set
314# CONFIG_INET_IPCOMP is not set
315# CONFIG_INET_TUNNEL is not set
316CONFIG_IP_TCPDIAG=y
317# CONFIG_IP_TCPDIAG_IPV6 is not set
318# CONFIG_IPV6 is not set
319# CONFIG_NETFILTER is not set
320
321#
322# SCTP Configuration (EXPERIMENTAL)
323#
324# CONFIG_IP_SCTP is not set
325# CONFIG_ATM is not set
326# CONFIG_BRIDGE is not set
327# CONFIG_VLAN_8021Q is not set
328# CONFIG_DECNET is not set
329# CONFIG_LLC2 is not set
330# CONFIG_IPX is not set
331# CONFIG_ATALK is not set
332# CONFIG_X25 is not set
333# CONFIG_LAPB is not set
334# CONFIG_NET_DIVERT is not set
335# CONFIG_ECONET is not set
336# CONFIG_WAN_ROUTER is not set
337
338#
339# QoS and/or fair queueing
340#
341# CONFIG_NET_SCHED is not set
342# CONFIG_NET_CLS_ROUTE is not set
343
344#
345# Network testing
346#
347# CONFIG_NET_PKTGEN is not set
348# CONFIG_NETPOLL is not set
349# CONFIG_NET_POLL_CONTROLLER is not set
350# CONFIG_HAMRADIO is not set
351# CONFIG_IRDA is not set
352# CONFIG_BT is not set
353CONFIG_NETDEVICES=y
354# CONFIG_DUMMY is not set
355# CONFIG_BONDING is not set
356# CONFIG_EQUALIZER is not set
357# CONFIG_TUN is not set
358
359#
360# ARCnet devices
361#
362# CONFIG_ARCNET is not set
363
364#
365# Ethernet (10 or 100Mbit)
366#
367CONFIG_NET_ETHERNET=y
368CONFIG_MII=y
369# CONFIG_NET_VENDOR_3COM is not set
370# CONFIG_LANCE is not set
371# CONFIG_NET_VENDOR_SMC is not set
372# CONFIG_SMC91X is not set
373# CONFIG_NET_VENDOR_RACAL is not set
374# CONFIG_AT1700 is not set
375# CONFIG_DEPCA is not set
376# CONFIG_HP100 is not set
377# CONFIG_NET_ISA is not set
378# CONFIG_NET_PCI is not set
379# CONFIG_NET_POCKET is not set
380
381#
382# Ethernet (1000 Mbit)
383#
384
385#
386# Ethernet (10000 Mbit)
387#
388
389#
390# Token Ring devices
391#
392# CONFIG_TR is not set
393
394#
395# Wireless LAN (non-hamradio)
396#
397# CONFIG_NET_RADIO is not set
398
399#
400# Wan interfaces
401#
402# CONFIG_WAN is not set
403CONFIG_PPP=y
404# CONFIG_PPP_MULTILINK is not set
405CONFIG_PPP_FILTER=y
406CONFIG_PPP_ASYNC=y
407# CONFIG_PPP_SYNC_TTY is not set
408CONFIG_PPP_DEFLATE=y
409CONFIG_PPP_BSDCOMP=y
410# CONFIG_PPPOE is not set
411# CONFIG_SLIP is not set
412# CONFIG_SHAPER is not set
413# CONFIG_NETCONSOLE is not set
414
415#
416# ISDN subsystem
417#
418# CONFIG_ISDN is not set
419
420#
421# Input device support
422#
423# CONFIG_INPUT is not set
424
425#
426# Hardware I/O ports
427#
428# CONFIG_SERIO is not set
429# CONFIG_GAMEPORT is not set
430CONFIG_SOUND_GAMEPORT=y
431
432#
433# Character devices
434#
435# CONFIG_VT is not set
436# CONFIG_SERIAL_NONSTANDARD is not set
437
438#
439# Serial drivers
440#
441# CONFIG_SERIAL_8250 is not set
442
443#
444# Non-8250 serial port support
445#
446CONFIG_SERIAL_IMX=y
447CONFIG_SERIAL_IMX_CONSOLE=y
448CONFIG_SERIAL_CORE=y
449CONFIG_SERIAL_CORE_CONSOLE=y
450CONFIG_UNIX98_PTYS=y
451# CONFIG_LEGACY_PTYS is not set
452
453#
454# IPMI
455#
456# CONFIG_IPMI_HANDLER is not set
457
458#
459# Watchdog Cards
460#
461# CONFIG_WATCHDOG is not set
462# CONFIG_NVRAM is not set
463CONFIG_RTC=m
464# CONFIG_DTLK is not set
465# CONFIG_R3964 is not set
466
467#
468# Ftape, the floppy tape device driver
469#
470# CONFIG_DRM is not set
471# CONFIG_RAW_DRIVER is not set
472
473#
474# TPM devices
475#
476# CONFIG_TCG_TPM is not set
477
478#
479# I2C support
480#
481# CONFIG_I2C is not set
482
483#
484# Misc devices
485#
486
487#
488# Multimedia devices
489#
490# CONFIG_VIDEO_DEV is not set
491
492#
493# Digital Video Broadcasting Devices
494#
495# CONFIG_DVB is not set
496
497#
498# Graphics support
499#
500# CONFIG_FB is not set
501
502#
503# Sound
504#
505# CONFIG_SOUND is not set
506
507#
508# USB support
509#
510CONFIG_USB_ARCH_HAS_HCD=y
511# CONFIG_USB_ARCH_HAS_OHCI is not set
512# CONFIG_USB is not set
513
514#
515# USB Gadget Support
516#
517# CONFIG_USB_GADGET is not set
518
519#
520# MMC/SD Card support
521#
522# CONFIG_MMC is not set
523
524#
525# File systems
526#
527# CONFIG_EXT2_FS is not set
528# CONFIG_EXT3_FS is not set
529# CONFIG_JBD is not set
530# CONFIG_REISERFS_FS is not set
531# CONFIG_JFS_FS is not set
532
533#
534# XFS support
535#
536# CONFIG_XFS_FS is not set
537# CONFIG_MINIX_FS is not set
538# CONFIG_ROMFS_FS is not set
539# CONFIG_QUOTA is not set
540CONFIG_DNOTIFY=y
541# CONFIG_AUTOFS_FS is not set
542# CONFIG_AUTOFS4_FS is not set
543
544#
545# CD-ROM/DVD Filesystems
546#
547# CONFIG_ISO9660_FS is not set
548# CONFIG_UDF_FS is not set
549
550#
551# DOS/FAT/NT Filesystems
552#
553CONFIG_FAT_FS=y
554CONFIG_MSDOS_FS=y
555CONFIG_VFAT_FS=y
556CONFIG_FAT_DEFAULT_CODEPAGE=437
557CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
558# CONFIG_NTFS_FS is not set
559
560#
561# Pseudo filesystems
562#
563CONFIG_PROC_FS=y
564CONFIG_SYSFS=y
565CONFIG_DEVFS_FS=y
566CONFIG_DEVFS_MOUNT=y
567# CONFIG_DEVFS_DEBUG is not set
568# CONFIG_DEVPTS_FS_XATTR is not set
569CONFIG_TMPFS=y
570# CONFIG_TMPFS_XATTR is not set
571# CONFIG_HUGETLB_PAGE is not set
572CONFIG_RAMFS=y
573
574#
575# Miscellaneous filesystems
576#
577# CONFIG_ADFS_FS is not set
578# CONFIG_AFFS_FS is not set
579# CONFIG_HFS_FS is not set
580# CONFIG_HFSPLUS_FS is not set
581# CONFIG_BEFS_FS is not set
582# CONFIG_BFS_FS is not set
583# CONFIG_EFS_FS is not set
584# CONFIG_JFFS_FS is not set
585CONFIG_JFFS2_FS=y
586CONFIG_JFFS2_FS_DEBUG=0
587# CONFIG_JFFS2_FS_NAND is not set
588# CONFIG_JFFS2_FS_NOR_ECC is not set
589# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
590CONFIG_JFFS2_ZLIB=y
591CONFIG_JFFS2_RTIME=y
592# CONFIG_JFFS2_RUBIN is not set
593CONFIG_CRAMFS=y
594# CONFIG_VXFS_FS is not set
595# CONFIG_HPFS_FS is not set
596# CONFIG_QNX4FS_FS is not set
597# CONFIG_SYSV_FS is not set
598# CONFIG_UFS_FS is not set
599
600#
601# Network File Systems
602#
603CONFIG_NFS_FS=y
604CONFIG_NFS_V3=y
605# CONFIG_NFS_V4 is not set
606# CONFIG_NFS_DIRECTIO is not set
607# CONFIG_NFSD is not set
608CONFIG_ROOT_NFS=y
609CONFIG_LOCKD=y
610CONFIG_LOCKD_V4=y
611CONFIG_SUNRPC=y
612# CONFIG_RPCSEC_GSS_KRB5 is not set
613# CONFIG_RPCSEC_GSS_SPKM3 is not set
614# CONFIG_SMB_FS is not set
615# CONFIG_CIFS is not set
616# CONFIG_NCP_FS is not set
617# CONFIG_CODA_FS is not set
618# CONFIG_AFS_FS is not set
619
620#
621# Partition Types
622#
623# CONFIG_PARTITION_ADVANCED is not set
624CONFIG_MSDOS_PARTITION=y
625
626#
627# Native Language Support
628#
629CONFIG_NLS=y
630CONFIG_NLS_DEFAULT="iso8859-1"
631# CONFIG_NLS_CODEPAGE_437 is not set
632# CONFIG_NLS_CODEPAGE_737 is not set
633# CONFIG_NLS_CODEPAGE_775 is not set
634# CONFIG_NLS_CODEPAGE_850 is not set
635# CONFIG_NLS_CODEPAGE_852 is not set
636# CONFIG_NLS_CODEPAGE_855 is not set
637# CONFIG_NLS_CODEPAGE_857 is not set
638# CONFIG_NLS_CODEPAGE_860 is not set
639# CONFIG_NLS_CODEPAGE_861 is not set
640# CONFIG_NLS_CODEPAGE_862 is not set
641# CONFIG_NLS_CODEPAGE_863 is not set
642# CONFIG_NLS_CODEPAGE_864 is not set
643# CONFIG_NLS_CODEPAGE_865 is not set
644# CONFIG_NLS_CODEPAGE_866 is not set
645# CONFIG_NLS_CODEPAGE_869 is not set
646# CONFIG_NLS_CODEPAGE_936 is not set
647# CONFIG_NLS_CODEPAGE_950 is not set
648# CONFIG_NLS_CODEPAGE_932 is not set
649# CONFIG_NLS_CODEPAGE_949 is not set
650# CONFIG_NLS_CODEPAGE_874 is not set
651# CONFIG_NLS_ISO8859_8 is not set
652# CONFIG_NLS_CODEPAGE_1250 is not set
653# CONFIG_NLS_CODEPAGE_1251 is not set
654# CONFIG_NLS_ASCII is not set
655# CONFIG_NLS_ISO8859_1 is not set
656# CONFIG_NLS_ISO8859_2 is not set
657# CONFIG_NLS_ISO8859_3 is not set
658# CONFIG_NLS_ISO8859_4 is not set
659# CONFIG_NLS_ISO8859_5 is not set
660# CONFIG_NLS_ISO8859_6 is not set
661# CONFIG_NLS_ISO8859_7 is not set
662# CONFIG_NLS_ISO8859_9 is not set
663# CONFIG_NLS_ISO8859_13 is not set
664# CONFIG_NLS_ISO8859_14 is not set
665# CONFIG_NLS_ISO8859_15 is not set
666# CONFIG_NLS_KOI8_R is not set
667# CONFIG_NLS_KOI8_U is not set
668# CONFIG_NLS_UTF8 is not set
669
670#
671# Profiling support
672#
673# CONFIG_PROFILING is not set
674
675#
676# Kernel hacking
677#
678# CONFIG_PRINTK_TIME is not set
679CONFIG_DEBUG_KERNEL=y
680CONFIG_MAGIC_SYSRQ=y
681CONFIG_LOG_BUF_SHIFT=14
682# CONFIG_SCHEDSTATS is not set
683# CONFIG_DEBUG_SLAB is not set
684CONFIG_DEBUG_PREEMPT=y
685# CONFIG_DEBUG_SPINLOCK is not set
686# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
687# CONFIG_DEBUG_KOBJECT is not set
688CONFIG_DEBUG_BUGVERBOSE=y
689CONFIG_DEBUG_INFO=y
690# CONFIG_DEBUG_FS is not set
691CONFIG_FRAME_POINTER=y
692CONFIG_DEBUG_USER=y
693CONFIG_DEBUG_ERRORS=y
694# CONFIG_DEBUG_LL is not set
695
696#
697# Security options
698#
699# CONFIG_KEYS is not set
700# CONFIG_SECURITY is not set
701
702#
703# Cryptographic options
704#
705CONFIG_CRYPTO=y
706# CONFIG_CRYPTO_HMAC is not set
707# CONFIG_CRYPTO_NULL is not set
708# CONFIG_CRYPTO_MD4 is not set
709# CONFIG_CRYPTO_MD5 is not set
710# CONFIG_CRYPTO_SHA1 is not set
711# CONFIG_CRYPTO_SHA256 is not set
712# CONFIG_CRYPTO_SHA512 is not set
713# CONFIG_CRYPTO_WP512 is not set
714# CONFIG_CRYPTO_TGR192 is not set
715# CONFIG_CRYPTO_DES is not set
716# CONFIG_CRYPTO_BLOWFISH is not set
717# CONFIG_CRYPTO_TWOFISH is not set
718# CONFIG_CRYPTO_SERPENT is not set
719# CONFIG_CRYPTO_AES is not set
720# CONFIG_CRYPTO_CAST5 is not set
721# CONFIG_CRYPTO_CAST6 is not set
722# CONFIG_CRYPTO_TEA is not set
723# CONFIG_CRYPTO_ARC4 is not set
724# CONFIG_CRYPTO_KHAZAD is not set
725# CONFIG_CRYPTO_ANUBIS is not set
726# CONFIG_CRYPTO_DEFLATE is not set
727# CONFIG_CRYPTO_MICHAEL_MIC is not set
728# CONFIG_CRYPTO_CRC32C is not set
729# CONFIG_CRYPTO_TEST is not set
730
731#
732# Hardware crypto devices
733#
734
735#
736# Library routines
737#
738CONFIG_CRC_CCITT=y
739CONFIG_CRC32=y
740# CONFIG_LIBCRC32C is not set
741CONFIG_ZLIB_INFLATE=y
742CONFIG_ZLIB_DEFLATE=y
diff --git a/arch/arm/configs/mx27_defconfig b/arch/arm/configs/mx27_defconfig
index edfdd6faf800..b4c1366e9e0d 100644
--- a/arch/arm/configs/mx27_defconfig
+++ b/arch/arm/configs/mx27_defconfig
@@ -200,7 +200,7 @@ CONFIG_MACH_MX27ADS=y
200CONFIG_MACH_PCM038=y 200CONFIG_MACH_PCM038=y
201CONFIG_MACH_PCM970_BASEBOARD=y 201CONFIG_MACH_PCM970_BASEBOARD=y
202CONFIG_MACH_MX27_3DS=y 202CONFIG_MACH_MX27_3DS=y
203CONFIG_MACH_MX27LITE=y 203CONFIG_MACH_IMX27LITE=y
204CONFIG_MXC_IRQ_PRIOR=y 204CONFIG_MXC_IRQ_PRIOR=y
205CONFIG_MXC_PWM=y 205CONFIG_MXC_PWM=y
206 206
diff --git a/arch/arm/configs/mx51_defconfig b/arch/arm/configs/mx51_defconfig
new file mode 100644
index 000000000000..c88e9527a8ec
--- /dev/null
+++ b/arch/arm/configs/mx51_defconfig
@@ -0,0 +1,1286 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc6
4# Tue Feb 2 15:20:48 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_GENERIC_HARDIRQS=y
12CONFIG_STACKTRACE_SUPPORT=y
13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
14CONFIG_LOCKDEP_SUPPORT=y
15CONFIG_TRACE_IRQFLAGS_SUPPORT=y
16CONFIG_HARDIRQS_SW_RESEND=y
17CONFIG_GENERIC_IRQ_PROBE=y
18CONFIG_RWSEM_GENERIC_SPINLOCK=y
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_ARCH_MTD_XIP=y
22CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
23CONFIG_VECTORS_BASE=0xffff0000
24CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25CONFIG_CONSTRUCTORS=y
26
27#
28# General setup
29#
30CONFIG_EXPERIMENTAL=y
31CONFIG_BROKEN_ON_SMP=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34# CONFIG_LOCALVERSION_AUTO is not set
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
41CONFIG_SWAP=y
42CONFIG_SYSVIPC=y
43CONFIG_SYSVIPC_SYSCTL=y
44# CONFIG_POSIX_MQUEUE is not set
45# CONFIG_BSD_PROCESS_ACCT is not set
46# CONFIG_TASKSTATS is not set
47# CONFIG_AUDIT is not set
48
49#
50# RCU Subsystem
51#
52CONFIG_TREE_RCU=y
53# CONFIG_TREE_PREEMPT_RCU is not set
54# CONFIG_TINY_RCU is not set
55# CONFIG_RCU_TRACE is not set
56CONFIG_RCU_FANOUT=32
57# CONFIG_RCU_FANOUT_EXACT is not set
58# CONFIG_TREE_RCU_TRACE is not set
59# CONFIG_IKCONFIG is not set
60CONFIG_LOG_BUF_SHIFT=18
61# CONFIG_GROUP_SCHED is not set
62# CONFIG_CGROUPS is not set
63# CONFIG_SYSFS_DEPRECATED_V2 is not set
64CONFIG_RELAY=y
65# CONFIG_NAMESPACES is not set
66# CONFIG_BLK_DEV_INITRD is not set
67CONFIG_CC_OPTIMIZE_FOR_SIZE=y
68CONFIG_SYSCTL=y
69CONFIG_ANON_INODES=y
70CONFIG_EMBEDDED=y
71CONFIG_UID16=y
72CONFIG_SYSCTL_SYSCALL=y
73CONFIG_KALLSYMS=y
74# CONFIG_KALLSYMS_ALL is not set
75# CONFIG_KALLSYMS_EXTRA_PASS is not set
76CONFIG_HOTPLUG=y
77CONFIG_PRINTK=y
78CONFIG_BUG=y
79CONFIG_ELF_CORE=y
80CONFIG_BASE_FULL=y
81CONFIG_FUTEX=y
82CONFIG_EPOLL=y
83CONFIG_SIGNALFD=y
84CONFIG_TIMERFD=y
85CONFIG_EVENTFD=y
86CONFIG_SHMEM=y
87CONFIG_AIO=y
88
89#
90# Kernel Performance Events And Counters
91#
92CONFIG_VM_EVENT_COUNTERS=y
93# CONFIG_SLUB_DEBUG is not set
94# CONFIG_COMPAT_BRK is not set
95# CONFIG_SLAB is not set
96CONFIG_SLUB=y
97# CONFIG_SLOB is not set
98# CONFIG_PROFILING is not set
99CONFIG_HAVE_OPROFILE=y
100# CONFIG_KPROBES is not set
101CONFIG_HAVE_KPROBES=y
102CONFIG_HAVE_KRETPROBES=y
103CONFIG_HAVE_CLK=y
104
105#
106# GCOV-based kernel profiling
107#
108# CONFIG_GCOV_KERNEL is not set
109# CONFIG_SLOW_WORK is not set
110CONFIG_HAVE_GENERIC_DMA_COHERENT=y
111CONFIG_RT_MUTEXES=y
112CONFIG_BASE_SMALL=0
113CONFIG_MODULES=y
114# CONFIG_MODULE_FORCE_LOAD is not set
115CONFIG_MODULE_UNLOAD=y
116# CONFIG_MODULE_FORCE_UNLOAD is not set
117CONFIG_MODVERSIONS=y
118CONFIG_MODULE_SRCVERSION_ALL=y
119CONFIG_BLOCK=y
120# CONFIG_LBDAF is not set
121# CONFIG_BLK_DEV_BSG is not set
122# CONFIG_BLK_DEV_INTEGRITY is not set
123
124#
125# IO Schedulers
126#
127CONFIG_IOSCHED_NOOP=y
128CONFIG_IOSCHED_DEADLINE=y
129CONFIG_IOSCHED_CFQ=y
130# CONFIG_DEFAULT_DEADLINE is not set
131CONFIG_DEFAULT_CFQ=y
132# CONFIG_DEFAULT_NOOP is not set
133CONFIG_DEFAULT_IOSCHED="cfq"
134# CONFIG_INLINE_SPIN_TRYLOCK is not set
135# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
136# CONFIG_INLINE_SPIN_LOCK is not set
137# CONFIG_INLINE_SPIN_LOCK_BH is not set
138# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
139# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
140CONFIG_INLINE_SPIN_UNLOCK=y
141# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
142CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
143# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
144# CONFIG_INLINE_READ_TRYLOCK is not set
145# CONFIG_INLINE_READ_LOCK is not set
146# CONFIG_INLINE_READ_LOCK_BH is not set
147# CONFIG_INLINE_READ_LOCK_IRQ is not set
148# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
149CONFIG_INLINE_READ_UNLOCK=y
150# CONFIG_INLINE_READ_UNLOCK_BH is not set
151CONFIG_INLINE_READ_UNLOCK_IRQ=y
152# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
153# CONFIG_INLINE_WRITE_TRYLOCK is not set
154# CONFIG_INLINE_WRITE_LOCK is not set
155# CONFIG_INLINE_WRITE_LOCK_BH is not set
156# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
157# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
158CONFIG_INLINE_WRITE_UNLOCK=y
159# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
160CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
161# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
162# CONFIG_MUTEX_SPIN_ON_OWNER is not set
163CONFIG_FREEZER=y
164
165#
166# System Type
167#
168CONFIG_MMU=y
169# CONFIG_ARCH_AAEC2000 is not set
170# CONFIG_ARCH_INTEGRATOR is not set
171# CONFIG_ARCH_REALVIEW is not set
172# CONFIG_ARCH_VERSATILE is not set
173# CONFIG_ARCH_AT91 is not set
174# CONFIG_ARCH_CLPS711X is not set
175# CONFIG_ARCH_GEMINI is not set
176# CONFIG_ARCH_EBSA110 is not set
177# CONFIG_ARCH_EP93XX is not set
178# CONFIG_ARCH_FOOTBRIDGE is not set
179CONFIG_ARCH_MXC=y
180# CONFIG_ARCH_STMP3XXX is not set
181# CONFIG_ARCH_NETX is not set
182# CONFIG_ARCH_H720X is not set
183# CONFIG_ARCH_NOMADIK is not set
184# CONFIG_ARCH_IOP13XX is not set
185# CONFIG_ARCH_IOP32X is not set
186# CONFIG_ARCH_IOP33X is not set
187# CONFIG_ARCH_IXP23XX is not set
188# CONFIG_ARCH_IXP2000 is not set
189# CONFIG_ARCH_IXP4XX is not set
190# CONFIG_ARCH_L7200 is not set
191# CONFIG_ARCH_DOVE is not set
192# CONFIG_ARCH_KIRKWOOD is not set
193# CONFIG_ARCH_LOKI is not set
194# CONFIG_ARCH_MV78XX0 is not set
195# CONFIG_ARCH_ORION5X is not set
196# CONFIG_ARCH_MMP is not set
197# CONFIG_ARCH_KS8695 is not set
198# CONFIG_ARCH_NS9XXX is not set
199# CONFIG_ARCH_W90X900 is not set
200# CONFIG_ARCH_PNX4008 is not set
201# CONFIG_ARCH_PXA is not set
202# CONFIG_ARCH_MSM is not set
203# CONFIG_ARCH_RPC is not set
204# CONFIG_ARCH_SA1100 is not set
205# CONFIG_ARCH_S3C2410 is not set
206# CONFIG_ARCH_S3C64XX is not set
207# CONFIG_ARCH_S5PC1XX is not set
208# CONFIG_ARCH_SHARK is not set
209# CONFIG_ARCH_LH7A40X is not set
210# CONFIG_ARCH_U300 is not set
211# CONFIG_ARCH_DAVINCI is not set
212# CONFIG_ARCH_OMAP is not set
213# CONFIG_ARCH_BCMRING is not set
214# CONFIG_ARCH_U8500 is not set
215
216#
217# Freescale MXC Implementations
218#
219# CONFIG_ARCH_MX1 is not set
220# CONFIG_ARCH_MX2 is not set
221# CONFIG_ARCH_MX25 is not set
222# CONFIG_ARCH_MX3 is not set
223# CONFIG_ARCH_MXC91231 is not set
224CONFIG_ARCH_MX5=y
225CONFIG_ARCH_MX51=y
226
227#
228# MX5 platforms:
229#
230CONFIG_MACH_MX51_BABBAGE=y
231# CONFIG_MXC_IRQ_PRIOR is not set
232CONFIG_MXC_TZIC=y
233# CONFIG_MXC_PWM is not set
234CONFIG_ARCH_MXC_IOMUX_V3=y
235
236#
237# Processor Type
238#
239CONFIG_CPU_32v6K=y
240CONFIG_CPU_V7=y
241CONFIG_CPU_32v7=y
242CONFIG_CPU_ABRT_EV7=y
243CONFIG_CPU_PABRT_V7=y
244CONFIG_CPU_CACHE_V7=y
245CONFIG_CPU_CACHE_VIPT=y
246CONFIG_CPU_COPY_V6=y
247CONFIG_CPU_TLB_V7=y
248CONFIG_CPU_HAS_ASID=y
249CONFIG_CPU_CP15=y
250CONFIG_CPU_CP15_MMU=y
251
252#
253# Processor Features
254#
255CONFIG_ARM_THUMB=y
256# CONFIG_ARM_THUMBEE is not set
257# CONFIG_CPU_ICACHE_DISABLE is not set
258# CONFIG_CPU_DCACHE_DISABLE is not set
259# CONFIG_CPU_BPREDICT_DISABLE is not set
260CONFIG_HAS_TLS_REG=y
261CONFIG_ARM_L1_CACHE_SHIFT=5
262# CONFIG_ARM_ERRATA_430973 is not set
263# CONFIG_ARM_ERRATA_458693 is not set
264# CONFIG_ARM_ERRATA_460075 is not set
265CONFIG_COMMON_CLKDEV=y
266
267#
268# Bus support
269#
270# CONFIG_PCI_SYSCALL is not set
271# CONFIG_ARCH_SUPPORTS_MSI is not set
272# CONFIG_PCCARD is not set
273
274#
275# Kernel Features
276#
277CONFIG_TICK_ONESHOT=y
278CONFIG_NO_HZ=y
279CONFIG_HIGH_RES_TIMERS=y
280CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
281CONFIG_VMSPLIT_3G=y
282# CONFIG_VMSPLIT_2G is not set
283# CONFIG_VMSPLIT_1G is not set
284CONFIG_PAGE_OFFSET=0xC0000000
285# CONFIG_PREEMPT_NONE is not set
286CONFIG_PREEMPT_VOLUNTARY=y
287# CONFIG_PREEMPT is not set
288CONFIG_HZ=100
289# CONFIG_THUMB2_KERNEL is not set
290CONFIG_AEABI=y
291# CONFIG_OABI_COMPAT is not set
292# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
293# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
294# CONFIG_HIGHMEM is not set
295CONFIG_SELECT_MEMORY_MODEL=y
296CONFIG_FLATMEM_MANUAL=y
297# CONFIG_DISCONTIGMEM_MANUAL is not set
298# CONFIG_SPARSEMEM_MANUAL is not set
299CONFIG_FLATMEM=y
300CONFIG_FLAT_NODE_MEM_MAP=y
301CONFIG_PAGEFLAGS_EXTENDED=y
302CONFIG_SPLIT_PTLOCK_CPUS=4
303# CONFIG_PHYS_ADDR_T_64BIT is not set
304CONFIG_ZONE_DMA_FLAG=0
305CONFIG_VIRT_TO_BUS=y
306# CONFIG_KSM is not set
307CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
308CONFIG_ALIGNMENT_TRAP=y
309# CONFIG_UACCESS_WITH_MEMCPY is not set
310
311#
312# Boot options
313#
314CONFIG_ZBOOT_ROM_TEXT=0
315CONFIG_ZBOOT_ROM_BSS=0
316CONFIG_CMDLINE="noinitrd console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.0.101:/shared/nfs ip=dhcp"
317# CONFIG_XIP_KERNEL is not set
318# CONFIG_KEXEC is not set
319
320#
321# CPU Power Management
322#
323# CONFIG_CPU_IDLE is not set
324
325#
326# Floating point emulation
327#
328
329#
330# At least one emulation must be selected
331#
332CONFIG_VFP=y
333CONFIG_VFPv3=y
334CONFIG_NEON=y
335
336#
337# Userspace binary formats
338#
339CONFIG_BINFMT_ELF=y
340# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
341CONFIG_HAVE_AOUT=y
342# CONFIG_BINFMT_AOUT is not set
343CONFIG_BINFMT_MISC=m
344
345#
346# Power management options
347#
348CONFIG_PM=y
349CONFIG_PM_DEBUG=y
350# CONFIG_PM_VERBOSE is not set
351CONFIG_CAN_PM_TRACE=y
352CONFIG_PM_SLEEP=y
353CONFIG_SUSPEND=y
354CONFIG_PM_TEST_SUSPEND=y
355CONFIG_SUSPEND_FREEZER=y
356# CONFIG_APM_EMULATION is not set
357# CONFIG_PM_RUNTIME is not set
358CONFIG_ARCH_SUSPEND_POSSIBLE=y
359CONFIG_NET=y
360
361#
362# Networking options
363#
364CONFIG_PACKET=y
365CONFIG_PACKET_MMAP=y
366CONFIG_UNIX=y
367# CONFIG_NET_KEY is not set
368CONFIG_INET=y
369# CONFIG_IP_MULTICAST is not set
370# CONFIG_IP_ADVANCED_ROUTER is not set
371CONFIG_IP_FIB_HASH=y
372CONFIG_IP_PNP=y
373CONFIG_IP_PNP_DHCP=y
374# CONFIG_IP_PNP_BOOTP is not set
375# CONFIG_IP_PNP_RARP is not set
376# CONFIG_NET_IPIP is not set
377# CONFIG_NET_IPGRE is not set
378# CONFIG_ARPD is not set
379# CONFIG_SYN_COOKIES is not set
380# CONFIG_INET_AH is not set
381# CONFIG_INET_ESP is not set
382# CONFIG_INET_IPCOMP is not set
383# CONFIG_INET_XFRM_TUNNEL is not set
384# CONFIG_INET_TUNNEL is not set
385# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
386# CONFIG_INET_XFRM_MODE_TUNNEL is not set
387# CONFIG_INET_XFRM_MODE_BEET is not set
388# CONFIG_INET_LRO is not set
389CONFIG_INET_DIAG=y
390CONFIG_INET_TCP_DIAG=y
391# CONFIG_TCP_CONG_ADVANCED is not set
392CONFIG_TCP_CONG_CUBIC=y
393CONFIG_DEFAULT_TCP_CONG="cubic"
394# CONFIG_TCP_MD5SIG is not set
395# CONFIG_IPV6 is not set
396# CONFIG_NETWORK_SECMARK is not set
397# CONFIG_NETFILTER is not set
398# CONFIG_IP_DCCP is not set
399# CONFIG_IP_SCTP is not set
400# CONFIG_RDS is not set
401# CONFIG_TIPC is not set
402# CONFIG_ATM is not set
403# CONFIG_BRIDGE is not set
404# CONFIG_NET_DSA is not set
405# CONFIG_VLAN_8021Q is not set
406# CONFIG_DECNET is not set
407# CONFIG_LLC2 is not set
408# CONFIG_IPX is not set
409# CONFIG_ATALK is not set
410# CONFIG_X25 is not set
411# CONFIG_LAPB is not set
412# CONFIG_ECONET is not set
413# CONFIG_WAN_ROUTER is not set
414# CONFIG_PHONET is not set
415# CONFIG_IEEE802154 is not set
416# CONFIG_NET_SCHED is not set
417# CONFIG_DCB is not set
418
419#
420# Network testing
421#
422# CONFIG_NET_PKTGEN is not set
423# CONFIG_HAMRADIO is not set
424# CONFIG_CAN is not set
425# CONFIG_IRDA is not set
426# CONFIG_BT is not set
427# CONFIG_AF_RXRPC is not set
428# CONFIG_WIRELESS is not set
429# CONFIG_WIMAX is not set
430# CONFIG_RFKILL is not set
431# CONFIG_NET_9P is not set
432
433#
434# Device Drivers
435#
436
437#
438# Generic Driver Options
439#
440CONFIG_UEVENT_HELPER_PATH=""
441# CONFIG_STANDALONE is not set
442CONFIG_PREVENT_FIRMWARE_BUILD=y
443CONFIG_FW_LOADER=y
444CONFIG_FIRMWARE_IN_KERNEL=y
445CONFIG_EXTRA_FIRMWARE=""
446# CONFIG_DEBUG_DRIVER is not set
447# CONFIG_DEBUG_DEVRES is not set
448# CONFIG_SYS_HYPERVISOR is not set
449CONFIG_CONNECTOR=y
450CONFIG_PROC_EVENTS=y
451# CONFIG_MTD is not set
452# CONFIG_PARPORT is not set
453CONFIG_BLK_DEV=y
454# CONFIG_BLK_DEV_COW_COMMON is not set
455CONFIG_BLK_DEV_LOOP=y
456# CONFIG_BLK_DEV_CRYPTOLOOP is not set
457# CONFIG_BLK_DEV_DRBD is not set
458# CONFIG_BLK_DEV_NBD is not set
459CONFIG_BLK_DEV_RAM=y
460CONFIG_BLK_DEV_RAM_COUNT=16
461CONFIG_BLK_DEV_RAM_SIZE=65536
462# CONFIG_BLK_DEV_XIP is not set
463# CONFIG_CDROM_PKTCDVD is not set
464# CONFIG_ATA_OVER_ETH is not set
465# CONFIG_MG_DISK is not set
466# CONFIG_MISC_DEVICES is not set
467CONFIG_HAVE_IDE=y
468# CONFIG_IDE is not set
469
470#
471# SCSI device support
472#
473# CONFIG_RAID_ATTRS is not set
474CONFIG_SCSI=y
475CONFIG_SCSI_DMA=y
476# CONFIG_SCSI_TGT is not set
477# CONFIG_SCSI_NETLINK is not set
478# CONFIG_SCSI_PROC_FS is not set
479
480#
481# SCSI support type (disk, tape, CD-ROM)
482#
483CONFIG_BLK_DEV_SD=y
484# CONFIG_CHR_DEV_ST is not set
485# CONFIG_CHR_DEV_OSST is not set
486# CONFIG_BLK_DEV_SR is not set
487# CONFIG_CHR_DEV_SG is not set
488# CONFIG_CHR_DEV_SCH is not set
489CONFIG_SCSI_MULTI_LUN=y
490CONFIG_SCSI_CONSTANTS=y
491CONFIG_SCSI_LOGGING=y
492CONFIG_SCSI_SCAN_ASYNC=y
493CONFIG_SCSI_WAIT_SCAN=m
494
495#
496# SCSI Transports
497#
498# CONFIG_SCSI_SPI_ATTRS is not set
499# CONFIG_SCSI_FC_ATTRS is not set
500# CONFIG_SCSI_ISCSI_ATTRS is not set
501# CONFIG_SCSI_SAS_LIBSAS is not set
502# CONFIG_SCSI_SRP_ATTRS is not set
503# CONFIG_SCSI_LOWLEVEL is not set
504# CONFIG_SCSI_DH is not set
505# CONFIG_SCSI_OSD_INITIATOR is not set
506CONFIG_ATA=m
507# CONFIG_ATA_NONSTANDARD is not set
508CONFIG_ATA_VERBOSE_ERROR=y
509CONFIG_SATA_PMP=y
510CONFIG_ATA_SFF=y
511# CONFIG_SATA_MV is not set
512# CONFIG_PATA_PLATFORM is not set
513# CONFIG_MD is not set
514CONFIG_NETDEVICES=y
515# CONFIG_DUMMY is not set
516# CONFIG_BONDING is not set
517# CONFIG_MACVLAN is not set
518# CONFIG_EQUALIZER is not set
519# CONFIG_TUN is not set
520# CONFIG_VETH is not set
521CONFIG_PHYLIB=y
522
523#
524# MII PHY device drivers
525#
526CONFIG_MARVELL_PHY=y
527CONFIG_DAVICOM_PHY=y
528CONFIG_QSEMI_PHY=y
529CONFIG_LXT_PHY=y
530CONFIG_CICADA_PHY=y
531CONFIG_VITESSE_PHY=y
532CONFIG_SMSC_PHY=y
533CONFIG_BROADCOM_PHY=y
534CONFIG_ICPLUS_PHY=y
535CONFIG_REALTEK_PHY=y
536CONFIG_NATIONAL_PHY=y
537CONFIG_STE10XP=y
538CONFIG_LSI_ET1011C_PHY=y
539CONFIG_FIXED_PHY=y
540CONFIG_MDIO_BITBANG=y
541CONFIG_MDIO_GPIO=y
542CONFIG_NET_ETHERNET=y
543CONFIG_MII=m
544# CONFIG_AX88796 is not set
545# CONFIG_SMC91X is not set
546# CONFIG_DM9000 is not set
547# CONFIG_ETHOC is not set
548# CONFIG_SMC911X is not set
549# CONFIG_SMSC911X is not set
550# CONFIG_DNET is not set
551# CONFIG_IBM_NEW_EMAC_ZMII is not set
552# CONFIG_IBM_NEW_EMAC_RGMII is not set
553# CONFIG_IBM_NEW_EMAC_TAH is not set
554# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
555# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
556# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
557# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
558# CONFIG_B44 is not set
559# CONFIG_KS8842 is not set
560# CONFIG_KS8851_MLL is not set
561CONFIG_FEC=y
562# CONFIG_FEC2 is not set
563# CONFIG_NETDEV_1000 is not set
564# CONFIG_NETDEV_10000 is not set
565# CONFIG_WLAN is not set
566
567#
568# Enable WiMAX (Networking options) to see the WiMAX drivers
569#
570# CONFIG_WAN is not set
571# CONFIG_PPP is not set
572# CONFIG_SLIP is not set
573# CONFIG_NETCONSOLE is not set
574# CONFIG_NETPOLL is not set
575# CONFIG_NET_POLL_CONTROLLER is not set
576# CONFIG_ISDN is not set
577# CONFIG_PHONE is not set
578
579#
580# Input device support
581#
582CONFIG_INPUT=y
583CONFIG_INPUT_FF_MEMLESS=m
584# CONFIG_INPUT_POLLDEV is not set
585# CONFIG_INPUT_SPARSEKMAP is not set
586
587#
588# Userland interfaces
589#
590CONFIG_INPUT_MOUSEDEV=y
591# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
592CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
593CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
594# CONFIG_INPUT_JOYDEV is not set
595CONFIG_INPUT_EVDEV=y
596CONFIG_INPUT_EVBUG=m
597
598#
599# Input Device Drivers
600#
601CONFIG_INPUT_KEYBOARD=y
602# CONFIG_KEYBOARD_ADP5588 is not set
603CONFIG_KEYBOARD_ATKBD=y
604# CONFIG_QT2160 is not set
605# CONFIG_KEYBOARD_LKKBD is not set
606# CONFIG_KEYBOARD_GPIO is not set
607# CONFIG_KEYBOARD_MATRIX is not set
608# CONFIG_KEYBOARD_LM8323 is not set
609# CONFIG_KEYBOARD_MAX7359 is not set
610# CONFIG_KEYBOARD_NEWTON is not set
611# CONFIG_KEYBOARD_OPENCORES is not set
612# CONFIG_KEYBOARD_STOWAWAY is not set
613# CONFIG_KEYBOARD_SUNKBD is not set
614# CONFIG_KEYBOARD_XTKBD is not set
615CONFIG_INPUT_MOUSE=y
616CONFIG_MOUSE_PS2=m
617CONFIG_MOUSE_PS2_ALPS=y
618CONFIG_MOUSE_PS2_LOGIPS2PP=y
619CONFIG_MOUSE_PS2_SYNAPTICS=y
620CONFIG_MOUSE_PS2_TRACKPOINT=y
621CONFIG_MOUSE_PS2_ELANTECH=y
622# CONFIG_MOUSE_PS2_SENTELIC is not set
623# CONFIG_MOUSE_PS2_TOUCHKIT is not set
624# CONFIG_MOUSE_SERIAL is not set
625# CONFIG_MOUSE_VSXXXAA is not set
626# CONFIG_MOUSE_GPIO is not set
627# CONFIG_MOUSE_SYNAPTICS_I2C is not set
628# CONFIG_INPUT_JOYSTICK is not set
629# CONFIG_INPUT_TABLET is not set
630# CONFIG_INPUT_TOUCHSCREEN is not set
631# CONFIG_INPUT_MISC is not set
632
633#
634# Hardware I/O ports
635#
636CONFIG_SERIO=y
637CONFIG_SERIO_SERPORT=m
638CONFIG_SERIO_LIBPS2=y
639# CONFIG_SERIO_RAW is not set
640# CONFIG_SERIO_ALTERA_PS2 is not set
641# CONFIG_GAMEPORT is not set
642
643#
644# Character devices
645#
646CONFIG_VT=y
647CONFIG_CONSOLE_TRANSLATIONS=y
648CONFIG_VT_CONSOLE=y
649CONFIG_HW_CONSOLE=y
650CONFIG_VT_HW_CONSOLE_BINDING=y
651# CONFIG_DEVKMEM is not set
652# CONFIG_SERIAL_NONSTANDARD is not set
653
654#
655# Serial drivers
656#
657# CONFIG_SERIAL_8250 is not set
658
659#
660# Non-8250 serial port support
661#
662CONFIG_SERIAL_IMX=y
663CONFIG_SERIAL_IMX_CONSOLE=y
664CONFIG_SERIAL_CORE=y
665CONFIG_SERIAL_CORE_CONSOLE=y
666CONFIG_UNIX98_PTYS=y
667# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
668# CONFIG_LEGACY_PTYS is not set
669# CONFIG_IPMI_HANDLER is not set
670CONFIG_HW_RANDOM=y
671# CONFIG_HW_RANDOM_TIMERIOMEM is not set
672# CONFIG_R3964 is not set
673# CONFIG_RAW_DRIVER is not set
674# CONFIG_TCG_TPM is not set
675CONFIG_I2C=y
676CONFIG_I2C_BOARDINFO=y
677# CONFIG_I2C_COMPAT is not set
678CONFIG_I2C_CHARDEV=m
679# CONFIG_I2C_HELPER_AUTO is not set
680
681#
682# I2C Algorithms
683#
684CONFIG_I2C_ALGOBIT=m
685CONFIG_I2C_ALGOPCF=m
686CONFIG_I2C_ALGOPCA=m
687
688#
689# I2C Hardware Bus support
690#
691
692#
693# I2C system bus drivers (mostly embedded / system-on-chip)
694#
695# CONFIG_I2C_DESIGNWARE is not set
696# CONFIG_I2C_GPIO is not set
697# CONFIG_I2C_IMX is not set
698# CONFIG_I2C_OCORES is not set
699# CONFIG_I2C_SIMTEC is not set
700
701#
702# External I2C/SMBus adapter drivers
703#
704# CONFIG_I2C_PARPORT_LIGHT is not set
705# CONFIG_I2C_TAOS_EVM is not set
706
707#
708# Other I2C/SMBus bus drivers
709#
710# CONFIG_I2C_PCA_PLATFORM is not set
711# CONFIG_I2C_STUB is not set
712
713#
714# Miscellaneous I2C Chip support
715#
716# CONFIG_SENSORS_TSL2550 is not set
717# CONFIG_I2C_DEBUG_CORE is not set
718# CONFIG_I2C_DEBUG_ALGO is not set
719# CONFIG_I2C_DEBUG_BUS is not set
720# CONFIG_I2C_DEBUG_CHIP is not set
721# CONFIG_SPI is not set
722
723#
724# PPS support
725#
726# CONFIG_PPS is not set
727CONFIG_ARCH_REQUIRE_GPIOLIB=y
728CONFIG_GPIOLIB=y
729# CONFIG_DEBUG_GPIO is not set
730CONFIG_GPIO_SYSFS=y
731
732#
733# Memory mapped GPIO expanders:
734#
735
736#
737# I2C GPIO expanders:
738#
739# CONFIG_GPIO_MAX732X is not set
740# CONFIG_GPIO_PCA953X is not set
741# CONFIG_GPIO_PCF857X is not set
742# CONFIG_GPIO_ADP5588 is not set
743
744#
745# PCI GPIO expanders:
746#
747
748#
749# SPI GPIO expanders:
750#
751
752#
753# AC97 GPIO expanders:
754#
755# CONFIG_W1 is not set
756# CONFIG_POWER_SUPPLY is not set
757# CONFIG_HWMON is not set
758# CONFIG_THERMAL is not set
759# CONFIG_WATCHDOG is not set
760CONFIG_SSB_POSSIBLE=y
761
762#
763# Sonics Silicon Backplane
764#
765# CONFIG_SSB is not set
766
767#
768# Multifunction device drivers
769#
770# CONFIG_MFD_CORE is not set
771# CONFIG_MFD_SM501 is not set
772# CONFIG_MFD_ASIC3 is not set
773# CONFIG_HTC_EGPIO is not set
774# CONFIG_HTC_PASIC3 is not set
775# CONFIG_TPS65010 is not set
776# CONFIG_TWL4030_CORE is not set
777# CONFIG_MFD_TMIO is not set
778# CONFIG_MFD_T7L66XB is not set
779# CONFIG_MFD_TC6387XB is not set
780# CONFIG_MFD_TC6393XB is not set
781# CONFIG_PMIC_DA903X is not set
782# CONFIG_PMIC_ADP5520 is not set
783# CONFIG_MFD_WM8400 is not set
784# CONFIG_MFD_WM831X is not set
785# CONFIG_MFD_WM8350_I2C is not set
786# CONFIG_MFD_PCF50633 is not set
787# CONFIG_AB3100_CORE is not set
788# CONFIG_MFD_88PM8607 is not set
789# CONFIG_REGULATOR is not set
790# CONFIG_MEDIA_SUPPORT is not set
791
792#
793# Graphics support
794#
795# CONFIG_VGASTATE is not set
796# CONFIG_VIDEO_OUTPUT_CONTROL is not set
797# CONFIG_FB is not set
798# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
799
800#
801# Display device support
802#
803# CONFIG_DISPLAY_SUPPORT is not set
804
805#
806# Console display driver support
807#
808# CONFIG_VGA_CONSOLE is not set
809CONFIG_DUMMY_CONSOLE=y
810# CONFIG_SOUND is not set
811# CONFIG_HID_SUPPORT is not set
812# CONFIG_USB_SUPPORT is not set
813CONFIG_MMC=y
814# CONFIG_MMC_DEBUG is not set
815# CONFIG_MMC_UNSAFE_RESUME is not set
816
817#
818# MMC/SD/SDIO Card Drivers
819#
820CONFIG_MMC_BLOCK=m
821CONFIG_MMC_BLOCK_BOUNCE=y
822# CONFIG_SDIO_UART is not set
823# CONFIG_MMC_TEST is not set
824
825#
826# MMC/SD/SDIO Host Controller Drivers
827#
828CONFIG_MMC_SDHCI=m
829# CONFIG_MMC_SDHCI_PLTFM is not set
830# CONFIG_MMC_AT91 is not set
831# CONFIG_MMC_ATMELMCI is not set
832# CONFIG_MMC_MXC is not set
833# CONFIG_MEMSTICK is not set
834CONFIG_NEW_LEDS=y
835CONFIG_LEDS_CLASS=m
836
837#
838# LED drivers
839#
840# CONFIG_LEDS_PCA9532 is not set
841# CONFIG_LEDS_GPIO is not set
842# CONFIG_LEDS_LP3944 is not set
843# CONFIG_LEDS_PCA955X is not set
844# CONFIG_LEDS_BD2802 is not set
845# CONFIG_LEDS_LT3593 is not set
846
847#
848# LED Triggers
849#
850# CONFIG_LEDS_TRIGGERS is not set
851# CONFIG_ACCESSIBILITY is not set
852CONFIG_RTC_LIB=y
853CONFIG_RTC_CLASS=y
854CONFIG_RTC_HCTOSYS=y
855CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
856# CONFIG_RTC_DEBUG is not set
857
858#
859# RTC interfaces
860#
861CONFIG_RTC_INTF_SYSFS=y
862CONFIG_RTC_INTF_PROC=y
863CONFIG_RTC_INTF_DEV=y
864CONFIG_RTC_INTF_DEV_UIE_EMUL=y
865# CONFIG_RTC_DRV_TEST is not set
866
867#
868# I2C RTC drivers
869#
870# CONFIG_RTC_DRV_DS1307 is not set
871# CONFIG_RTC_DRV_DS1374 is not set
872# CONFIG_RTC_DRV_DS1672 is not set
873# CONFIG_RTC_DRV_MAX6900 is not set
874# CONFIG_RTC_DRV_RS5C372 is not set
875# CONFIG_RTC_DRV_ISL1208 is not set
876# CONFIG_RTC_DRV_X1205 is not set
877# CONFIG_RTC_DRV_PCF8563 is not set
878# CONFIG_RTC_DRV_PCF8583 is not set
879# CONFIG_RTC_DRV_M41T80 is not set
880# CONFIG_RTC_DRV_BQ32K is not set
881# CONFIG_RTC_DRV_S35390A is not set
882# CONFIG_RTC_DRV_FM3130 is not set
883# CONFIG_RTC_DRV_RX8581 is not set
884# CONFIG_RTC_DRV_RX8025 is not set
885
886#
887# SPI RTC drivers
888#
889
890#
891# Platform RTC drivers
892#
893# CONFIG_RTC_DRV_CMOS is not set
894# CONFIG_RTC_DRV_DS1286 is not set
895# CONFIG_RTC_DRV_DS1511 is not set
896# CONFIG_RTC_DRV_DS1553 is not set
897# CONFIG_RTC_DRV_DS1742 is not set
898# CONFIG_RTC_DRV_STK17TA8 is not set
899# CONFIG_RTC_DRV_M48T86 is not set
900# CONFIG_RTC_DRV_M48T35 is not set
901# CONFIG_RTC_DRV_M48T59 is not set
902# CONFIG_RTC_DRV_MSM6242 is not set
903# CONFIG_RTC_MXC is not set
904# CONFIG_RTC_DRV_BQ4802 is not set
905# CONFIG_RTC_DRV_RP5C01 is not set
906# CONFIG_RTC_DRV_V3020 is not set
907
908#
909# on-CPU RTC drivers
910#
911# CONFIG_DMADEVICES is not set
912# CONFIG_AUXDISPLAY is not set
913# CONFIG_UIO is not set
914
915#
916# TI VLYNQ
917#
918# CONFIG_STAGING is not set
919
920#
921# File systems
922#
923CONFIG_EXT2_FS=y
924CONFIG_EXT2_FS_XATTR=y
925CONFIG_EXT2_FS_POSIX_ACL=y
926CONFIG_EXT2_FS_SECURITY=y
927# CONFIG_EXT2_FS_XIP is not set
928CONFIG_EXT3_FS=y
929CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
930CONFIG_EXT3_FS_XATTR=y
931CONFIG_EXT3_FS_POSIX_ACL=y
932CONFIG_EXT3_FS_SECURITY=y
933CONFIG_EXT4_FS=y
934CONFIG_EXT4_FS_XATTR=y
935CONFIG_EXT4_FS_POSIX_ACL=y
936CONFIG_EXT4_FS_SECURITY=y
937# CONFIG_EXT4_DEBUG is not set
938CONFIG_JBD=y
939# CONFIG_JBD_DEBUG is not set
940CONFIG_JBD2=y
941# CONFIG_JBD2_DEBUG is not set
942CONFIG_FS_MBCACHE=y
943# CONFIG_REISERFS_FS is not set
944# CONFIG_JFS_FS is not set
945CONFIG_FS_POSIX_ACL=y
946# CONFIG_XFS_FS is not set
947# CONFIG_OCFS2_FS is not set
948# CONFIG_BTRFS_FS is not set
949# CONFIG_NILFS2_FS is not set
950CONFIG_FILE_LOCKING=y
951CONFIG_FSNOTIFY=y
952CONFIG_DNOTIFY=y
953CONFIG_INOTIFY=y
954CONFIG_INOTIFY_USER=y
955CONFIG_QUOTA=y
956CONFIG_QUOTA_NETLINK_INTERFACE=y
957# CONFIG_PRINT_QUOTA_WARNING is not set
958# CONFIG_QFMT_V1 is not set
959# CONFIG_QFMT_V2 is not set
960CONFIG_QUOTACTL=y
961CONFIG_AUTOFS_FS=y
962CONFIG_AUTOFS4_FS=y
963CONFIG_FUSE_FS=y
964# CONFIG_CUSE is not set
965
966#
967# Caches
968#
969# CONFIG_FSCACHE is not set
970
971#
972# CD-ROM/DVD Filesystems
973#
974CONFIG_ISO9660_FS=m
975CONFIG_JOLIET=y
976CONFIG_ZISOFS=y
977CONFIG_UDF_FS=m
978CONFIG_UDF_NLS=y
979
980#
981# DOS/FAT/NT Filesystems
982#
983CONFIG_FAT_FS=y
984CONFIG_MSDOS_FS=m
985CONFIG_VFAT_FS=y
986CONFIG_FAT_DEFAULT_CODEPAGE=437
987CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
988# CONFIG_NTFS_FS is not set
989
990#
991# Pseudo filesystems
992#
993CONFIG_PROC_FS=y
994CONFIG_PROC_SYSCTL=y
995CONFIG_PROC_PAGE_MONITOR=y
996CONFIG_SYSFS=y
997# CONFIG_TMPFS is not set
998# CONFIG_HUGETLB_PAGE is not set
999CONFIG_CONFIGFS_FS=m
1000CONFIG_MISC_FILESYSTEMS=y
1001# CONFIG_ADFS_FS is not set
1002# CONFIG_AFFS_FS is not set
1003# CONFIG_ECRYPT_FS is not set
1004# CONFIG_HFS_FS is not set
1005# CONFIG_HFSPLUS_FS is not set
1006# CONFIG_BEFS_FS is not set
1007# CONFIG_BFS_FS is not set
1008# CONFIG_EFS_FS is not set
1009# CONFIG_CRAMFS is not set
1010# CONFIG_SQUASHFS is not set
1011# CONFIG_VXFS_FS is not set
1012# CONFIG_MINIX_FS is not set
1013# CONFIG_OMFS_FS is not set
1014# CONFIG_HPFS_FS is not set
1015# CONFIG_QNX4FS_FS is not set
1016# CONFIG_ROMFS_FS is not set
1017# CONFIG_SYSV_FS is not set
1018# CONFIG_UFS_FS is not set
1019CONFIG_NETWORK_FILESYSTEMS=y
1020CONFIG_NFS_FS=y
1021CONFIG_NFS_V3=y
1022CONFIG_NFS_V3_ACL=y
1023CONFIG_NFS_V4=y
1024# CONFIG_NFS_V4_1 is not set
1025CONFIG_ROOT_NFS=y
1026# CONFIG_NFSD is not set
1027CONFIG_LOCKD=y
1028CONFIG_LOCKD_V4=y
1029CONFIG_NFS_ACL_SUPPORT=y
1030CONFIG_NFS_COMMON=y
1031CONFIG_SUNRPC=y
1032CONFIG_SUNRPC_GSS=y
1033CONFIG_RPCSEC_GSS_KRB5=y
1034# CONFIG_RPCSEC_GSS_SPKM3 is not set
1035# CONFIG_SMB_FS is not set
1036# CONFIG_CIFS is not set
1037# CONFIG_NCP_FS is not set
1038# CONFIG_CODA_FS is not set
1039# CONFIG_AFS_FS is not set
1040
1041#
1042# Partition Types
1043#
1044# CONFIG_PARTITION_ADVANCED is not set
1045CONFIG_MSDOS_PARTITION=y
1046CONFIG_NLS=y
1047CONFIG_NLS_DEFAULT="cp437"
1048CONFIG_NLS_CODEPAGE_437=y
1049# CONFIG_NLS_CODEPAGE_737 is not set
1050# CONFIG_NLS_CODEPAGE_775 is not set
1051# CONFIG_NLS_CODEPAGE_850 is not set
1052# CONFIG_NLS_CODEPAGE_852 is not set
1053# CONFIG_NLS_CODEPAGE_855 is not set
1054# CONFIG_NLS_CODEPAGE_857 is not set
1055# CONFIG_NLS_CODEPAGE_860 is not set
1056# CONFIG_NLS_CODEPAGE_861 is not set
1057# CONFIG_NLS_CODEPAGE_862 is not set
1058# CONFIG_NLS_CODEPAGE_863 is not set
1059# CONFIG_NLS_CODEPAGE_864 is not set
1060# CONFIG_NLS_CODEPAGE_865 is not set
1061# CONFIG_NLS_CODEPAGE_866 is not set
1062# CONFIG_NLS_CODEPAGE_869 is not set
1063# CONFIG_NLS_CODEPAGE_936 is not set
1064# CONFIG_NLS_CODEPAGE_950 is not set
1065# CONFIG_NLS_CODEPAGE_932 is not set
1066# CONFIG_NLS_CODEPAGE_949 is not set
1067# CONFIG_NLS_CODEPAGE_874 is not set
1068# CONFIG_NLS_ISO8859_8 is not set
1069# CONFIG_NLS_CODEPAGE_1250 is not set
1070# CONFIG_NLS_CODEPAGE_1251 is not set
1071CONFIG_NLS_ASCII=y
1072CONFIG_NLS_ISO8859_1=m
1073# CONFIG_NLS_ISO8859_2 is not set
1074# CONFIG_NLS_ISO8859_3 is not set
1075# CONFIG_NLS_ISO8859_4 is not set
1076# CONFIG_NLS_ISO8859_5 is not set
1077# CONFIG_NLS_ISO8859_6 is not set
1078# CONFIG_NLS_ISO8859_7 is not set
1079# CONFIG_NLS_ISO8859_9 is not set
1080# CONFIG_NLS_ISO8859_13 is not set
1081# CONFIG_NLS_ISO8859_14 is not set
1082CONFIG_NLS_ISO8859_15=m
1083# CONFIG_NLS_KOI8_R is not set
1084# CONFIG_NLS_KOI8_U is not set
1085CONFIG_NLS_UTF8=y
1086# CONFIG_DLM is not set
1087
1088#
1089# Kernel hacking
1090#
1091# CONFIG_PRINTK_TIME is not set
1092CONFIG_ENABLE_WARN_DEPRECATED=y
1093CONFIG_ENABLE_MUST_CHECK=y
1094CONFIG_FRAME_WARN=1024
1095CONFIG_MAGIC_SYSRQ=y
1096# CONFIG_STRIP_ASM_SYMS is not set
1097# CONFIG_UNUSED_SYMBOLS is not set
1098CONFIG_DEBUG_FS=y
1099# CONFIG_HEADERS_CHECK is not set
1100CONFIG_DEBUG_KERNEL=y
1101# CONFIG_DEBUG_SHIRQ is not set
1102# CONFIG_DETECT_SOFTLOCKUP is not set
1103# CONFIG_DETECT_HUNG_TASK is not set
1104# CONFIG_SCHED_DEBUG is not set
1105# CONFIG_SCHEDSTATS is not set
1106# CONFIG_TIMER_STATS is not set
1107# CONFIG_DEBUG_OBJECTS is not set
1108# CONFIG_DEBUG_KMEMLEAK is not set
1109# CONFIG_DEBUG_RT_MUTEXES is not set
1110# CONFIG_RT_MUTEX_TESTER is not set
1111# CONFIG_DEBUG_SPINLOCK is not set
1112# CONFIG_DEBUG_MUTEXES is not set
1113# CONFIG_DEBUG_LOCK_ALLOC is not set
1114# CONFIG_PROVE_LOCKING is not set
1115# CONFIG_LOCK_STAT is not set
1116# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1117# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1118# CONFIG_DEBUG_KOBJECT is not set
1119# CONFIG_DEBUG_BUGVERBOSE is not set
1120# CONFIG_DEBUG_INFO is not set
1121# CONFIG_DEBUG_VM is not set
1122# CONFIG_DEBUG_WRITECOUNT is not set
1123# CONFIG_DEBUG_MEMORY_INIT is not set
1124# CONFIG_DEBUG_LIST is not set
1125# CONFIG_DEBUG_SG is not set
1126# CONFIG_DEBUG_NOTIFIERS is not set
1127# CONFIG_DEBUG_CREDENTIALS is not set
1128CONFIG_FRAME_POINTER=y
1129# CONFIG_BOOT_PRINTK_DELAY is not set
1130# CONFIG_RCU_TORTURE_TEST is not set
1131# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1132# CONFIG_BACKTRACE_SELF_TEST is not set
1133# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1134# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1135# CONFIG_FAULT_INJECTION is not set
1136# CONFIG_LATENCYTOP is not set
1137# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1138# CONFIG_PAGE_POISONING is not set
1139CONFIG_HAVE_FUNCTION_TRACER=y
1140CONFIG_TRACING_SUPPORT=y
1141# CONFIG_FTRACE is not set
1142# CONFIG_DYNAMIC_DEBUG is not set
1143# CONFIG_SAMPLES is not set
1144CONFIG_HAVE_ARCH_KGDB=y
1145# CONFIG_KGDB is not set
1146# CONFIG_ARM_UNWIND is not set
1147# CONFIG_DEBUG_USER is not set
1148# CONFIG_DEBUG_ERRORS is not set
1149# CONFIG_DEBUG_STACK_USAGE is not set
1150CONFIG_DEBUG_LL=y
1151CONFIG_EARLY_PRINTK=y
1152# CONFIG_DEBUG_ICEDCC is not set
1153# CONFIG_OC_ETM is not set
1154
1155#
1156# Security options
1157#
1158CONFIG_KEYS=y
1159# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
1160# CONFIG_SECURITY is not set
1161CONFIG_SECURITYFS=y
1162# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1163# CONFIG_DEFAULT_SECURITY_SMACK is not set
1164# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1165CONFIG_DEFAULT_SECURITY_DAC=y
1166CONFIG_DEFAULT_SECURITY=""
1167CONFIG_CRYPTO=y
1168
1169#
1170# Crypto core or helper
1171#
1172CONFIG_CRYPTO_ALGAPI=y
1173CONFIG_CRYPTO_ALGAPI2=y
1174CONFIG_CRYPTO_AEAD2=y
1175CONFIG_CRYPTO_BLKCIPHER=y
1176CONFIG_CRYPTO_BLKCIPHER2=y
1177CONFIG_CRYPTO_HASH=y
1178CONFIG_CRYPTO_HASH2=y
1179CONFIG_CRYPTO_RNG2=y
1180CONFIG_CRYPTO_PCOMP=y
1181CONFIG_CRYPTO_MANAGER=y
1182CONFIG_CRYPTO_MANAGER2=y
1183# CONFIG_CRYPTO_GF128MUL is not set
1184# CONFIG_CRYPTO_NULL is not set
1185CONFIG_CRYPTO_WORKQUEUE=y
1186# CONFIG_CRYPTO_CRYPTD is not set
1187# CONFIG_CRYPTO_AUTHENC is not set
1188# CONFIG_CRYPTO_TEST is not set
1189
1190#
1191# Authenticated Encryption with Associated Data
1192#
1193# CONFIG_CRYPTO_CCM is not set
1194# CONFIG_CRYPTO_GCM is not set
1195# CONFIG_CRYPTO_SEQIV is not set
1196
1197#
1198# Block modes
1199#
1200CONFIG_CRYPTO_CBC=y
1201# CONFIG_CRYPTO_CTR is not set
1202# CONFIG_CRYPTO_CTS is not set
1203# CONFIG_CRYPTO_ECB is not set
1204# CONFIG_CRYPTO_LRW is not set
1205# CONFIG_CRYPTO_PCBC is not set
1206# CONFIG_CRYPTO_XTS is not set
1207
1208#
1209# Hash modes
1210#
1211# CONFIG_CRYPTO_HMAC is not set
1212# CONFIG_CRYPTO_XCBC is not set
1213# CONFIG_CRYPTO_VMAC is not set
1214
1215#
1216# Digest
1217#
1218CONFIG_CRYPTO_CRC32C=m
1219# CONFIG_CRYPTO_GHASH is not set
1220# CONFIG_CRYPTO_MD4 is not set
1221CONFIG_CRYPTO_MD5=y
1222# CONFIG_CRYPTO_MICHAEL_MIC is not set
1223# CONFIG_CRYPTO_RMD128 is not set
1224# CONFIG_CRYPTO_RMD160 is not set
1225# CONFIG_CRYPTO_RMD256 is not set
1226# CONFIG_CRYPTO_RMD320 is not set
1227# CONFIG_CRYPTO_SHA1 is not set
1228# CONFIG_CRYPTO_SHA256 is not set
1229# CONFIG_CRYPTO_SHA512 is not set
1230# CONFIG_CRYPTO_TGR192 is not set
1231# CONFIG_CRYPTO_WP512 is not set
1232
1233#
1234# Ciphers
1235#
1236# CONFIG_CRYPTO_AES is not set
1237# CONFIG_CRYPTO_ANUBIS is not set
1238# CONFIG_CRYPTO_ARC4 is not set
1239# CONFIG_CRYPTO_BLOWFISH is not set
1240# CONFIG_CRYPTO_CAMELLIA is not set
1241# CONFIG_CRYPTO_CAST5 is not set
1242# CONFIG_CRYPTO_CAST6 is not set
1243CONFIG_CRYPTO_DES=y
1244# CONFIG_CRYPTO_FCRYPT is not set
1245# CONFIG_CRYPTO_KHAZAD is not set
1246# CONFIG_CRYPTO_SALSA20 is not set
1247# CONFIG_CRYPTO_SEED is not set
1248# CONFIG_CRYPTO_SERPENT is not set
1249# CONFIG_CRYPTO_TEA is not set
1250# CONFIG_CRYPTO_TWOFISH is not set
1251
1252#
1253# Compression
1254#
1255CONFIG_CRYPTO_DEFLATE=y
1256# CONFIG_CRYPTO_ZLIB is not set
1257CONFIG_CRYPTO_LZO=y
1258
1259#
1260# Random Number Generation
1261#
1262# CONFIG_CRYPTO_ANSI_CPRNG is not set
1263# CONFIG_CRYPTO_HW is not set
1264# CONFIG_BINARY_PRINTF is not set
1265
1266#
1267# Library routines
1268#
1269CONFIG_BITREVERSE=y
1270CONFIG_RATIONAL=y
1271CONFIG_GENERIC_FIND_LAST_BIT=y
1272CONFIG_CRC_CCITT=m
1273CONFIG_CRC16=y
1274CONFIG_CRC_T10DIF=y
1275CONFIG_CRC_ITU_T=m
1276CONFIG_CRC32=y
1277CONFIG_CRC7=m
1278CONFIG_LIBCRC32C=m
1279CONFIG_ZLIB_INFLATE=y
1280CONFIG_ZLIB_DEFLATE=y
1281CONFIG_LZO_COMPRESS=y
1282CONFIG_LZO_DECOMPRESS=y
1283CONFIG_HAS_IOMEM=y
1284CONFIG_HAS_IOPORT=y
1285CONFIG_HAS_DMA=y
1286CONFIG_NLATTR=y
diff --git a/arch/arm/configs/nuc950_defconfig b/arch/arm/configs/nuc950_defconfig
index 97300ec478dd..51cc2a260cbb 100644
--- a/arch/arm/configs/nuc950_defconfig
+++ b/arch/arm/configs/nuc950_defconfig
@@ -590,8 +590,40 @@ CONFIG_SSB_POSSIBLE=y
590# 590#
591# CONFIG_VGASTATE is not set 591# CONFIG_VGASTATE is not set
592# CONFIG_VIDEO_OUTPUT_CONTROL is not set 592# CONFIG_VIDEO_OUTPUT_CONTROL is not set
593# CONFIG_FB is not set
594# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 593# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
594CONFIG_FB=y
595# CONFIG_FIRMWARE_EDID is not set
596# CONFIG_FB_DDC is not set
597# CONFIG_FB_BOOT_VESA_SUPPORT is not set
598CONFIG_FB_CFB_FILLRECT=y
599CONFIG_FB_CFB_COPYAREA=y
600CONFIG_FB_CFB_IMAGEBLIT=y
601# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
602# CONFIG_FB_SYS_FILLRECT is not set
603# CONFIG_FB_SYS_COPYAREA is not set
604# CONFIG_FB_SYS_IMAGEBLIT is not set
605# CONFIG_FB_FOREIGN_ENDIAN is not set
606# CONFIG_FB_SYS_FOPS is not set
607# CONFIG_FB_SVGALIB is not set
608# CONFIG_FB_MACMODES is not set
609# CONFIG_FB_BACKLIGHT is not set
610# CONFIG_FB_MODE_HELPERS is not set
611# CONFIG_FB_TILEBLITTING is not set
612
613#
614# Frame buffer hardware drivers
615#
616# CONFIG_FB_S1D13XXX is not set
617CONFIG_FB_NUC900=y
618CONFIG_GPM1040A0_320X240=y
619CONFIG_FB_NUC900_DEBUG=y
620# CONFIG_FB_VIRTUAL is not set
621# CONFIG_FB_METRONOME is not set
622# CONFIG_FB_MB862XX is not set
623# CONFIG_FB_BROADSHEET is not set
624# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
625
626
595 627
596# 628#
597# Display device support 629# Display device support
@@ -603,6 +635,25 @@ CONFIG_SSB_POSSIBLE=y
603# 635#
604# CONFIG_VGA_CONSOLE is not set 636# CONFIG_VGA_CONSOLE is not set
605CONFIG_DUMMY_CONSOLE=y 637CONFIG_DUMMY_CONSOLE=y
638CONFIG_FRAMEBUFFER_CONSOLE=y
639CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
640# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
641CONFIG_FONTS=y
642# CONFIG_FONT_8x8 is not set
643CONFIG_FONT_8x16=y
644# CONFIG_FONT_6x11 is not set
645# CONFIG_FONT_7x14 is not set
646# CONFIG_FONT_PEARL_8x8 is not set
647# CONFIG_FONT_ACORN_8x8 is not set
648# CONFIG_FONT_MINI_4x6 is not set
649# CONFIG_FONT_SUN8x16 is not set
650# CONFIG_FONT_SUN12x22 is not set
651# CONFIG_FONT_10x18 is not set
652CONFIG_LOGO=y
653# CONFIG_LOGO_LINUX_MONO is not set
654# CONFIG_LOGO_LINUX_VGA16 is not set
655CONFIG_LOGO_LINUX_CLUT224=y
656
606# CONFIG_SOUND is not set 657# CONFIG_SOUND is not set
607# CONFIG_HID_SUPPORT is not set 658# CONFIG_HID_SUPPORT is not set
608CONFIG_USB_SUPPORT=y 659CONFIG_USB_SUPPORT=y
diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig
index 85b05d3e279b..ee1ebd8dfa80 100644
--- a/arch/arm/configs/orion5x_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc6 3# Linux kernel version: 2.6.33-rc6
4# Sat Nov 7 20:52:21 2009 4# Thu Feb 4 23:30:00 2010
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -32,6 +32,12 @@ CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32 32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION="" 33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y 34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
35CONFIG_SWAP=y 41CONFIG_SWAP=y
36CONFIG_SYSVIPC=y 42CONFIG_SYSVIPC=y
37CONFIG_SYSVIPC_SYSCTL=y 43CONFIG_SYSVIPC_SYSCTL=y
@@ -45,6 +51,7 @@ CONFIG_SYSVIPC_SYSCTL=y
45# 51#
46CONFIG_TREE_RCU=y 52CONFIG_TREE_RCU=y
47# CONFIG_TREE_PREEMPT_RCU is not set 53# CONFIG_TREE_PREEMPT_RCU is not set
54# CONFIG_TINY_RCU is not set
48# CONFIG_RCU_TRACE is not set 55# CONFIG_RCU_TRACE is not set
49CONFIG_RCU_FANOUT=32 56CONFIG_RCU_FANOUT=32
50# CONFIG_RCU_FANOUT_EXACT is not set 57# CONFIG_RCU_FANOUT_EXACT is not set
@@ -122,14 +129,41 @@ CONFIG_LBDAF=y
122# IO Schedulers 129# IO Schedulers
123# 130#
124CONFIG_IOSCHED_NOOP=y 131CONFIG_IOSCHED_NOOP=y
125CONFIG_IOSCHED_AS=y
126CONFIG_IOSCHED_DEADLINE=y 132CONFIG_IOSCHED_DEADLINE=y
127CONFIG_IOSCHED_CFQ=y 133CONFIG_IOSCHED_CFQ=y
128# CONFIG_DEFAULT_AS is not set
129# CONFIG_DEFAULT_DEADLINE is not set 134# CONFIG_DEFAULT_DEADLINE is not set
130CONFIG_DEFAULT_CFQ=y 135CONFIG_DEFAULT_CFQ=y
131# CONFIG_DEFAULT_NOOP is not set 136# CONFIG_DEFAULT_NOOP is not set
132CONFIG_DEFAULT_IOSCHED="cfq" 137CONFIG_DEFAULT_IOSCHED="cfq"
138# CONFIG_INLINE_SPIN_TRYLOCK is not set
139# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
140# CONFIG_INLINE_SPIN_LOCK is not set
141# CONFIG_INLINE_SPIN_LOCK_BH is not set
142# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
143# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
144# CONFIG_INLINE_SPIN_UNLOCK is not set
145# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
146# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
147# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
148# CONFIG_INLINE_READ_TRYLOCK is not set
149# CONFIG_INLINE_READ_LOCK is not set
150# CONFIG_INLINE_READ_LOCK_BH is not set
151# CONFIG_INLINE_READ_LOCK_IRQ is not set
152# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
153# CONFIG_INLINE_READ_UNLOCK is not set
154# CONFIG_INLINE_READ_UNLOCK_BH is not set
155# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
156# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
157# CONFIG_INLINE_WRITE_TRYLOCK is not set
158# CONFIG_INLINE_WRITE_LOCK is not set
159# CONFIG_INLINE_WRITE_LOCK_BH is not set
160# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
161# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
162# CONFIG_INLINE_WRITE_UNLOCK is not set
163# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
164# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
165# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
166# CONFIG_MUTEX_SPIN_ON_OWNER is not set
133# CONFIG_FREEZER is not set 167# CONFIG_FREEZER is not set
134 168
135# 169#
@@ -158,6 +192,7 @@ CONFIG_MMU=y
158# CONFIG_ARCH_IXP2000 is not set 192# CONFIG_ARCH_IXP2000 is not set
159# CONFIG_ARCH_IXP4XX is not set 193# CONFIG_ARCH_IXP4XX is not set
160# CONFIG_ARCH_L7200 is not set 194# CONFIG_ARCH_L7200 is not set
195# CONFIG_ARCH_DOVE is not set
161# CONFIG_ARCH_KIRKWOOD is not set 196# CONFIG_ARCH_KIRKWOOD is not set
162# CONFIG_ARCH_LOKI is not set 197# CONFIG_ARCH_LOKI is not set
163# CONFIG_ARCH_MV78XX0 is not set 198# CONFIG_ARCH_MV78XX0 is not set
@@ -180,6 +215,7 @@ CONFIG_ARCH_ORION5X=y
180# CONFIG_ARCH_DAVINCI is not set 215# CONFIG_ARCH_DAVINCI is not set
181# CONFIG_ARCH_OMAP is not set 216# CONFIG_ARCH_OMAP is not set
182# CONFIG_ARCH_BCMRING is not set 217# CONFIG_ARCH_BCMRING is not set
218# CONFIG_ARCH_U8500 is not set
183 219
184# 220#
185# Orion Implementations 221# Orion Implementations
@@ -192,6 +228,7 @@ CONFIG_MACH_TS209=y
192CONFIG_MACH_TERASTATION_PRO2=y 228CONFIG_MACH_TERASTATION_PRO2=y
193CONFIG_MACH_LINKSTATION_PRO=y 229CONFIG_MACH_LINKSTATION_PRO=y
194CONFIG_MACH_LINKSTATION_MINI=y 230CONFIG_MACH_LINKSTATION_MINI=y
231CONFIG_MACH_LINKSTATION_LS_HGL=y
195CONFIG_MACH_TS409=y 232CONFIG_MACH_TS409=y
196CONFIG_MACH_WRT350N_V2=y 233CONFIG_MACH_WRT350N_V2=y
197CONFIG_MACH_TS78XX=y 234CONFIG_MACH_TS78XX=y
@@ -268,12 +305,10 @@ CONFIG_FLATMEM_MANUAL=y
268CONFIG_FLATMEM=y 305CONFIG_FLATMEM=y
269CONFIG_FLAT_NODE_MEM_MAP=y 306CONFIG_FLAT_NODE_MEM_MAP=y
270CONFIG_PAGEFLAGS_EXTENDED=y 307CONFIG_PAGEFLAGS_EXTENDED=y
271CONFIG_SPLIT_PTLOCK_CPUS=4096 308CONFIG_SPLIT_PTLOCK_CPUS=999999
272# CONFIG_PHYS_ADDR_T_64BIT is not set 309# CONFIG_PHYS_ADDR_T_64BIT is not set
273CONFIG_ZONE_DMA_FLAG=0 310CONFIG_ZONE_DMA_FLAG=0
274CONFIG_VIRT_TO_BUS=y 311CONFIG_VIRT_TO_BUS=y
275CONFIG_HAVE_MLOCK=y
276CONFIG_HAVE_MLOCKED_PAGE_BIT=y
277# CONFIG_KSM is not set 312# CONFIG_KSM is not set
278CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 313CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
279CONFIG_LEDS=y 314CONFIG_LEDS=y
@@ -412,10 +447,6 @@ CONFIG_NET_PKTGEN=m
412# CONFIG_AF_RXRPC is not set 447# CONFIG_AF_RXRPC is not set
413CONFIG_WIRELESS=y 448CONFIG_WIRELESS=y
414# CONFIG_CFG80211 is not set 449# CONFIG_CFG80211 is not set
415CONFIG_CFG80211_DEFAULT_PS_VALUE=0
416# CONFIG_WIRELESS_OLD_REGULATORY is not set
417CONFIG_WIRELESS_EXT=y
418CONFIG_WIRELESS_EXT_SYSFS=y
419# CONFIG_LIB80211 is not set 450# CONFIG_LIB80211 is not set
420 451
421# 452#
@@ -554,6 +585,10 @@ CONFIG_BLK_DEV=y
554# CONFIG_BLK_DEV_COW_COMMON is not set 585# CONFIG_BLK_DEV_COW_COMMON is not set
555CONFIG_BLK_DEV_LOOP=y 586CONFIG_BLK_DEV_LOOP=y
556# CONFIG_BLK_DEV_CRYPTOLOOP is not set 587# CONFIG_BLK_DEV_CRYPTOLOOP is not set
588
589#
590# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
591#
557# CONFIG_BLK_DEV_NBD is not set 592# CONFIG_BLK_DEV_NBD is not set
558# CONFIG_BLK_DEV_SX8 is not set 593# CONFIG_BLK_DEV_SX8 is not set
559# CONFIG_BLK_DEV_UB is not set 594# CONFIG_BLK_DEV_UB is not set
@@ -562,6 +597,7 @@ CONFIG_BLK_DEV_LOOP=y
562# CONFIG_ATA_OVER_ETH is not set 597# CONFIG_ATA_OVER_ETH is not set
563# CONFIG_MG_DISK is not set 598# CONFIG_MG_DISK is not set
564CONFIG_MISC_DEVICES=y 599CONFIG_MISC_DEVICES=y
600# CONFIG_AD525X_DPOT is not set
565# CONFIG_PHANTOM is not set 601# CONFIG_PHANTOM is not set
566# CONFIG_SGI_IOC4 is not set 602# CONFIG_SGI_IOC4 is not set
567# CONFIG_TIFM_CORE is not set 603# CONFIG_TIFM_CORE is not set
@@ -569,6 +605,7 @@ CONFIG_MISC_DEVICES=y
569# CONFIG_ENCLOSURE_SERVICES is not set 605# CONFIG_ENCLOSURE_SERVICES is not set
570# CONFIG_HP_ILO is not set 606# CONFIG_HP_ILO is not set
571# CONFIG_ISL29003 is not set 607# CONFIG_ISL29003 is not set
608# CONFIG_DS1682 is not set
572# CONFIG_C2PORT is not set 609# CONFIG_C2PORT is not set
573 610
574# 611#
@@ -621,7 +658,9 @@ CONFIG_SCSI_LOWLEVEL=y
621# CONFIG_SCSI_BNX2_ISCSI is not set 658# CONFIG_SCSI_BNX2_ISCSI is not set
622# CONFIG_BE2ISCSI is not set 659# CONFIG_BE2ISCSI is not set
623# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 660# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
661# CONFIG_SCSI_HPSA is not set
624# CONFIG_SCSI_3W_9XXX is not set 662# CONFIG_SCSI_3W_9XXX is not set
663# CONFIG_SCSI_3W_SAS is not set
625# CONFIG_SCSI_ACARD is not set 664# CONFIG_SCSI_ACARD is not set
626# CONFIG_SCSI_AACRAID is not set 665# CONFIG_SCSI_AACRAID is not set
627# CONFIG_SCSI_AIC7XXX is not set 666# CONFIG_SCSI_AIC7XXX is not set
@@ -657,6 +696,7 @@ CONFIG_SCSI_LOWLEVEL=y
657# CONFIG_SCSI_NSP32 is not set 696# CONFIG_SCSI_NSP32 is not set
658# CONFIG_SCSI_DEBUG is not set 697# CONFIG_SCSI_DEBUG is not set
659# CONFIG_SCSI_PMCRAID is not set 698# CONFIG_SCSI_PMCRAID is not set
699# CONFIG_SCSI_PM8001 is not set
660# CONFIG_SCSI_SRP is not set 700# CONFIG_SCSI_SRP is not set
661# CONFIG_SCSI_BFA_FC is not set 701# CONFIG_SCSI_BFA_FC is not set
662# CONFIG_SCSI_DH is not set 702# CONFIG_SCSI_DH is not set
@@ -711,15 +751,16 @@ CONFIG_SATA_MV=y
711# CONFIG_PATA_NS87415 is not set 751# CONFIG_PATA_NS87415 is not set
712# CONFIG_PATA_OPTI is not set 752# CONFIG_PATA_OPTI is not set
713# CONFIG_PATA_OPTIDMA is not set 753# CONFIG_PATA_OPTIDMA is not set
754# CONFIG_PATA_PDC2027X is not set
714# CONFIG_PATA_PDC_OLD is not set 755# CONFIG_PATA_PDC_OLD is not set
715# CONFIG_PATA_RADISYS is not set 756# CONFIG_PATA_RADISYS is not set
716# CONFIG_PATA_RDC is not set 757# CONFIG_PATA_RDC is not set
717# CONFIG_PATA_RZ1000 is not set 758# CONFIG_PATA_RZ1000 is not set
718# CONFIG_PATA_SC1200 is not set 759# CONFIG_PATA_SC1200 is not set
719# CONFIG_PATA_SERVERWORKS is not set 760# CONFIG_PATA_SERVERWORKS is not set
720# CONFIG_PATA_PDC2027X is not set
721# CONFIG_PATA_SIL680 is not set 761# CONFIG_PATA_SIL680 is not set
722# CONFIG_PATA_SIS is not set 762# CONFIG_PATA_SIS is not set
763# CONFIG_PATA_TOSHIBA is not set
723# CONFIG_PATA_VIA is not set 764# CONFIG_PATA_VIA is not set
724# CONFIG_PATA_WINBOND is not set 765# CONFIG_PATA_WINBOND is not set
725# CONFIG_PATA_PLATFORM is not set 766# CONFIG_PATA_PLATFORM is not set
@@ -736,7 +777,7 @@ CONFIG_SATA_MV=y
736# 777#
737 778
738# 779#
739# See the help texts for more information. 780# The newer stack is recommended.
740# 781#
741# CONFIG_FIREWIRE is not set 782# CONFIG_FIREWIRE is not set
742# CONFIG_IEEE1394 is not set 783# CONFIG_IEEE1394 is not set
@@ -842,8 +883,10 @@ CONFIG_MV643XX_ETH=y
842# CONFIG_NETDEV_10000 is not set 883# CONFIG_NETDEV_10000 is not set
843# CONFIG_TR is not set 884# CONFIG_TR is not set
844CONFIG_WLAN=y 885CONFIG_WLAN=y
845# CONFIG_WLAN_PRE80211 is not set 886# CONFIG_ATMEL is not set
846# CONFIG_WLAN_80211 is not set 887# CONFIG_PRISM54 is not set
888# CONFIG_USB_ZD1201 is not set
889# CONFIG_HOSTAP is not set
847 890
848# 891#
849# Enable WiMAX (Networking options) to see the WiMAX drivers 892# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -866,6 +909,7 @@ CONFIG_WLAN=y
866# CONFIG_NETCONSOLE is not set 909# CONFIG_NETCONSOLE is not set
867# CONFIG_NETPOLL is not set 910# CONFIG_NETPOLL is not set
868# CONFIG_NET_POLL_CONTROLLER is not set 911# CONFIG_NET_POLL_CONTROLLER is not set
912# CONFIG_VMXNET3 is not set
869# CONFIG_ISDN is not set 913# CONFIG_ISDN is not set
870# CONFIG_PHONE is not set 914# CONFIG_PHONE is not set
871 915
@@ -875,6 +919,7 @@ CONFIG_WLAN=y
875CONFIG_INPUT=y 919CONFIG_INPUT=y
876# CONFIG_INPUT_FF_MEMLESS is not set 920# CONFIG_INPUT_FF_MEMLESS is not set
877# CONFIG_INPUT_POLLDEV is not set 921# CONFIG_INPUT_POLLDEV is not set
922# CONFIG_INPUT_SPARSEKMAP is not set
878 923
879# 924#
880# Userland interfaces 925# Userland interfaces
@@ -993,11 +1038,6 @@ CONFIG_I2C_MV64XXX=y
993# CONFIG_I2C_TINY_USB is not set 1038# CONFIG_I2C_TINY_USB is not set
994 1039
995# 1040#
996# Graphics adapter I2C/DDC channel drivers
997#
998# CONFIG_I2C_VOODOO3 is not set
999
1000#
1001# Other I2C/SMBus bus drivers 1041# Other I2C/SMBus bus drivers
1002# 1042#
1003# CONFIG_I2C_PCA_PLATFORM is not set 1043# CONFIG_I2C_PCA_PLATFORM is not set
@@ -1006,7 +1046,6 @@ CONFIG_I2C_MV64XXX=y
1006# 1046#
1007# Miscellaneous I2C Chip support 1047# Miscellaneous I2C Chip support
1008# 1048#
1009# CONFIG_DS1682 is not set
1010# CONFIG_SENSORS_TSL2550 is not set 1049# CONFIG_SENSORS_TSL2550 is not set
1011# CONFIG_I2C_DEBUG_CORE is not set 1050# CONFIG_I2C_DEBUG_CORE is not set
1012# CONFIG_I2C_DEBUG_ALGO is not set 1051# CONFIG_I2C_DEBUG_ALGO is not set
@@ -1033,10 +1072,12 @@ CONFIG_GPIO_SYSFS=y
1033# CONFIG_GPIO_MAX732X is not set 1072# CONFIG_GPIO_MAX732X is not set
1034# CONFIG_GPIO_PCA953X is not set 1073# CONFIG_GPIO_PCA953X is not set
1035# CONFIG_GPIO_PCF857X is not set 1074# CONFIG_GPIO_PCF857X is not set
1075# CONFIG_GPIO_ADP5588 is not set
1036 1076
1037# 1077#
1038# PCI GPIO expanders: 1078# PCI GPIO expanders:
1039# 1079#
1080# CONFIG_GPIO_CS5535 is not set
1040# CONFIG_GPIO_BT8XX is not set 1081# CONFIG_GPIO_BT8XX is not set
1041# CONFIG_GPIO_LANGWELL is not set 1082# CONFIG_GPIO_LANGWELL is not set
1042 1083
@@ -1079,6 +1120,7 @@ CONFIG_HWMON=y
1079# CONFIG_SENSORS_GL520SM is not set 1120# CONFIG_SENSORS_GL520SM is not set
1080# CONFIG_SENSORS_IT87 is not set 1121# CONFIG_SENSORS_IT87 is not set
1081# CONFIG_SENSORS_LM63 is not set 1122# CONFIG_SENSORS_LM63 is not set
1123# CONFIG_SENSORS_LM73 is not set
1082CONFIG_SENSORS_LM75=y 1124CONFIG_SENSORS_LM75=y
1083# CONFIG_SENSORS_LM77 is not set 1125# CONFIG_SENSORS_LM77 is not set
1084# CONFIG_SENSORS_LM78 is not set 1126# CONFIG_SENSORS_LM78 is not set
@@ -1104,6 +1146,7 @@ CONFIG_SENSORS_LM75=y
1104# CONFIG_SENSORS_SMSC47M192 is not set 1146# CONFIG_SENSORS_SMSC47M192 is not set
1105# CONFIG_SENSORS_SMSC47B397 is not set 1147# CONFIG_SENSORS_SMSC47B397 is not set
1106# CONFIG_SENSORS_ADS7828 is not set 1148# CONFIG_SENSORS_ADS7828 is not set
1149# CONFIG_SENSORS_AMC6821 is not set
1107# CONFIG_SENSORS_THMC50 is not set 1150# CONFIG_SENSORS_THMC50 is not set
1108# CONFIG_SENSORS_TMP401 is not set 1151# CONFIG_SENSORS_TMP401 is not set
1109# CONFIG_SENSORS_TMP421 is not set 1152# CONFIG_SENSORS_TMP421 is not set
@@ -1118,6 +1161,7 @@ CONFIG_SENSORS_LM75=y
1118# CONFIG_SENSORS_W83L786NG is not set 1161# CONFIG_SENSORS_W83L786NG is not set
1119# CONFIG_SENSORS_W83627HF is not set 1162# CONFIG_SENSORS_W83627HF is not set
1120# CONFIG_SENSORS_W83627EHF is not set 1163# CONFIG_SENSORS_W83627EHF is not set
1164# CONFIG_SENSORS_LIS3_I2C is not set
1121# CONFIG_THERMAL is not set 1165# CONFIG_THERMAL is not set
1122# CONFIG_WATCHDOG is not set 1166# CONFIG_WATCHDOG is not set
1123CONFIG_SSB_POSSIBLE=y 1167CONFIG_SSB_POSSIBLE=y
@@ -1140,11 +1184,13 @@ CONFIG_SSB_POSSIBLE=y
1140# CONFIG_MFD_TMIO is not set 1184# CONFIG_MFD_TMIO is not set
1141# CONFIG_MFD_TC6393XB is not set 1185# CONFIG_MFD_TC6393XB is not set
1142# CONFIG_PMIC_DA903X is not set 1186# CONFIG_PMIC_DA903X is not set
1187# CONFIG_PMIC_ADP5520 is not set
1143# CONFIG_MFD_WM8400 is not set 1188# CONFIG_MFD_WM8400 is not set
1144# CONFIG_MFD_WM831X is not set 1189# CONFIG_MFD_WM831X is not set
1145# CONFIG_MFD_WM8350_I2C is not set 1190# CONFIG_MFD_WM8350_I2C is not set
1146# CONFIG_MFD_PCF50633 is not set 1191# CONFIG_MFD_PCF50633 is not set
1147# CONFIG_AB3100_CORE is not set 1192# CONFIG_AB3100_CORE is not set
1193# CONFIG_MFD_88PM8607 is not set
1148# CONFIG_REGULATOR is not set 1194# CONFIG_REGULATOR is not set
1149# CONFIG_MEDIA_SUPPORT is not set 1195# CONFIG_MEDIA_SUPPORT is not set
1150 1196
@@ -1316,6 +1362,7 @@ CONFIG_USB_STORAGE_JUMPSHOT=y
1316# OTG and related infrastructure 1362# OTG and related infrastructure
1317# 1363#
1318# CONFIG_USB_GPIO_VBUS is not set 1364# CONFIG_USB_GPIO_VBUS is not set
1365# CONFIG_USB_ULPI is not set
1319# CONFIG_NOP_USB_XCEIV is not set 1366# CONFIG_NOP_USB_XCEIV is not set
1320# CONFIG_UWB is not set 1367# CONFIG_UWB is not set
1321# CONFIG_MMC is not set 1368# CONFIG_MMC is not set
@@ -1332,6 +1379,7 @@ CONFIG_LEDS_GPIO_PLATFORM=y
1332# CONFIG_LEDS_LP3944 is not set 1379# CONFIG_LEDS_LP3944 is not set
1333# CONFIG_LEDS_PCA955X is not set 1380# CONFIG_LEDS_PCA955X is not set
1334# CONFIG_LEDS_BD2802 is not set 1381# CONFIG_LEDS_BD2802 is not set
1382# CONFIG_LEDS_LT3593 is not set
1335 1383
1336# 1384#
1337# LED Triggers 1385# LED Triggers
@@ -1377,6 +1425,7 @@ CONFIG_RTC_DRV_PCF8563=y
1377# CONFIG_RTC_DRV_PCF8583 is not set 1425# CONFIG_RTC_DRV_PCF8583 is not set
1378CONFIG_RTC_DRV_M41T80=y 1426CONFIG_RTC_DRV_M41T80=y
1379# CONFIG_RTC_DRV_M41T80_WDT is not set 1427# CONFIG_RTC_DRV_M41T80_WDT is not set
1428# CONFIG_RTC_DRV_BQ32K is not set
1380CONFIG_RTC_DRV_S35390A=y 1429CONFIG_RTC_DRV_S35390A=y
1381# CONFIG_RTC_DRV_FM3130 is not set 1430# CONFIG_RTC_DRV_FM3130 is not set
1382# CONFIG_RTC_DRV_RX8581 is not set 1431# CONFIG_RTC_DRV_RX8581 is not set
@@ -1398,7 +1447,9 @@ CONFIG_RTC_DRV_S35390A=y
1398CONFIG_RTC_DRV_M48T86=y 1447CONFIG_RTC_DRV_M48T86=y
1399# CONFIG_RTC_DRV_M48T35 is not set 1448# CONFIG_RTC_DRV_M48T35 is not set
1400# CONFIG_RTC_DRV_M48T59 is not set 1449# CONFIG_RTC_DRV_M48T59 is not set
1450# CONFIG_RTC_DRV_MSM6242 is not set
1401# CONFIG_RTC_DRV_BQ4802 is not set 1451# CONFIG_RTC_DRV_BQ4802 is not set
1452# CONFIG_RTC_DRV_RP5C01 is not set
1402# CONFIG_RTC_DRV_V3020 is not set 1453# CONFIG_RTC_DRV_V3020 is not set
1403 1454
1404# 1455#
@@ -1686,7 +1737,9 @@ CONFIG_DEBUG_USER=y
1686CONFIG_DEBUG_ERRORS=y 1737CONFIG_DEBUG_ERRORS=y
1687# CONFIG_DEBUG_STACK_USAGE is not set 1738# CONFIG_DEBUG_STACK_USAGE is not set
1688CONFIG_DEBUG_LL=y 1739CONFIG_DEBUG_LL=y
1740# CONFIG_EARLY_PRINTK is not set
1689# CONFIG_DEBUG_ICEDCC is not set 1741# CONFIG_DEBUG_ICEDCC is not set
1742# CONFIG_OC_ETM is not set
1690 1743
1691# 1744#
1692# Security options 1745# Security options
@@ -1694,7 +1747,11 @@ CONFIG_DEBUG_LL=y
1694# CONFIG_KEYS is not set 1747# CONFIG_KEYS is not set
1695# CONFIG_SECURITY is not set 1748# CONFIG_SECURITY is not set
1696# CONFIG_SECURITYFS is not set 1749# CONFIG_SECURITYFS is not set
1697# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1750# CONFIG_DEFAULT_SECURITY_SELINUX is not set
1751# CONFIG_DEFAULT_SECURITY_SMACK is not set
1752# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
1753CONFIG_DEFAULT_SECURITY_DAC=y
1754CONFIG_DEFAULT_SECURITY=""
1698CONFIG_CRYPTO=y 1755CONFIG_CRYPTO=y
1699 1756
1700# 1757#
diff --git a/arch/arm/configs/pxa168_defconfig b/arch/arm/configs/pxa168_defconfig
index 791b8c39aefc..113511f91eb7 100644
--- a/arch/arm/configs/pxa168_defconfig
+++ b/arch/arm/configs/pxa168_defconfig
@@ -1,15 +1,13 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.29-rc3 3# Linux kernel version: 2.6.33-rc3
4# Fri Mar 20 13:43:13 2009 4# Tue Jan 12 08:57:10 2010
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y 9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y 10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 12CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_HAVE_LATENCYTOP_SUPPORT=y 13CONFIG_HAVE_LATENCYTOP_SUPPORT=y
@@ -18,13 +16,12 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 16CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 17CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 18CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 19CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 20CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 22CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
28 25
29# 26#
30# General setup 27# General setup
@@ -35,6 +32,12 @@ CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32 32CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION="" 33CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y 34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
38CONFIG_SWAP=y 41CONFIG_SWAP=y
39CONFIG_SYSVIPC=y 42CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y 43CONFIG_SYSVIPC_SYSCTL=y
@@ -46,11 +49,13 @@ CONFIG_SYSVIPC_SYSCTL=y
46# 49#
47# RCU Subsystem 50# RCU Subsystem
48# 51#
49CONFIG_CLASSIC_RCU=y 52CONFIG_TREE_RCU=y
50# CONFIG_TREE_RCU is not set 53# CONFIG_TREE_PREEMPT_RCU is not set
51# CONFIG_PREEMPT_RCU is not set 54# CONFIG_TINY_RCU is not set
55# CONFIG_RCU_TRACE is not set
56CONFIG_RCU_FANOUT=32
57# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set 58# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_PREEMPT_RCU_TRACE is not set
54# CONFIG_IKCONFIG is not set 59# CONFIG_IKCONFIG is not set
55CONFIG_LOG_BUF_SHIFT=14 60CONFIG_LOG_BUF_SHIFT=14
56# CONFIG_GROUP_SCHED is not set 61# CONFIG_GROUP_SCHED is not set
@@ -64,10 +69,10 @@ CONFIG_NAMESPACES=y
64# CONFIG_USER_NS is not set 69# CONFIG_USER_NS is not set
65# CONFIG_PID_NS is not set 70# CONFIG_PID_NS is not set
66# CONFIG_NET_NS is not set 71# CONFIG_NET_NS is not set
67CONFIG_BLK_DEV_INITRD=y 72# CONFIG_BLK_DEV_INITRD is not set
68CONFIG_INITRAMFS_SOURCE=""
69CONFIG_CC_OPTIMIZE_FOR_SIZE=y 73CONFIG_CC_OPTIMIZE_FOR_SIZE=y
70CONFIG_SYSCTL=y 74CONFIG_SYSCTL=y
75CONFIG_ANON_INODES=y
71# CONFIG_EMBEDDED is not set 76# CONFIG_EMBEDDED is not set
72CONFIG_UID16=y 77CONFIG_UID16=y
73CONFIG_SYSCTL_SYSCALL=y 78CONFIG_SYSCTL_SYSCALL=y
@@ -78,17 +83,20 @@ CONFIG_HOTPLUG=y
78CONFIG_PRINTK=y 83CONFIG_PRINTK=y
79CONFIG_BUG=y 84CONFIG_BUG=y
80CONFIG_ELF_CORE=y 85CONFIG_ELF_CORE=y
81CONFIG_COMPAT_BRK=y
82CONFIG_BASE_FULL=y 86CONFIG_BASE_FULL=y
83CONFIG_FUTEX=y 87CONFIG_FUTEX=y
84CONFIG_ANON_INODES=y
85CONFIG_EPOLL=y 88CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y 89CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y 90CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y 91CONFIG_EVENTFD=y
89CONFIG_SHMEM=y 92CONFIG_SHMEM=y
90CONFIG_AIO=y 93CONFIG_AIO=y
94
95#
96# Kernel Performance Events And Counters
97#
91CONFIG_VM_EVENT_COUNTERS=y 98CONFIG_VM_EVENT_COUNTERS=y
99CONFIG_COMPAT_BRK=y
92CONFIG_SLAB=y 100CONFIG_SLAB=y
93# CONFIG_SLUB is not set 101# CONFIG_SLUB is not set
94# CONFIG_SLOB is not set 102# CONFIG_SLOB is not set
@@ -98,6 +106,11 @@ CONFIG_HAVE_OPROFILE=y
98CONFIG_HAVE_KPROBES=y 106CONFIG_HAVE_KPROBES=y
99CONFIG_HAVE_KRETPROBES=y 107CONFIG_HAVE_KRETPROBES=y
100CONFIG_HAVE_CLK=y 108CONFIG_HAVE_CLK=y
109
110#
111# GCOV-based kernel profiling
112#
113# CONFIG_SLOW_WORK is not set
101CONFIG_HAVE_GENERIC_DMA_COHERENT=y 114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
102CONFIG_SLABINFO=y 115CONFIG_SLABINFO=y
103CONFIG_RT_MUTEXES=y 116CONFIG_RT_MUTEXES=y
@@ -109,8 +122,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
109# CONFIG_MODVERSIONS is not set 122# CONFIG_MODVERSIONS is not set
110# CONFIG_MODULE_SRCVERSION_ALL is not set 123# CONFIG_MODULE_SRCVERSION_ALL is not set
111CONFIG_BLOCK=y 124CONFIG_BLOCK=y
112# CONFIG_LBD is not set 125CONFIG_LBDAF=y
113# CONFIG_BLK_DEV_IO_TRACE is not set
114# CONFIG_BLK_DEV_BSG is not set 126# CONFIG_BLK_DEV_BSG is not set
115# CONFIG_BLK_DEV_INTEGRITY is not set 127# CONFIG_BLK_DEV_INTEGRITY is not set
116 128
@@ -118,31 +130,62 @@ CONFIG_BLOCK=y
118# IO Schedulers 130# IO Schedulers
119# 131#
120CONFIG_IOSCHED_NOOP=y 132CONFIG_IOSCHED_NOOP=y
121CONFIG_IOSCHED_AS=y
122CONFIG_IOSCHED_DEADLINE=y 133CONFIG_IOSCHED_DEADLINE=y
123CONFIG_IOSCHED_CFQ=y 134CONFIG_IOSCHED_CFQ=y
124# CONFIG_DEFAULT_AS is not set
125# CONFIG_DEFAULT_DEADLINE is not set 135# CONFIG_DEFAULT_DEADLINE is not set
126CONFIG_DEFAULT_CFQ=y 136CONFIG_DEFAULT_CFQ=y
127# CONFIG_DEFAULT_NOOP is not set 137# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="cfq" 138CONFIG_DEFAULT_IOSCHED="cfq"
139# CONFIG_INLINE_SPIN_TRYLOCK is not set
140# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
141# CONFIG_INLINE_SPIN_LOCK is not set
142# CONFIG_INLINE_SPIN_LOCK_BH is not set
143# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
144# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
145# CONFIG_INLINE_SPIN_UNLOCK is not set
146# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
147# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
148# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
149# CONFIG_INLINE_READ_TRYLOCK is not set
150# CONFIG_INLINE_READ_LOCK is not set
151# CONFIG_INLINE_READ_LOCK_BH is not set
152# CONFIG_INLINE_READ_LOCK_IRQ is not set
153# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
154# CONFIG_INLINE_READ_UNLOCK is not set
155# CONFIG_INLINE_READ_UNLOCK_BH is not set
156# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
157# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
158# CONFIG_INLINE_WRITE_TRYLOCK is not set
159# CONFIG_INLINE_WRITE_LOCK is not set
160# CONFIG_INLINE_WRITE_LOCK_BH is not set
161# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
162# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
163# CONFIG_INLINE_WRITE_UNLOCK is not set
164# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
165# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
166# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
167# CONFIG_MUTEX_SPIN_ON_OWNER is not set
129# CONFIG_FREEZER is not set 168# CONFIG_FREEZER is not set
130 169
131# 170#
132# System Type 171# System Type
133# 172#
173CONFIG_MMU=y
134# CONFIG_ARCH_AAEC2000 is not set 174# CONFIG_ARCH_AAEC2000 is not set
135# CONFIG_ARCH_INTEGRATOR is not set 175# CONFIG_ARCH_INTEGRATOR is not set
136# CONFIG_ARCH_REALVIEW is not set 176# CONFIG_ARCH_REALVIEW is not set
137# CONFIG_ARCH_VERSATILE is not set 177# CONFIG_ARCH_VERSATILE is not set
138# CONFIG_ARCH_AT91 is not set 178# CONFIG_ARCH_AT91 is not set
139# CONFIG_ARCH_CLPS711X is not set 179# CONFIG_ARCH_CLPS711X is not set
180# CONFIG_ARCH_GEMINI is not set
140# CONFIG_ARCH_EBSA110 is not set 181# CONFIG_ARCH_EBSA110 is not set
141# CONFIG_ARCH_EP93XX is not set 182# CONFIG_ARCH_EP93XX is not set
142# CONFIG_ARCH_FOOTBRIDGE is not set 183# CONFIG_ARCH_FOOTBRIDGE is not set
184# CONFIG_ARCH_MXC is not set
185# CONFIG_ARCH_STMP3XXX is not set
143# CONFIG_ARCH_NETX is not set 186# CONFIG_ARCH_NETX is not set
144# CONFIG_ARCH_H720X is not set 187# CONFIG_ARCH_H720X is not set
145# CONFIG_ARCH_IMX is not set 188# CONFIG_ARCH_NOMADIK is not set
146# CONFIG_ARCH_IOP13XX is not set 189# CONFIG_ARCH_IOP13XX is not set
147# CONFIG_ARCH_IOP32X is not set 190# CONFIG_ARCH_IOP32X is not set
148# CONFIG_ARCH_IOP33X is not set 191# CONFIG_ARCH_IOP33X is not set
@@ -150,26 +193,30 @@ CONFIG_DEFAULT_IOSCHED="cfq"
150# CONFIG_ARCH_IXP2000 is not set 193# CONFIG_ARCH_IXP2000 is not set
151# CONFIG_ARCH_IXP4XX is not set 194# CONFIG_ARCH_IXP4XX is not set
152# CONFIG_ARCH_L7200 is not set 195# CONFIG_ARCH_L7200 is not set
196# CONFIG_ARCH_DOVE is not set
153# CONFIG_ARCH_KIRKWOOD is not set 197# CONFIG_ARCH_KIRKWOOD is not set
154# CONFIG_ARCH_KS8695 is not set
155# CONFIG_ARCH_NS9XXX is not set
156# CONFIG_ARCH_LOKI is not set 198# CONFIG_ARCH_LOKI is not set
157# CONFIG_ARCH_MV78XX0 is not set 199# CONFIG_ARCH_MV78XX0 is not set
158# CONFIG_ARCH_MXC is not set
159# CONFIG_ARCH_ORION5X is not set 200# CONFIG_ARCH_ORION5X is not set
201CONFIG_ARCH_MMP=y
202# CONFIG_ARCH_KS8695 is not set
203# CONFIG_ARCH_NS9XXX is not set
204# CONFIG_ARCH_W90X900 is not set
160# CONFIG_ARCH_PNX4008 is not set 205# CONFIG_ARCH_PNX4008 is not set
161# CONFIG_ARCH_PXA is not set 206# CONFIG_ARCH_PXA is not set
162CONFIG_ARCH_MMP=y 207# CONFIG_ARCH_MSM is not set
163# CONFIG_ARCH_RPC is not set 208# CONFIG_ARCH_RPC is not set
164# CONFIG_ARCH_SA1100 is not set 209# CONFIG_ARCH_SA1100 is not set
165# CONFIG_ARCH_S3C2410 is not set 210# CONFIG_ARCH_S3C2410 is not set
166# CONFIG_ARCH_S3C64XX is not set 211# CONFIG_ARCH_S3C64XX is not set
212# CONFIG_ARCH_S5PC1XX is not set
167# CONFIG_ARCH_SHARK is not set 213# CONFIG_ARCH_SHARK is not set
168# CONFIG_ARCH_LH7A40X is not set 214# CONFIG_ARCH_LH7A40X is not set
215# CONFIG_ARCH_U300 is not set
169# CONFIG_ARCH_DAVINCI is not set 216# CONFIG_ARCH_DAVINCI is not set
170# CONFIG_ARCH_OMAP is not set 217# CONFIG_ARCH_OMAP is not set
171# CONFIG_ARCH_MSM is not set 218# CONFIG_ARCH_BCMRING is not set
172# CONFIG_ARCH_W90X900 is not set 219# CONFIG_ARCH_U8500 is not set
173# CONFIG_MACH_TAVOREVB is not set 220# CONFIG_MACH_TAVOREVB is not set
174 221
175# 222#
@@ -177,6 +224,7 @@ CONFIG_ARCH_MMP=y
177# 224#
178CONFIG_MACH_ASPENITE=y 225CONFIG_MACH_ASPENITE=y
179CONFIG_MACH_ZYLONITE2=y 226CONFIG_MACH_ZYLONITE2=y
227CONFIG_MACH_AVENGERS_LITE=y
180# CONFIG_MACH_TTC_DKB is not set 228# CONFIG_MACH_TTC_DKB is not set
181CONFIG_CPU_PXA168=y 229CONFIG_CPU_PXA168=y
182CONFIG_PLAT_PXA=y 230CONFIG_PLAT_PXA=y
@@ -187,7 +235,7 @@ CONFIG_PLAT_PXA=y
187CONFIG_CPU_MOHAWK=y 235CONFIG_CPU_MOHAWK=y
188CONFIG_CPU_32v5=y 236CONFIG_CPU_32v5=y
189CONFIG_CPU_ABRT_EV5T=y 237CONFIG_CPU_ABRT_EV5T=y
190CONFIG_CPU_PABRT_NOIFAR=y 238CONFIG_CPU_PABRT_LEGACY=y
191CONFIG_CPU_CACHE_VIVT=y 239CONFIG_CPU_CACHE_VIVT=y
192CONFIG_CPU_COPY_V4WB=y 240CONFIG_CPU_COPY_V4WB=y
193CONFIG_CPU_TLB_V4WBI=y 241CONFIG_CPU_TLB_V4WBI=y
@@ -201,7 +249,7 @@ CONFIG_ARM_THUMB=y
201# CONFIG_CPU_ICACHE_DISABLE is not set 249# CONFIG_CPU_ICACHE_DISABLE is not set
202# CONFIG_CPU_DCACHE_DISABLE is not set 250# CONFIG_CPU_DCACHE_DISABLE is not set
203# CONFIG_CPU_BPREDICT_DISABLE is not set 251# CONFIG_CPU_BPREDICT_DISABLE is not set
204# CONFIG_OUTER_CACHE is not set 252CONFIG_ARM_L1_CACHE_SHIFT=5
205CONFIG_IWMMXT=y 253CONFIG_IWMMXT=y
206CONFIG_COMMON_CLKDEV=y 254CONFIG_COMMON_CLKDEV=y
207 255
@@ -223,13 +271,15 @@ CONFIG_VMSPLIT_3G=y
223# CONFIG_VMSPLIT_2G is not set 271# CONFIG_VMSPLIT_2G is not set
224# CONFIG_VMSPLIT_1G is not set 272# CONFIG_VMSPLIT_1G is not set
225CONFIG_PAGE_OFFSET=0xC0000000 273CONFIG_PAGE_OFFSET=0xC0000000
274# CONFIG_PREEMPT_NONE is not set
275# CONFIG_PREEMPT_VOLUNTARY is not set
226CONFIG_PREEMPT=y 276CONFIG_PREEMPT=y
227CONFIG_HZ=100 277CONFIG_HZ=100
228CONFIG_AEABI=y 278CONFIG_AEABI=y
229CONFIG_OABI_COMPAT=y 279CONFIG_OABI_COMPAT=y
230CONFIG_ARCH_FLATMEM_HAS_HOLES=y
231# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 280# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
232# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 281# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
282# CONFIG_HIGHMEM is not set
233CONFIG_SELECT_MEMORY_MODEL=y 283CONFIG_SELECT_MEMORY_MODEL=y
234CONFIG_FLATMEM_MANUAL=y 284CONFIG_FLATMEM_MANUAL=y
235# CONFIG_DISCONTIGMEM_MANUAL is not set 285# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -237,12 +287,14 @@ CONFIG_FLATMEM_MANUAL=y
237CONFIG_FLATMEM=y 287CONFIG_FLATMEM=y
238CONFIG_FLAT_NODE_MEM_MAP=y 288CONFIG_FLAT_NODE_MEM_MAP=y
239CONFIG_PAGEFLAGS_EXTENDED=y 289CONFIG_PAGEFLAGS_EXTENDED=y
240CONFIG_SPLIT_PTLOCK_CPUS=4096 290CONFIG_SPLIT_PTLOCK_CPUS=999999
241# CONFIG_PHYS_ADDR_T_64BIT is not set 291# CONFIG_PHYS_ADDR_T_64BIT is not set
242CONFIG_ZONE_DMA_FLAG=0 292CONFIG_ZONE_DMA_FLAG=0
243CONFIG_VIRT_TO_BUS=y 293CONFIG_VIRT_TO_BUS=y
244CONFIG_UNEVICTABLE_LRU=y 294# CONFIG_KSM is not set
295CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
245CONFIG_ALIGNMENT_TRAP=y 296CONFIG_ALIGNMENT_TRAP=y
297# CONFIG_UACCESS_WITH_MEMCPY is not set
246 298
247# 299#
248# Boot options 300# Boot options
@@ -288,7 +340,6 @@ CONFIG_NET=y
288# 340#
289# Networking options 341# Networking options
290# 342#
291CONFIG_COMPAT_NET_DEV_OPS=y
292CONFIG_PACKET=y 343CONFIG_PACKET=y
293# CONFIG_PACKET_MMAP is not set 344# CONFIG_PACKET_MMAP is not set
294CONFIG_UNIX=y 345CONFIG_UNIX=y
@@ -330,6 +381,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
330# CONFIG_NETFILTER is not set 381# CONFIG_NETFILTER is not set
331# CONFIG_IP_DCCP is not set 382# CONFIG_IP_DCCP is not set
332# CONFIG_IP_SCTP is not set 383# CONFIG_IP_SCTP is not set
384# CONFIG_RDS is not set
333# CONFIG_TIPC is not set 385# CONFIG_TIPC is not set
334# CONFIG_ATM is not set 386# CONFIG_ATM is not set
335# CONFIG_BRIDGE is not set 387# CONFIG_BRIDGE is not set
@@ -343,6 +395,8 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
343# CONFIG_LAPB is not set 395# CONFIG_LAPB is not set
344# CONFIG_ECONET is not set 396# CONFIG_ECONET is not set
345# CONFIG_WAN_ROUTER is not set 397# CONFIG_WAN_ROUTER is not set
398# CONFIG_PHONET is not set
399# CONFIG_IEEE802154 is not set
346# CONFIG_NET_SCHED is not set 400# CONFIG_NET_SCHED is not set
347# CONFIG_DCB is not set 401# CONFIG_DCB is not set
348 402
@@ -355,13 +409,13 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
355# CONFIG_IRDA is not set 409# CONFIG_IRDA is not set
356# CONFIG_BT is not set 410# CONFIG_BT is not set
357# CONFIG_AF_RXRPC is not set 411# CONFIG_AF_RXRPC is not set
358# CONFIG_PHONET is not set
359CONFIG_WIRELESS=y 412CONFIG_WIRELESS=y
360# CONFIG_CFG80211 is not set 413# CONFIG_CFG80211 is not set
361CONFIG_WIRELESS_OLD_REGULATORY=y
362# CONFIG_WIRELESS_EXT is not set
363# CONFIG_LIB80211 is not set 414# CONFIG_LIB80211 is not set
364# CONFIG_MAC80211 is not set 415
416#
417# CFG80211 needs to be enabled for MAC80211
418#
365# CONFIG_WIMAX is not set 419# CONFIG_WIMAX is not set
366# CONFIG_RFKILL is not set 420# CONFIG_RFKILL is not set
367# CONFIG_NET_9P is not set 421# CONFIG_NET_9P is not set
@@ -374,6 +428,7 @@ CONFIG_WIRELESS_OLD_REGULATORY=y
374# Generic Driver Options 428# Generic Driver Options
375# 429#
376CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 430CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
431# CONFIG_DEVTMPFS is not set
377# CONFIG_STANDALONE is not set 432# CONFIG_STANDALONE is not set
378# CONFIG_PREVENT_FIRMWARE_BUILD is not set 433# CONFIG_PREVENT_FIRMWARE_BUILD is not set
379CONFIG_FW_LOADER=y 434CONFIG_FW_LOADER=y
@@ -412,8 +467,10 @@ CONFIG_MII=y
412# CONFIG_AX88796 is not set 467# CONFIG_AX88796 is not set
413CONFIG_SMC91X=y 468CONFIG_SMC91X=y
414# CONFIG_DM9000 is not set 469# CONFIG_DM9000 is not set
470# CONFIG_ETHOC is not set
415# CONFIG_SMC911X is not set 471# CONFIG_SMC911X is not set
416# CONFIG_SMSC911X is not set 472# CONFIG_SMSC911X is not set
473# CONFIG_DNET is not set
417# CONFIG_IBM_NEW_EMAC_ZMII is not set 474# CONFIG_IBM_NEW_EMAC_ZMII is not set
418# CONFIG_IBM_NEW_EMAC_RGMII is not set 475# CONFIG_IBM_NEW_EMAC_RGMII is not set
419# CONFIG_IBM_NEW_EMAC_TAH is not set 476# CONFIG_IBM_NEW_EMAC_TAH is not set
@@ -422,15 +479,12 @@ CONFIG_SMC91X=y
422# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set 479# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
423# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set 480# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
424# CONFIG_B44 is not set 481# CONFIG_B44 is not set
482# CONFIG_KS8842 is not set
483# CONFIG_KS8851_MLL is not set
425# CONFIG_NETDEV_1000 is not set 484# CONFIG_NETDEV_1000 is not set
426# CONFIG_NETDEV_10000 is not set 485# CONFIG_NETDEV_10000 is not set
427 486CONFIG_WLAN=y
428# 487# CONFIG_HOSTAP is not set
429# Wireless LAN
430#
431# CONFIG_WLAN_PRE80211 is not set
432# CONFIG_WLAN_80211 is not set
433# CONFIG_IWLWIFI_LEDS is not set
434 488
435# 489#
436# Enable WiMAX (Networking options) to see the WiMAX drivers 490# Enable WiMAX (Networking options) to see the WiMAX drivers
@@ -442,6 +496,7 @@ CONFIG_SMC91X=y
442# CONFIG_NETPOLL is not set 496# CONFIG_NETPOLL is not set
443# CONFIG_NET_POLL_CONTROLLER is not set 497# CONFIG_NET_POLL_CONTROLLER is not set
444# CONFIG_ISDN is not set 498# CONFIG_ISDN is not set
499# CONFIG_PHONE is not set
445 500
446# 501#
447# Input device support 502# Input device support
@@ -449,6 +504,7 @@ CONFIG_SMC91X=y
449CONFIG_INPUT=y 504CONFIG_INPUT=y
450# CONFIG_INPUT_FF_MEMLESS is not set 505# CONFIG_INPUT_FF_MEMLESS is not set
451# CONFIG_INPUT_POLLDEV is not set 506# CONFIG_INPUT_POLLDEV is not set
507# CONFIG_INPUT_SPARSEKMAP is not set
452 508
453# 509#
454# Userland interfaces 510# Userland interfaces
@@ -510,6 +566,11 @@ CONFIG_UNIX98_PTYS=y
510# CONFIG_TCG_TPM is not set 566# CONFIG_TCG_TPM is not set
511# CONFIG_I2C is not set 567# CONFIG_I2C is not set
512# CONFIG_SPI is not set 568# CONFIG_SPI is not set
569
570#
571# PPS support
572#
573# CONFIG_PPS is not set
513CONFIG_ARCH_REQUIRE_GPIOLIB=y 574CONFIG_ARCH_REQUIRE_GPIOLIB=y
514CONFIG_GPIOLIB=y 575CONFIG_GPIOLIB=y
515# CONFIG_DEBUG_GPIO is not set 576# CONFIG_DEBUG_GPIO is not set
@@ -530,11 +591,14 @@ CONFIG_GPIOLIB=y
530# 591#
531# SPI GPIO expanders: 592# SPI GPIO expanders:
532# 593#
594
595#
596# AC97 GPIO expanders:
597#
533# CONFIG_W1 is not set 598# CONFIG_W1 is not set
534# CONFIG_POWER_SUPPLY is not set 599# CONFIG_POWER_SUPPLY is not set
535# CONFIG_HWMON is not set 600# CONFIG_HWMON is not set
536# CONFIG_THERMAL is not set 601# CONFIG_THERMAL is not set
537# CONFIG_THERMAL_HWMON is not set
538# CONFIG_WATCHDOG is not set 602# CONFIG_WATCHDOG is not set
539CONFIG_SSB_POSSIBLE=y 603CONFIG_SSB_POSSIBLE=y
540 604
@@ -555,22 +619,8 @@ CONFIG_SSB_POSSIBLE=y
555# CONFIG_MFD_T7L66XB is not set 619# CONFIG_MFD_T7L66XB is not set
556# CONFIG_MFD_TC6387XB is not set 620# CONFIG_MFD_TC6387XB is not set
557# CONFIG_MFD_TC6393XB is not set 621# CONFIG_MFD_TC6393XB is not set
558 622# CONFIG_REGULATOR is not set
559# 623# CONFIG_MEDIA_SUPPORT is not set
560# Multimedia devices
561#
562
563#
564# Multimedia core support
565#
566# CONFIG_VIDEO_DEV is not set
567# CONFIG_DVB_CORE is not set
568# CONFIG_VIDEO_MEDIA is not set
569
570#
571# Multimedia drivers
572#
573# CONFIG_DAB is not set
574 624
575# 625#
576# Graphics support 626# Graphics support
@@ -595,13 +645,17 @@ CONFIG_DUMMY_CONSOLE=y
595# CONFIG_USB_SUPPORT is not set 645# CONFIG_USB_SUPPORT is not set
596# CONFIG_MMC is not set 646# CONFIG_MMC is not set
597# CONFIG_MEMSTICK is not set 647# CONFIG_MEMSTICK is not set
598# CONFIG_ACCESSIBILITY is not set
599# CONFIG_NEW_LEDS is not set 648# CONFIG_NEW_LEDS is not set
649# CONFIG_ACCESSIBILITY is not set
600CONFIG_RTC_LIB=y 650CONFIG_RTC_LIB=y
601# CONFIG_RTC_CLASS is not set 651# CONFIG_RTC_CLASS is not set
602# CONFIG_DMADEVICES is not set 652# CONFIG_DMADEVICES is not set
603# CONFIG_REGULATOR is not set 653# CONFIG_AUXDISPLAY is not set
604# CONFIG_UIO is not set 654# CONFIG_UIO is not set
655
656#
657# TI VLYNQ
658#
605# CONFIG_STAGING is not set 659# CONFIG_STAGING is not set
606 660
607# 661#
@@ -613,10 +667,13 @@ CONFIG_RTC_LIB=y
613# CONFIG_REISERFS_FS is not set 667# CONFIG_REISERFS_FS is not set
614# CONFIG_JFS_FS is not set 668# CONFIG_JFS_FS is not set
615CONFIG_FS_POSIX_ACL=y 669CONFIG_FS_POSIX_ACL=y
616CONFIG_FILE_LOCKING=y
617# CONFIG_XFS_FS is not set 670# CONFIG_XFS_FS is not set
671# CONFIG_GFS2_FS is not set
618# CONFIG_OCFS2_FS is not set 672# CONFIG_OCFS2_FS is not set
619# CONFIG_BTRFS_FS is not set 673# CONFIG_BTRFS_FS is not set
674# CONFIG_NILFS2_FS is not set
675CONFIG_FILE_LOCKING=y
676CONFIG_FSNOTIFY=y
620CONFIG_DNOTIFY=y 677CONFIG_DNOTIFY=y
621CONFIG_INOTIFY=y 678CONFIG_INOTIFY=y
622CONFIG_INOTIFY_USER=y 679CONFIG_INOTIFY_USER=y
@@ -627,6 +684,11 @@ CONFIG_INOTIFY_USER=y
627CONFIG_GENERIC_ACL=y 684CONFIG_GENERIC_ACL=y
628 685
629# 686#
687# Caches
688#
689# CONFIG_FSCACHE is not set
690
691#
630# CD-ROM/DVD Filesystems 692# CD-ROM/DVD Filesystems
631# 693#
632# CONFIG_ISO9660_FS is not set 694# CONFIG_ISO9660_FS is not set
@@ -673,6 +735,7 @@ CONFIG_NFS_FS=y
673CONFIG_NFS_V3=y 735CONFIG_NFS_V3=y
674CONFIG_NFS_V3_ACL=y 736CONFIG_NFS_V3_ACL=y
675CONFIG_NFS_V4=y 737CONFIG_NFS_V4=y
738# CONFIG_NFS_V4_1 is not set
676CONFIG_ROOT_NFS=y 739CONFIG_ROOT_NFS=y
677# CONFIG_NFSD is not set 740# CONFIG_NFSD is not set
678CONFIG_LOCKD=y 741CONFIG_LOCKD=y
@@ -681,7 +744,6 @@ CONFIG_NFS_ACL_SUPPORT=y
681CONFIG_NFS_COMMON=y 744CONFIG_NFS_COMMON=y
682CONFIG_SUNRPC=y 745CONFIG_SUNRPC=y
683CONFIG_SUNRPC_GSS=y 746CONFIG_SUNRPC_GSS=y
684# CONFIG_SUNRPC_REGISTER_V4 is not set
685CONFIG_RPCSEC_GSS_KRB5=y 747CONFIG_RPCSEC_GSS_KRB5=y
686# CONFIG_RPCSEC_GSS_SPKM3 is not set 748# CONFIG_RPCSEC_GSS_SPKM3 is not set
687# CONFIG_SMB_FS is not set 749# CONFIG_SMB_FS is not set
@@ -706,6 +768,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
706CONFIG_ENABLE_MUST_CHECK=y 768CONFIG_ENABLE_MUST_CHECK=y
707CONFIG_FRAME_WARN=1024 769CONFIG_FRAME_WARN=1024
708CONFIG_MAGIC_SYSRQ=y 770CONFIG_MAGIC_SYSRQ=y
771# CONFIG_STRIP_ASM_SYMS is not set
709# CONFIG_UNUSED_SYMBOLS is not set 772# CONFIG_UNUSED_SYMBOLS is not set
710# CONFIG_DEBUG_FS is not set 773# CONFIG_DEBUG_FS is not set
711# CONFIG_HEADERS_CHECK is not set 774# CONFIG_HEADERS_CHECK is not set
@@ -714,11 +777,15 @@ CONFIG_DEBUG_KERNEL=y
714CONFIG_DETECT_SOFTLOCKUP=y 777CONFIG_DETECT_SOFTLOCKUP=y
715# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 778# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
716CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 779CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
780CONFIG_DETECT_HUNG_TASK=y
781# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
782CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
717CONFIG_SCHED_DEBUG=y 783CONFIG_SCHED_DEBUG=y
718# CONFIG_SCHEDSTATS is not set 784# CONFIG_SCHEDSTATS is not set
719# CONFIG_TIMER_STATS is not set 785# CONFIG_TIMER_STATS is not set
720# CONFIG_DEBUG_OBJECTS is not set 786# CONFIG_DEBUG_OBJECTS is not set
721# CONFIG_DEBUG_SLAB is not set 787# CONFIG_DEBUG_SLAB is not set
788# CONFIG_DEBUG_KMEMLEAK is not set
722# CONFIG_DEBUG_PREEMPT is not set 789# CONFIG_DEBUG_PREEMPT is not set
723# CONFIG_DEBUG_RT_MUTEXES is not set 790# CONFIG_DEBUG_RT_MUTEXES is not set
724# CONFIG_RT_MUTEX_TESTER is not set 791# CONFIG_RT_MUTEX_TESTER is not set
@@ -738,28 +805,33 @@ CONFIG_DEBUG_MEMORY_INIT=y
738# CONFIG_DEBUG_LIST is not set 805# CONFIG_DEBUG_LIST is not set
739# CONFIG_DEBUG_SG is not set 806# CONFIG_DEBUG_SG is not set
740# CONFIG_DEBUG_NOTIFIERS is not set 807# CONFIG_DEBUG_NOTIFIERS is not set
808# CONFIG_DEBUG_CREDENTIALS is not set
741# CONFIG_BOOT_PRINTK_DELAY is not set 809# CONFIG_BOOT_PRINTK_DELAY is not set
742# CONFIG_RCU_TORTURE_TEST is not set 810# CONFIG_RCU_TORTURE_TEST is not set
743# CONFIG_RCU_CPU_STALL_DETECTOR is not set 811# CONFIG_RCU_CPU_STALL_DETECTOR is not set
744# CONFIG_BACKTRACE_SELF_TEST is not set 812# CONFIG_BACKTRACE_SELF_TEST is not set
745# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 813# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
814# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
746# CONFIG_FAULT_INJECTION is not set 815# CONFIG_FAULT_INJECTION is not set
747# CONFIG_LATENCYTOP is not set 816# CONFIG_LATENCYTOP is not set
748# CONFIG_SYSCTL_SYSCALL_CHECK is not set 817# CONFIG_SYSCTL_SYSCALL_CHECK is not set
818# CONFIG_PAGE_POISONING is not set
749CONFIG_HAVE_FUNCTION_TRACER=y 819CONFIG_HAVE_FUNCTION_TRACER=y
750 820CONFIG_TRACING_SUPPORT=y
751# 821CONFIG_FTRACE=y
752# Tracers
753#
754# CONFIG_FUNCTION_TRACER is not set 822# CONFIG_FUNCTION_TRACER is not set
755# CONFIG_IRQSOFF_TRACER is not set 823# CONFIG_IRQSOFF_TRACER is not set
756# CONFIG_PREEMPT_TRACER is not set 824# CONFIG_PREEMPT_TRACER is not set
757# CONFIG_SCHED_TRACER is not set 825# CONFIG_SCHED_TRACER is not set
758# CONFIG_CONTEXT_SWITCH_TRACER is not set 826# CONFIG_ENABLE_DEFAULT_TRACERS is not set
759# CONFIG_BOOT_TRACER is not set 827# CONFIG_BOOT_TRACER is not set
760# CONFIG_TRACE_BRANCH_PROFILING is not set 828CONFIG_BRANCH_PROFILE_NONE=y
829# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
830# CONFIG_PROFILE_ALL_BRANCHES is not set
761# CONFIG_STACK_TRACER is not set 831# CONFIG_STACK_TRACER is not set
762# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 832# CONFIG_KMEMTRACE is not set
833# CONFIG_WORKQUEUE_TRACER is not set
834# CONFIG_BLK_DEV_IO_TRACE is not set
763# CONFIG_SAMPLES is not set 835# CONFIG_SAMPLES is not set
764CONFIG_HAVE_ARCH_KGDB=y 836CONFIG_HAVE_ARCH_KGDB=y
765# CONFIG_KGDB is not set 837# CONFIG_KGDB is not set
@@ -768,7 +840,9 @@ CONFIG_DEBUG_USER=y
768CONFIG_DEBUG_ERRORS=y 840CONFIG_DEBUG_ERRORS=y
769# CONFIG_DEBUG_STACK_USAGE is not set 841# CONFIG_DEBUG_STACK_USAGE is not set
770CONFIG_DEBUG_LL=y 842CONFIG_DEBUG_LL=y
843# CONFIG_EARLY_PRINTK is not set
771# CONFIG_DEBUG_ICEDCC is not set 844# CONFIG_DEBUG_ICEDCC is not set
845# CONFIG_OC_ETM is not set
772 846
773# 847#
774# Security options 848# Security options
@@ -776,13 +850,16 @@ CONFIG_DEBUG_LL=y
776# CONFIG_KEYS is not set 850# CONFIG_KEYS is not set
777# CONFIG_SECURITY is not set 851# CONFIG_SECURITY is not set
778# CONFIG_SECURITYFS is not set 852# CONFIG_SECURITYFS is not set
779# CONFIG_SECURITY_FILE_CAPABILITIES is not set 853# CONFIG_DEFAULT_SECURITY_SELINUX is not set
854# CONFIG_DEFAULT_SECURITY_SMACK is not set
855# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
856CONFIG_DEFAULT_SECURITY_DAC=y
857CONFIG_DEFAULT_SECURITY=""
780CONFIG_CRYPTO=y 858CONFIG_CRYPTO=y
781 859
782# 860#
783# Crypto core or helper 861# Crypto core or helper
784# 862#
785# CONFIG_CRYPTO_FIPS is not set
786CONFIG_CRYPTO_ALGAPI=y 863CONFIG_CRYPTO_ALGAPI=y
787CONFIG_CRYPTO_ALGAPI2=y 864CONFIG_CRYPTO_ALGAPI2=y
788CONFIG_CRYPTO_AEAD2=y 865CONFIG_CRYPTO_AEAD2=y
@@ -791,10 +868,12 @@ CONFIG_CRYPTO_BLKCIPHER2=y
791CONFIG_CRYPTO_HASH=y 868CONFIG_CRYPTO_HASH=y
792CONFIG_CRYPTO_HASH2=y 869CONFIG_CRYPTO_HASH2=y
793CONFIG_CRYPTO_RNG2=y 870CONFIG_CRYPTO_RNG2=y
871CONFIG_CRYPTO_PCOMP=y
794CONFIG_CRYPTO_MANAGER=y 872CONFIG_CRYPTO_MANAGER=y
795CONFIG_CRYPTO_MANAGER2=y 873CONFIG_CRYPTO_MANAGER2=y
796# CONFIG_CRYPTO_GF128MUL is not set 874# CONFIG_CRYPTO_GF128MUL is not set
797# CONFIG_CRYPTO_NULL is not set 875# CONFIG_CRYPTO_NULL is not set
876CONFIG_CRYPTO_WORKQUEUE=y
798# CONFIG_CRYPTO_CRYPTD is not set 877# CONFIG_CRYPTO_CRYPTD is not set
799# CONFIG_CRYPTO_AUTHENC is not set 878# CONFIG_CRYPTO_AUTHENC is not set
800# CONFIG_CRYPTO_TEST is not set 879# CONFIG_CRYPTO_TEST is not set
@@ -822,11 +901,13 @@ CONFIG_CRYPTO_CBC=y
822# 901#
823# CONFIG_CRYPTO_HMAC is not set 902# CONFIG_CRYPTO_HMAC is not set
824# CONFIG_CRYPTO_XCBC is not set 903# CONFIG_CRYPTO_XCBC is not set
904# CONFIG_CRYPTO_VMAC is not set
825 905
826# 906#
827# Digest 907# Digest
828# 908#
829# CONFIG_CRYPTO_CRC32C is not set 909# CONFIG_CRYPTO_CRC32C is not set
910# CONFIG_CRYPTO_GHASH is not set
830# CONFIG_CRYPTO_MD4 is not set 911# CONFIG_CRYPTO_MD4 is not set
831CONFIG_CRYPTO_MD5=y 912CONFIG_CRYPTO_MD5=y
832# CONFIG_CRYPTO_MICHAEL_MIC is not set 913# CONFIG_CRYPTO_MICHAEL_MIC is not set
@@ -863,6 +944,7 @@ CONFIG_CRYPTO_DES=y
863# Compression 944# Compression
864# 945#
865# CONFIG_CRYPTO_DEFLATE is not set 946# CONFIG_CRYPTO_DEFLATE is not set
947# CONFIG_CRYPTO_ZLIB is not set
866# CONFIG_CRYPTO_LZO is not set 948# CONFIG_CRYPTO_LZO is not set
867 949
868# 950#
@@ -870,6 +952,7 @@ CONFIG_CRYPTO_DES=y
870# 952#
871# CONFIG_CRYPTO_ANSI_CPRNG is not set 953# CONFIG_CRYPTO_ANSI_CPRNG is not set
872CONFIG_CRYPTO_HW=y 954CONFIG_CRYPTO_HW=y
955# CONFIG_BINARY_PRINTF is not set
873 956
874# 957#
875# Library routines 958# Library routines
@@ -884,7 +967,7 @@ CONFIG_CRC32=y
884# CONFIG_CRC7 is not set 967# CONFIG_CRC7 is not set
885# CONFIG_LIBCRC32C is not set 968# CONFIG_LIBCRC32C is not set
886CONFIG_ZLIB_INFLATE=y 969CONFIG_ZLIB_INFLATE=y
887CONFIG_PLIST=y
888CONFIG_HAS_IOMEM=y 970CONFIG_HAS_IOMEM=y
889CONFIG_HAS_IOPORT=y 971CONFIG_HAS_IOPORT=y
890CONFIG_HAS_DMA=y 972CONFIG_HAS_DMA=y
973CONFIG_NLATTR=y
diff --git a/arch/arm/configs/raumfeld_defconfig b/arch/arm/configs/raumfeld_defconfig
new file mode 100644
index 000000000000..acb1a8f30e31
--- /dev/null
+++ b/arch/arm/configs/raumfeld_defconfig
@@ -0,0 +1,1898 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.32-rc5
4# Sun Nov 1 21:57:32 2009
5#
6CONFIG_ARM=y
7CONFIG_HAVE_PWM=y
8CONFIG_SYS_SUPPORTS_APM_EMULATION=y
9CONFIG_GENERIC_GPIO=y
10CONFIG_GENERIC_TIME=y
11CONFIG_GENERIC_CLOCKEVENTS=y
12CONFIG_GENERIC_HARDIRQS=y
13CONFIG_STACKTRACE_SUPPORT=y
14CONFIG_HAVE_LATENCYTOP_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20CONFIG_ARCH_HAS_CPUFREQ=y
21CONFIG_GENERIC_HWEIGHT=y
22CONFIG_GENERIC_CALIBRATE_DELAY=y
23CONFIG_ARCH_MTD_XIP=y
24CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
25CONFIG_VECTORS_BASE=0xffff0000
26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27CONFIG_CONSTRUCTORS=y
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36# CONFIG_LOCALVERSION_AUTO is not set
37# CONFIG_SWAP is not set
38# CONFIG_SYSVIPC is not set
39# CONFIG_POSIX_MQUEUE is not set
40# CONFIG_BSD_PROCESS_ACCT is not set
41# CONFIG_TASKSTATS is not set
42# CONFIG_AUDIT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=17
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57# CONFIG_SYSFS_DEPRECATED_V2 is not set
58# CONFIG_RELAY is not set
59CONFIG_NAMESPACES=y
60# CONFIG_UTS_NS is not set
61# CONFIG_USER_NS is not set
62# CONFIG_PID_NS is not set
63# CONFIG_NET_NS is not set
64# CONFIG_BLK_DEV_INITRD is not set
65CONFIG_CC_OPTIMIZE_FOR_SIZE=y
66CONFIG_SYSCTL=y
67CONFIG_ANON_INODES=y
68# CONFIG_EMBEDDED is not set
69CONFIG_UID16=y
70CONFIG_SYSCTL_SYSCALL=y
71CONFIG_KALLSYMS=y
72# CONFIG_KALLSYMS_ALL is not set
73# CONFIG_KALLSYMS_EXTRA_PASS is not set
74CONFIG_HOTPLUG=y
75CONFIG_PRINTK=y
76CONFIG_BUG=y
77CONFIG_ELF_CORE=y
78CONFIG_BASE_FULL=y
79CONFIG_FUTEX=y
80CONFIG_EPOLL=y
81CONFIG_SIGNALFD=y
82CONFIG_TIMERFD=y
83CONFIG_EVENTFD=y
84CONFIG_SHMEM=y
85CONFIG_AIO=y
86
87#
88# Kernel Performance Events And Counters
89#
90CONFIG_VM_EVENT_COUNTERS=y
91CONFIG_SLUB_DEBUG=y
92CONFIG_COMPAT_BRK=y
93# CONFIG_SLAB is not set
94CONFIG_SLUB=y
95# CONFIG_SLOB is not set
96# CONFIG_PROFILING is not set
97CONFIG_HAVE_OPROFILE=y
98# CONFIG_KPROBES is not set
99CONFIG_HAVE_KPROBES=y
100CONFIG_HAVE_KRETPROBES=y
101CONFIG_HAVE_CLK=y
102
103#
104# GCOV-based kernel profiling
105#
106CONFIG_SLOW_WORK=y
107CONFIG_HAVE_GENERIC_DMA_COHERENT=y
108CONFIG_SLABINFO=y
109CONFIG_RT_MUTEXES=y
110CONFIG_BASE_SMALL=0
111CONFIG_MODULES=y
112# CONFIG_MODULE_FORCE_LOAD is not set
113CONFIG_MODULE_UNLOAD=y
114# CONFIG_MODULE_FORCE_UNLOAD is not set
115# CONFIG_MODVERSIONS is not set
116# CONFIG_MODULE_SRCVERSION_ALL is not set
117CONFIG_BLOCK=y
118# CONFIG_LBDAF is not set
119# CONFIG_BLK_DEV_BSG is not set
120# CONFIG_BLK_DEV_INTEGRITY is not set
121
122#
123# IO Schedulers
124#
125CONFIG_IOSCHED_NOOP=y
126CONFIG_IOSCHED_AS=y
127CONFIG_IOSCHED_DEADLINE=y
128CONFIG_IOSCHED_CFQ=y
129# CONFIG_DEFAULT_AS is not set
130# CONFIG_DEFAULT_DEADLINE is not set
131CONFIG_DEFAULT_CFQ=y
132# CONFIG_DEFAULT_NOOP is not set
133CONFIG_DEFAULT_IOSCHED="cfq"
134CONFIG_FREEZER=y
135
136#
137# System Type
138#
139CONFIG_MMU=y
140# CONFIG_ARCH_AAEC2000 is not set
141# CONFIG_ARCH_INTEGRATOR is not set
142# CONFIG_ARCH_REALVIEW is not set
143# CONFIG_ARCH_VERSATILE is not set
144# CONFIG_ARCH_AT91 is not set
145# CONFIG_ARCH_CLPS711X is not set
146# CONFIG_ARCH_GEMINI is not set
147# CONFIG_ARCH_EBSA110 is not set
148# CONFIG_ARCH_EP93XX is not set
149# CONFIG_ARCH_FOOTBRIDGE is not set
150# CONFIG_ARCH_MXC is not set
151# CONFIG_ARCH_STMP3XXX is not set
152# CONFIG_ARCH_NETX is not set
153# CONFIG_ARCH_H720X is not set
154# CONFIG_ARCH_NOMADIK is not set
155# CONFIG_ARCH_IOP13XX is not set
156# CONFIG_ARCH_IOP32X is not set
157# CONFIG_ARCH_IOP33X is not set
158# CONFIG_ARCH_IXP23XX is not set
159# CONFIG_ARCH_IXP2000 is not set
160# CONFIG_ARCH_IXP4XX is not set
161# CONFIG_ARCH_L7200 is not set
162# CONFIG_ARCH_KIRKWOOD is not set
163# CONFIG_ARCH_LOKI is not set
164# CONFIG_ARCH_MV78XX0 is not set
165# CONFIG_ARCH_ORION5X is not set
166# CONFIG_ARCH_MMP is not set
167# CONFIG_ARCH_KS8695 is not set
168# CONFIG_ARCH_NS9XXX is not set
169# CONFIG_ARCH_W90X900 is not set
170# CONFIG_ARCH_PNX4008 is not set
171CONFIG_ARCH_PXA=y
172# CONFIG_ARCH_MSM is not set
173# CONFIG_ARCH_RPC is not set
174# CONFIG_ARCH_SA1100 is not set
175# CONFIG_ARCH_S3C2410 is not set
176# CONFIG_ARCH_S3C64XX is not set
177# CONFIG_ARCH_S5PC1XX is not set
178# CONFIG_ARCH_SHARK is not set
179# CONFIG_ARCH_LH7A40X is not set
180# CONFIG_ARCH_U300 is not set
181# CONFIG_ARCH_DAVINCI is not set
182# CONFIG_ARCH_OMAP is not set
183# CONFIG_ARCH_BCMRING is not set
184
185#
186# Intel PXA2xx/PXA3xx Implementations
187#
188
189#
190# Supported PXA3xx Processor Variants
191#
192CONFIG_CPU_PXA300=y
193# CONFIG_CPU_PXA310 is not set
194CONFIG_CPU_PXA320=y
195# CONFIG_CPU_PXA930 is not set
196# CONFIG_CPU_PXA935 is not set
197# CONFIG_CPU_PXA950 is not set
198
199#
200# Intel/Marvell Dev Platforms (sorted by hardware release time)
201#
202# CONFIG_ARCH_LUBBOCK is not set
203# CONFIG_MACH_MAINSTONE is not set
204# CONFIG_MACH_ZYLONITE is not set
205# CONFIG_MACH_LITTLETON is not set
206# CONFIG_MACH_TAVOREVB is not set
207# CONFIG_MACH_SAAR is not set
208
209#
210# Third Party Dev Platforms (sorted by vendor name)
211#
212# CONFIG_ARCH_PXA_IDP is not set
213# CONFIG_ARCH_VIPER is not set
214# CONFIG_MACH_BALLOON3 is not set
215# CONFIG_MACH_CSB726 is not set
216# CONFIG_MACH_ARMCORE is not set
217# CONFIG_MACH_EM_X270 is not set
218# CONFIG_MACH_EXEDA is not set
219# CONFIG_MACH_CM_X300 is not set
220# CONFIG_ARCH_GUMSTIX is not set
221# CONFIG_MACH_INTELMOTE2 is not set
222# CONFIG_MACH_STARGATE2 is not set
223# CONFIG_MACH_XCEP is not set
224# CONFIG_TRIZEPS_PXA is not set
225# CONFIG_MACH_LOGICPD_PXA270 is not set
226# CONFIG_MACH_PCM027 is not set
227# CONFIG_MACH_COLIBRI is not set
228# CONFIG_MACH_COLIBRI300 is not set
229# CONFIG_MACH_COLIBRI320 is not set
230
231#
232# End-user Products (sorted by vendor name)
233#
234# CONFIG_MACH_H4700 is not set
235# CONFIG_MACH_H5000 is not set
236# CONFIG_MACH_HIMALAYA is not set
237# CONFIG_MACH_MAGICIAN is not set
238# CONFIG_MACH_MIOA701 is not set
239# CONFIG_PXA_EZX is not set
240# CONFIG_MACH_MP900C is not set
241# CONFIG_ARCH_PXA_PALM is not set
242CONFIG_MACH_RAUMFELD_RC=y
243CONFIG_MACH_RAUMFELD_CONNECTOR=y
244CONFIG_MACH_RAUMFELD_PROTO=y
245CONFIG_MACH_RAUMFELD_SPEAKER=y
246# CONFIG_PXA_SHARPSL is not set
247# CONFIG_ARCH_PXA_ESERIES is not set
248CONFIG_PXA3xx=y
249CONFIG_PXA_SSP=y
250CONFIG_PLAT_PXA=y
251
252#
253# Processor Type
254#
255CONFIG_CPU_32=y
256CONFIG_CPU_XSC3=y
257CONFIG_CPU_32v5=y
258CONFIG_CPU_ABRT_EV5T=y
259CONFIG_CPU_PABRT_LEGACY=y
260CONFIG_CPU_CACHE_VIVT=y
261CONFIG_CPU_TLB_V4WBI=y
262CONFIG_CPU_CP15=y
263CONFIG_CPU_CP15_MMU=y
264CONFIG_IO_36=y
265
266#
267# Processor Features
268#
269CONFIG_ARM_THUMB=y
270# CONFIG_CPU_DCACHE_DISABLE is not set
271# CONFIG_CPU_BPREDICT_DISABLE is not set
272CONFIG_OUTER_CACHE=y
273CONFIG_CACHE_XSC3L2=y
274CONFIG_ARM_L1_CACHE_SHIFT=5
275CONFIG_IWMMXT=y
276CONFIG_COMMON_CLKDEV=y
277
278#
279# Bus support
280#
281# CONFIG_PCI_SYSCALL is not set
282# CONFIG_ARCH_SUPPORTS_MSI is not set
283# CONFIG_PCCARD is not set
284
285#
286# Kernel Features
287#
288CONFIG_TICK_ONESHOT=y
289CONFIG_NO_HZ=y
290# CONFIG_HIGH_RES_TIMERS is not set
291CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
292CONFIG_VMSPLIT_3G=y
293# CONFIG_VMSPLIT_2G is not set
294# CONFIG_VMSPLIT_1G is not set
295CONFIG_PAGE_OFFSET=0xC0000000
296CONFIG_PREEMPT_NONE=y
297# CONFIG_PREEMPT_VOLUNTARY is not set
298# CONFIG_PREEMPT is not set
299CONFIG_HZ=100
300CONFIG_AEABI=y
301# CONFIG_OABI_COMPAT is not set
302# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
303# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
304# CONFIG_HIGHMEM is not set
305CONFIG_SELECT_MEMORY_MODEL=y
306CONFIG_FLATMEM_MANUAL=y
307# CONFIG_DISCONTIGMEM_MANUAL is not set
308# CONFIG_SPARSEMEM_MANUAL is not set
309CONFIG_FLATMEM=y
310CONFIG_FLAT_NODE_MEM_MAP=y
311CONFIG_PAGEFLAGS_EXTENDED=y
312CONFIG_SPLIT_PTLOCK_CPUS=4096
313# CONFIG_PHYS_ADDR_T_64BIT is not set
314CONFIG_ZONE_DMA_FLAG=0
315CONFIG_VIRT_TO_BUS=y
316CONFIG_HAVE_MLOCK=y
317CONFIG_HAVE_MLOCKED_PAGE_BIT=y
318# CONFIG_KSM is not set
319CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
320CONFIG_ALIGNMENT_TRAP=y
321# CONFIG_UACCESS_WITH_MEMCPY is not set
322
323#
324# Boot options
325#
326CONFIG_ZBOOT_ROM_TEXT=0
327CONFIG_ZBOOT_ROM_BSS=0
328CONFIG_CMDLINE="console=ttyS0,115200 rw"
329# CONFIG_XIP_KERNEL is not set
330# CONFIG_KEXEC is not set
331
332#
333# CPU Power Management
334#
335CONFIG_CPU_FREQ=y
336CONFIG_CPU_FREQ_TABLE=y
337# CONFIG_CPU_FREQ_DEBUG is not set
338CONFIG_CPU_FREQ_STAT=y
339# CONFIG_CPU_FREQ_STAT_DETAILS is not set
340CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
341# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
342# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
343# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
344# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
345CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
346# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
347# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
348# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
349# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
350CONFIG_CPU_IDLE=y
351CONFIG_CPU_IDLE_GOV_LADDER=y
352CONFIG_CPU_IDLE_GOV_MENU=y
353
354#
355# Floating point emulation
356#
357
358#
359# At least one emulation must be selected
360#
361
362#
363# Userspace binary formats
364#
365CONFIG_BINFMT_ELF=y
366# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
367CONFIG_HAVE_AOUT=y
368# CONFIG_BINFMT_AOUT is not set
369# CONFIG_BINFMT_MISC is not set
370
371#
372# Power management options
373#
374CONFIG_PM=y
375# CONFIG_PM_DEBUG is not set
376CONFIG_PM_SLEEP=y
377CONFIG_SUSPEND=y
378CONFIG_SUSPEND_FREEZER=y
379CONFIG_APM_EMULATION=y
380# CONFIG_PM_RUNTIME is not set
381CONFIG_ARCH_SUSPEND_POSSIBLE=y
382CONFIG_NET=y
383
384#
385# Networking options
386#
387CONFIG_PACKET=y
388CONFIG_PACKET_MMAP=y
389CONFIG_UNIX=y
390CONFIG_XFRM=y
391# CONFIG_XFRM_USER is not set
392# CONFIG_XFRM_SUB_POLICY is not set
393# CONFIG_XFRM_MIGRATE is not set
394# CONFIG_XFRM_STATISTICS is not set
395# CONFIG_NET_KEY is not set
396CONFIG_INET=y
397CONFIG_IP_MULTICAST=y
398# CONFIG_IP_ADVANCED_ROUTER is not set
399CONFIG_IP_FIB_HASH=y
400CONFIG_IP_PNP=y
401# CONFIG_IP_PNP_DHCP is not set
402# CONFIG_IP_PNP_BOOTP is not set
403# CONFIG_IP_PNP_RARP is not set
404# CONFIG_NET_IPIP is not set
405# CONFIG_NET_IPGRE is not set
406# CONFIG_IP_MROUTE is not set
407# CONFIG_ARPD is not set
408CONFIG_SYN_COOKIES=y
409# CONFIG_INET_AH is not set
410# CONFIG_INET_ESP is not set
411# CONFIG_INET_IPCOMP is not set
412# CONFIG_INET_XFRM_TUNNEL is not set
413CONFIG_INET_TUNNEL=y
414CONFIG_INET_XFRM_MODE_TRANSPORT=y
415CONFIG_INET_XFRM_MODE_TUNNEL=y
416CONFIG_INET_XFRM_MODE_BEET=y
417# CONFIG_INET_LRO is not set
418CONFIG_INET_DIAG=y
419CONFIG_INET_TCP_DIAG=y
420# CONFIG_TCP_CONG_ADVANCED is not set
421CONFIG_TCP_CONG_CUBIC=y
422CONFIG_DEFAULT_TCP_CONG="cubic"
423# CONFIG_TCP_MD5SIG is not set
424CONFIG_IPV6=y
425# CONFIG_IPV6_PRIVACY is not set
426# CONFIG_IPV6_ROUTER_PREF is not set
427# CONFIG_IPV6_OPTIMISTIC_DAD is not set
428# CONFIG_INET6_AH is not set
429# CONFIG_INET6_ESP is not set
430# CONFIG_INET6_IPCOMP is not set
431# CONFIG_IPV6_MIP6 is not set
432# CONFIG_INET6_XFRM_TUNNEL is not set
433# CONFIG_INET6_TUNNEL is not set
434CONFIG_INET6_XFRM_MODE_TRANSPORT=y
435CONFIG_INET6_XFRM_MODE_TUNNEL=y
436CONFIG_INET6_XFRM_MODE_BEET=y
437# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
438CONFIG_IPV6_SIT=y
439CONFIG_IPV6_NDISC_NODETYPE=y
440# CONFIG_IPV6_TUNNEL is not set
441# CONFIG_IPV6_MULTIPLE_TABLES is not set
442# CONFIG_IPV6_MROUTE is not set
443# CONFIG_NETWORK_SECMARK is not set
444# CONFIG_NETFILTER is not set
445# CONFIG_IP_DCCP is not set
446# CONFIG_IP_SCTP is not set
447# CONFIG_RDS is not set
448# CONFIG_TIPC is not set
449# CONFIG_ATM is not set
450# CONFIG_BRIDGE is not set
451# CONFIG_NET_DSA is not set
452# CONFIG_VLAN_8021Q is not set
453# CONFIG_DECNET is not set
454# CONFIG_LLC2 is not set
455# CONFIG_IPX is not set
456# CONFIG_ATALK is not set
457# CONFIG_X25 is not set
458# CONFIG_LAPB is not set
459# CONFIG_ECONET is not set
460# CONFIG_WAN_ROUTER is not set
461# CONFIG_PHONET is not set
462# CONFIG_IEEE802154 is not set
463# CONFIG_NET_SCHED is not set
464# CONFIG_DCB is not set
465
466#
467# Network testing
468#
469# CONFIG_NET_PKTGEN is not set
470# CONFIG_HAMRADIO is not set
471# CONFIG_CAN is not set
472# CONFIG_IRDA is not set
473# CONFIG_BT is not set
474# CONFIG_AF_RXRPC is not set
475CONFIG_WIRELESS=y
476CONFIG_CFG80211=y
477# CONFIG_NL80211_TESTMODE is not set
478# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
479CONFIG_CFG80211_REG_DEBUG=y
480CONFIG_CFG80211_DEFAULT_PS=y
481CONFIG_CFG80211_DEFAULT_PS_VALUE=1
482CONFIG_WIRELESS_OLD_REGULATORY=y
483CONFIG_WIRELESS_EXT=y
484CONFIG_WIRELESS_EXT_SYSFS=y
485CONFIG_LIB80211=y
486# CONFIG_LIB80211_DEBUG is not set
487CONFIG_MAC80211=y
488CONFIG_MAC80211_RC_MINSTREL=y
489# CONFIG_MAC80211_RC_DEFAULT_PID is not set
490CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
491CONFIG_MAC80211_RC_DEFAULT="minstrel"
492# CONFIG_MAC80211_MESH is not set
493# CONFIG_MAC80211_LEDS is not set
494# CONFIG_MAC80211_DEBUG_MENU is not set
495# CONFIG_WIMAX is not set
496# CONFIG_RFKILL is not set
497# CONFIG_NET_9P is not set
498
499#
500# Device Drivers
501#
502
503#
504# Generic Driver Options
505#
506CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
507# CONFIG_DEVTMPFS is not set
508CONFIG_STANDALONE=y
509CONFIG_PREVENT_FIRMWARE_BUILD=y
510CONFIG_FW_LOADER=y
511CONFIG_FIRMWARE_IN_KERNEL=y
512CONFIG_EXTRA_FIRMWARE=""
513# CONFIG_DEBUG_DRIVER is not set
514# CONFIG_DEBUG_DEVRES is not set
515# CONFIG_SYS_HYPERVISOR is not set
516# CONFIG_CONNECTOR is not set
517CONFIG_MTD=y
518# CONFIG_MTD_DEBUG is not set
519# CONFIG_MTD_TESTS is not set
520CONFIG_MTD_CONCAT=y
521CONFIG_MTD_PARTITIONS=y
522# CONFIG_MTD_REDBOOT_PARTS is not set
523# CONFIG_MTD_CMDLINE_PARTS is not set
524# CONFIG_MTD_AFS_PARTS is not set
525# CONFIG_MTD_AR7_PARTS is not set
526
527#
528# User Modules And Translation Layers
529#
530CONFIG_MTD_CHAR=y
531CONFIG_MTD_BLKDEVS=y
532CONFIG_MTD_BLOCK=y
533# CONFIG_FTL is not set
534CONFIG_NFTL=y
535CONFIG_NFTL_RW=y
536# CONFIG_INFTL is not set
537# CONFIG_RFD_FTL is not set
538# CONFIG_SSFDC is not set
539# CONFIG_MTD_OOPS is not set
540
541#
542# RAM/ROM/Flash chip drivers
543#
544# CONFIG_MTD_CFI is not set
545# CONFIG_MTD_JEDECPROBE is not set
546CONFIG_MTD_MAP_BANK_WIDTH_1=y
547CONFIG_MTD_MAP_BANK_WIDTH_2=y
548CONFIG_MTD_MAP_BANK_WIDTH_4=y
549# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
550# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
551# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
552CONFIG_MTD_CFI_I1=y
553CONFIG_MTD_CFI_I2=y
554# CONFIG_MTD_CFI_I4 is not set
555# CONFIG_MTD_CFI_I8 is not set
556# CONFIG_MTD_RAM is not set
557# CONFIG_MTD_ROM is not set
558# CONFIG_MTD_ABSENT is not set
559
560#
561# Mapping drivers for chip access
562#
563# CONFIG_MTD_COMPLEX_MAPPINGS is not set
564# CONFIG_MTD_PLATRAM is not set
565
566#
567# Self-contained MTD device drivers
568#
569# CONFIG_MTD_DATAFLASH is not set
570# CONFIG_MTD_M25P80 is not set
571# CONFIG_MTD_SST25L is not set
572# CONFIG_MTD_SLRAM is not set
573# CONFIG_MTD_PHRAM is not set
574# CONFIG_MTD_MTDRAM is not set
575CONFIG_MTD_BLOCK2MTD=y
576
577#
578# Disk-On-Chip Device Drivers
579#
580# CONFIG_MTD_DOC2000 is not set
581# CONFIG_MTD_DOC2001 is not set
582# CONFIG_MTD_DOC2001PLUS is not set
583CONFIG_MTD_NAND=y
584# CONFIG_MTD_NAND_VERIFY_WRITE is not set
585# CONFIG_MTD_NAND_ECC_SMC is not set
586# CONFIG_MTD_NAND_MUSEUM_IDS is not set
587# CONFIG_MTD_NAND_H1900 is not set
588# CONFIG_MTD_NAND_GPIO is not set
589CONFIG_MTD_NAND_IDS=y
590# CONFIG_MTD_NAND_DISKONCHIP is not set
591# CONFIG_MTD_NAND_SHARPSL is not set
592CONFIG_MTD_NAND_PXA3xx=y
593# CONFIG_MTD_NAND_PXA3xx_BUILTIN is not set
594# CONFIG_MTD_NAND_NANDSIM is not set
595# CONFIG_MTD_NAND_PLATFORM is not set
596# CONFIG_MTD_ALAUDA is not set
597# CONFIG_MTD_ONENAND is not set
598
599#
600# LPDDR flash memory drivers
601#
602# CONFIG_MTD_LPDDR is not set
603
604#
605# UBI - Unsorted block images
606#
607CONFIG_MTD_UBI=y
608CONFIG_MTD_UBI_WL_THRESHOLD=4096
609CONFIG_MTD_UBI_BEB_RESERVE=1
610# CONFIG_MTD_UBI_GLUEBI is not set
611
612#
613# UBI debugging options
614#
615# CONFIG_MTD_UBI_DEBUG is not set
616# CONFIG_PARPORT is not set
617CONFIG_BLK_DEV=y
618# CONFIG_BLK_DEV_COW_COMMON is not set
619CONFIG_BLK_DEV_LOOP=y
620# CONFIG_BLK_DEV_CRYPTOLOOP is not set
621# CONFIG_BLK_DEV_NBD is not set
622# CONFIG_BLK_DEV_UB is not set
623# CONFIG_BLK_DEV_RAM is not set
624# CONFIG_CDROM_PKTCDVD is not set
625# CONFIG_ATA_OVER_ETH is not set
626# CONFIG_MG_DISK is not set
627CONFIG_MISC_DEVICES=y
628# CONFIG_ICS932S401 is not set
629# CONFIG_ENCLOSURE_SERVICES is not set
630CONFIG_ISL29003=y
631CONFIG_TI_DAC7512=y
632# CONFIG_C2PORT is not set
633
634#
635# EEPROM support
636#
637# CONFIG_EEPROM_AT24 is not set
638# CONFIG_EEPROM_AT25 is not set
639# CONFIG_EEPROM_LEGACY is not set
640# CONFIG_EEPROM_MAX6875 is not set
641# CONFIG_EEPROM_93CX6 is not set
642CONFIG_HAVE_IDE=y
643# CONFIG_IDE is not set
644
645#
646# SCSI device support
647#
648# CONFIG_RAID_ATTRS is not set
649CONFIG_SCSI=y
650CONFIG_SCSI_DMA=y
651# CONFIG_SCSI_TGT is not set
652# CONFIG_SCSI_NETLINK is not set
653CONFIG_SCSI_PROC_FS=y
654
655#
656# SCSI support type (disk, tape, CD-ROM)
657#
658CONFIG_BLK_DEV_SD=y
659# CONFIG_CHR_DEV_ST is not set
660# CONFIG_CHR_DEV_OSST is not set
661# CONFIG_BLK_DEV_SR is not set
662CONFIG_CHR_DEV_SG=y
663# CONFIG_CHR_DEV_SCH is not set
664# CONFIG_SCSI_MULTI_LUN is not set
665# CONFIG_SCSI_CONSTANTS is not set
666# CONFIG_SCSI_LOGGING is not set
667# CONFIG_SCSI_SCAN_ASYNC is not set
668CONFIG_SCSI_WAIT_SCAN=m
669
670#
671# SCSI Transports
672#
673# CONFIG_SCSI_SPI_ATTRS is not set
674# CONFIG_SCSI_FC_ATTRS is not set
675# CONFIG_SCSI_ISCSI_ATTRS is not set
676# CONFIG_SCSI_SAS_LIBSAS is not set
677# CONFIG_SCSI_SRP_ATTRS is not set
678CONFIG_SCSI_LOWLEVEL=y
679# CONFIG_ISCSI_TCP is not set
680# CONFIG_LIBFC is not set
681# CONFIG_LIBFCOE is not set
682# CONFIG_SCSI_DEBUG is not set
683# CONFIG_SCSI_DH is not set
684# CONFIG_SCSI_OSD_INITIATOR is not set
685# CONFIG_ATA is not set
686# CONFIG_MD is not set
687CONFIG_NETDEVICES=y
688# CONFIG_DUMMY is not set
689# CONFIG_BONDING is not set
690# CONFIG_MACVLAN is not set
691# CONFIG_EQUALIZER is not set
692# CONFIG_TUN is not set
693# CONFIG_VETH is not set
694CONFIG_PHYLIB=y
695
696#
697# MII PHY device drivers
698#
699# CONFIG_MARVELL_PHY is not set
700# CONFIG_DAVICOM_PHY is not set
701# CONFIG_QSEMI_PHY is not set
702# CONFIG_LXT_PHY is not set
703# CONFIG_CICADA_PHY is not set
704# CONFIG_VITESSE_PHY is not set
705# CONFIG_SMSC_PHY is not set
706# CONFIG_BROADCOM_PHY is not set
707# CONFIG_ICPLUS_PHY is not set
708# CONFIG_REALTEK_PHY is not set
709# CONFIG_NATIONAL_PHY is not set
710# CONFIG_STE10XP is not set
711# CONFIG_LSI_ET1011C_PHY is not set
712# CONFIG_FIXED_PHY is not set
713# CONFIG_MDIO_BITBANG is not set
714CONFIG_NET_ETHERNET=y
715CONFIG_MII=y
716# CONFIG_AX88796 is not set
717# CONFIG_SMC91X is not set
718# CONFIG_DM9000 is not set
719# CONFIG_ENC28J60 is not set
720# CONFIG_ETHOC is not set
721# CONFIG_SMC911X is not set
722CONFIG_SMSC911X=y
723# CONFIG_DNET is not set
724# CONFIG_IBM_NEW_EMAC_ZMII is not set
725# CONFIG_IBM_NEW_EMAC_RGMII is not set
726# CONFIG_IBM_NEW_EMAC_TAH is not set
727# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
728# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
729# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
730# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
731# CONFIG_B44 is not set
732# CONFIG_KS8842 is not set
733# CONFIG_KS8851 is not set
734# CONFIG_KS8851_MLL is not set
735# CONFIG_NETDEV_1000 is not set
736# CONFIG_NETDEV_10000 is not set
737CONFIG_WLAN=y
738# CONFIG_WLAN_PRE80211 is not set
739CONFIG_WLAN_80211=y
740CONFIG_LIBERTAS=y
741# CONFIG_LIBERTAS_USB is not set
742CONFIG_LIBERTAS_SDIO=m
743# CONFIG_LIBERTAS_SPI is not set
744# CONFIG_LIBERTAS_DEBUG is not set
745# CONFIG_LIBERTAS_THINFIRM is not set
746# CONFIG_AT76C50X_USB is not set
747# CONFIG_USB_ZD1201 is not set
748# CONFIG_USB_NET_RNDIS_WLAN is not set
749# CONFIG_RTL8187 is not set
750# CONFIG_MAC80211_HWSIM is not set
751# CONFIG_P54_COMMON is not set
752# CONFIG_ATH_COMMON is not set
753# CONFIG_HOSTAP is not set
754# CONFIG_B43 is not set
755# CONFIG_B43LEGACY is not set
756# CONFIG_ZD1211RW is not set
757# CONFIG_RT2X00 is not set
758# CONFIG_WL12XX is not set
759# CONFIG_IWM is not set
760
761#
762# Enable WiMAX (Networking options) to see the WiMAX drivers
763#
764
765#
766# USB Network Adapters
767#
768# CONFIG_USB_CATC is not set
769# CONFIG_USB_KAWETH is not set
770# CONFIG_USB_PEGASUS is not set
771# CONFIG_USB_RTL8150 is not set
772CONFIG_USB_USBNET=y
773# CONFIG_USB_NET_AX8817X is not set
774CONFIG_USB_NET_CDCETHER=y
775# CONFIG_USB_NET_CDC_EEM is not set
776# CONFIG_USB_NET_DM9601 is not set
777# CONFIG_USB_NET_SMSC95XX is not set
778# CONFIG_USB_NET_GL620A is not set
779# CONFIG_USB_NET_NET1080 is not set
780# CONFIG_USB_NET_PLUSB is not set
781CONFIG_USB_NET_MCS7830=y
782# CONFIG_USB_NET_RNDIS_HOST is not set
783# CONFIG_USB_NET_CDC_SUBSET is not set
784# CONFIG_USB_NET_ZAURUS is not set
785# CONFIG_USB_NET_INT51X1 is not set
786# CONFIG_WAN is not set
787# CONFIG_PPP is not set
788# CONFIG_SLIP is not set
789# CONFIG_NETCONSOLE is not set
790# CONFIG_NETPOLL is not set
791# CONFIG_NET_POLL_CONTROLLER is not set
792# CONFIG_ISDN is not set
793# CONFIG_PHONE is not set
794
795#
796# Input device support
797#
798CONFIG_INPUT=y
799# CONFIG_INPUT_FF_MEMLESS is not set
800CONFIG_INPUT_POLLDEV=y
801
802#
803# Userland interfaces
804#
805CONFIG_INPUT_MOUSEDEV=y
806CONFIG_INPUT_MOUSEDEV_PSAUX=y
807CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
808CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
809# CONFIG_INPUT_JOYDEV is not set
810CONFIG_INPUT_EVDEV=y
811# CONFIG_INPUT_EVBUG is not set
812
813#
814# Input Device Drivers
815#
816CONFIG_INPUT_KEYBOARD=y
817# CONFIG_KEYBOARD_ADP5588 is not set
818CONFIG_KEYBOARD_ATKBD=y
819# CONFIG_QT2160 is not set
820# CONFIG_KEYBOARD_LKKBD is not set
821CONFIG_KEYBOARD_GPIO=y
822# CONFIG_KEYBOARD_MATRIX is not set
823# CONFIG_KEYBOARD_LM8323 is not set
824# CONFIG_KEYBOARD_MAX7359 is not set
825# CONFIG_KEYBOARD_NEWTON is not set
826# CONFIG_KEYBOARD_OPENCORES is not set
827# CONFIG_KEYBOARD_PXA27x is not set
828# CONFIG_KEYBOARD_STOWAWAY is not set
829# CONFIG_KEYBOARD_SUNKBD is not set
830# CONFIG_KEYBOARD_XTKBD is not set
831# CONFIG_INPUT_MOUSE is not set
832# CONFIG_INPUT_JOYSTICK is not set
833# CONFIG_INPUT_TABLET is not set
834CONFIG_INPUT_TOUCHSCREEN=y
835# CONFIG_TOUCHSCREEN_ADS7846 is not set
836# CONFIG_TOUCHSCREEN_AD7877 is not set
837# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
838# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
839# CONFIG_TOUCHSCREEN_AD7879 is not set
840CONFIG_TOUCHSCREEN_EETI=m
841# CONFIG_TOUCHSCREEN_FUJITSU is not set
842# CONFIG_TOUCHSCREEN_GUNZE is not set
843# CONFIG_TOUCHSCREEN_ELO is not set
844# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
845# CONFIG_TOUCHSCREEN_MCS5000 is not set
846# CONFIG_TOUCHSCREEN_MTOUCH is not set
847# CONFIG_TOUCHSCREEN_INEXIO is not set
848# CONFIG_TOUCHSCREEN_MK712 is not set
849# CONFIG_TOUCHSCREEN_PENMOUNT is not set
850# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
851# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
852# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
853# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
854# CONFIG_TOUCHSCREEN_TSC2007 is not set
855# CONFIG_TOUCHSCREEN_W90X900 is not set
856CONFIG_INPUT_MISC=y
857# CONFIG_INPUT_ATI_REMOTE is not set
858# CONFIG_INPUT_ATI_REMOTE2 is not set
859# CONFIG_INPUT_KEYSPAN_REMOTE is not set
860# CONFIG_INPUT_POWERMATE is not set
861# CONFIG_INPUT_YEALINK is not set
862# CONFIG_INPUT_CM109 is not set
863# CONFIG_INPUT_UINPUT is not set
864CONFIG_INPUT_GPIO_ROTARY_ENCODER=y
865
866#
867# Hardware I/O ports
868#
869CONFIG_SERIO=y
870CONFIG_SERIO_SERPORT=y
871CONFIG_SERIO_LIBPS2=y
872# CONFIG_SERIO_RAW is not set
873# CONFIG_GAMEPORT is not set
874
875#
876# Character devices
877#
878CONFIG_VT=y
879CONFIG_CONSOLE_TRANSLATIONS=y
880CONFIG_VT_CONSOLE=y
881CONFIG_HW_CONSOLE=y
882# CONFIG_VT_HW_CONSOLE_BINDING is not set
883CONFIG_DEVKMEM=y
884# CONFIG_SERIAL_NONSTANDARD is not set
885
886#
887# Serial drivers
888#
889# CONFIG_SERIAL_8250 is not set
890
891#
892# Non-8250 serial port support
893#
894# CONFIG_SERIAL_MAX3100 is not set
895CONFIG_SERIAL_PXA=y
896CONFIG_SERIAL_PXA_CONSOLE=y
897CONFIG_SERIAL_CORE=y
898CONFIG_SERIAL_CORE_CONSOLE=y
899CONFIG_UNIX98_PTYS=y
900# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
901CONFIG_LEGACY_PTYS=y
902CONFIG_LEGACY_PTY_COUNT=256
903# CONFIG_IPMI_HANDLER is not set
904CONFIG_HW_RANDOM=y
905# CONFIG_HW_RANDOM_TIMERIOMEM is not set
906# CONFIG_R3964 is not set
907# CONFIG_RAW_DRIVER is not set
908# CONFIG_TCG_TPM is not set
909CONFIG_I2C=y
910CONFIG_I2C_BOARDINFO=y
911CONFIG_I2C_COMPAT=y
912CONFIG_I2C_CHARDEV=y
913CONFIG_I2C_HELPER_AUTO=y
914
915#
916# I2C Hardware Bus support
917#
918
919#
920# I2C system bus drivers (mostly embedded / system-on-chip)
921#
922# CONFIG_I2C_DESIGNWARE is not set
923# CONFIG_I2C_GPIO is not set
924# CONFIG_I2C_OCORES is not set
925CONFIG_I2C_PXA=y
926# CONFIG_I2C_PXA_SLAVE is not set
927# CONFIG_I2C_SIMTEC is not set
928
929#
930# External I2C/SMBus adapter drivers
931#
932# CONFIG_I2C_PARPORT_LIGHT is not set
933# CONFIG_I2C_TAOS_EVM is not set
934# CONFIG_I2C_TINY_USB is not set
935
936#
937# Other I2C/SMBus bus drivers
938#
939# CONFIG_I2C_PCA_PLATFORM is not set
940# CONFIG_I2C_STUB is not set
941
942#
943# Miscellaneous I2C Chip support
944#
945# CONFIG_DS1682 is not set
946# CONFIG_SENSORS_TSL2550 is not set
947# CONFIG_I2C_DEBUG_CORE is not set
948# CONFIG_I2C_DEBUG_ALGO is not set
949# CONFIG_I2C_DEBUG_BUS is not set
950# CONFIG_I2C_DEBUG_CHIP is not set
951CONFIG_SPI=y
952CONFIG_SPI_DEBUG=y
953CONFIG_SPI_MASTER=y
954
955#
956# SPI Master Controller Drivers
957#
958CONFIG_SPI_BITBANG=y
959CONFIG_SPI_GPIO=y
960# CONFIG_SPI_PXA2XX is not set
961
962#
963# SPI Protocol Masters
964#
965CONFIG_SPI_SPIDEV=y
966# CONFIG_SPI_TLE62X0 is not set
967
968#
969# PPS support
970#
971# CONFIG_PPS is not set
972CONFIG_ARCH_REQUIRE_GPIOLIB=y
973CONFIG_GPIOLIB=y
974CONFIG_DEBUG_GPIO=y
975# CONFIG_GPIO_SYSFS is not set
976
977#
978# Memory mapped GPIO expanders:
979#
980
981#
982# I2C GPIO expanders:
983#
984# CONFIG_GPIO_MAX732X is not set
985# CONFIG_GPIO_PCA953X is not set
986# CONFIG_GPIO_PCF857X is not set
987
988#
989# PCI GPIO expanders:
990#
991
992#
993# SPI GPIO expanders:
994#
995# CONFIG_GPIO_MAX7301 is not set
996# CONFIG_GPIO_MCP23S08 is not set
997# CONFIG_GPIO_MC33880 is not set
998
999#
1000# AC97 GPIO expanders:
1001#
1002CONFIG_W1=m
1003
1004#
1005# 1-wire Bus Masters
1006#
1007# CONFIG_W1_MASTER_DS2490 is not set
1008# CONFIG_W1_MASTER_DS2482 is not set
1009# CONFIG_W1_MASTER_DS1WM is not set
1010CONFIG_W1_MASTER_GPIO=m
1011
1012#
1013# 1-wire Slaves
1014#
1015# CONFIG_W1_SLAVE_THERM is not set
1016# CONFIG_W1_SLAVE_SMEM is not set
1017# CONFIG_W1_SLAVE_DS2431 is not set
1018# CONFIG_W1_SLAVE_DS2433 is not set
1019CONFIG_W1_SLAVE_DS2760=m
1020# CONFIG_W1_SLAVE_BQ27000 is not set
1021CONFIG_POWER_SUPPLY=y
1022# CONFIG_POWER_SUPPLY_DEBUG is not set
1023CONFIG_PDA_POWER=y
1024# CONFIG_APM_POWER is not set
1025CONFIG_BATTERY_DS2760=m
1026# CONFIG_BATTERY_DS2782 is not set
1027# CONFIG_BATTERY_BQ27x00 is not set
1028# CONFIG_BATTERY_MAX17040 is not set
1029CONFIG_HWMON=y
1030# CONFIG_HWMON_VID is not set
1031# CONFIG_HWMON_DEBUG_CHIP is not set
1032
1033#
1034# Native drivers
1035#
1036# CONFIG_SENSORS_AD7414 is not set
1037# CONFIG_SENSORS_AD7418 is not set
1038# CONFIG_SENSORS_ADCXX is not set
1039# CONFIG_SENSORS_ADM1021 is not set
1040# CONFIG_SENSORS_ADM1025 is not set
1041# CONFIG_SENSORS_ADM1026 is not set
1042# CONFIG_SENSORS_ADM1029 is not set
1043# CONFIG_SENSORS_ADM1031 is not set
1044# CONFIG_SENSORS_ADM9240 is not set
1045# CONFIG_SENSORS_ADT7462 is not set
1046# CONFIG_SENSORS_ADT7470 is not set
1047# CONFIG_SENSORS_ADT7473 is not set
1048# CONFIG_SENSORS_ADT7475 is not set
1049# CONFIG_SENSORS_ATXP1 is not set
1050# CONFIG_SENSORS_DS1621 is not set
1051# CONFIG_SENSORS_F71805F is not set
1052# CONFIG_SENSORS_F71882FG is not set
1053# CONFIG_SENSORS_F75375S is not set
1054# CONFIG_SENSORS_G760A is not set
1055# CONFIG_SENSORS_GL518SM is not set
1056# CONFIG_SENSORS_GL520SM is not set
1057# CONFIG_SENSORS_IT87 is not set
1058# CONFIG_SENSORS_LM63 is not set
1059# CONFIG_SENSORS_LM70 is not set
1060# CONFIG_SENSORS_LM75 is not set
1061# CONFIG_SENSORS_LM77 is not set
1062# CONFIG_SENSORS_LM78 is not set
1063# CONFIG_SENSORS_LM80 is not set
1064# CONFIG_SENSORS_LM83 is not set
1065# CONFIG_SENSORS_LM85 is not set
1066# CONFIG_SENSORS_LM87 is not set
1067# CONFIG_SENSORS_LM90 is not set
1068# CONFIG_SENSORS_LM92 is not set
1069# CONFIG_SENSORS_LM93 is not set
1070# CONFIG_SENSORS_LTC4215 is not set
1071# CONFIG_SENSORS_LTC4245 is not set
1072# CONFIG_SENSORS_LM95241 is not set
1073# CONFIG_SENSORS_MAX1111 is not set
1074# CONFIG_SENSORS_MAX1619 is not set
1075# CONFIG_SENSORS_MAX6650 is not set
1076# CONFIG_SENSORS_PC87360 is not set
1077# CONFIG_SENSORS_PC87427 is not set
1078# CONFIG_SENSORS_PCF8591 is not set
1079# CONFIG_SENSORS_SHT15 is not set
1080# CONFIG_SENSORS_DME1737 is not set
1081# CONFIG_SENSORS_SMSC47M1 is not set
1082# CONFIG_SENSORS_SMSC47M192 is not set
1083# CONFIG_SENSORS_SMSC47B397 is not set
1084# CONFIG_SENSORS_ADS7828 is not set
1085# CONFIG_SENSORS_THMC50 is not set
1086# CONFIG_SENSORS_TMP401 is not set
1087# CONFIG_SENSORS_TMP421 is not set
1088# CONFIG_SENSORS_VT1211 is not set
1089# CONFIG_SENSORS_W83781D is not set
1090# CONFIG_SENSORS_W83791D is not set
1091# CONFIG_SENSORS_W83792D is not set
1092# CONFIG_SENSORS_W83793 is not set
1093# CONFIG_SENSORS_W83L785TS is not set
1094# CONFIG_SENSORS_W83L786NG is not set
1095# CONFIG_SENSORS_W83627HF is not set
1096# CONFIG_SENSORS_W83627EHF is not set
1097CONFIG_SENSORS_LIS3_SPI=y
1098# CONFIG_THERMAL is not set
1099# CONFIG_WATCHDOG is not set
1100CONFIG_SSB_POSSIBLE=y
1101
1102#
1103# Sonics Silicon Backplane
1104#
1105# CONFIG_SSB is not set
1106
1107#
1108# Multifunction device drivers
1109#
1110# CONFIG_MFD_CORE is not set
1111# CONFIG_MFD_SM501 is not set
1112# CONFIG_MFD_ASIC3 is not set
1113# CONFIG_HTC_EGPIO is not set
1114# CONFIG_HTC_PASIC3 is not set
1115# CONFIG_TPS65010 is not set
1116# CONFIG_TWL4030_CORE is not set
1117# CONFIG_MFD_TMIO is not set
1118# CONFIG_MFD_T7L66XB is not set
1119# CONFIG_MFD_TC6387XB is not set
1120# CONFIG_MFD_TC6393XB is not set
1121# CONFIG_PMIC_DA903X is not set
1122# CONFIG_MFD_WM8400 is not set
1123# CONFIG_MFD_WM831X is not set
1124# CONFIG_MFD_WM8350_I2C is not set
1125# CONFIG_MFD_PCF50633 is not set
1126# CONFIG_MFD_MC13783 is not set
1127# CONFIG_AB3100_CORE is not set
1128# CONFIG_EZX_PCAP is not set
1129CONFIG_REGULATOR=y
1130CONFIG_REGULATOR_DEBUG=y
1131CONFIG_REGULATOR_FIXED_VOLTAGE=y
1132# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
1133# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
1134# CONFIG_REGULATOR_BQ24022 is not set
1135# CONFIG_REGULATOR_MAX1586 is not set
1136CONFIG_REGULATOR_MAX8660=y
1137# CONFIG_REGULATOR_LP3971 is not set
1138# CONFIG_REGULATOR_TPS65023 is not set
1139# CONFIG_REGULATOR_TPS6507X is not set
1140# CONFIG_MEDIA_SUPPORT is not set
1141
1142#
1143# Graphics support
1144#
1145# CONFIG_VGASTATE is not set
1146# CONFIG_VIDEO_OUTPUT_CONTROL is not set
1147CONFIG_FB=y
1148# CONFIG_FIRMWARE_EDID is not set
1149# CONFIG_FB_DDC is not set
1150# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1151CONFIG_FB_CFB_FILLRECT=y
1152CONFIG_FB_CFB_COPYAREA=y
1153CONFIG_FB_CFB_IMAGEBLIT=y
1154# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
1155# CONFIG_FB_SYS_FILLRECT is not set
1156# CONFIG_FB_SYS_COPYAREA is not set
1157# CONFIG_FB_SYS_IMAGEBLIT is not set
1158# CONFIG_FB_FOREIGN_ENDIAN is not set
1159# CONFIG_FB_SYS_FOPS is not set
1160# CONFIG_FB_SVGALIB is not set
1161# CONFIG_FB_MACMODES is not set
1162# CONFIG_FB_BACKLIGHT is not set
1163# CONFIG_FB_MODE_HELPERS is not set
1164# CONFIG_FB_TILEBLITTING is not set
1165
1166#
1167# Frame buffer hardware drivers
1168#
1169# CONFIG_FB_S1D13XXX is not set
1170CONFIG_FB_PXA=y
1171# CONFIG_FB_PXA_OVERLAY is not set
1172# CONFIG_FB_PXA_SMARTPANEL is not set
1173# CONFIG_FB_PXA_PARAMETERS is not set
1174CONFIG_PXA3XX_GCU=y
1175# CONFIG_FB_MBX is not set
1176# CONFIG_FB_W100 is not set
1177# CONFIG_FB_VIRTUAL is not set
1178# CONFIG_FB_METRONOME is not set
1179# CONFIG_FB_MB862XX is not set
1180# CONFIG_FB_BROADSHEET is not set
1181CONFIG_BACKLIGHT_LCD_SUPPORT=y
1182# CONFIG_LCD_CLASS_DEVICE is not set
1183CONFIG_BACKLIGHT_CLASS_DEVICE=y
1184# CONFIG_BACKLIGHT_GENERIC is not set
1185CONFIG_BACKLIGHT_PWM=y
1186
1187#
1188# Display device support
1189#
1190# CONFIG_DISPLAY_SUPPORT is not set
1191
1192#
1193# Console display driver support
1194#
1195# CONFIG_VGA_CONSOLE is not set
1196CONFIG_DUMMY_CONSOLE=y
1197CONFIG_FRAMEBUFFER_CONSOLE=y
1198# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
1199# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
1200# CONFIG_FONTS is not set
1201CONFIG_FONT_8x8=y
1202CONFIG_FONT_8x16=y
1203CONFIG_LOGO=y
1204# CONFIG_LOGO_LINUX_MONO is not set
1205# CONFIG_LOGO_LINUX_VGA16 is not set
1206# CONFIG_LOGO_LINUX_CLUT224 is not set
1207CONFIG_LOGO_RAUMFELD_CLUT224=y
1208CONFIG_SOUND=y
1209# CONFIG_SOUND_OSS_CORE is not set
1210CONFIG_SND=y
1211CONFIG_SND_TIMER=y
1212CONFIG_SND_PCM=y
1213CONFIG_SND_JACK=y
1214# CONFIG_SND_SEQUENCER is not set
1215# CONFIG_SND_MIXER_OSS is not set
1216# CONFIG_SND_PCM_OSS is not set
1217# CONFIG_SND_DYNAMIC_MINORS is not set
1218CONFIG_SND_SUPPORT_OLD_API=y
1219CONFIG_SND_VERBOSE_PROCFS=y
1220# CONFIG_SND_VERBOSE_PRINTK is not set
1221# CONFIG_SND_DEBUG is not set
1222# CONFIG_SND_RAWMIDI_SEQ is not set
1223# CONFIG_SND_OPL3_LIB_SEQ is not set
1224# CONFIG_SND_OPL4_LIB_SEQ is not set
1225# CONFIG_SND_SBAWE_SEQ is not set
1226# CONFIG_SND_EMU10K1_SEQ is not set
1227# CONFIG_SND_DRIVERS is not set
1228CONFIG_SND_ARM=y
1229CONFIG_SND_PXA2XX_LIB=y
1230# CONFIG_SND_PXA2XX_AC97 is not set
1231CONFIG_SND_SPI=y
1232# CONFIG_SND_USB is not set
1233CONFIG_SND_SOC=y
1234CONFIG_SND_PXA2XX_SOC=y
1235CONFIG_SND_PXA_SOC_SSP=y
1236CONFIG_SND_SOC_RAUMFELD=y
1237CONFIG_SND_SOC_I2C_AND_SPI=y
1238# CONFIG_SND_SOC_ALL_CODECS is not set
1239CONFIG_SND_SOC_AK4104=y
1240CONFIG_SND_SOC_CS4270=y
1241# CONFIG_SOUND_PRIME is not set
1242CONFIG_HID_SUPPORT=y
1243CONFIG_HID=y
1244# CONFIG_HIDRAW is not set
1245
1246#
1247# USB Input Devices
1248#
1249CONFIG_USB_HID=y
1250# CONFIG_HID_PID is not set
1251# CONFIG_USB_HIDDEV is not set
1252
1253#
1254# Special HID drivers
1255#
1256CONFIG_HID_A4TECH=y
1257CONFIG_HID_APPLE=y
1258CONFIG_HID_BELKIN=y
1259CONFIG_HID_CHERRY=y
1260CONFIG_HID_CHICONY=y
1261CONFIG_HID_CYPRESS=y
1262CONFIG_HID_DRAGONRISE=y
1263# CONFIG_DRAGONRISE_FF is not set
1264CONFIG_HID_EZKEY=y
1265CONFIG_HID_KYE=y
1266CONFIG_HID_GYRATION=y
1267CONFIG_HID_TWINHAN=y
1268CONFIG_HID_KENSINGTON=y
1269CONFIG_HID_LOGITECH=y
1270# CONFIG_LOGITECH_FF is not set
1271# CONFIG_LOGIRUMBLEPAD2_FF is not set
1272CONFIG_HID_MICROSOFT=y
1273CONFIG_HID_MONTEREY=y
1274CONFIG_HID_NTRIG=y
1275CONFIG_HID_PANTHERLORD=y
1276# CONFIG_PANTHERLORD_FF is not set
1277CONFIG_HID_PETALYNX=y
1278CONFIG_HID_SAMSUNG=y
1279CONFIG_HID_SONY=y
1280CONFIG_HID_SUNPLUS=y
1281CONFIG_HID_GREENASIA=y
1282# CONFIG_GREENASIA_FF is not set
1283CONFIG_HID_SMARTJOYPLUS=y
1284# CONFIG_SMARTJOYPLUS_FF is not set
1285CONFIG_HID_TOPSEED=y
1286CONFIG_HID_THRUSTMASTER=y
1287# CONFIG_THRUSTMASTER_FF is not set
1288CONFIG_HID_ZEROPLUS=y
1289# CONFIG_ZEROPLUS_FF is not set
1290CONFIG_USB_SUPPORT=y
1291CONFIG_USB_ARCH_HAS_HCD=y
1292CONFIG_USB_ARCH_HAS_OHCI=y
1293# CONFIG_USB_ARCH_HAS_EHCI is not set
1294CONFIG_USB=y
1295CONFIG_USB_DEBUG=y
1296CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
1297
1298#
1299# Miscellaneous USB options
1300#
1301# CONFIG_USB_DEVICEFS is not set
1302CONFIG_USB_DEVICE_CLASS=y
1303# CONFIG_USB_DYNAMIC_MINORS is not set
1304# CONFIG_USB_SUSPEND is not set
1305# CONFIG_USB_OTG is not set
1306CONFIG_USB_MON=y
1307# CONFIG_USB_WUSB is not set
1308# CONFIG_USB_WUSB_CBAF is not set
1309
1310#
1311# USB Host Controller Drivers
1312#
1313# CONFIG_USB_C67X00_HCD is not set
1314# CONFIG_USB_OXU210HP_HCD is not set
1315# CONFIG_USB_ISP116X_HCD is not set
1316# CONFIG_USB_ISP1760_HCD is not set
1317# CONFIG_USB_ISP1362_HCD is not set
1318CONFIG_USB_OHCI_HCD=y
1319# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
1320# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
1321CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1322# CONFIG_USB_SL811_HCD is not set
1323# CONFIG_USB_R8A66597_HCD is not set
1324# CONFIG_USB_HWA_HCD is not set
1325# CONFIG_USB_MUSB_HDRC is not set
1326
1327#
1328# USB Device Class drivers
1329#
1330# CONFIG_USB_ACM is not set
1331# CONFIG_USB_PRINTER is not set
1332# CONFIG_USB_WDM is not set
1333# CONFIG_USB_TMC is not set
1334
1335#
1336# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
1337#
1338
1339#
1340# also be needed; see USB_STORAGE Help for more info
1341#
1342CONFIG_USB_STORAGE=y
1343# CONFIG_USB_STORAGE_DEBUG is not set
1344# CONFIG_USB_STORAGE_DATAFAB is not set
1345CONFIG_USB_STORAGE_FREECOM=y
1346CONFIG_USB_STORAGE_ISD200=y
1347CONFIG_USB_STORAGE_USBAT=y
1348CONFIG_USB_STORAGE_SDDR09=y
1349CONFIG_USB_STORAGE_SDDR55=y
1350# CONFIG_USB_STORAGE_JUMPSHOT is not set
1351# CONFIG_USB_STORAGE_ALAUDA is not set
1352# CONFIG_USB_STORAGE_ONETOUCH is not set
1353# CONFIG_USB_STORAGE_KARMA is not set
1354# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1355# CONFIG_USB_LIBUSUAL is not set
1356
1357#
1358# USB Imaging devices
1359#
1360# CONFIG_USB_MDC800 is not set
1361# CONFIG_USB_MICROTEK is not set
1362
1363#
1364# USB port drivers
1365#
1366# CONFIG_USB_SERIAL is not set
1367
1368#
1369# USB Miscellaneous drivers
1370#
1371# CONFIG_USB_EMI62 is not set
1372# CONFIG_USB_EMI26 is not set
1373# CONFIG_USB_ADUTUX is not set
1374# CONFIG_USB_SEVSEG is not set
1375# CONFIG_USB_RIO500 is not set
1376# CONFIG_USB_LEGOTOWER is not set
1377# CONFIG_USB_LCD is not set
1378# CONFIG_USB_BERRY_CHARGE is not set
1379# CONFIG_USB_LED is not set
1380# CONFIG_USB_CYPRESS_CY7C63 is not set
1381# CONFIG_USB_CYTHERM is not set
1382# CONFIG_USB_IDMOUSE is not set
1383# CONFIG_USB_FTDI_ELAN is not set
1384# CONFIG_USB_APPLEDISPLAY is not set
1385# CONFIG_USB_LD is not set
1386# CONFIG_USB_TRANCEVIBRATOR is not set
1387# CONFIG_USB_IOWARRIOR is not set
1388# CONFIG_USB_TEST is not set
1389# CONFIG_USB_ISIGHTFW is not set
1390# CONFIG_USB_VST is not set
1391# CONFIG_USB_GADGET is not set
1392
1393#
1394# OTG and related infrastructure
1395#
1396# CONFIG_USB_GPIO_VBUS is not set
1397# CONFIG_NOP_USB_XCEIV is not set
1398CONFIG_MMC=y
1399# CONFIG_MMC_DEBUG is not set
1400# CONFIG_MMC_UNSAFE_RESUME is not set
1401
1402#
1403# MMC/SD/SDIO Card Drivers
1404#
1405CONFIG_MMC_BLOCK=y
1406CONFIG_MMC_BLOCK_BOUNCE=y
1407# CONFIG_SDIO_UART is not set
1408# CONFIG_MMC_TEST is not set
1409
1410#
1411# MMC/SD/SDIO Host Controller Drivers
1412#
1413CONFIG_MMC_PXA=m
1414# CONFIG_MMC_SDHCI is not set
1415# CONFIG_MMC_AT91 is not set
1416# CONFIG_MMC_ATMELMCI is not set
1417# CONFIG_MMC_SPI is not set
1418# CONFIG_MEMSTICK is not set
1419CONFIG_NEW_LEDS=y
1420CONFIG_LEDS_CLASS=y
1421
1422#
1423# LED drivers
1424#
1425# CONFIG_LEDS_PCA9532 is not set
1426CONFIG_LEDS_GPIO=y
1427CONFIG_LEDS_GPIO_PLATFORM=y
1428# CONFIG_LEDS_LP3944 is not set
1429# CONFIG_LEDS_PCA955X is not set
1430# CONFIG_LEDS_DAC124S085 is not set
1431# CONFIG_LEDS_PWM is not set
1432# CONFIG_LEDS_BD2802 is not set
1433CONFIG_LEDS_LT3593=y
1434
1435#
1436# LED Triggers
1437#
1438CONFIG_LEDS_TRIGGERS=y
1439# CONFIG_LEDS_TRIGGER_TIMER is not set
1440# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
1441CONFIG_LEDS_TRIGGER_BACKLIGHT=y
1442# CONFIG_LEDS_TRIGGER_GPIO is not set
1443# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
1444
1445#
1446# iptables trigger is under Netfilter config (LED target)
1447#
1448# CONFIG_ACCESSIBILITY is not set
1449CONFIG_RTC_LIB=y
1450CONFIG_RTC_CLASS=y
1451CONFIG_RTC_HCTOSYS=y
1452CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1453# CONFIG_RTC_DEBUG is not set
1454
1455#
1456# RTC interfaces
1457#
1458CONFIG_RTC_INTF_SYSFS=y
1459CONFIG_RTC_INTF_PROC=y
1460CONFIG_RTC_INTF_DEV=y
1461# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1462# CONFIG_RTC_DRV_TEST is not set
1463
1464#
1465# I2C RTC drivers
1466#
1467# CONFIG_RTC_DRV_DS1307 is not set
1468# CONFIG_RTC_DRV_DS1374 is not set
1469# CONFIG_RTC_DRV_DS1672 is not set
1470# CONFIG_RTC_DRV_MAX6900 is not set
1471# CONFIG_RTC_DRV_RS5C372 is not set
1472# CONFIG_RTC_DRV_ISL1208 is not set
1473# CONFIG_RTC_DRV_X1205 is not set
1474# CONFIG_RTC_DRV_PCF8563 is not set
1475# CONFIG_RTC_DRV_PCF8583 is not set
1476# CONFIG_RTC_DRV_M41T80 is not set
1477# CONFIG_RTC_DRV_S35390A is not set
1478# CONFIG_RTC_DRV_FM3130 is not set
1479# CONFIG_RTC_DRV_RX8581 is not set
1480# CONFIG_RTC_DRV_RX8025 is not set
1481
1482#
1483# SPI RTC drivers
1484#
1485# CONFIG_RTC_DRV_M41T94 is not set
1486# CONFIG_RTC_DRV_DS1305 is not set
1487# CONFIG_RTC_DRV_DS1390 is not set
1488# CONFIG_RTC_DRV_MAX6902 is not set
1489# CONFIG_RTC_DRV_R9701 is not set
1490# CONFIG_RTC_DRV_RS5C348 is not set
1491# CONFIG_RTC_DRV_DS3234 is not set
1492# CONFIG_RTC_DRV_PCF2123 is not set
1493
1494#
1495# Platform RTC drivers
1496#
1497# CONFIG_RTC_DRV_CMOS is not set
1498# CONFIG_RTC_DRV_DS1286 is not set
1499# CONFIG_RTC_DRV_DS1511 is not set
1500# CONFIG_RTC_DRV_DS1553 is not set
1501# CONFIG_RTC_DRV_DS1742 is not set
1502# CONFIG_RTC_DRV_STK17TA8 is not set
1503# CONFIG_RTC_DRV_M48T86 is not set
1504# CONFIG_RTC_DRV_M48T35 is not set
1505# CONFIG_RTC_DRV_M48T59 is not set
1506# CONFIG_RTC_DRV_BQ4802 is not set
1507# CONFIG_RTC_DRV_V3020 is not set
1508
1509#
1510# on-CPU RTC drivers
1511#
1512# CONFIG_RTC_DRV_SA1100 is not set
1513CONFIG_RTC_DRV_PXA=y
1514CONFIG_DMADEVICES=y
1515
1516#
1517# DMA Devices
1518#
1519# CONFIG_AUXDISPLAY is not set
1520CONFIG_UIO=y
1521# CONFIG_UIO_PDRV is not set
1522# CONFIG_UIO_PDRV_GENIRQ is not set
1523# CONFIG_UIO_SMX is not set
1524# CONFIG_UIO_SERCOS3 is not set
1525
1526#
1527# TI VLYNQ
1528#
1529# CONFIG_STAGING is not set
1530
1531#
1532# File systems
1533#
1534CONFIG_EXT2_FS=y
1535# CONFIG_EXT2_FS_XATTR is not set
1536CONFIG_EXT2_FS_XIP=y
1537CONFIG_EXT3_FS=y
1538# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
1539CONFIG_EXT3_FS_XATTR=y
1540# CONFIG_EXT3_FS_POSIX_ACL is not set
1541# CONFIG_EXT3_FS_SECURITY is not set
1542# CONFIG_EXT4_FS is not set
1543CONFIG_FS_XIP=y
1544CONFIG_JBD=y
1545CONFIG_FS_MBCACHE=y
1546# CONFIG_REISERFS_FS is not set
1547# CONFIG_JFS_FS is not set
1548# CONFIG_FS_POSIX_ACL is not set
1549# CONFIG_XFS_FS is not set
1550# CONFIG_OCFS2_FS is not set
1551# CONFIG_BTRFS_FS is not set
1552# CONFIG_NILFS2_FS is not set
1553CONFIG_FILE_LOCKING=y
1554CONFIG_FSNOTIFY=y
1555CONFIG_DNOTIFY=y
1556CONFIG_INOTIFY=y
1557CONFIG_INOTIFY_USER=y
1558# CONFIG_QUOTA is not set
1559# CONFIG_AUTOFS_FS is not set
1560# CONFIG_AUTOFS4_FS is not set
1561# CONFIG_FUSE_FS is not set
1562
1563#
1564# Caches
1565#
1566CONFIG_FSCACHE=y
1567CONFIG_FSCACHE_STATS=y
1568# CONFIG_FSCACHE_HISTOGRAM is not set
1569# CONFIG_FSCACHE_DEBUG is not set
1570CONFIG_CACHEFILES=y
1571# CONFIG_CACHEFILES_DEBUG is not set
1572# CONFIG_CACHEFILES_HISTOGRAM is not set
1573
1574#
1575# CD-ROM/DVD Filesystems
1576#
1577# CONFIG_ISO9660_FS is not set
1578# CONFIG_UDF_FS is not set
1579
1580#
1581# DOS/FAT/NT Filesystems
1582#
1583CONFIG_FAT_FS=y
1584CONFIG_MSDOS_FS=y
1585CONFIG_VFAT_FS=y
1586CONFIG_FAT_DEFAULT_CODEPAGE=437
1587CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1588# CONFIG_NTFS_FS is not set
1589
1590#
1591# Pseudo filesystems
1592#
1593CONFIG_PROC_FS=y
1594CONFIG_PROC_SYSCTL=y
1595CONFIG_PROC_PAGE_MONITOR=y
1596CONFIG_SYSFS=y
1597CONFIG_TMPFS=y
1598# CONFIG_TMPFS_POSIX_ACL is not set
1599# CONFIG_HUGETLB_PAGE is not set
1600# CONFIG_CONFIGFS_FS is not set
1601CONFIG_MISC_FILESYSTEMS=y
1602# CONFIG_ADFS_FS is not set
1603# CONFIG_AFFS_FS is not set
1604# CONFIG_HFS_FS is not set
1605# CONFIG_HFSPLUS_FS is not set
1606# CONFIG_BEFS_FS is not set
1607# CONFIG_BFS_FS is not set
1608# CONFIG_EFS_FS is not set
1609# CONFIG_JFFS2_FS is not set
1610CONFIG_UBIFS_FS=y
1611# CONFIG_UBIFS_FS_XATTR is not set
1612# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
1613CONFIG_UBIFS_FS_LZO=y
1614CONFIG_UBIFS_FS_ZLIB=y
1615# CONFIG_UBIFS_FS_DEBUG is not set
1616# CONFIG_CRAMFS is not set
1617# CONFIG_SQUASHFS is not set
1618# CONFIG_VXFS_FS is not set
1619# CONFIG_MINIX_FS is not set
1620# CONFIG_OMFS_FS is not set
1621# CONFIG_HPFS_FS is not set
1622# CONFIG_QNX4FS_FS is not set
1623# CONFIG_ROMFS_FS is not set
1624# CONFIG_SYSV_FS is not set
1625# CONFIG_UFS_FS is not set
1626CONFIG_NETWORK_FILESYSTEMS=y
1627CONFIG_NFS_FS=y
1628CONFIG_NFS_V3=y
1629# CONFIG_NFS_V3_ACL is not set
1630# CONFIG_NFS_V4 is not set
1631CONFIG_ROOT_NFS=y
1632CONFIG_NFS_FSCACHE=y
1633# CONFIG_NFSD is not set
1634CONFIG_LOCKD=y
1635CONFIG_LOCKD_V4=y
1636CONFIG_NFS_COMMON=y
1637CONFIG_SUNRPC=y
1638# CONFIG_RPCSEC_GSS_KRB5 is not set
1639# CONFIG_RPCSEC_GSS_SPKM3 is not set
1640# CONFIG_SMB_FS is not set
1641# CONFIG_CIFS is not set
1642# CONFIG_NCP_FS is not set
1643# CONFIG_CODA_FS is not set
1644# CONFIG_AFS_FS is not set
1645
1646#
1647# Partition Types
1648#
1649# CONFIG_PARTITION_ADVANCED is not set
1650CONFIG_MSDOS_PARTITION=y
1651CONFIG_NLS=y
1652CONFIG_NLS_DEFAULT="iso8859-1"
1653CONFIG_NLS_CODEPAGE_437=y
1654CONFIG_NLS_CODEPAGE_737=y
1655CONFIG_NLS_CODEPAGE_775=y
1656CONFIG_NLS_CODEPAGE_850=y
1657CONFIG_NLS_CODEPAGE_852=y
1658CONFIG_NLS_CODEPAGE_855=y
1659CONFIG_NLS_CODEPAGE_857=y
1660CONFIG_NLS_CODEPAGE_860=y
1661CONFIG_NLS_CODEPAGE_861=y
1662CONFIG_NLS_CODEPAGE_862=y
1663CONFIG_NLS_CODEPAGE_863=y
1664CONFIG_NLS_CODEPAGE_864=y
1665CONFIG_NLS_CODEPAGE_865=y
1666CONFIG_NLS_CODEPAGE_866=y
1667CONFIG_NLS_CODEPAGE_869=y
1668CONFIG_NLS_CODEPAGE_936=y
1669CONFIG_NLS_CODEPAGE_950=y
1670CONFIG_NLS_CODEPAGE_932=y
1671CONFIG_NLS_CODEPAGE_949=y
1672CONFIG_NLS_CODEPAGE_874=y
1673CONFIG_NLS_ISO8859_8=y
1674CONFIG_NLS_CODEPAGE_1250=y
1675CONFIG_NLS_CODEPAGE_1251=y
1676CONFIG_NLS_ASCII=y
1677CONFIG_NLS_ISO8859_1=y
1678CONFIG_NLS_ISO8859_2=y
1679CONFIG_NLS_ISO8859_3=y
1680CONFIG_NLS_ISO8859_4=y
1681CONFIG_NLS_ISO8859_5=y
1682CONFIG_NLS_ISO8859_6=y
1683CONFIG_NLS_ISO8859_7=y
1684CONFIG_NLS_ISO8859_9=y
1685CONFIG_NLS_ISO8859_13=y
1686CONFIG_NLS_ISO8859_14=y
1687CONFIG_NLS_ISO8859_15=y
1688CONFIG_NLS_KOI8_R=y
1689CONFIG_NLS_KOI8_U=y
1690CONFIG_NLS_UTF8=y
1691# CONFIG_DLM is not set
1692
1693#
1694# Kernel hacking
1695#
1696CONFIG_PRINTK_TIME=y
1697CONFIG_ENABLE_WARN_DEPRECATED=y
1698CONFIG_ENABLE_MUST_CHECK=y
1699CONFIG_FRAME_WARN=1024
1700# CONFIG_MAGIC_SYSRQ is not set
1701# CONFIG_STRIP_ASM_SYMS is not set
1702# CONFIG_UNUSED_SYMBOLS is not set
1703# CONFIG_DEBUG_FS is not set
1704# CONFIG_HEADERS_CHECK is not set
1705CONFIG_DEBUG_KERNEL=y
1706# CONFIG_DEBUG_SHIRQ is not set
1707CONFIG_DETECT_SOFTLOCKUP=y
1708# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1709CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1710CONFIG_DETECT_HUNG_TASK=y
1711# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
1712CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
1713CONFIG_SCHED_DEBUG=y
1714# CONFIG_SCHEDSTATS is not set
1715# CONFIG_TIMER_STATS is not set
1716# CONFIG_DEBUG_OBJECTS is not set
1717# CONFIG_SLUB_DEBUG_ON is not set
1718# CONFIG_SLUB_STATS is not set
1719# CONFIG_DEBUG_KMEMLEAK is not set
1720# CONFIG_DEBUG_RT_MUTEXES is not set
1721# CONFIG_RT_MUTEX_TESTER is not set
1722# CONFIG_DEBUG_SPINLOCK is not set
1723# CONFIG_DEBUG_MUTEXES is not set
1724# CONFIG_DEBUG_LOCK_ALLOC is not set
1725# CONFIG_PROVE_LOCKING is not set
1726# CONFIG_LOCK_STAT is not set
1727# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1728# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1729# CONFIG_DEBUG_KOBJECT is not set
1730CONFIG_DEBUG_BUGVERBOSE=y
1731CONFIG_DEBUG_INFO=y
1732# CONFIG_DEBUG_VM is not set
1733# CONFIG_DEBUG_WRITECOUNT is not set
1734CONFIG_DEBUG_MEMORY_INIT=y
1735# CONFIG_DEBUG_LIST is not set
1736# CONFIG_DEBUG_SG is not set
1737# CONFIG_DEBUG_NOTIFIERS is not set
1738# CONFIG_DEBUG_CREDENTIALS is not set
1739# CONFIG_BOOT_PRINTK_DELAY is not set
1740# CONFIG_RCU_TORTURE_TEST is not set
1741# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1742# CONFIG_BACKTRACE_SELF_TEST is not set
1743# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1744# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
1745# CONFIG_FAULT_INJECTION is not set
1746# CONFIG_LATENCYTOP is not set
1747# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1748# CONFIG_PAGE_POISONING is not set
1749CONFIG_HAVE_FUNCTION_TRACER=y
1750CONFIG_TRACING_SUPPORT=y
1751CONFIG_FTRACE=y
1752# CONFIG_FUNCTION_TRACER is not set
1753# CONFIG_IRQSOFF_TRACER is not set
1754# CONFIG_SCHED_TRACER is not set
1755# CONFIG_ENABLE_DEFAULT_TRACERS is not set
1756# CONFIG_BOOT_TRACER is not set
1757CONFIG_BRANCH_PROFILE_NONE=y
1758# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
1759# CONFIG_PROFILE_ALL_BRANCHES is not set
1760# CONFIG_STACK_TRACER is not set
1761# CONFIG_KMEMTRACE is not set
1762# CONFIG_WORKQUEUE_TRACER is not set
1763# CONFIG_BLK_DEV_IO_TRACE is not set
1764# CONFIG_SAMPLES is not set
1765CONFIG_HAVE_ARCH_KGDB=y
1766# CONFIG_KGDB is not set
1767CONFIG_ARM_UNWIND=y
1768CONFIG_DEBUG_USER=y
1769CONFIG_DEBUG_ERRORS=y
1770# CONFIG_DEBUG_STACK_USAGE is not set
1771CONFIG_DEBUG_LL=y
1772# CONFIG_DEBUG_ICEDCC is not set
1773
1774#
1775# Security options
1776#
1777# CONFIG_KEYS is not set
1778# CONFIG_SECURITY is not set
1779# CONFIG_SECURITYFS is not set
1780# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1781CONFIG_CRYPTO=y
1782
1783#
1784# Crypto core or helper
1785#
1786CONFIG_CRYPTO_ALGAPI=y
1787CONFIG_CRYPTO_ALGAPI2=y
1788CONFIG_CRYPTO_AEAD2=y
1789CONFIG_CRYPTO_BLKCIPHER=y
1790CONFIG_CRYPTO_BLKCIPHER2=y
1791CONFIG_CRYPTO_HASH2=y
1792CONFIG_CRYPTO_RNG2=y
1793CONFIG_CRYPTO_PCOMP=y
1794CONFIG_CRYPTO_MANAGER=y
1795CONFIG_CRYPTO_MANAGER2=y
1796# CONFIG_CRYPTO_GF128MUL is not set
1797# CONFIG_CRYPTO_NULL is not set
1798CONFIG_CRYPTO_WORKQUEUE=y
1799# CONFIG_CRYPTO_CRYPTD is not set
1800# CONFIG_CRYPTO_AUTHENC is not set
1801# CONFIG_CRYPTO_TEST is not set
1802
1803#
1804# Authenticated Encryption with Associated Data
1805#
1806# CONFIG_CRYPTO_CCM is not set
1807# CONFIG_CRYPTO_GCM is not set
1808# CONFIG_CRYPTO_SEQIV is not set
1809
1810#
1811# Block modes
1812#
1813# CONFIG_CRYPTO_CBC is not set
1814# CONFIG_CRYPTO_CTR is not set
1815# CONFIG_CRYPTO_CTS is not set
1816CONFIG_CRYPTO_ECB=y
1817# CONFIG_CRYPTO_LRW is not set
1818# CONFIG_CRYPTO_PCBC is not set
1819# CONFIG_CRYPTO_XTS is not set
1820
1821#
1822# Hash modes
1823#
1824# CONFIG_CRYPTO_HMAC is not set
1825# CONFIG_CRYPTO_XCBC is not set
1826# CONFIG_CRYPTO_VMAC is not set
1827
1828#
1829# Digest
1830#
1831# CONFIG_CRYPTO_CRC32C is not set
1832# CONFIG_CRYPTO_GHASH is not set
1833# CONFIG_CRYPTO_MD4 is not set
1834# CONFIG_CRYPTO_MD5 is not set
1835# CONFIG_CRYPTO_MICHAEL_MIC is not set
1836# CONFIG_CRYPTO_RMD128 is not set
1837# CONFIG_CRYPTO_RMD160 is not set
1838# CONFIG_CRYPTO_RMD256 is not set
1839# CONFIG_CRYPTO_RMD320 is not set
1840# CONFIG_CRYPTO_SHA1 is not set
1841# CONFIG_CRYPTO_SHA256 is not set
1842# CONFIG_CRYPTO_SHA512 is not set
1843# CONFIG_CRYPTO_TGR192 is not set
1844# CONFIG_CRYPTO_WP512 is not set
1845
1846#
1847# Ciphers
1848#
1849CONFIG_CRYPTO_AES=y
1850# CONFIG_CRYPTO_ANUBIS is not set
1851CONFIG_CRYPTO_ARC4=y
1852# CONFIG_CRYPTO_BLOWFISH is not set
1853# CONFIG_CRYPTO_CAMELLIA is not set
1854# CONFIG_CRYPTO_CAST5 is not set
1855# CONFIG_CRYPTO_CAST6 is not set
1856# CONFIG_CRYPTO_DES is not set
1857# CONFIG_CRYPTO_FCRYPT is not set
1858# CONFIG_CRYPTO_KHAZAD is not set
1859# CONFIG_CRYPTO_SALSA20 is not set
1860# CONFIG_CRYPTO_SEED is not set
1861# CONFIG_CRYPTO_SERPENT is not set
1862# CONFIG_CRYPTO_TEA is not set
1863# CONFIG_CRYPTO_TWOFISH is not set
1864
1865#
1866# Compression
1867#
1868CONFIG_CRYPTO_DEFLATE=y
1869# CONFIG_CRYPTO_ZLIB is not set
1870CONFIG_CRYPTO_LZO=y
1871
1872#
1873# Random Number Generation
1874#
1875# CONFIG_CRYPTO_ANSI_CPRNG is not set
1876# CONFIG_CRYPTO_HW is not set
1877# CONFIG_BINARY_PRINTF is not set
1878
1879#
1880# Library routines
1881#
1882CONFIG_BITREVERSE=y
1883CONFIG_GENERIC_FIND_LAST_BIT=y
1884# CONFIG_CRC_CCITT is not set
1885CONFIG_CRC16=y
1886# CONFIG_CRC_T10DIF is not set
1887# CONFIG_CRC_ITU_T is not set
1888CONFIG_CRC32=y
1889# CONFIG_CRC7 is not set
1890# CONFIG_LIBCRC32C is not set
1891CONFIG_ZLIB_INFLATE=y
1892CONFIG_ZLIB_DEFLATE=y
1893CONFIG_LZO_COMPRESS=y
1894CONFIG_LZO_DECOMPRESS=y
1895CONFIG_HAS_IOMEM=y
1896CONFIG_HAS_IOPORT=y
1897CONFIG_HAS_DMA=y
1898CONFIG_NLATTR=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 2f10dae02796..8e94c3caeb8c 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -187,7 +187,7 @@ CONFIG_S3C24XX_GPIO_EXTRA128=y
187CONFIG_PM_SIMTEC=y 187CONFIG_PM_SIMTEC=y
188CONFIG_S3C2410_DMA=y 188CONFIG_S3C2410_DMA=y
189# CONFIG_S3C2410_DMA_DEBUG is not set 189# CONFIG_S3C2410_DMA_DEBUG is not set
190CONFIG_S3C24XX_ADC=y 190CONFIG_S3C_ADC=y
191CONFIG_MACH_SMDK=y 191CONFIG_MACH_SMDK=y
192CONFIG_PLAT_S3C=y 192CONFIG_PLAT_S3C=y
193CONFIG_CPU_LLSERIAL_S3C2410=y 193CONFIG_CPU_LLSERIAL_S3C2410=y
@@ -203,8 +203,8 @@ CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
203# 203#
204# Power management 204# Power management
205# 205#
206# CONFIG_S3C2410_PM_DEBUG is not set 206# CONFIG_SAMSUNG_PM_DEBUG is not set
207# CONFIG_S3C2410_PM_CHECK is not set 207# CONFIG_SAMSUNG_PM_CHECK is not set
208CONFIG_S3C_LOWLEVEL_UART_PORT=0 208CONFIG_S3C_LOWLEVEL_UART_PORT=0
209CONFIG_S3C_GPIO_SPACE=0 209CONFIG_S3C_GPIO_SPACE=0
210CONFIG_S3C_DEV_HSMMC=y 210CONFIG_S3C_DEV_HSMMC=y
diff --git a/arch/arm/configs/s3c6400_defconfig b/arch/arm/configs/s3c6400_defconfig
index f56e50fab79b..5e7d4c1b8fc1 100644
--- a/arch/arm/configs/s3c6400_defconfig
+++ b/arch/arm/configs/s3c6400_defconfig
@@ -1,14 +1,11 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc3 3# Linux kernel version: 2.6.33-rc4
4# Mon Nov 3 10:10:30 2008 4# Tue Jan 19 13:12:40 2010
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y 8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y
12CONFIG_NO_IOPORT=y 9CONFIG_NO_IOPORT=y
13CONFIG_GENERIC_HARDIRQS=y 10CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y 11CONFIG_STACKTRACE_SUPPORT=y
@@ -18,13 +15,13 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y
18CONFIG_HARDIRQS_SW_RESEND=y 15CONFIG_HARDIRQS_SW_RESEND=y
19CONFIG_GENERIC_IRQ_PROBE=y 16CONFIG_GENERIC_IRQ_PROBE=y
20CONFIG_RWSEM_GENERIC_SPINLOCK=y 17CONFIG_RWSEM_GENERIC_SPINLOCK=y
21# CONFIG_ARCH_HAS_ILOG2_U32 is not set 18CONFIG_ARCH_HAS_CPUFREQ=y
22# CONFIG_ARCH_HAS_ILOG2_U64 is not set
23CONFIG_GENERIC_HWEIGHT=y 19CONFIG_GENERIC_HWEIGHT=y
24CONFIG_GENERIC_CALIBRATE_DELAY=y 20CONFIG_GENERIC_CALIBRATE_DELAY=y
25CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
26CONFIG_VECTORS_BASE=0xffff0000 22CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
28 25
29# 26#
30# General setup 27# General setup
@@ -34,13 +31,30 @@ CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32 31CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION="" 32CONFIG_LOCALVERSION=""
36CONFIG_LOCALVERSION_AUTO=y 33CONFIG_LOCALVERSION_AUTO=y
34CONFIG_HAVE_KERNEL_GZIP=y
35CONFIG_HAVE_KERNEL_LZO=y
36CONFIG_KERNEL_GZIP=y
37# CONFIG_KERNEL_BZIP2 is not set
38# CONFIG_KERNEL_LZMA is not set
39# CONFIG_KERNEL_LZO is not set
37CONFIG_SWAP=y 40CONFIG_SWAP=y
38# CONFIG_SYSVIPC is not set 41# CONFIG_SYSVIPC is not set
39# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
43
44#
45# RCU Subsystem
46#
47CONFIG_TREE_RCU=y
48# CONFIG_TREE_PREEMPT_RCU is not set
49# CONFIG_TINY_RCU is not set
50# CONFIG_RCU_TRACE is not set
51CONFIG_RCU_FANOUT=32
52# CONFIG_RCU_FANOUT_EXACT is not set
53# CONFIG_TREE_RCU_TRACE is not set
40# CONFIG_IKCONFIG is not set 54# CONFIG_IKCONFIG is not set
41CONFIG_LOG_BUF_SHIFT=17 55CONFIG_LOG_BUF_SHIFT=17
42# CONFIG_CGROUPS is not set
43# CONFIG_GROUP_SCHED is not set 56# CONFIG_GROUP_SCHED is not set
57# CONFIG_CGROUPS is not set
44CONFIG_SYSFS_DEPRECATED=y 58CONFIG_SYSFS_DEPRECATED=y
45CONFIG_SYSFS_DEPRECATED_V2=y 59CONFIG_SYSFS_DEPRECATED_V2=y
46# CONFIG_RELAY is not set 60# CONFIG_RELAY is not set
@@ -50,8 +64,13 @@ CONFIG_NAMESPACES=y
50# CONFIG_PID_NS is not set 64# CONFIG_PID_NS is not set
51CONFIG_BLK_DEV_INITRD=y 65CONFIG_BLK_DEV_INITRD=y
52CONFIG_INITRAMFS_SOURCE="" 66CONFIG_INITRAMFS_SOURCE=""
67CONFIG_RD_GZIP=y
68CONFIG_RD_BZIP2=y
69CONFIG_RD_LZMA=y
70CONFIG_RD_LZO=y
53CONFIG_CC_OPTIMIZE_FOR_SIZE=y 71CONFIG_CC_OPTIMIZE_FOR_SIZE=y
54CONFIG_SYSCTL=y 72CONFIG_SYSCTL=y
73CONFIG_ANON_INODES=y
55# CONFIG_EMBEDDED is not set 74# CONFIG_EMBEDDED is not set
56CONFIG_UID16=y 75CONFIG_UID16=y
57CONFIG_SYSCTL_SYSCALL=y 76CONFIG_SYSCTL_SYSCALL=y
@@ -62,32 +81,38 @@ CONFIG_HOTPLUG=y
62CONFIG_PRINTK=y 81CONFIG_PRINTK=y
63CONFIG_BUG=y 82CONFIG_BUG=y
64CONFIG_ELF_CORE=y 83CONFIG_ELF_CORE=y
65CONFIG_COMPAT_BRK=y
66CONFIG_BASE_FULL=y 84CONFIG_BASE_FULL=y
67CONFIG_FUTEX=y 85CONFIG_FUTEX=y
68CONFIG_ANON_INODES=y
69CONFIG_EPOLL=y 86CONFIG_EPOLL=y
70CONFIG_SIGNALFD=y 87CONFIG_SIGNALFD=y
71CONFIG_TIMERFD=y 88CONFIG_TIMERFD=y
72CONFIG_EVENTFD=y 89CONFIG_EVENTFD=y
73CONFIG_SHMEM=y 90CONFIG_SHMEM=y
74CONFIG_AIO=y 91CONFIG_AIO=y
92
93#
94# Kernel Performance Events And Counters
95#
75CONFIG_VM_EVENT_COUNTERS=y 96CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLUB_DEBUG=y 97CONFIG_SLUB_DEBUG=y
98CONFIG_COMPAT_BRK=y
77# CONFIG_SLAB is not set 99# CONFIG_SLAB is not set
78CONFIG_SLUB=y 100CONFIG_SLUB=y
79# CONFIG_SLOB is not set 101# CONFIG_SLOB is not set
80# CONFIG_PROFILING is not set 102# CONFIG_PROFILING is not set
81# CONFIG_MARKERS is not set
82CONFIG_HAVE_OPROFILE=y 103CONFIG_HAVE_OPROFILE=y
83# CONFIG_KPROBES is not set 104# CONFIG_KPROBES is not set
84CONFIG_HAVE_KPROBES=y 105CONFIG_HAVE_KPROBES=y
85CONFIG_HAVE_KRETPROBES=y 106CONFIG_HAVE_KRETPROBES=y
86CONFIG_HAVE_CLK=y 107CONFIG_HAVE_CLK=y
108
109#
110# GCOV-based kernel profiling
111#
112# CONFIG_SLOW_WORK is not set
87CONFIG_HAVE_GENERIC_DMA_COHERENT=y 113CONFIG_HAVE_GENERIC_DMA_COHERENT=y
88CONFIG_SLABINFO=y 114CONFIG_SLABINFO=y
89CONFIG_RT_MUTEXES=y 115CONFIG_RT_MUTEXES=y
90# CONFIG_TINY_SHMEM is not set
91CONFIG_BASE_SMALL=0 116CONFIG_BASE_SMALL=0
92CONFIG_MODULES=y 117CONFIG_MODULES=y
93# CONFIG_MODULE_FORCE_LOAD is not set 118# CONFIG_MODULE_FORCE_LOAD is not set
@@ -95,11 +120,8 @@ CONFIG_MODULE_UNLOAD=y
95# CONFIG_MODULE_FORCE_UNLOAD is not set 120# CONFIG_MODULE_FORCE_UNLOAD is not set
96# CONFIG_MODVERSIONS is not set 121# CONFIG_MODVERSIONS is not set
97# CONFIG_MODULE_SRCVERSION_ALL is not set 122# CONFIG_MODULE_SRCVERSION_ALL is not set
98CONFIG_KMOD=y
99CONFIG_BLOCK=y 123CONFIG_BLOCK=y
100CONFIG_LBD=y 124CONFIG_LBDAF=y
101# CONFIG_BLK_DEV_IO_TRACE is not set
102CONFIG_LSF=y
103# CONFIG_BLK_DEV_BSG is not set 125# CONFIG_BLK_DEV_BSG is not set
104# CONFIG_BLK_DEV_INTEGRITY is not set 126# CONFIG_BLK_DEV_INTEGRITY is not set
105 127
@@ -107,33 +129,62 @@ CONFIG_LSF=y
107# IO Schedulers 129# IO Schedulers
108# 130#
109CONFIG_IOSCHED_NOOP=y 131CONFIG_IOSCHED_NOOP=y
110CONFIG_IOSCHED_AS=y
111CONFIG_IOSCHED_DEADLINE=y 132CONFIG_IOSCHED_DEADLINE=y
112CONFIG_IOSCHED_CFQ=y 133CONFIG_IOSCHED_CFQ=y
113# CONFIG_DEFAULT_AS is not set
114# CONFIG_DEFAULT_DEADLINE is not set 134# CONFIG_DEFAULT_DEADLINE is not set
115CONFIG_DEFAULT_CFQ=y 135CONFIG_DEFAULT_CFQ=y
116# CONFIG_DEFAULT_NOOP is not set 136# CONFIG_DEFAULT_NOOP is not set
117CONFIG_DEFAULT_IOSCHED="cfq" 137CONFIG_DEFAULT_IOSCHED="cfq"
118CONFIG_CLASSIC_RCU=y 138# CONFIG_INLINE_SPIN_TRYLOCK is not set
139# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
140# CONFIG_INLINE_SPIN_LOCK is not set
141# CONFIG_INLINE_SPIN_LOCK_BH is not set
142# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
143# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
144# CONFIG_INLINE_SPIN_UNLOCK is not set
145# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
146# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
147# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
148# CONFIG_INLINE_READ_TRYLOCK is not set
149# CONFIG_INLINE_READ_LOCK is not set
150# CONFIG_INLINE_READ_LOCK_BH is not set
151# CONFIG_INLINE_READ_LOCK_IRQ is not set
152# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
153# CONFIG_INLINE_READ_UNLOCK is not set
154# CONFIG_INLINE_READ_UNLOCK_BH is not set
155# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
156# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
157# CONFIG_INLINE_WRITE_TRYLOCK is not set
158# CONFIG_INLINE_WRITE_LOCK is not set
159# CONFIG_INLINE_WRITE_LOCK_BH is not set
160# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
161# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
162# CONFIG_INLINE_WRITE_UNLOCK is not set
163# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
164# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
165# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
166# CONFIG_MUTEX_SPIN_ON_OWNER is not set
119# CONFIG_FREEZER is not set 167# CONFIG_FREEZER is not set
120 168
121# 169#
122# System Type 170# System Type
123# 171#
172CONFIG_MMU=y
124# CONFIG_ARCH_AAEC2000 is not set 173# CONFIG_ARCH_AAEC2000 is not set
125# CONFIG_ARCH_INTEGRATOR is not set 174# CONFIG_ARCH_INTEGRATOR is not set
126# CONFIG_ARCH_REALVIEW is not set 175# CONFIG_ARCH_REALVIEW is not set
127# CONFIG_ARCH_VERSATILE is not set 176# CONFIG_ARCH_VERSATILE is not set
128# CONFIG_ARCH_AT91 is not set 177# CONFIG_ARCH_AT91 is not set
129# CONFIG_ARCH_CLPS7500 is not set
130# CONFIG_ARCH_CLPS711X is not set 178# CONFIG_ARCH_CLPS711X is not set
179# CONFIG_ARCH_GEMINI is not set
131# CONFIG_ARCH_EBSA110 is not set 180# CONFIG_ARCH_EBSA110 is not set
132# CONFIG_ARCH_EP93XX is not set 181# CONFIG_ARCH_EP93XX is not set
133# CONFIG_ARCH_FOOTBRIDGE is not set 182# CONFIG_ARCH_FOOTBRIDGE is not set
183# CONFIG_ARCH_MXC is not set
184# CONFIG_ARCH_STMP3XXX is not set
134# CONFIG_ARCH_NETX is not set 185# CONFIG_ARCH_NETX is not set
135# CONFIG_ARCH_H720X is not set 186# CONFIG_ARCH_H720X is not set
136# CONFIG_ARCH_IMX is not set 187# CONFIG_ARCH_NOMADIK is not set
137# CONFIG_ARCH_IOP13XX is not set 188# CONFIG_ARCH_IOP13XX is not set
138# CONFIG_ARCH_IOP32X is not set 189# CONFIG_ARCH_IOP32X is not set
139# CONFIG_ARCH_IOP33X is not set 190# CONFIG_ARCH_IOP33X is not set
@@ -141,35 +192,62 @@ CONFIG_CLASSIC_RCU=y
141# CONFIG_ARCH_IXP2000 is not set 192# CONFIG_ARCH_IXP2000 is not set
142# CONFIG_ARCH_IXP4XX is not set 193# CONFIG_ARCH_IXP4XX is not set
143# CONFIG_ARCH_L7200 is not set 194# CONFIG_ARCH_L7200 is not set
195# CONFIG_ARCH_DOVE is not set
144# CONFIG_ARCH_KIRKWOOD is not set 196# CONFIG_ARCH_KIRKWOOD is not set
145# CONFIG_ARCH_KS8695 is not set
146# CONFIG_ARCH_NS9XXX is not set
147# CONFIG_ARCH_LOKI is not set 197# CONFIG_ARCH_LOKI is not set
148# CONFIG_ARCH_MV78XX0 is not set 198# CONFIG_ARCH_MV78XX0 is not set
149# CONFIG_ARCH_MXC is not set
150# CONFIG_ARCH_ORION5X is not set 199# CONFIG_ARCH_ORION5X is not set
200# CONFIG_ARCH_MMP is not set
201# CONFIG_ARCH_KS8695 is not set
202# CONFIG_ARCH_NS9XXX is not set
203# CONFIG_ARCH_W90X900 is not set
151# CONFIG_ARCH_PNX4008 is not set 204# CONFIG_ARCH_PNX4008 is not set
152# CONFIG_ARCH_PXA is not set 205# CONFIG_ARCH_PXA is not set
206# CONFIG_ARCH_MSM is not set
153# CONFIG_ARCH_RPC is not set 207# CONFIG_ARCH_RPC is not set
154# CONFIG_ARCH_SA1100 is not set 208# CONFIG_ARCH_SA1100 is not set
155# CONFIG_ARCH_S3C2410 is not set 209# CONFIG_ARCH_S3C2410 is not set
156CONFIG_ARCH_S3C64XX=y 210CONFIG_ARCH_S3C64XX=y
211# CONFIG_ARCH_S5P6440 is not set
212# CONFIG_ARCH_S5PC1XX is not set
157# CONFIG_ARCH_SHARK is not set 213# CONFIG_ARCH_SHARK is not set
158# CONFIG_ARCH_LH7A40X is not set 214# CONFIG_ARCH_LH7A40X is not set
215# CONFIG_ARCH_U300 is not set
159# CONFIG_ARCH_DAVINCI is not set 216# CONFIG_ARCH_DAVINCI is not set
160# CONFIG_ARCH_OMAP is not set 217# CONFIG_ARCH_OMAP is not set
161# CONFIG_ARCH_MSM is not set 218# CONFIG_ARCH_BCMRING is not set
219# CONFIG_ARCH_U8500 is not set
220CONFIG_PLAT_SAMSUNG=y
221CONFIG_SAMSUNG_CLKSRC=y
222CONFIG_SAMSUNG_IRQ_VIC_TIMER=y
223CONFIG_SAMSUNG_IRQ_UART=y
224CONFIG_S3C_GPIO_CFG_S3C24XX=y
225CONFIG_S3C_GPIO_CFG_S3C64XX=y
226CONFIG_S3C_GPIO_PULL_UPDOWN=y
227CONFIG_SAMSUNG_GPIO_EXTRA=0
228# CONFIG_S3C_ADC is not set
229CONFIG_S3C_DEV_HSMMC=y
230CONFIG_S3C_DEV_HSMMC1=y
231CONFIG_S3C_DEV_I2C1=y
232CONFIG_S3C_DEV_FB=y
233CONFIG_S3C_DEV_USB_HOST=y
234CONFIG_S3C_DEV_USB_HSOTG=y
235CONFIG_S3C_DEV_NAND=y
162CONFIG_PLAT_S3C64XX=y 236CONFIG_PLAT_S3C64XX=y
163CONFIG_CPU_S3C6400_INIT=y 237CONFIG_CPU_S3C6400_INIT=y
164CONFIG_CPU_S3C6400_CLOCK=y 238CONFIG_CPU_S3C6400_CLOCK=y
239# CONFIG_S3C64XX_DMA is not set
165CONFIG_S3C64XX_SETUP_I2C0=y 240CONFIG_S3C64XX_SETUP_I2C0=y
166CONFIG_S3C64XX_SETUP_I2C1=y 241CONFIG_S3C64XX_SETUP_I2C1=y
242CONFIG_S3C64XX_SETUP_FB_24BPP=y
243CONFIG_S3C64XX_SETUP_SDHCI_GPIO=y
167CONFIG_PLAT_S3C=y 244CONFIG_PLAT_S3C=y
168 245
169# 246#
170# Boot options 247# Boot options
171# 248#
172CONFIG_S3C_BOOT_ERROR_RESET=y 249CONFIG_S3C_BOOT_ERROR_RESET=y
250CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
173 251
174# 252#
175# Power management 253# Power management
@@ -177,17 +255,16 @@ CONFIG_S3C_BOOT_ERROR_RESET=y
177CONFIG_S3C_LOWLEVEL_UART_PORT=0 255CONFIG_S3C_LOWLEVEL_UART_PORT=0
178CONFIG_S3C_GPIO_SPACE=0 256CONFIG_S3C_GPIO_SPACE=0
179CONFIG_S3C_GPIO_TRACK=y 257CONFIG_S3C_GPIO_TRACK=y
180CONFIG_S3C_GPIO_PULL_UPDOWN=y 258# CONFIG_MACH_SMDK6400 is not set
181CONFIG_S3C_GPIO_CFG_S3C24XX=y
182CONFIG_S3C_GPIO_CFG_S3C64XX=y
183CONFIG_S3C_DEV_HSMMC=y
184CONFIG_S3C_DEV_HSMMC1=y
185CONFIG_S3C_DEV_I2C1=y
186CONFIG_CPU_S3C6410=y 259CONFIG_CPU_S3C6410=y
187CONFIG_S3C6410_SETUP_SDHCI=y 260CONFIG_S3C6410_SETUP_SDHCI=y
261# CONFIG_MACH_ANW6410 is not set
188CONFIG_MACH_SMDK6410=y 262CONFIG_MACH_SMDK6410=y
189CONFIG_SMDK6410_SD_CH0=y 263CONFIG_SMDK6410_SD_CH0=y
190# CONFIG_SMDK6410_SD_CH1 is not set 264# CONFIG_SMDK6410_SD_CH1 is not set
265# CONFIG_SMDK6410_WM1190_EV1 is not set
266# CONFIG_MACH_NCP is not set
267# CONFIG_MACH_HMT is not set
191 268
192# 269#
193# Processor Type 270# Processor Type
@@ -196,7 +273,7 @@ CONFIG_CPU_V6=y
196CONFIG_CPU_32v6K=y 273CONFIG_CPU_32v6K=y
197CONFIG_CPU_32v6=y 274CONFIG_CPU_32v6=y
198CONFIG_CPU_ABRT_EV6=y 275CONFIG_CPU_ABRT_EV6=y
199CONFIG_CPU_PABRT_NOIFAR=y 276CONFIG_CPU_PABRT_V6=y
200CONFIG_CPU_CACHE_V6=y 277CONFIG_CPU_CACHE_V6=y
201CONFIG_CPU_CACHE_VIPT=y 278CONFIG_CPU_CACHE_VIPT=y
202CONFIG_CPU_COPY_V6=y 279CONFIG_CPU_COPY_V6=y
@@ -212,8 +289,10 @@ CONFIG_ARM_THUMB=y
212# CONFIG_CPU_ICACHE_DISABLE is not set 289# CONFIG_CPU_ICACHE_DISABLE is not set
213# CONFIG_CPU_DCACHE_DISABLE is not set 290# CONFIG_CPU_DCACHE_DISABLE is not set
214# CONFIG_CPU_BPREDICT_DISABLE is not set 291# CONFIG_CPU_BPREDICT_DISABLE is not set
215# CONFIG_OUTER_CACHE is not set 292CONFIG_ARM_L1_CACHE_SHIFT=5
293# CONFIG_ARM_ERRATA_411920 is not set
216CONFIG_ARM_VIC=y 294CONFIG_ARM_VIC=y
295CONFIG_ARM_VIC_NR=2
217 296
218# 297#
219# Bus support 298# Bus support
@@ -229,13 +308,15 @@ CONFIG_VMSPLIT_3G=y
229# CONFIG_VMSPLIT_2G is not set 308# CONFIG_VMSPLIT_2G is not set
230# CONFIG_VMSPLIT_1G is not set 309# CONFIG_VMSPLIT_1G is not set
231CONFIG_PAGE_OFFSET=0xC0000000 310CONFIG_PAGE_OFFSET=0xC0000000
311CONFIG_PREEMPT_NONE=y
312# CONFIG_PREEMPT_VOLUNTARY is not set
232# CONFIG_PREEMPT is not set 313# CONFIG_PREEMPT is not set
233CONFIG_HZ=100 314CONFIG_HZ=100
234CONFIG_AEABI=y 315CONFIG_AEABI=y
235CONFIG_OABI_COMPAT=y 316CONFIG_OABI_COMPAT=y
236CONFIG_ARCH_FLATMEM_HAS_HOLES=y
237# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set 317# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
238# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set 318# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
319# CONFIG_HIGHMEM is not set
239CONFIG_SELECT_MEMORY_MODEL=y 320CONFIG_SELECT_MEMORY_MODEL=y
240CONFIG_FLATMEM_MANUAL=y 321CONFIG_FLATMEM_MANUAL=y
241# CONFIG_DISCONTIGMEM_MANUAL is not set 322# CONFIG_DISCONTIGMEM_MANUAL is not set
@@ -243,26 +324,28 @@ CONFIG_FLATMEM_MANUAL=y
243CONFIG_FLATMEM=y 324CONFIG_FLATMEM=y
244CONFIG_FLAT_NODE_MEM_MAP=y 325CONFIG_FLAT_NODE_MEM_MAP=y
245CONFIG_PAGEFLAGS_EXTENDED=y 326CONFIG_PAGEFLAGS_EXTENDED=y
246CONFIG_SPLIT_PTLOCK_CPUS=4 327CONFIG_SPLIT_PTLOCK_CPUS=999999
247# CONFIG_RESOURCES_64BIT is not set
248# CONFIG_PHYS_ADDR_T_64BIT is not set 328# CONFIG_PHYS_ADDR_T_64BIT is not set
249CONFIG_ZONE_DMA_FLAG=0 329CONFIG_ZONE_DMA_FLAG=0
250CONFIG_VIRT_TO_BUS=y 330CONFIG_VIRT_TO_BUS=y
251CONFIG_UNEVICTABLE_LRU=y 331# CONFIG_KSM is not set
332CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
252CONFIG_ALIGNMENT_TRAP=y 333CONFIG_ALIGNMENT_TRAP=y
334# CONFIG_UACCESS_WITH_MEMCPY is not set
253 335
254# 336#
255# Boot options 337# Boot options
256# 338#
257CONFIG_ZBOOT_ROM_TEXT=0 339CONFIG_ZBOOT_ROM_TEXT=0
258CONFIG_ZBOOT_ROM_BSS=0 340CONFIG_ZBOOT_ROM_BSS=0
259CONFIG_CMDLINE="console=ttySAC0,115200 root=/dev/ram init=/bin/bash initrd=0x51000000,4M" 341CONFIG_CMDLINE="console=ttySAC0,115200 root=/dev/ram init=/linuxrc initrd=0x51000000,6M ramdisk_size=6144"
260# CONFIG_XIP_KERNEL is not set 342# CONFIG_XIP_KERNEL is not set
261# CONFIG_KEXEC is not set 343# CONFIG_KEXEC is not set
262 344
263# 345#
264# CPU Power Management 346# CPU Power Management
265# 347#
348# CONFIG_CPU_FREQ is not set
266# CONFIG_CPU_IDLE is not set 349# CONFIG_CPU_IDLE is not set
267 350
268# 351#
@@ -300,6 +383,7 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
300# Generic Driver Options 383# Generic Driver Options
301# 384#
302CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 385CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
386# CONFIG_DEVTMPFS is not set
303CONFIG_STANDALONE=y 387CONFIG_STANDALONE=y
304CONFIG_PREVENT_FIRMWARE_BUILD=y 388CONFIG_PREVENT_FIRMWARE_BUILD=y
305CONFIG_FW_LOADER=y 389CONFIG_FW_LOADER=y
@@ -314,14 +398,32 @@ CONFIG_BLK_DEV=y
314# CONFIG_BLK_DEV_COW_COMMON is not set 398# CONFIG_BLK_DEV_COW_COMMON is not set
315CONFIG_BLK_DEV_LOOP=y 399CONFIG_BLK_DEV_LOOP=y
316# CONFIG_BLK_DEV_CRYPTOLOOP is not set 400# CONFIG_BLK_DEV_CRYPTOLOOP is not set
401
402#
403# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
404#
317CONFIG_BLK_DEV_RAM=y 405CONFIG_BLK_DEV_RAM=y
318CONFIG_BLK_DEV_RAM_COUNT=16 406CONFIG_BLK_DEV_RAM_COUNT=16
319CONFIG_BLK_DEV_RAM_SIZE=4096 407CONFIG_BLK_DEV_RAM_SIZE=4096
320# CONFIG_BLK_DEV_XIP is not set 408# CONFIG_BLK_DEV_XIP is not set
321# CONFIG_CDROM_PKTCDVD is not set 409# CONFIG_CDROM_PKTCDVD is not set
410# CONFIG_MG_DISK is not set
322CONFIG_MISC_DEVICES=y 411CONFIG_MISC_DEVICES=y
323# CONFIG_EEPROM_93CX6 is not set 412# CONFIG_AD525X_DPOT is not set
413# CONFIG_ICS932S401 is not set
324# CONFIG_ENCLOSURE_SERVICES is not set 414# CONFIG_ENCLOSURE_SERVICES is not set
415# CONFIG_ISL29003 is not set
416# CONFIG_DS1682 is not set
417# CONFIG_C2PORT is not set
418
419#
420# EEPROM support
421#
422CONFIG_EEPROM_AT24=y
423# CONFIG_EEPROM_LEGACY is not set
424# CONFIG_EEPROM_MAX6875 is not set
425# CONFIG_EEPROM_93CX6 is not set
426# CONFIG_IWMC3200TOP is not set
325CONFIG_HAVE_IDE=y 427CONFIG_HAVE_IDE=y
326# CONFIG_IDE is not set 428# CONFIG_IDE is not set
327 429
@@ -334,6 +436,7 @@ CONFIG_HAVE_IDE=y
334# CONFIG_SCSI_NETLINK is not set 436# CONFIG_SCSI_NETLINK is not set
335# CONFIG_ATA is not set 437# CONFIG_ATA is not set
336# CONFIG_MD is not set 438# CONFIG_MD is not set
439# CONFIG_PHONE is not set
337 440
338# 441#
339# Input device support 442# Input device support
@@ -341,6 +444,7 @@ CONFIG_HAVE_IDE=y
341CONFIG_INPUT=y 444CONFIG_INPUT=y
342# CONFIG_INPUT_FF_MEMLESS is not set 445# CONFIG_INPUT_FF_MEMLESS is not set
343# CONFIG_INPUT_POLLDEV is not set 446# CONFIG_INPUT_POLLDEV is not set
447# CONFIG_INPUT_SPARSEKMAP is not set
344 448
345# 449#
346# Userland interfaces 450# Userland interfaces
@@ -357,27 +461,33 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
357# Input Device Drivers 461# Input Device Drivers
358# 462#
359CONFIG_INPUT_KEYBOARD=y 463CONFIG_INPUT_KEYBOARD=y
464# CONFIG_KEYBOARD_ADP5588 is not set
360CONFIG_KEYBOARD_ATKBD=y 465CONFIG_KEYBOARD_ATKBD=y
361# CONFIG_KEYBOARD_SUNKBD is not set 466# CONFIG_QT2160 is not set
362# CONFIG_KEYBOARD_LKKBD is not set 467# CONFIG_KEYBOARD_LKKBD is not set
363# CONFIG_KEYBOARD_XTKBD is not set 468# CONFIG_KEYBOARD_GPIO is not set
469# CONFIG_KEYBOARD_MATRIX is not set
470# CONFIG_KEYBOARD_MAX7359 is not set
364# CONFIG_KEYBOARD_NEWTON is not set 471# CONFIG_KEYBOARD_NEWTON is not set
472# CONFIG_KEYBOARD_OPENCORES is not set
365# CONFIG_KEYBOARD_STOWAWAY is not set 473# CONFIG_KEYBOARD_STOWAWAY is not set
366# CONFIG_KEYBOARD_GPIO is not set 474# CONFIG_KEYBOARD_SUNKBD is not set
475# CONFIG_KEYBOARD_XTKBD is not set
367CONFIG_INPUT_MOUSE=y 476CONFIG_INPUT_MOUSE=y
368CONFIG_MOUSE_PS2=y 477CONFIG_MOUSE_PS2=y
369CONFIG_MOUSE_PS2_ALPS=y 478CONFIG_MOUSE_PS2_ALPS=y
370CONFIG_MOUSE_PS2_LOGIPS2PP=y 479CONFIG_MOUSE_PS2_LOGIPS2PP=y
371CONFIG_MOUSE_PS2_SYNAPTICS=y 480CONFIG_MOUSE_PS2_SYNAPTICS=y
372CONFIG_MOUSE_PS2_LIFEBOOK=y
373CONFIG_MOUSE_PS2_TRACKPOINT=y 481CONFIG_MOUSE_PS2_TRACKPOINT=y
374# CONFIG_MOUSE_PS2_ELANTECH is not set 482# CONFIG_MOUSE_PS2_ELANTECH is not set
483# CONFIG_MOUSE_PS2_SENTELIC is not set
375# CONFIG_MOUSE_PS2_TOUCHKIT is not set 484# CONFIG_MOUSE_PS2_TOUCHKIT is not set
376# CONFIG_MOUSE_SERIAL is not set 485# CONFIG_MOUSE_SERIAL is not set
377# CONFIG_MOUSE_APPLETOUCH is not set 486# CONFIG_MOUSE_APPLETOUCH is not set
378# CONFIG_MOUSE_BCM5974 is not set 487# CONFIG_MOUSE_BCM5974 is not set
379# CONFIG_MOUSE_VSXXXAA is not set 488# CONFIG_MOUSE_VSXXXAA is not set
380# CONFIG_MOUSE_GPIO is not set 489# CONFIG_MOUSE_GPIO is not set
490# CONFIG_MOUSE_SYNAPTICS_I2C is not set
381# CONFIG_INPUT_JOYSTICK is not set 491# CONFIG_INPUT_JOYSTICK is not set
382# CONFIG_INPUT_TABLET is not set 492# CONFIG_INPUT_TABLET is not set
383# CONFIG_INPUT_TOUCHSCREEN is not set 493# CONFIG_INPUT_TOUCHSCREEN is not set
@@ -390,6 +500,7 @@ CONFIG_SERIO=y
390CONFIG_SERIO_SERPORT=y 500CONFIG_SERIO_SERPORT=y
391CONFIG_SERIO_LIBPS2=y 501CONFIG_SERIO_LIBPS2=y
392# CONFIG_SERIO_RAW is not set 502# CONFIG_SERIO_RAW is not set
503# CONFIG_SERIO_ALTERA_PS2 is not set
393# CONFIG_GAMEPORT is not set 504# CONFIG_GAMEPORT is not set
394 505
395# 506#
@@ -423,16 +534,18 @@ CONFIG_SERIAL_S3C6400=y
423CONFIG_SERIAL_CORE=y 534CONFIG_SERIAL_CORE=y
424CONFIG_SERIAL_CORE_CONSOLE=y 535CONFIG_SERIAL_CORE_CONSOLE=y
425CONFIG_UNIX98_PTYS=y 536CONFIG_UNIX98_PTYS=y
537# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
426CONFIG_LEGACY_PTYS=y 538CONFIG_LEGACY_PTYS=y
427CONFIG_LEGACY_PTY_COUNT=256 539CONFIG_LEGACY_PTY_COUNT=256
428# CONFIG_IPMI_HANDLER is not set 540# CONFIG_IPMI_HANDLER is not set
429CONFIG_HW_RANDOM=y 541CONFIG_HW_RANDOM=y
430# CONFIG_NVRAM is not set 542# CONFIG_HW_RANDOM_TIMERIOMEM is not set
431# CONFIG_R3964 is not set 543# CONFIG_R3964 is not set
432# CONFIG_RAW_DRIVER is not set 544# CONFIG_RAW_DRIVER is not set
433# CONFIG_TCG_TPM is not set 545# CONFIG_TCG_TPM is not set
434CONFIG_I2C=y 546CONFIG_I2C=y
435CONFIG_I2C_BOARDINFO=y 547CONFIG_I2C_BOARDINFO=y
548CONFIG_I2C_COMPAT=y
436CONFIG_I2C_CHARDEV=y 549CONFIG_I2C_CHARDEV=y
437CONFIG_I2C_HELPER_AUTO=y 550CONFIG_I2C_HELPER_AUTO=y
438 551
@@ -443,6 +556,7 @@ CONFIG_I2C_HELPER_AUTO=y
443# 556#
444# I2C system bus drivers (mostly embedded / system-on-chip) 557# I2C system bus drivers (mostly embedded / system-on-chip)
445# 558#
559# CONFIG_I2C_DESIGNWARE is not set
446# CONFIG_I2C_GPIO is not set 560# CONFIG_I2C_GPIO is not set
447# CONFIG_I2C_OCORES is not set 561# CONFIG_I2C_OCORES is not set
448CONFIG_I2C_S3C2410=y 562CONFIG_I2C_S3C2410=y
@@ -463,32 +577,33 @@ CONFIG_I2C_S3C2410=y
463# 577#
464# Miscellaneous I2C Chip support 578# Miscellaneous I2C Chip support
465# 579#
466# CONFIG_DS1682 is not set
467CONFIG_EEPROM_AT24=y
468# CONFIG_EEPROM_LEGACY is not set
469# CONFIG_SENSORS_PCF8574 is not set
470# CONFIG_PCF8575 is not set
471# CONFIG_SENSORS_PCA9539 is not set
472# CONFIG_SENSORS_PCF8591 is not set
473# CONFIG_TPS65010 is not set
474# CONFIG_SENSORS_MAX6875 is not set
475# CONFIG_SENSORS_TSL2550 is not set 580# CONFIG_SENSORS_TSL2550 is not set
476# CONFIG_I2C_DEBUG_CORE is not set 581# CONFIG_I2C_DEBUG_CORE is not set
477# CONFIG_I2C_DEBUG_ALGO is not set 582# CONFIG_I2C_DEBUG_ALGO is not set
478# CONFIG_I2C_DEBUG_BUS is not set 583# CONFIG_I2C_DEBUG_BUS is not set
479# CONFIG_I2C_DEBUG_CHIP is not set 584# CONFIG_I2C_DEBUG_CHIP is not set
480# CONFIG_SPI is not set 585# CONFIG_SPI is not set
586
587#
588# PPS support
589#
590# CONFIG_PPS is not set
481CONFIG_ARCH_REQUIRE_GPIOLIB=y 591CONFIG_ARCH_REQUIRE_GPIOLIB=y
482CONFIG_GPIOLIB=y 592CONFIG_GPIOLIB=y
483# CONFIG_DEBUG_GPIO is not set 593# CONFIG_DEBUG_GPIO is not set
484# CONFIG_GPIO_SYSFS is not set 594# CONFIG_GPIO_SYSFS is not set
485 595
486# 596#
597# Memory mapped GPIO expanders:
598#
599
600#
487# I2C GPIO expanders: 601# I2C GPIO expanders:
488# 602#
489# CONFIG_GPIO_MAX732X is not set 603# CONFIG_GPIO_MAX732X is not set
490# CONFIG_GPIO_PCA953X is not set 604# CONFIG_GPIO_PCA953X is not set
491# CONFIG_GPIO_PCF857X is not set 605# CONFIG_GPIO_PCF857X is not set
606# CONFIG_GPIO_ADP5588 is not set
492 607
493# 608#
494# PCI GPIO expanders: 609# PCI GPIO expanders:
@@ -497,10 +612,19 @@ CONFIG_GPIOLIB=y
497# 612#
498# SPI GPIO expanders: 613# SPI GPIO expanders:
499# 614#
615
616#
617# AC97 GPIO expanders:
618#
500# CONFIG_W1 is not set 619# CONFIG_W1 is not set
501# CONFIG_POWER_SUPPLY is not set 620# CONFIG_POWER_SUPPLY is not set
502CONFIG_HWMON=y 621CONFIG_HWMON=y
503# CONFIG_HWMON_VID is not set 622# CONFIG_HWMON_VID is not set
623# CONFIG_HWMON_DEBUG_CHIP is not set
624
625#
626# Native drivers
627#
504# CONFIG_SENSORS_AD7414 is not set 628# CONFIG_SENSORS_AD7414 is not set
505# CONFIG_SENSORS_AD7418 is not set 629# CONFIG_SENSORS_AD7418 is not set
506# CONFIG_SENSORS_ADM1021 is not set 630# CONFIG_SENSORS_ADM1021 is not set
@@ -509,17 +633,21 @@ CONFIG_HWMON=y
509# CONFIG_SENSORS_ADM1029 is not set 633# CONFIG_SENSORS_ADM1029 is not set
510# CONFIG_SENSORS_ADM1031 is not set 634# CONFIG_SENSORS_ADM1031 is not set
511# CONFIG_SENSORS_ADM9240 is not set 635# CONFIG_SENSORS_ADM9240 is not set
636# CONFIG_SENSORS_ADT7462 is not set
512# CONFIG_SENSORS_ADT7470 is not set 637# CONFIG_SENSORS_ADT7470 is not set
513# CONFIG_SENSORS_ADT7473 is not set 638# CONFIG_SENSORS_ADT7473 is not set
639# CONFIG_SENSORS_ADT7475 is not set
514# CONFIG_SENSORS_ATXP1 is not set 640# CONFIG_SENSORS_ATXP1 is not set
515# CONFIG_SENSORS_DS1621 is not set 641# CONFIG_SENSORS_DS1621 is not set
516# CONFIG_SENSORS_F71805F is not set 642# CONFIG_SENSORS_F71805F is not set
517# CONFIG_SENSORS_F71882FG is not set 643# CONFIG_SENSORS_F71882FG is not set
518# CONFIG_SENSORS_F75375S is not set 644# CONFIG_SENSORS_F75375S is not set
645# CONFIG_SENSORS_G760A is not set
519# CONFIG_SENSORS_GL518SM is not set 646# CONFIG_SENSORS_GL518SM is not set
520# CONFIG_SENSORS_GL520SM is not set 647# CONFIG_SENSORS_GL520SM is not set
521# CONFIG_SENSORS_IT87 is not set 648# CONFIG_SENSORS_IT87 is not set
522# CONFIG_SENSORS_LM63 is not set 649# CONFIG_SENSORS_LM63 is not set
650# CONFIG_SENSORS_LM73 is not set
523# CONFIG_SENSORS_LM75 is not set 651# CONFIG_SENSORS_LM75 is not set
524# CONFIG_SENSORS_LM77 is not set 652# CONFIG_SENSORS_LM77 is not set
525# CONFIG_SENSORS_LM78 is not set 653# CONFIG_SENSORS_LM78 is not set
@@ -530,16 +658,24 @@ CONFIG_HWMON=y
530# CONFIG_SENSORS_LM90 is not set 658# CONFIG_SENSORS_LM90 is not set
531# CONFIG_SENSORS_LM92 is not set 659# CONFIG_SENSORS_LM92 is not set
532# CONFIG_SENSORS_LM93 is not set 660# CONFIG_SENSORS_LM93 is not set
661# CONFIG_SENSORS_LTC4215 is not set
662# CONFIG_SENSORS_LTC4245 is not set
663# CONFIG_SENSORS_LM95241 is not set
533# CONFIG_SENSORS_MAX1619 is not set 664# CONFIG_SENSORS_MAX1619 is not set
534# CONFIG_SENSORS_MAX6650 is not set 665# CONFIG_SENSORS_MAX6650 is not set
535# CONFIG_SENSORS_PC87360 is not set 666# CONFIG_SENSORS_PC87360 is not set
536# CONFIG_SENSORS_PC87427 is not set 667# CONFIG_SENSORS_PC87427 is not set
668# CONFIG_SENSORS_PCF8591 is not set
669# CONFIG_SENSORS_SHT15 is not set
537# CONFIG_SENSORS_DME1737 is not set 670# CONFIG_SENSORS_DME1737 is not set
538# CONFIG_SENSORS_SMSC47M1 is not set 671# CONFIG_SENSORS_SMSC47M1 is not set
539# CONFIG_SENSORS_SMSC47M192 is not set 672# CONFIG_SENSORS_SMSC47M192 is not set
540# CONFIG_SENSORS_SMSC47B397 is not set 673# CONFIG_SENSORS_SMSC47B397 is not set
541# CONFIG_SENSORS_ADS7828 is not set 674# CONFIG_SENSORS_ADS7828 is not set
675# CONFIG_SENSORS_AMC6821 is not set
542# CONFIG_SENSORS_THMC50 is not set 676# CONFIG_SENSORS_THMC50 is not set
677# CONFIG_SENSORS_TMP401 is not set
678# CONFIG_SENSORS_TMP421 is not set
543# CONFIG_SENSORS_VT1211 is not set 679# CONFIG_SENSORS_VT1211 is not set
544# CONFIG_SENSORS_W83781D is not set 680# CONFIG_SENSORS_W83781D is not set
545# CONFIG_SENSORS_W83791D is not set 681# CONFIG_SENSORS_W83791D is not set
@@ -549,15 +685,14 @@ CONFIG_HWMON=y
549# CONFIG_SENSORS_W83L786NG is not set 685# CONFIG_SENSORS_W83L786NG is not set
550# CONFIG_SENSORS_W83627HF is not set 686# CONFIG_SENSORS_W83627HF is not set
551# CONFIG_SENSORS_W83627EHF is not set 687# CONFIG_SENSORS_W83627EHF is not set
552# CONFIG_HWMON_DEBUG_CHIP is not set 688# CONFIG_SENSORS_LIS3_I2C is not set
553# CONFIG_THERMAL is not set 689# CONFIG_THERMAL is not set
554# CONFIG_THERMAL_HWMON is not set
555# CONFIG_WATCHDOG is not set 690# CONFIG_WATCHDOG is not set
691CONFIG_SSB_POSSIBLE=y
556 692
557# 693#
558# Sonics Silicon Backplane 694# Sonics Silicon Backplane
559# 695#
560CONFIG_SSB_POSSIBLE=y
561# CONFIG_SSB is not set 696# CONFIG_SSB is not set
562 697
563# 698#
@@ -568,28 +703,22 @@ CONFIG_SSB_POSSIBLE=y
568# CONFIG_MFD_ASIC3 is not set 703# CONFIG_MFD_ASIC3 is not set
569# CONFIG_HTC_EGPIO is not set 704# CONFIG_HTC_EGPIO is not set
570# CONFIG_HTC_PASIC3 is not set 705# CONFIG_HTC_PASIC3 is not set
706# CONFIG_TPS65010 is not set
707# CONFIG_TWL4030_CORE is not set
571# CONFIG_MFD_TMIO is not set 708# CONFIG_MFD_TMIO is not set
572# CONFIG_MFD_T7L66XB is not set 709# CONFIG_MFD_T7L66XB is not set
573# CONFIG_MFD_TC6387XB is not set 710# CONFIG_MFD_TC6387XB is not set
574# CONFIG_MFD_TC6393XB is not set 711# CONFIG_MFD_TC6393XB is not set
575# CONFIG_PMIC_DA903X is not set 712# CONFIG_PMIC_DA903X is not set
713# CONFIG_PMIC_ADP5520 is not set
576# CONFIG_MFD_WM8400 is not set 714# CONFIG_MFD_WM8400 is not set
715# CONFIG_MFD_WM831X is not set
577# CONFIG_MFD_WM8350_I2C is not set 716# CONFIG_MFD_WM8350_I2C is not set
578 717# CONFIG_MFD_PCF50633 is not set
579# 718# CONFIG_AB3100_CORE is not set
580# Multimedia devices 719# CONFIG_MFD_88PM8607 is not set
581# 720# CONFIG_REGULATOR is not set
582 721# CONFIG_MEDIA_SUPPORT is not set
583#
584# Multimedia core support
585#
586# CONFIG_VIDEO_DEV is not set
587# CONFIG_VIDEO_MEDIA is not set
588
589#
590# Multimedia drivers
591#
592# CONFIG_DAB is not set
593 722
594# 723#
595# Graphics support 724# Graphics support
@@ -612,17 +741,15 @@ CONFIG_DUMMY_CONSOLE=y
612# CONFIG_SOUND is not set 741# CONFIG_SOUND is not set
613CONFIG_HID_SUPPORT=y 742CONFIG_HID_SUPPORT=y
614CONFIG_HID=y 743CONFIG_HID=y
615CONFIG_HID_DEBUG=y
616# CONFIG_HIDRAW is not set 744# CONFIG_HIDRAW is not set
617# CONFIG_HID_PID is not set 745# CONFIG_HID_PID is not set
618 746
619# 747#
620# Special HID drivers 748# Special HID drivers
621# 749#
622# CONFIG_HID_COMPAT is not set
623CONFIG_USB_SUPPORT=y 750CONFIG_USB_SUPPORT=y
624CONFIG_USB_ARCH_HAS_HCD=y 751CONFIG_USB_ARCH_HAS_HCD=y
625# CONFIG_USB_ARCH_HAS_OHCI is not set 752CONFIG_USB_ARCH_HAS_OHCI=y
626# CONFIG_USB_ARCH_HAS_EHCI is not set 753# CONFIG_USB_ARCH_HAS_EHCI is not set
627# CONFIG_USB is not set 754# CONFIG_USB is not set
628 755
@@ -631,9 +758,13 @@ CONFIG_USB_ARCH_HAS_HCD=y
631# 758#
632 759
633# 760#
634# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 761# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
635# 762#
636# CONFIG_USB_GADGET is not set 763# CONFIG_USB_GADGET is not set
764
765#
766# OTG and related infrastructure
767#
637CONFIG_MMC=y 768CONFIG_MMC=y
638CONFIG_MMC_DEBUG=y 769CONFIG_MMC_DEBUG=y
639CONFIG_MMC_UNSAFE_RESUME=y 770CONFIG_MMC_UNSAFE_RESUME=y
@@ -650,22 +781,24 @@ CONFIG_SDIO_UART=y
650# MMC/SD/SDIO Host Controller Drivers 781# MMC/SD/SDIO Host Controller Drivers
651# 782#
652CONFIG_MMC_SDHCI=y 783CONFIG_MMC_SDHCI=y
784# CONFIG_MMC_SDHCI_PLTFM is not set
653CONFIG_MMC_SDHCI_S3C=y 785CONFIG_MMC_SDHCI_S3C=y
786# CONFIG_MMC_SDHCI_S3C_DMA is not set
787# CONFIG_MMC_AT91 is not set
788# CONFIG_MMC_ATMELMCI is not set
654# CONFIG_MEMSTICK is not set 789# CONFIG_MEMSTICK is not set
655# CONFIG_ACCESSIBILITY is not set
656# CONFIG_NEW_LEDS is not set 790# CONFIG_NEW_LEDS is not set
791# CONFIG_ACCESSIBILITY is not set
657CONFIG_RTC_LIB=y 792CONFIG_RTC_LIB=y
658# CONFIG_RTC_CLASS is not set 793# CONFIG_RTC_CLASS is not set
659# CONFIG_DMADEVICES is not set 794# CONFIG_DMADEVICES is not set
795# CONFIG_AUXDISPLAY is not set
796# CONFIG_UIO is not set
660 797
661# 798#
662# Voltage and Current regulators 799# TI VLYNQ
663# 800#
664# CONFIG_REGULATOR is not set 801# CONFIG_STAGING is not set
665# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
666# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
667# CONFIG_REGULATOR_BQ24022 is not set
668# CONFIG_UIO is not set
669 802
670# 803#
671# File systems 804# File systems
@@ -674,6 +807,7 @@ CONFIG_EXT2_FS=y
674# CONFIG_EXT2_FS_XATTR is not set 807# CONFIG_EXT2_FS_XATTR is not set
675# CONFIG_EXT2_FS_XIP is not set 808# CONFIG_EXT2_FS_XIP is not set
676CONFIG_EXT3_FS=y 809CONFIG_EXT3_FS=y
810# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
677CONFIG_EXT3_FS_XATTR=y 811CONFIG_EXT3_FS_XATTR=y
678CONFIG_EXT3_FS_POSIX_ACL=y 812CONFIG_EXT3_FS_POSIX_ACL=y
679CONFIG_EXT3_FS_SECURITY=y 813CONFIG_EXT3_FS_SECURITY=y
@@ -683,9 +817,12 @@ CONFIG_FS_MBCACHE=y
683# CONFIG_REISERFS_FS is not set 817# CONFIG_REISERFS_FS is not set
684# CONFIG_JFS_FS is not set 818# CONFIG_JFS_FS is not set
685CONFIG_FS_POSIX_ACL=y 819CONFIG_FS_POSIX_ACL=y
686CONFIG_FILE_LOCKING=y
687# CONFIG_XFS_FS is not set 820# CONFIG_XFS_FS is not set
688# CONFIG_GFS2_FS is not set 821# CONFIG_GFS2_FS is not set
822# CONFIG_BTRFS_FS is not set
823# CONFIG_NILFS2_FS is not set
824CONFIG_FILE_LOCKING=y
825CONFIG_FSNOTIFY=y
689CONFIG_DNOTIFY=y 826CONFIG_DNOTIFY=y
690CONFIG_INOTIFY=y 827CONFIG_INOTIFY=y
691CONFIG_INOTIFY_USER=y 828CONFIG_INOTIFY_USER=y
@@ -696,6 +833,11 @@ CONFIG_INOTIFY_USER=y
696CONFIG_GENERIC_ACL=y 833CONFIG_GENERIC_ACL=y
697 834
698# 835#
836# Caches
837#
838# CONFIG_FSCACHE is not set
839
840#
699# CD-ROM/DVD Filesystems 841# CD-ROM/DVD Filesystems
700# 842#
701# CONFIG_ISO9660_FS is not set 843# CONFIG_ISO9660_FS is not set
@@ -719,10 +861,7 @@ CONFIG_TMPFS=y
719CONFIG_TMPFS_POSIX_ACL=y 861CONFIG_TMPFS_POSIX_ACL=y
720# CONFIG_HUGETLB_PAGE is not set 862# CONFIG_HUGETLB_PAGE is not set
721# CONFIG_CONFIGFS_FS is not set 863# CONFIG_CONFIGFS_FS is not set
722 864CONFIG_MISC_FILESYSTEMS=y
723#
724# Miscellaneous filesystems
725#
726# CONFIG_ADFS_FS is not set 865# CONFIG_ADFS_FS is not set
727# CONFIG_AFFS_FS is not set 866# CONFIG_AFFS_FS is not set
728# CONFIG_HFS_FS is not set 867# CONFIG_HFS_FS is not set
@@ -731,12 +870,17 @@ CONFIG_TMPFS_POSIX_ACL=y
731# CONFIG_BFS_FS is not set 870# CONFIG_BFS_FS is not set
732# CONFIG_EFS_FS is not set 871# CONFIG_EFS_FS is not set
733CONFIG_CRAMFS=y 872CONFIG_CRAMFS=y
873# CONFIG_SQUASHFS is not set
734# CONFIG_VXFS_FS is not set 874# CONFIG_VXFS_FS is not set
735# CONFIG_MINIX_FS is not set 875# CONFIG_MINIX_FS is not set
736# CONFIG_OMFS_FS is not set 876# CONFIG_OMFS_FS is not set
737# CONFIG_HPFS_FS is not set 877# CONFIG_HPFS_FS is not set
738# CONFIG_QNX4FS_FS is not set 878# CONFIG_QNX4FS_FS is not set
739CONFIG_ROMFS_FS=y 879CONFIG_ROMFS_FS=y
880CONFIG_ROMFS_BACKED_BY_BLOCK=y
881# CONFIG_ROMFS_BACKED_BY_MTD is not set
882# CONFIG_ROMFS_BACKED_BY_BOTH is not set
883CONFIG_ROMFS_ON_BLOCK=y
740# CONFIG_SYSV_FS is not set 884# CONFIG_SYSV_FS is not set
741# CONFIG_UFS_FS is not set 885# CONFIG_UFS_FS is not set
742 886
@@ -755,6 +899,7 @@ CONFIG_ENABLE_WARN_DEPRECATED=y
755CONFIG_ENABLE_MUST_CHECK=y 899CONFIG_ENABLE_MUST_CHECK=y
756CONFIG_FRAME_WARN=1024 900CONFIG_FRAME_WARN=1024
757CONFIG_MAGIC_SYSRQ=y 901CONFIG_MAGIC_SYSRQ=y
902# CONFIG_STRIP_ASM_SYMS is not set
758# CONFIG_UNUSED_SYMBOLS is not set 903# CONFIG_UNUSED_SYMBOLS is not set
759# CONFIG_DEBUG_FS is not set 904# CONFIG_DEBUG_FS is not set
760# CONFIG_HEADERS_CHECK is not set 905# CONFIG_HEADERS_CHECK is not set
@@ -763,12 +908,16 @@ CONFIG_DEBUG_KERNEL=y
763CONFIG_DETECT_SOFTLOCKUP=y 908CONFIG_DETECT_SOFTLOCKUP=y
764# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set 909# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
765CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 910CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
911CONFIG_DETECT_HUNG_TASK=y
912# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
913CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
766CONFIG_SCHED_DEBUG=y 914CONFIG_SCHED_DEBUG=y
767# CONFIG_SCHEDSTATS is not set 915# CONFIG_SCHEDSTATS is not set
768# CONFIG_TIMER_STATS is not set 916# CONFIG_TIMER_STATS is not set
769# CONFIG_DEBUG_OBJECTS is not set 917# CONFIG_DEBUG_OBJECTS is not set
770# CONFIG_SLUB_DEBUG_ON is not set 918# CONFIG_SLUB_DEBUG_ON is not set
771# CONFIG_SLUB_STATS is not set 919# CONFIG_SLUB_STATS is not set
920# CONFIG_DEBUG_KMEMLEAK is not set
772CONFIG_DEBUG_RT_MUTEXES=y 921CONFIG_DEBUG_RT_MUTEXES=y
773CONFIG_DEBUG_PI_LIST=y 922CONFIG_DEBUG_PI_LIST=y
774# CONFIG_RT_MUTEX_TESTER is not set 923# CONFIG_RT_MUTEX_TESTER is not set
@@ -787,34 +936,43 @@ CONFIG_DEBUG_INFO=y
787CONFIG_DEBUG_MEMORY_INIT=y 936CONFIG_DEBUG_MEMORY_INIT=y
788# CONFIG_DEBUG_LIST is not set 937# CONFIG_DEBUG_LIST is not set
789# CONFIG_DEBUG_SG is not set 938# CONFIG_DEBUG_SG is not set
790CONFIG_FRAME_POINTER=y 939# CONFIG_DEBUG_NOTIFIERS is not set
940# CONFIG_DEBUG_CREDENTIALS is not set
791# CONFIG_BOOT_PRINTK_DELAY is not set 941# CONFIG_BOOT_PRINTK_DELAY is not set
792# CONFIG_RCU_TORTURE_TEST is not set 942# CONFIG_RCU_TORTURE_TEST is not set
793# CONFIG_RCU_CPU_STALL_DETECTOR is not set 943# CONFIG_RCU_CPU_STALL_DETECTOR is not set
794# CONFIG_BACKTRACE_SELF_TEST is not set 944# CONFIG_BACKTRACE_SELF_TEST is not set
795# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 945# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
946# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
796# CONFIG_FAULT_INJECTION is not set 947# CONFIG_FAULT_INJECTION is not set
797# CONFIG_LATENCYTOP is not set 948# CONFIG_LATENCYTOP is not set
798CONFIG_SYSCTL_SYSCALL_CHECK=y 949CONFIG_SYSCTL_SYSCALL_CHECK=y
950# CONFIG_PAGE_POISONING is not set
799CONFIG_HAVE_FUNCTION_TRACER=y 951CONFIG_HAVE_FUNCTION_TRACER=y
800 952CONFIG_TRACING_SUPPORT=y
801# 953CONFIG_FTRACE=y
802# Tracers
803#
804# CONFIG_FUNCTION_TRACER is not set 954# CONFIG_FUNCTION_TRACER is not set
805# CONFIG_SCHED_TRACER is not set 955# CONFIG_SCHED_TRACER is not set
806# CONFIG_CONTEXT_SWITCH_TRACER is not set 956# CONFIG_ENABLE_DEFAULT_TRACERS is not set
807# CONFIG_BOOT_TRACER is not set 957# CONFIG_BOOT_TRACER is not set
958CONFIG_BRANCH_PROFILE_NONE=y
959# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
960# CONFIG_PROFILE_ALL_BRANCHES is not set
808# CONFIG_STACK_TRACER is not set 961# CONFIG_STACK_TRACER is not set
809# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 962# CONFIG_KMEMTRACE is not set
963# CONFIG_WORKQUEUE_TRACER is not set
964# CONFIG_BLK_DEV_IO_TRACE is not set
810# CONFIG_SAMPLES is not set 965# CONFIG_SAMPLES is not set
811CONFIG_HAVE_ARCH_KGDB=y 966CONFIG_HAVE_ARCH_KGDB=y
812# CONFIG_KGDB is not set 967# CONFIG_KGDB is not set
968CONFIG_ARM_UNWIND=y
813CONFIG_DEBUG_USER=y 969CONFIG_DEBUG_USER=y
814CONFIG_DEBUG_ERRORS=y 970CONFIG_DEBUG_ERRORS=y
815# CONFIG_DEBUG_STACK_USAGE is not set 971# CONFIG_DEBUG_STACK_USAGE is not set
816CONFIG_DEBUG_LL=y 972CONFIG_DEBUG_LL=y
973# CONFIG_EARLY_PRINTK is not set
817# CONFIG_DEBUG_ICEDCC is not set 974# CONFIG_DEBUG_ICEDCC is not set
975# CONFIG_OC_ETM is not set
818CONFIG_DEBUG_S3C_UART=0 976CONFIG_DEBUG_S3C_UART=0
819 977
820# 978#
@@ -823,13 +981,19 @@ CONFIG_DEBUG_S3C_UART=0
823# CONFIG_KEYS is not set 981# CONFIG_KEYS is not set
824# CONFIG_SECURITY is not set 982# CONFIG_SECURITY is not set
825# CONFIG_SECURITYFS is not set 983# CONFIG_SECURITYFS is not set
826# CONFIG_SECURITY_FILE_CAPABILITIES is not set 984# CONFIG_DEFAULT_SECURITY_SELINUX is not set
985# CONFIG_DEFAULT_SECURITY_SMACK is not set
986# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
987CONFIG_DEFAULT_SECURITY_DAC=y
988CONFIG_DEFAULT_SECURITY=""
827# CONFIG_CRYPTO is not set 989# CONFIG_CRYPTO is not set
990# CONFIG_BINARY_PRINTF is not set
828 991
829# 992#
830# Library routines 993# Library routines
831# 994#
832CONFIG_BITREVERSE=y 995CONFIG_BITREVERSE=y
996CONFIG_GENERIC_FIND_LAST_BIT=y
833# CONFIG_CRC_CCITT is not set 997# CONFIG_CRC_CCITT is not set
834# CONFIG_CRC16 is not set 998# CONFIG_CRC16 is not set
835# CONFIG_CRC_T10DIF is not set 999# CONFIG_CRC_T10DIF is not set
@@ -838,6 +1002,10 @@ CONFIG_CRC32=y
838# CONFIG_CRC7 is not set 1002# CONFIG_CRC7 is not set
839# CONFIG_LIBCRC32C is not set 1003# CONFIG_LIBCRC32C is not set
840CONFIG_ZLIB_INFLATE=y 1004CONFIG_ZLIB_INFLATE=y
841CONFIG_PLIST=y 1005CONFIG_LZO_DECOMPRESS=y
1006CONFIG_DECOMPRESS_GZIP=y
1007CONFIG_DECOMPRESS_BZIP2=y
1008CONFIG_DECOMPRESS_LZMA=y
1009CONFIG_DECOMPRESS_LZO=y
842CONFIG_HAS_IOMEM=y 1010CONFIG_HAS_IOMEM=y
843CONFIG_HAS_DMA=y 1011CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/s5p6440_defconfig b/arch/arm/configs/s5p6440_defconfig
new file mode 100644
index 000000000000..279a15e53114
--- /dev/null
+++ b/arch/arm/configs/s5p6440_defconfig
@@ -0,0 +1,969 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc2
4# Sat Jan 9 16:33:55 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_NO_IOPORT=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y
34# CONFIG_SYSVIPC is not set
35# CONFIG_BSD_PROCESS_ACCT is not set
36
37#
38# RCU Subsystem
39#
40CONFIG_TREE_RCU=y
41# CONFIG_TREE_PREEMPT_RCU is not set
42# CONFIG_TINY_RCU is not set
43# CONFIG_RCU_TRACE is not set
44CONFIG_RCU_FANOUT=32
45# CONFIG_RCU_FANOUT_EXACT is not set
46# CONFIG_TREE_RCU_TRACE is not set
47# CONFIG_IKCONFIG is not set
48CONFIG_LOG_BUF_SHIFT=17
49# CONFIG_GROUP_SCHED is not set
50# CONFIG_CGROUPS is not set
51CONFIG_SYSFS_DEPRECATED=y
52CONFIG_SYSFS_DEPRECATED_V2=y
53# CONFIG_RELAY is not set
54CONFIG_NAMESPACES=y
55# CONFIG_UTS_NS is not set
56# CONFIG_USER_NS is not set
57# CONFIG_PID_NS is not set
58CONFIG_BLK_DEV_INITRD=y
59CONFIG_INITRAMFS_SOURCE=""
60CONFIG_RD_GZIP=y
61CONFIG_RD_BZIP2=y
62CONFIG_RD_LZMA=y
63CONFIG_CC_OPTIMIZE_FOR_SIZE=y
64CONFIG_SYSCTL=y
65CONFIG_ANON_INODES=y
66# CONFIG_EMBEDDED is not set
67CONFIG_UID16=y
68CONFIG_SYSCTL_SYSCALL=y
69CONFIG_KALLSYMS=y
70CONFIG_KALLSYMS_ALL=y
71# CONFIG_KALLSYMS_EXTRA_PASS is not set
72CONFIG_HOTPLUG=y
73CONFIG_PRINTK=y
74CONFIG_BUG=y
75CONFIG_ELF_CORE=y
76CONFIG_BASE_FULL=y
77CONFIG_FUTEX=y
78CONFIG_EPOLL=y
79CONFIG_SIGNALFD=y
80CONFIG_TIMERFD=y
81CONFIG_EVENTFD=y
82CONFIG_SHMEM=y
83CONFIG_AIO=y
84
85#
86# Kernel Performance Events And Counters
87#
88CONFIG_VM_EVENT_COUNTERS=y
89CONFIG_SLUB_DEBUG=y
90CONFIG_COMPAT_BRK=y
91# CONFIG_SLAB is not set
92CONFIG_SLUB=y
93# CONFIG_SLOB is not set
94# CONFIG_PROFILING is not set
95CONFIG_HAVE_OPROFILE=y
96# CONFIG_KPROBES is not set
97CONFIG_HAVE_KPROBES=y
98CONFIG_HAVE_KRETPROBES=y
99CONFIG_HAVE_CLK=y
100
101#
102# GCOV-based kernel profiling
103#
104# CONFIG_SLOW_WORK is not set
105CONFIG_HAVE_GENERIC_DMA_COHERENT=y
106CONFIG_SLABINFO=y
107CONFIG_RT_MUTEXES=y
108CONFIG_BASE_SMALL=0
109CONFIG_MODULES=y
110# CONFIG_MODULE_FORCE_LOAD is not set
111CONFIG_MODULE_UNLOAD=y
112# CONFIG_MODULE_FORCE_UNLOAD is not set
113# CONFIG_MODVERSIONS is not set
114# CONFIG_MODULE_SRCVERSION_ALL is not set
115CONFIG_BLOCK=y
116CONFIG_LBDAF=y
117# CONFIG_BLK_DEV_BSG is not set
118# CONFIG_BLK_DEV_INTEGRITY is not set
119
120#
121# IO Schedulers
122#
123CONFIG_IOSCHED_NOOP=y
124CONFIG_IOSCHED_DEADLINE=y
125CONFIG_IOSCHED_CFQ=y
126# CONFIG_DEFAULT_DEADLINE is not set
127CONFIG_DEFAULT_CFQ=y
128# CONFIG_DEFAULT_NOOP is not set
129CONFIG_DEFAULT_IOSCHED="cfq"
130# CONFIG_INLINE_SPIN_TRYLOCK is not set
131# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
132# CONFIG_INLINE_SPIN_LOCK is not set
133# CONFIG_INLINE_SPIN_LOCK_BH is not set
134# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
135# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
136# CONFIG_INLINE_SPIN_UNLOCK is not set
137# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
138# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
139# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
140# CONFIG_INLINE_READ_TRYLOCK is not set
141# CONFIG_INLINE_READ_LOCK is not set
142# CONFIG_INLINE_READ_LOCK_BH is not set
143# CONFIG_INLINE_READ_LOCK_IRQ is not set
144# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
145# CONFIG_INLINE_READ_UNLOCK is not set
146# CONFIG_INLINE_READ_UNLOCK_BH is not set
147# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
148# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
149# CONFIG_INLINE_WRITE_TRYLOCK is not set
150# CONFIG_INLINE_WRITE_LOCK is not set
151# CONFIG_INLINE_WRITE_LOCK_BH is not set
152# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
153# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
154# CONFIG_INLINE_WRITE_UNLOCK is not set
155# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
156# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
157# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
158# CONFIG_MUTEX_SPIN_ON_OWNER is not set
159# CONFIG_FREEZER is not set
160
161#
162# System Type
163#
164CONFIG_MMU=y
165# CONFIG_ARCH_AAEC2000 is not set
166# CONFIG_ARCH_INTEGRATOR is not set
167# CONFIG_ARCH_REALVIEW is not set
168# CONFIG_ARCH_VERSATILE is not set
169# CONFIG_ARCH_AT91 is not set
170# CONFIG_ARCH_CLPS711X is not set
171# CONFIG_ARCH_GEMINI is not set
172# CONFIG_ARCH_EBSA110 is not set
173# CONFIG_ARCH_EP93XX is not set
174# CONFIG_ARCH_FOOTBRIDGE is not set
175# CONFIG_ARCH_MXC is not set
176# CONFIG_ARCH_STMP3XXX is not set
177# CONFIG_ARCH_NETX is not set
178# CONFIG_ARCH_H720X is not set
179# CONFIG_ARCH_NOMADIK is not set
180# CONFIG_ARCH_IOP13XX is not set
181# CONFIG_ARCH_IOP32X is not set
182# CONFIG_ARCH_IOP33X is not set
183# CONFIG_ARCH_IXP23XX is not set
184# CONFIG_ARCH_IXP2000 is not set
185# CONFIG_ARCH_IXP4XX is not set
186# CONFIG_ARCH_L7200 is not set
187# CONFIG_ARCH_DOVE is not set
188# CONFIG_ARCH_KIRKWOOD is not set
189# CONFIG_ARCH_LOKI is not set
190# CONFIG_ARCH_MV78XX0 is not set
191# CONFIG_ARCH_ORION5X is not set
192# CONFIG_ARCH_MMP is not set
193# CONFIG_ARCH_KS8695 is not set
194# CONFIG_ARCH_NS9XXX is not set
195# CONFIG_ARCH_W90X900 is not set
196# CONFIG_ARCH_PNX4008 is not set
197# CONFIG_ARCH_PXA is not set
198# CONFIG_ARCH_MSM is not set
199# CONFIG_ARCH_RPC is not set
200# CONFIG_ARCH_SA1100 is not set
201# CONFIG_ARCH_S3C2410 is not set
202# CONFIG_ARCH_S3C64XX is not set
203CONFIG_ARCH_S5P6440=y
204# CONFIG_ARCH_S5PC1XX is not set
205# CONFIG_ARCH_SHARK is not set
206# CONFIG_ARCH_LH7A40X is not set
207# CONFIG_ARCH_U300 is not set
208# CONFIG_ARCH_DAVINCI is not set
209# CONFIG_ARCH_OMAP is not set
210# CONFIG_ARCH_BCMRING is not set
211# CONFIG_ARCH_U8500 is not set
212CONFIG_PLAT_SAMSUNG=y
213CONFIG_SAMSUNG_CLKSRC=y
214CONFIG_SAMSUNG_IRQ_VIC_TIMER=y
215CONFIG_SAMSUNG_IRQ_UART=y
216CONFIG_SAMSUNG_GPIO_EXTRA=0
217CONFIG_PLAT_S3C=y
218
219#
220# Boot options
221#
222CONFIG_S3C_BOOT_ERROR_RESET=y
223CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
224
225#
226# Power management
227#
228CONFIG_S3C_LOWLEVEL_UART_PORT=1
229CONFIG_S3C_GPIO_SPACE=0
230CONFIG_S3C_GPIO_TRACK=y
231CONFIG_PLAT_S5P=y
232CONFIG_CPU_S5P6440_INIT=y
233CONFIG_CPU_S5P6440_CLOCK=y
234CONFIG_CPU_S5P6440=y
235CONFIG_MACH_SMDK6440=y
236
237#
238# Processor Type
239#
240CONFIG_CPU_V6=y
241CONFIG_CPU_32v6K=y
242CONFIG_CPU_32v6=y
243CONFIG_CPU_ABRT_EV6=y
244CONFIG_CPU_PABRT_V6=y
245CONFIG_CPU_CACHE_V6=y
246CONFIG_CPU_CACHE_VIPT=y
247CONFIG_CPU_COPY_V6=y
248CONFIG_CPU_TLB_V6=y
249CONFIG_CPU_HAS_ASID=y
250CONFIG_CPU_CP15=y
251CONFIG_CPU_CP15_MMU=y
252
253#
254# Processor Features
255#
256CONFIG_ARM_THUMB=y
257# CONFIG_CPU_ICACHE_DISABLE is not set
258# CONFIG_CPU_DCACHE_DISABLE is not set
259# CONFIG_CPU_BPREDICT_DISABLE is not set
260CONFIG_ARM_L1_CACHE_SHIFT=5
261# CONFIG_ARM_ERRATA_411920 is not set
262CONFIG_ARM_VIC=y
263CONFIG_ARM_VIC_NR=2
264
265#
266# Bus support
267#
268# CONFIG_PCI_SYSCALL is not set
269# CONFIG_ARCH_SUPPORTS_MSI is not set
270# CONFIG_PCCARD is not set
271
272#
273# Kernel Features
274#
275CONFIG_VMSPLIT_3G=y
276# CONFIG_VMSPLIT_2G is not set
277# CONFIG_VMSPLIT_1G is not set
278CONFIG_PAGE_OFFSET=0xC0000000
279CONFIG_PREEMPT_NONE=y
280# CONFIG_PREEMPT_VOLUNTARY is not set
281# CONFIG_PREEMPT is not set
282CONFIG_HZ=200
283CONFIG_AEABI=y
284CONFIG_OABI_COMPAT=y
285# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
286# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
287# CONFIG_HIGHMEM is not set
288CONFIG_SELECT_MEMORY_MODEL=y
289CONFIG_FLATMEM_MANUAL=y
290# CONFIG_DISCONTIGMEM_MANUAL is not set
291# CONFIG_SPARSEMEM_MANUAL is not set
292CONFIG_FLATMEM=y
293CONFIG_FLAT_NODE_MEM_MAP=y
294CONFIG_PAGEFLAGS_EXTENDED=y
295CONFIG_SPLIT_PTLOCK_CPUS=999999
296# CONFIG_PHYS_ADDR_T_64BIT is not set
297CONFIG_ZONE_DMA_FLAG=0
298CONFIG_VIRT_TO_BUS=y
299# CONFIG_KSM is not set
300CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
301CONFIG_ALIGNMENT_TRAP=y
302# CONFIG_UACCESS_WITH_MEMCPY is not set
303
304#
305# Boot options
306#
307CONFIG_ZBOOT_ROM_TEXT=0
308CONFIG_ZBOOT_ROM_BSS=0
309CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
310# CONFIG_XIP_KERNEL is not set
311# CONFIG_KEXEC is not set
312
313#
314# CPU Power Management
315#
316# CONFIG_CPU_IDLE is not set
317
318#
319# Floating point emulation
320#
321
322#
323# At least one emulation must be selected
324#
325CONFIG_FPE_NWFPE=y
326# CONFIG_FPE_NWFPE_XP is not set
327# CONFIG_FPE_FASTFPE is not set
328# CONFIG_VFP is not set
329
330#
331# Userspace binary formats
332#
333CONFIG_BINFMT_ELF=y
334# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
335CONFIG_HAVE_AOUT=y
336# CONFIG_BINFMT_AOUT is not set
337# CONFIG_BINFMT_MISC is not set
338
339#
340# Power management options
341#
342# CONFIG_PM is not set
343CONFIG_ARCH_SUSPEND_POSSIBLE=y
344# CONFIG_NET is not set
345
346#
347# Device Drivers
348#
349
350#
351# Generic Driver Options
352#
353CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
354# CONFIG_DEVTMPFS is not set
355CONFIG_STANDALONE=y
356# CONFIG_PREVENT_FIRMWARE_BUILD is not set
357CONFIG_FW_LOADER=y
358CONFIG_FIRMWARE_IN_KERNEL=y
359CONFIG_EXTRA_FIRMWARE=""
360# CONFIG_DEBUG_DRIVER is not set
361# CONFIG_DEBUG_DEVRES is not set
362# CONFIG_SYS_HYPERVISOR is not set
363# CONFIG_MTD is not set
364# CONFIG_PARPORT is not set
365CONFIG_BLK_DEV=y
366# CONFIG_BLK_DEV_COW_COMMON is not set
367# CONFIG_BLK_DEV_LOOP is not set
368
369#
370# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
371#
372CONFIG_BLK_DEV_RAM=y
373CONFIG_BLK_DEV_RAM_COUNT=16
374CONFIG_BLK_DEV_RAM_SIZE=8192
375# CONFIG_BLK_DEV_XIP is not set
376# CONFIG_CDROM_PKTCDVD is not set
377# CONFIG_MG_DISK is not set
378# CONFIG_MISC_DEVICES is not set
379CONFIG_HAVE_IDE=y
380# CONFIG_IDE is not set
381
382#
383# SCSI device support
384#
385# CONFIG_RAID_ATTRS is not set
386CONFIG_SCSI=y
387CONFIG_SCSI_DMA=y
388# CONFIG_SCSI_TGT is not set
389# CONFIG_SCSI_NETLINK is not set
390CONFIG_SCSI_PROC_FS=y
391
392#
393# SCSI support type (disk, tape, CD-ROM)
394#
395CONFIG_BLK_DEV_SD=y
396# CONFIG_CHR_DEV_ST is not set
397# CONFIG_CHR_DEV_OSST is not set
398# CONFIG_BLK_DEV_SR is not set
399CONFIG_CHR_DEV_SG=y
400# CONFIG_CHR_DEV_SCH is not set
401# CONFIG_SCSI_MULTI_LUN is not set
402# CONFIG_SCSI_CONSTANTS is not set
403# CONFIG_SCSI_LOGGING is not set
404# CONFIG_SCSI_SCAN_ASYNC is not set
405CONFIG_SCSI_WAIT_SCAN=m
406
407#
408# SCSI Transports
409#
410# CONFIG_SCSI_SPI_ATTRS is not set
411# CONFIG_SCSI_FC_ATTRS is not set
412# CONFIG_SCSI_SAS_LIBSAS is not set
413# CONFIG_SCSI_SRP_ATTRS is not set
414CONFIG_SCSI_LOWLEVEL=y
415# CONFIG_LIBFC is not set
416# CONFIG_LIBFCOE is not set
417# CONFIG_SCSI_DEBUG is not set
418# CONFIG_SCSI_DH is not set
419# CONFIG_SCSI_OSD_INITIATOR is not set
420# CONFIG_ATA is not set
421# CONFIG_MD is not set
422# CONFIG_PHONE is not set
423
424#
425# Input device support
426#
427CONFIG_INPUT=y
428# CONFIG_INPUT_FF_MEMLESS is not set
429# CONFIG_INPUT_POLLDEV is not set
430# CONFIG_INPUT_SPARSEKMAP is not set
431
432#
433# Userland interfaces
434#
435CONFIG_INPUT_MOUSEDEV=y
436CONFIG_INPUT_MOUSEDEV_PSAUX=y
437CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
438CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
439# CONFIG_INPUT_JOYDEV is not set
440CONFIG_INPUT_EVDEV=y
441# CONFIG_INPUT_EVBUG is not set
442
443#
444# Input Device Drivers
445#
446CONFIG_INPUT_KEYBOARD=y
447CONFIG_KEYBOARD_ATKBD=y
448# CONFIG_KEYBOARD_LKKBD is not set
449# CONFIG_KEYBOARD_GPIO is not set
450# CONFIG_KEYBOARD_MATRIX is not set
451# CONFIG_KEYBOARD_NEWTON is not set
452# CONFIG_KEYBOARD_OPENCORES is not set
453# CONFIG_KEYBOARD_STOWAWAY is not set
454# CONFIG_KEYBOARD_SUNKBD is not set
455# CONFIG_KEYBOARD_XTKBD is not set
456CONFIG_INPUT_MOUSE=y
457CONFIG_MOUSE_PS2=y
458CONFIG_MOUSE_PS2_ALPS=y
459CONFIG_MOUSE_PS2_LOGIPS2PP=y
460CONFIG_MOUSE_PS2_SYNAPTICS=y
461CONFIG_MOUSE_PS2_TRACKPOINT=y
462# CONFIG_MOUSE_PS2_ELANTECH is not set
463# CONFIG_MOUSE_PS2_SENTELIC is not set
464# CONFIG_MOUSE_PS2_TOUCHKIT is not set
465# CONFIG_MOUSE_SERIAL is not set
466# CONFIG_MOUSE_VSXXXAA is not set
467# CONFIG_MOUSE_GPIO is not set
468# CONFIG_INPUT_JOYSTICK is not set
469# CONFIG_INPUT_TABLET is not set
470CONFIG_INPUT_TOUCHSCREEN=y
471# CONFIG_TOUCHSCREEN_AD7879 is not set
472# CONFIG_TOUCHSCREEN_DYNAPRO is not set
473# CONFIG_TOUCHSCREEN_FUJITSU is not set
474# CONFIG_TOUCHSCREEN_GUNZE is not set
475# CONFIG_TOUCHSCREEN_ELO is not set
476# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
477# CONFIG_TOUCHSCREEN_MTOUCH is not set
478# CONFIG_TOUCHSCREEN_INEXIO is not set
479# CONFIG_TOUCHSCREEN_MK712 is not set
480# CONFIG_TOUCHSCREEN_PENMOUNT is not set
481# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
482# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
483# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
484# CONFIG_TOUCHSCREEN_W90X900 is not set
485# CONFIG_INPUT_MISC is not set
486
487#
488# Hardware I/O ports
489#
490CONFIG_SERIO=y
491CONFIG_SERIO_SERPORT=y
492CONFIG_SERIO_LIBPS2=y
493# CONFIG_SERIO_RAW is not set
494# CONFIG_SERIO_ALTERA_PS2 is not set
495# CONFIG_GAMEPORT is not set
496
497#
498# Character devices
499#
500CONFIG_VT=y
501CONFIG_CONSOLE_TRANSLATIONS=y
502CONFIG_VT_CONSOLE=y
503CONFIG_HW_CONSOLE=y
504# CONFIG_VT_HW_CONSOLE_BINDING is not set
505CONFIG_DEVKMEM=y
506# CONFIG_SERIAL_NONSTANDARD is not set
507
508#
509# Serial drivers
510#
511CONFIG_SERIAL_8250=y
512# CONFIG_SERIAL_8250_CONSOLE is not set
513CONFIG_SERIAL_8250_NR_UARTS=3
514CONFIG_SERIAL_8250_RUNTIME_UARTS=3
515# CONFIG_SERIAL_8250_EXTENDED is not set
516
517#
518# Non-8250 serial port support
519#
520CONFIG_SERIAL_SAMSUNG=y
521CONFIG_SERIAL_SAMSUNG_UARTS=4
522# CONFIG_SERIAL_SAMSUNG_DEBUG is not set
523CONFIG_SERIAL_SAMSUNG_CONSOLE=y
524CONFIG_SERIAL_S5P6440=y
525CONFIG_SERIAL_CORE=y
526CONFIG_SERIAL_CORE_CONSOLE=y
527CONFIG_UNIX98_PTYS=y
528# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
529CONFIG_LEGACY_PTYS=y
530CONFIG_LEGACY_PTY_COUNT=256
531# CONFIG_IPMI_HANDLER is not set
532CONFIG_HW_RANDOM=y
533# CONFIG_HW_RANDOM_TIMERIOMEM is not set
534# CONFIG_R3964 is not set
535# CONFIG_RAW_DRIVER is not set
536# CONFIG_TCG_TPM is not set
537# CONFIG_I2C is not set
538# CONFIG_SPI is not set
539
540#
541# PPS support
542#
543# CONFIG_PPS is not set
544CONFIG_ARCH_REQUIRE_GPIOLIB=y
545CONFIG_GPIOLIB=y
546# CONFIG_DEBUG_GPIO is not set
547# CONFIG_GPIO_SYSFS is not set
548
549#
550# Memory mapped GPIO expanders:
551#
552
553#
554# I2C GPIO expanders:
555#
556
557#
558# PCI GPIO expanders:
559#
560
561#
562# SPI GPIO expanders:
563#
564
565#
566# AC97 GPIO expanders:
567#
568# CONFIG_W1 is not set
569# CONFIG_POWER_SUPPLY is not set
570# CONFIG_HWMON is not set
571# CONFIG_THERMAL is not set
572# CONFIG_WATCHDOG is not set
573CONFIG_SSB_POSSIBLE=y
574
575#
576# Sonics Silicon Backplane
577#
578# CONFIG_SSB is not set
579
580#
581# Multifunction device drivers
582#
583# CONFIG_MFD_CORE is not set
584# CONFIG_MFD_SM501 is not set
585# CONFIG_MFD_ASIC3 is not set
586# CONFIG_HTC_EGPIO is not set
587# CONFIG_HTC_PASIC3 is not set
588# CONFIG_MFD_TMIO is not set
589# CONFIG_MFD_T7L66XB is not set
590# CONFIG_MFD_TC6387XB is not set
591# CONFIG_MFD_TC6393XB is not set
592# CONFIG_REGULATOR is not set
593# CONFIG_MEDIA_SUPPORT is not set
594
595#
596# Graphics support
597#
598# CONFIG_VGASTATE is not set
599# CONFIG_VIDEO_OUTPUT_CONTROL is not set
600# CONFIG_FB is not set
601# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
602
603#
604# Display device support
605#
606CONFIG_DISPLAY_SUPPORT=y
607
608#
609# Display hardware drivers
610#
611
612#
613# Console display driver support
614#
615# CONFIG_VGA_CONSOLE is not set
616CONFIG_DUMMY_CONSOLE=y
617# CONFIG_SOUND is not set
618# CONFIG_HID_SUPPORT is not set
619# CONFIG_USB_SUPPORT is not set
620# CONFIG_MMC is not set
621# CONFIG_MEMSTICK is not set
622# CONFIG_NEW_LEDS is not set
623# CONFIG_ACCESSIBILITY is not set
624CONFIG_RTC_LIB=y
625# CONFIG_RTC_CLASS is not set
626# CONFIG_DMADEVICES is not set
627# CONFIG_AUXDISPLAY is not set
628# CONFIG_UIO is not set
629
630#
631# TI VLYNQ
632#
633# CONFIG_STAGING is not set
634
635#
636# File systems
637#
638CONFIG_EXT2_FS=y
639# CONFIG_EXT2_FS_XATTR is not set
640# CONFIG_EXT2_FS_XIP is not set
641CONFIG_EXT3_FS=y
642# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
643CONFIG_EXT3_FS_XATTR=y
644CONFIG_EXT3_FS_POSIX_ACL=y
645CONFIG_EXT3_FS_SECURITY=y
646# CONFIG_EXT4_FS is not set
647CONFIG_JBD=y
648CONFIG_FS_MBCACHE=y
649# CONFIG_REISERFS_FS is not set
650# CONFIG_JFS_FS is not set
651CONFIG_FS_POSIX_ACL=y
652# CONFIG_XFS_FS is not set
653# CONFIG_GFS2_FS is not set
654# CONFIG_BTRFS_FS is not set
655# CONFIG_NILFS2_FS is not set
656CONFIG_FILE_LOCKING=y
657CONFIG_FSNOTIFY=y
658CONFIG_DNOTIFY=y
659CONFIG_INOTIFY=y
660CONFIG_INOTIFY_USER=y
661# CONFIG_QUOTA is not set
662# CONFIG_AUTOFS_FS is not set
663# CONFIG_AUTOFS4_FS is not set
664# CONFIG_FUSE_FS is not set
665CONFIG_GENERIC_ACL=y
666
667#
668# Caches
669#
670# CONFIG_FSCACHE is not set
671
672#
673# CD-ROM/DVD Filesystems
674#
675# CONFIG_ISO9660_FS is not set
676# CONFIG_UDF_FS is not set
677
678#
679# DOS/FAT/NT Filesystems
680#
681CONFIG_FAT_FS=y
682CONFIG_MSDOS_FS=y
683CONFIG_VFAT_FS=y
684CONFIG_FAT_DEFAULT_CODEPAGE=437
685CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
686# CONFIG_NTFS_FS is not set
687
688#
689# Pseudo filesystems
690#
691CONFIG_PROC_FS=y
692CONFIG_PROC_SYSCTL=y
693CONFIG_PROC_PAGE_MONITOR=y
694CONFIG_SYSFS=y
695CONFIG_TMPFS=y
696CONFIG_TMPFS_POSIX_ACL=y
697# CONFIG_HUGETLB_PAGE is not set
698# CONFIG_CONFIGFS_FS is not set
699CONFIG_MISC_FILESYSTEMS=y
700# CONFIG_ADFS_FS is not set
701# CONFIG_AFFS_FS is not set
702# CONFIG_HFS_FS is not set
703# CONFIG_HFSPLUS_FS is not set
704# CONFIG_BEFS_FS is not set
705# CONFIG_BFS_FS is not set
706# CONFIG_EFS_FS is not set
707CONFIG_CRAMFS=y
708# CONFIG_SQUASHFS is not set
709# CONFIG_VXFS_FS is not set
710# CONFIG_MINIX_FS is not set
711# CONFIG_OMFS_FS is not set
712# CONFIG_HPFS_FS is not set
713# CONFIG_QNX4FS_FS is not set
714CONFIG_ROMFS_FS=y
715CONFIG_ROMFS_BACKED_BY_BLOCK=y
716# CONFIG_ROMFS_BACKED_BY_MTD is not set
717# CONFIG_ROMFS_BACKED_BY_BOTH is not set
718CONFIG_ROMFS_ON_BLOCK=y
719# CONFIG_SYSV_FS is not set
720# CONFIG_UFS_FS is not set
721
722#
723# Partition Types
724#
725# CONFIG_PARTITION_ADVANCED is not set
726CONFIG_MSDOS_PARTITION=y
727CONFIG_NLS=y
728CONFIG_NLS_DEFAULT="iso8859-1"
729CONFIG_NLS_CODEPAGE_437=y
730# CONFIG_NLS_CODEPAGE_737 is not set
731# CONFIG_NLS_CODEPAGE_775 is not set
732# CONFIG_NLS_CODEPAGE_850 is not set
733# CONFIG_NLS_CODEPAGE_852 is not set
734# CONFIG_NLS_CODEPAGE_855 is not set
735# CONFIG_NLS_CODEPAGE_857 is not set
736# CONFIG_NLS_CODEPAGE_860 is not set
737# CONFIG_NLS_CODEPAGE_861 is not set
738# CONFIG_NLS_CODEPAGE_862 is not set
739# CONFIG_NLS_CODEPAGE_863 is not set
740# CONFIG_NLS_CODEPAGE_864 is not set
741# CONFIG_NLS_CODEPAGE_865 is not set
742# CONFIG_NLS_CODEPAGE_866 is not set
743# CONFIG_NLS_CODEPAGE_869 is not set
744# CONFIG_NLS_CODEPAGE_936 is not set
745# CONFIG_NLS_CODEPAGE_950 is not set
746# CONFIG_NLS_CODEPAGE_932 is not set
747# CONFIG_NLS_CODEPAGE_949 is not set
748# CONFIG_NLS_CODEPAGE_874 is not set
749# CONFIG_NLS_ISO8859_8 is not set
750# CONFIG_NLS_CODEPAGE_1250 is not set
751# CONFIG_NLS_CODEPAGE_1251 is not set
752CONFIG_NLS_ASCII=y
753CONFIG_NLS_ISO8859_1=y
754# CONFIG_NLS_ISO8859_2 is not set
755# CONFIG_NLS_ISO8859_3 is not set
756# CONFIG_NLS_ISO8859_4 is not set
757# CONFIG_NLS_ISO8859_5 is not set
758# CONFIG_NLS_ISO8859_6 is not set
759# CONFIG_NLS_ISO8859_7 is not set
760# CONFIG_NLS_ISO8859_9 is not set
761# CONFIG_NLS_ISO8859_13 is not set
762# CONFIG_NLS_ISO8859_14 is not set
763# CONFIG_NLS_ISO8859_15 is not set
764# CONFIG_NLS_KOI8_R is not set
765# CONFIG_NLS_KOI8_U is not set
766# CONFIG_NLS_UTF8 is not set
767
768#
769# Kernel hacking
770#
771# CONFIG_PRINTK_TIME is not set
772CONFIG_ENABLE_WARN_DEPRECATED=y
773CONFIG_ENABLE_MUST_CHECK=y
774CONFIG_FRAME_WARN=1024
775CONFIG_MAGIC_SYSRQ=y
776# CONFIG_STRIP_ASM_SYMS is not set
777# CONFIG_UNUSED_SYMBOLS is not set
778# CONFIG_DEBUG_FS is not set
779# CONFIG_HEADERS_CHECK is not set
780CONFIG_DEBUG_KERNEL=y
781# CONFIG_DEBUG_SHIRQ is not set
782CONFIG_DETECT_SOFTLOCKUP=y
783# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
784CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
785CONFIG_DETECT_HUNG_TASK=y
786# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
787CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
788CONFIG_SCHED_DEBUG=y
789# CONFIG_SCHEDSTATS is not set
790# CONFIG_TIMER_STATS is not set
791# CONFIG_DEBUG_OBJECTS is not set
792# CONFIG_SLUB_DEBUG_ON is not set
793# CONFIG_SLUB_STATS is not set
794# CONFIG_DEBUG_KMEMLEAK is not set
795CONFIG_DEBUG_RT_MUTEXES=y
796CONFIG_DEBUG_PI_LIST=y
797# CONFIG_RT_MUTEX_TESTER is not set
798CONFIG_DEBUG_SPINLOCK=y
799CONFIG_DEBUG_MUTEXES=y
800# CONFIG_DEBUG_LOCK_ALLOC is not set
801# CONFIG_PROVE_LOCKING is not set
802# CONFIG_LOCK_STAT is not set
803CONFIG_DEBUG_SPINLOCK_SLEEP=y
804# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
805# CONFIG_DEBUG_KOBJECT is not set
806CONFIG_DEBUG_BUGVERBOSE=y
807CONFIG_DEBUG_INFO=y
808# CONFIG_DEBUG_VM is not set
809# CONFIG_DEBUG_WRITECOUNT is not set
810CONFIG_DEBUG_MEMORY_INIT=y
811# CONFIG_DEBUG_LIST is not set
812# CONFIG_DEBUG_SG is not set
813# CONFIG_DEBUG_NOTIFIERS is not set
814# CONFIG_DEBUG_CREDENTIALS is not set
815# CONFIG_BOOT_PRINTK_DELAY is not set
816# CONFIG_RCU_TORTURE_TEST is not set
817# CONFIG_RCU_CPU_STALL_DETECTOR is not set
818# CONFIG_BACKTRACE_SELF_TEST is not set
819# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
820# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
821# CONFIG_FAULT_INJECTION is not set
822# CONFIG_LATENCYTOP is not set
823CONFIG_SYSCTL_SYSCALL_CHECK=y
824# CONFIG_PAGE_POISONING is not set
825CONFIG_HAVE_FUNCTION_TRACER=y
826CONFIG_TRACING_SUPPORT=y
827CONFIG_FTRACE=y
828# CONFIG_FUNCTION_TRACER is not set
829# CONFIG_SCHED_TRACER is not set
830# CONFIG_ENABLE_DEFAULT_TRACERS is not set
831# CONFIG_BOOT_TRACER is not set
832CONFIG_BRANCH_PROFILE_NONE=y
833# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
834# CONFIG_PROFILE_ALL_BRANCHES is not set
835# CONFIG_STACK_TRACER is not set
836# CONFIG_KMEMTRACE is not set
837# CONFIG_WORKQUEUE_TRACER is not set
838# CONFIG_BLK_DEV_IO_TRACE is not set
839# CONFIG_SAMPLES is not set
840CONFIG_HAVE_ARCH_KGDB=y
841# CONFIG_KGDB is not set
842CONFIG_ARM_UNWIND=y
843CONFIG_DEBUG_USER=y
844CONFIG_DEBUG_ERRORS=y
845# CONFIG_DEBUG_STACK_USAGE is not set
846CONFIG_DEBUG_LL=y
847# CONFIG_EARLY_PRINTK is not set
848# CONFIG_DEBUG_ICEDCC is not set
849# CONFIG_OC_ETM is not set
850CONFIG_DEBUG_S3C_UART=1
851
852#
853# Security options
854#
855# CONFIG_KEYS is not set
856# CONFIG_SECURITY is not set
857# CONFIG_SECURITYFS is not set
858# CONFIG_DEFAULT_SECURITY_SELINUX is not set
859# CONFIG_DEFAULT_SECURITY_SMACK is not set
860# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
861CONFIG_DEFAULT_SECURITY_DAC=y
862CONFIG_DEFAULT_SECURITY=""
863CONFIG_CRYPTO=y
864
865#
866# Crypto core or helper
867#
868# CONFIG_CRYPTO_MANAGER is not set
869# CONFIG_CRYPTO_MANAGER2 is not set
870# CONFIG_CRYPTO_GF128MUL is not set
871# CONFIG_CRYPTO_NULL is not set
872# CONFIG_CRYPTO_CRYPTD is not set
873# CONFIG_CRYPTO_AUTHENC is not set
874# CONFIG_CRYPTO_TEST is not set
875
876#
877# Authenticated Encryption with Associated Data
878#
879# CONFIG_CRYPTO_CCM is not set
880# CONFIG_CRYPTO_GCM is not set
881# CONFIG_CRYPTO_SEQIV is not set
882
883#
884# Block modes
885#
886# CONFIG_CRYPTO_CBC is not set
887# CONFIG_CRYPTO_CTR is not set
888# CONFIG_CRYPTO_CTS is not set
889# CONFIG_CRYPTO_ECB is not set
890# CONFIG_CRYPTO_LRW is not set
891# CONFIG_CRYPTO_PCBC is not set
892# CONFIG_CRYPTO_XTS is not set
893
894#
895# Hash modes
896#
897# CONFIG_CRYPTO_HMAC is not set
898# CONFIG_CRYPTO_XCBC is not set
899# CONFIG_CRYPTO_VMAC is not set
900
901#
902# Digest
903#
904# CONFIG_CRYPTO_CRC32C is not set
905# CONFIG_CRYPTO_GHASH is not set
906# CONFIG_CRYPTO_MD4 is not set
907# CONFIG_CRYPTO_MD5 is not set
908# CONFIG_CRYPTO_MICHAEL_MIC is not set
909# CONFIG_CRYPTO_RMD128 is not set
910# CONFIG_CRYPTO_RMD160 is not set
911# CONFIG_CRYPTO_RMD256 is not set
912# CONFIG_CRYPTO_RMD320 is not set
913# CONFIG_CRYPTO_SHA1 is not set
914# CONFIG_CRYPTO_SHA256 is not set
915# CONFIG_CRYPTO_SHA512 is not set
916# CONFIG_CRYPTO_TGR192 is not set
917# CONFIG_CRYPTO_WP512 is not set
918
919#
920# Ciphers
921#
922# CONFIG_CRYPTO_AES is not set
923# CONFIG_CRYPTO_ANUBIS is not set
924# CONFIG_CRYPTO_ARC4 is not set
925# CONFIG_CRYPTO_BLOWFISH is not set
926# CONFIG_CRYPTO_CAMELLIA is not set
927# CONFIG_CRYPTO_CAST5 is not set
928# CONFIG_CRYPTO_CAST6 is not set
929# CONFIG_CRYPTO_DES is not set
930# CONFIG_CRYPTO_FCRYPT is not set
931# CONFIG_CRYPTO_KHAZAD is not set
932# CONFIG_CRYPTO_SALSA20 is not set
933# CONFIG_CRYPTO_SEED is not set
934# CONFIG_CRYPTO_SERPENT is not set
935# CONFIG_CRYPTO_TEA is not set
936# CONFIG_CRYPTO_TWOFISH is not set
937
938#
939# Compression
940#
941# CONFIG_CRYPTO_DEFLATE is not set
942# CONFIG_CRYPTO_ZLIB is not set
943# CONFIG_CRYPTO_LZO is not set
944
945#
946# Random Number Generation
947#
948# CONFIG_CRYPTO_ANSI_CPRNG is not set
949CONFIG_CRYPTO_HW=y
950# CONFIG_BINARY_PRINTF is not set
951
952#
953# Library routines
954#
955CONFIG_BITREVERSE=y
956CONFIG_GENERIC_FIND_LAST_BIT=y
957CONFIG_CRC_CCITT=y
958# CONFIG_CRC16 is not set
959# CONFIG_CRC_T10DIF is not set
960# CONFIG_CRC_ITU_T is not set
961CONFIG_CRC32=y
962# CONFIG_CRC7 is not set
963# CONFIG_LIBCRC32C is not set
964CONFIG_ZLIB_INFLATE=y
965CONFIG_DECOMPRESS_GZIP=y
966CONFIG_DECOMPRESS_BZIP2=y
967CONFIG_DECOMPRESS_LZMA=y
968CONFIG_HAS_IOMEM=y
969CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/s5p6442_defconfig b/arch/arm/configs/s5p6442_defconfig
new file mode 100644
index 000000000000..74e20bfc0487
--- /dev/null
+++ b/arch/arm/configs/s5p6442_defconfig
@@ -0,0 +1,883 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc4
4# Mon Jan 25 08:50:28 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_NO_IOPORT=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_VECTORS_BASE=0xffff0000
22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23CONFIG_CONSTRUCTORS=y
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_HAVE_KERNEL_GZIP=y
34CONFIG_HAVE_KERNEL_LZO=y
35CONFIG_KERNEL_GZIP=y
36# CONFIG_KERNEL_BZIP2 is not set
37# CONFIG_KERNEL_LZMA is not set
38# CONFIG_KERNEL_LZO is not set
39CONFIG_SWAP=y
40# CONFIG_SYSVIPC is not set
41# CONFIG_BSD_PROCESS_ACCT is not set
42
43#
44# RCU Subsystem
45#
46CONFIG_TREE_RCU=y
47# CONFIG_TREE_PREEMPT_RCU is not set
48# CONFIG_TINY_RCU is not set
49# CONFIG_RCU_TRACE is not set
50CONFIG_RCU_FANOUT=32
51# CONFIG_RCU_FANOUT_EXACT is not set
52# CONFIG_TREE_RCU_TRACE is not set
53# CONFIG_IKCONFIG is not set
54CONFIG_LOG_BUF_SHIFT=17
55# CONFIG_GROUP_SCHED is not set
56# CONFIG_CGROUPS is not set
57CONFIG_SYSFS_DEPRECATED=y
58CONFIG_SYSFS_DEPRECATED_V2=y
59# CONFIG_RELAY is not set
60CONFIG_NAMESPACES=y
61# CONFIG_UTS_NS is not set
62# CONFIG_USER_NS is not set
63# CONFIG_PID_NS is not set
64CONFIG_BLK_DEV_INITRD=y
65CONFIG_INITRAMFS_SOURCE=""
66CONFIG_RD_GZIP=y
67CONFIG_RD_BZIP2=y
68CONFIG_RD_LZMA=y
69CONFIG_RD_LZO=y
70CONFIG_CC_OPTIMIZE_FOR_SIZE=y
71CONFIG_SYSCTL=y
72CONFIG_ANON_INODES=y
73# CONFIG_EMBEDDED is not set
74CONFIG_UID16=y
75CONFIG_SYSCTL_SYSCALL=y
76CONFIG_KALLSYMS=y
77CONFIG_KALLSYMS_ALL=y
78# CONFIG_KALLSYMS_EXTRA_PASS is not set
79CONFIG_HOTPLUG=y
80CONFIG_PRINTK=y
81CONFIG_BUG=y
82CONFIG_ELF_CORE=y
83CONFIG_BASE_FULL=y
84CONFIG_FUTEX=y
85CONFIG_EPOLL=y
86CONFIG_SIGNALFD=y
87CONFIG_TIMERFD=y
88CONFIG_EVENTFD=y
89CONFIG_SHMEM=y
90CONFIG_AIO=y
91
92#
93# Kernel Performance Events And Counters
94#
95CONFIG_VM_EVENT_COUNTERS=y
96CONFIG_SLUB_DEBUG=y
97CONFIG_COMPAT_BRK=y
98# CONFIG_SLAB is not set
99CONFIG_SLUB=y
100# CONFIG_SLOB is not set
101# CONFIG_PROFILING is not set
102CONFIG_HAVE_OPROFILE=y
103# CONFIG_KPROBES is not set
104CONFIG_HAVE_KPROBES=y
105CONFIG_HAVE_KRETPROBES=y
106CONFIG_HAVE_CLK=y
107
108#
109# GCOV-based kernel profiling
110#
111# CONFIG_SLOW_WORK is not set
112CONFIG_HAVE_GENERIC_DMA_COHERENT=y
113CONFIG_SLABINFO=y
114CONFIG_RT_MUTEXES=y
115CONFIG_BASE_SMALL=0
116CONFIG_MODULES=y
117# CONFIG_MODULE_FORCE_LOAD is not set
118CONFIG_MODULE_UNLOAD=y
119# CONFIG_MODULE_FORCE_UNLOAD is not set
120# CONFIG_MODVERSIONS is not set
121# CONFIG_MODULE_SRCVERSION_ALL is not set
122CONFIG_BLOCK=y
123CONFIG_LBDAF=y
124# CONFIG_BLK_DEV_BSG is not set
125# CONFIG_BLK_DEV_INTEGRITY is not set
126
127#
128# IO Schedulers
129#
130CONFIG_IOSCHED_NOOP=y
131CONFIG_IOSCHED_DEADLINE=y
132CONFIG_IOSCHED_CFQ=y
133# CONFIG_DEFAULT_DEADLINE is not set
134CONFIG_DEFAULT_CFQ=y
135# CONFIG_DEFAULT_NOOP is not set
136CONFIG_DEFAULT_IOSCHED="cfq"
137# CONFIG_INLINE_SPIN_TRYLOCK is not set
138# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
139# CONFIG_INLINE_SPIN_LOCK is not set
140# CONFIG_INLINE_SPIN_LOCK_BH is not set
141# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
142# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
143# CONFIG_INLINE_SPIN_UNLOCK is not set
144# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
145# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
146# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
147# CONFIG_INLINE_READ_TRYLOCK is not set
148# CONFIG_INLINE_READ_LOCK is not set
149# CONFIG_INLINE_READ_LOCK_BH is not set
150# CONFIG_INLINE_READ_LOCK_IRQ is not set
151# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
152# CONFIG_INLINE_READ_UNLOCK is not set
153# CONFIG_INLINE_READ_UNLOCK_BH is not set
154# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
155# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
156# CONFIG_INLINE_WRITE_TRYLOCK is not set
157# CONFIG_INLINE_WRITE_LOCK is not set
158# CONFIG_INLINE_WRITE_LOCK_BH is not set
159# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
160# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
161# CONFIG_INLINE_WRITE_UNLOCK is not set
162# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
163# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
164# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
165# CONFIG_MUTEX_SPIN_ON_OWNER is not set
166# CONFIG_FREEZER is not set
167
168#
169# System Type
170#
171CONFIG_MMU=y
172# CONFIG_ARCH_AAEC2000 is not set
173# CONFIG_ARCH_INTEGRATOR is not set
174# CONFIG_ARCH_REALVIEW is not set
175# CONFIG_ARCH_VERSATILE is not set
176# CONFIG_ARCH_AT91 is not set
177# CONFIG_ARCH_CLPS711X is not set
178# CONFIG_ARCH_GEMINI is not set
179# CONFIG_ARCH_EBSA110 is not set
180# CONFIG_ARCH_EP93XX is not set
181# CONFIG_ARCH_FOOTBRIDGE is not set
182# CONFIG_ARCH_MXC is not set
183# CONFIG_ARCH_STMP3XXX is not set
184# CONFIG_ARCH_NETX is not set
185# CONFIG_ARCH_H720X is not set
186# CONFIG_ARCH_NOMADIK is not set
187# CONFIG_ARCH_IOP13XX is not set
188# CONFIG_ARCH_IOP32X is not set
189# CONFIG_ARCH_IOP33X is not set
190# CONFIG_ARCH_IXP23XX is not set
191# CONFIG_ARCH_IXP2000 is not set
192# CONFIG_ARCH_IXP4XX is not set
193# CONFIG_ARCH_L7200 is not set
194# CONFIG_ARCH_DOVE is not set
195# CONFIG_ARCH_KIRKWOOD is not set
196# CONFIG_ARCH_LOKI is not set
197# CONFIG_ARCH_MV78XX0 is not set
198# CONFIG_ARCH_ORION5X is not set
199# CONFIG_ARCH_MMP is not set
200# CONFIG_ARCH_KS8695 is not set
201# CONFIG_ARCH_NS9XXX is not set
202# CONFIG_ARCH_W90X900 is not set
203# CONFIG_ARCH_PNX4008 is not set
204# CONFIG_ARCH_PXA is not set
205# CONFIG_ARCH_MSM is not set
206# CONFIG_ARCH_RPC is not set
207# CONFIG_ARCH_SA1100 is not set
208# CONFIG_ARCH_S3C2410 is not set
209# CONFIG_ARCH_S3C64XX is not set
210# CONFIG_ARCH_S5P6440 is not set
211CONFIG_ARCH_S5P6442=y
212# CONFIG_ARCH_S5PC1XX is not set
213# CONFIG_ARCH_SHARK is not set
214# CONFIG_ARCH_LH7A40X is not set
215# CONFIG_ARCH_U300 is not set
216# CONFIG_ARCH_DAVINCI is not set
217# CONFIG_ARCH_OMAP is not set
218# CONFIG_ARCH_BCMRING is not set
219# CONFIG_ARCH_U8500 is not set
220CONFIG_PLAT_SAMSUNG=y
221CONFIG_SAMSUNG_CLKSRC=y
222CONFIG_SAMSUNG_IRQ_VIC_TIMER=y
223CONFIG_SAMSUNG_IRQ_UART=y
224CONFIG_SAMSUNG_GPIOLIB_4BIT=y
225CONFIG_S3C_GPIO_CFG_S3C24XX=y
226CONFIG_S3C_GPIO_CFG_S3C64XX=y
227CONFIG_S3C_GPIO_PULL_UPDOWN=y
228CONFIG_SAMSUNG_GPIO_EXTRA=0
229# CONFIG_S3C_ADC is not set
230
231#
232# Power management
233#
234CONFIG_PLAT_S3C=y
235
236#
237# Boot options
238#
239# CONFIG_S3C_BOOT_ERROR_RESET is not set
240CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
241CONFIG_S3C_LOWLEVEL_UART_PORT=1
242CONFIG_S3C_GPIO_SPACE=0
243CONFIG_S3C_GPIO_TRACK=y
244CONFIG_PLAT_S5P=y
245CONFIG_CPU_S5P6442=y
246CONFIG_MACH_SMDK6442=y
247
248#
249# Processor Type
250#
251CONFIG_CPU_V6=y
252CONFIG_CPU_32v6K=y
253CONFIG_CPU_32v6=y
254CONFIG_CPU_ABRT_EV6=y
255CONFIG_CPU_PABRT_V6=y
256CONFIG_CPU_CACHE_V6=y
257CONFIG_CPU_CACHE_VIPT=y
258CONFIG_CPU_COPY_V6=y
259CONFIG_CPU_TLB_V6=y
260CONFIG_CPU_HAS_ASID=y
261CONFIG_CPU_CP15=y
262CONFIG_CPU_CP15_MMU=y
263
264#
265# Processor Features
266#
267CONFIG_ARM_THUMB=y
268# CONFIG_CPU_ICACHE_DISABLE is not set
269# CONFIG_CPU_DCACHE_DISABLE is not set
270# CONFIG_CPU_BPREDICT_DISABLE is not set
271CONFIG_ARM_L1_CACHE_SHIFT=5
272# CONFIG_ARM_ERRATA_411920 is not set
273CONFIG_ARM_VIC=y
274CONFIG_ARM_VIC_NR=2
275
276#
277# Bus support
278#
279# CONFIG_PCI_SYSCALL is not set
280# CONFIG_ARCH_SUPPORTS_MSI is not set
281# CONFIG_PCCARD is not set
282
283#
284# Kernel Features
285#
286CONFIG_VMSPLIT_3G=y
287# CONFIG_VMSPLIT_2G is not set
288# CONFIG_VMSPLIT_1G is not set
289CONFIG_PAGE_OFFSET=0xC0000000
290CONFIG_PREEMPT_NONE=y
291# CONFIG_PREEMPT_VOLUNTARY is not set
292# CONFIG_PREEMPT is not set
293CONFIG_HZ=200
294CONFIG_AEABI=y
295CONFIG_OABI_COMPAT=y
296# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
297# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
298# CONFIG_HIGHMEM is not set
299CONFIG_SELECT_MEMORY_MODEL=y
300CONFIG_FLATMEM_MANUAL=y
301# CONFIG_DISCONTIGMEM_MANUAL is not set
302# CONFIG_SPARSEMEM_MANUAL is not set
303CONFIG_FLATMEM=y
304CONFIG_FLAT_NODE_MEM_MAP=y
305CONFIG_PAGEFLAGS_EXTENDED=y
306CONFIG_SPLIT_PTLOCK_CPUS=999999
307# CONFIG_PHYS_ADDR_T_64BIT is not set
308CONFIG_ZONE_DMA_FLAG=0
309CONFIG_VIRT_TO_BUS=y
310# CONFIG_KSM is not set
311CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
312CONFIG_ALIGNMENT_TRAP=y
313# CONFIG_UACCESS_WITH_MEMCPY is not set
314
315#
316# Boot options
317#
318CONFIG_ZBOOT_ROM_TEXT=0
319CONFIG_ZBOOT_ROM_BSS=0
320CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
321# CONFIG_XIP_KERNEL is not set
322# CONFIG_KEXEC is not set
323
324#
325# CPU Power Management
326#
327# CONFIG_CPU_IDLE is not set
328
329#
330# Floating point emulation
331#
332
333#
334# At least one emulation must be selected
335#
336CONFIG_FPE_NWFPE=y
337# CONFIG_FPE_NWFPE_XP is not set
338# CONFIG_FPE_FASTFPE is not set
339# CONFIG_VFP is not set
340
341#
342# Userspace binary formats
343#
344CONFIG_BINFMT_ELF=y
345# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
346CONFIG_HAVE_AOUT=y
347# CONFIG_BINFMT_AOUT is not set
348# CONFIG_BINFMT_MISC is not set
349
350#
351# Power management options
352#
353# CONFIG_PM is not set
354CONFIG_ARCH_SUSPEND_POSSIBLE=y
355# CONFIG_NET is not set
356
357#
358# Device Drivers
359#
360
361#
362# Generic Driver Options
363#
364CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
365# CONFIG_DEVTMPFS is not set
366CONFIG_STANDALONE=y
367# CONFIG_PREVENT_FIRMWARE_BUILD is not set
368CONFIG_FW_LOADER=y
369CONFIG_FIRMWARE_IN_KERNEL=y
370CONFIG_EXTRA_FIRMWARE=""
371# CONFIG_DEBUG_DRIVER is not set
372# CONFIG_DEBUG_DEVRES is not set
373# CONFIG_SYS_HYPERVISOR is not set
374# CONFIG_MTD is not set
375# CONFIG_PARPORT is not set
376CONFIG_BLK_DEV=y
377# CONFIG_BLK_DEV_COW_COMMON is not set
378CONFIG_BLK_DEV_LOOP=y
379# CONFIG_BLK_DEV_CRYPTOLOOP is not set
380
381#
382# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
383#
384CONFIG_BLK_DEV_RAM=y
385CONFIG_BLK_DEV_RAM_COUNT=16
386CONFIG_BLK_DEV_RAM_SIZE=8192
387# CONFIG_BLK_DEV_XIP is not set
388# CONFIG_CDROM_PKTCDVD is not set
389# CONFIG_MG_DISK is not set
390# CONFIG_MISC_DEVICES is not set
391CONFIG_HAVE_IDE=y
392# CONFIG_IDE is not set
393
394#
395# SCSI device support
396#
397# CONFIG_RAID_ATTRS is not set
398CONFIG_SCSI=y
399CONFIG_SCSI_DMA=y
400# CONFIG_SCSI_TGT is not set
401# CONFIG_SCSI_NETLINK is not set
402CONFIG_SCSI_PROC_FS=y
403
404#
405# SCSI support type (disk, tape, CD-ROM)
406#
407CONFIG_BLK_DEV_SD=y
408# CONFIG_CHR_DEV_ST is not set
409# CONFIG_CHR_DEV_OSST is not set
410# CONFIG_BLK_DEV_SR is not set
411CONFIG_CHR_DEV_SG=y
412# CONFIG_CHR_DEV_SCH is not set
413# CONFIG_SCSI_MULTI_LUN is not set
414# CONFIG_SCSI_CONSTANTS is not set
415# CONFIG_SCSI_LOGGING is not set
416# CONFIG_SCSI_SCAN_ASYNC is not set
417CONFIG_SCSI_WAIT_SCAN=m
418
419#
420# SCSI Transports
421#
422# CONFIG_SCSI_SPI_ATTRS is not set
423# CONFIG_SCSI_FC_ATTRS is not set
424# CONFIG_SCSI_SAS_LIBSAS is not set
425# CONFIG_SCSI_SRP_ATTRS is not set
426CONFIG_SCSI_LOWLEVEL=y
427# CONFIG_LIBFC is not set
428# CONFIG_LIBFCOE is not set
429# CONFIG_SCSI_DEBUG is not set
430# CONFIG_SCSI_DH is not set
431# CONFIG_SCSI_OSD_INITIATOR is not set
432# CONFIG_ATA is not set
433# CONFIG_MD is not set
434# CONFIG_PHONE is not set
435
436#
437# Input device support
438#
439CONFIG_INPUT=y
440# CONFIG_INPUT_FF_MEMLESS is not set
441# CONFIG_INPUT_POLLDEV is not set
442# CONFIG_INPUT_SPARSEKMAP is not set
443
444#
445# Userland interfaces
446#
447CONFIG_INPUT_MOUSEDEV=y
448CONFIG_INPUT_MOUSEDEV_PSAUX=y
449CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
450CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
451# CONFIG_INPUT_JOYDEV is not set
452CONFIG_INPUT_EVDEV=y
453# CONFIG_INPUT_EVBUG is not set
454
455#
456# Input Device Drivers
457#
458# CONFIG_INPUT_KEYBOARD is not set
459# CONFIG_INPUT_MOUSE is not set
460# CONFIG_INPUT_JOYSTICK is not set
461# CONFIG_INPUT_TABLET is not set
462CONFIG_INPUT_TOUCHSCREEN=y
463# CONFIG_TOUCHSCREEN_AD7879 is not set
464# CONFIG_TOUCHSCREEN_DYNAPRO is not set
465# CONFIG_TOUCHSCREEN_FUJITSU is not set
466# CONFIG_TOUCHSCREEN_GUNZE is not set
467# CONFIG_TOUCHSCREEN_ELO is not set
468# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
469# CONFIG_TOUCHSCREEN_MTOUCH is not set
470# CONFIG_TOUCHSCREEN_INEXIO is not set
471# CONFIG_TOUCHSCREEN_MK712 is not set
472# CONFIG_TOUCHSCREEN_PENMOUNT is not set
473# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
474# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
475# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
476# CONFIG_TOUCHSCREEN_W90X900 is not set
477# CONFIG_INPUT_MISC is not set
478
479#
480# Hardware I/O ports
481#
482CONFIG_SERIO=y
483CONFIG_SERIO_SERPORT=y
484# CONFIG_SERIO_RAW is not set
485# CONFIG_SERIO_ALTERA_PS2 is not set
486# CONFIG_GAMEPORT is not set
487
488#
489# Character devices
490#
491CONFIG_VT=y
492CONFIG_CONSOLE_TRANSLATIONS=y
493CONFIG_VT_CONSOLE=y
494CONFIG_HW_CONSOLE=y
495# CONFIG_VT_HW_CONSOLE_BINDING is not set
496CONFIG_DEVKMEM=y
497# CONFIG_SERIAL_NONSTANDARD is not set
498
499#
500# Serial drivers
501#
502CONFIG_SERIAL_8250=y
503# CONFIG_SERIAL_8250_CONSOLE is not set
504CONFIG_SERIAL_8250_NR_UARTS=3
505CONFIG_SERIAL_8250_RUNTIME_UARTS=3
506# CONFIG_SERIAL_8250_EXTENDED is not set
507
508#
509# Non-8250 serial port support
510#
511CONFIG_SERIAL_SAMSUNG=y
512CONFIG_SERIAL_SAMSUNG_UARTS=3
513# CONFIG_SERIAL_SAMSUNG_DEBUG is not set
514CONFIG_SERIAL_SAMSUNG_CONSOLE=y
515CONFIG_SERIAL_S5PV210=y
516CONFIG_SERIAL_CORE=y
517CONFIG_SERIAL_CORE_CONSOLE=y
518CONFIG_UNIX98_PTYS=y
519# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
520CONFIG_LEGACY_PTYS=y
521CONFIG_LEGACY_PTY_COUNT=256
522# CONFIG_IPMI_HANDLER is not set
523CONFIG_HW_RANDOM=y
524# CONFIG_HW_RANDOM_TIMERIOMEM is not set
525# CONFIG_R3964 is not set
526# CONFIG_RAW_DRIVER is not set
527# CONFIG_TCG_TPM is not set
528# CONFIG_I2C is not set
529# CONFIG_SPI is not set
530
531#
532# PPS support
533#
534# CONFIG_PPS is not set
535CONFIG_ARCH_REQUIRE_GPIOLIB=y
536CONFIG_GPIOLIB=y
537# CONFIG_DEBUG_GPIO is not set
538# CONFIG_GPIO_SYSFS is not set
539
540#
541# Memory mapped GPIO expanders:
542#
543
544#
545# I2C GPIO expanders:
546#
547
548#
549# PCI GPIO expanders:
550#
551
552#
553# SPI GPIO expanders:
554#
555
556#
557# AC97 GPIO expanders:
558#
559# CONFIG_W1 is not set
560# CONFIG_POWER_SUPPLY is not set
561# CONFIG_HWMON is not set
562# CONFIG_THERMAL is not set
563# CONFIG_WATCHDOG is not set
564CONFIG_SSB_POSSIBLE=y
565
566#
567# Sonics Silicon Backplane
568#
569# CONFIG_SSB is not set
570
571#
572# Multifunction device drivers
573#
574# CONFIG_MFD_CORE is not set
575# CONFIG_MFD_SM501 is not set
576# CONFIG_MFD_ASIC3 is not set
577# CONFIG_HTC_EGPIO is not set
578# CONFIG_HTC_PASIC3 is not set
579# CONFIG_MFD_TMIO is not set
580# CONFIG_MFD_T7L66XB is not set
581# CONFIG_MFD_TC6387XB is not set
582# CONFIG_MFD_TC6393XB is not set
583# CONFIG_REGULATOR is not set
584# CONFIG_MEDIA_SUPPORT is not set
585
586#
587# Graphics support
588#
589# CONFIG_VGASTATE is not set
590# CONFIG_VIDEO_OUTPUT_CONTROL is not set
591# CONFIG_FB is not set
592# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
593
594#
595# Display device support
596#
597# CONFIG_DISPLAY_SUPPORT is not set
598
599#
600# Console display driver support
601#
602# CONFIG_VGA_CONSOLE is not set
603CONFIG_DUMMY_CONSOLE=y
604# CONFIG_SOUND is not set
605# CONFIG_HID_SUPPORT is not set
606# CONFIG_USB_SUPPORT is not set
607# CONFIG_MMC is not set
608# CONFIG_MEMSTICK is not set
609# CONFIG_NEW_LEDS is not set
610# CONFIG_ACCESSIBILITY is not set
611CONFIG_RTC_LIB=y
612# CONFIG_RTC_CLASS is not set
613# CONFIG_DMADEVICES is not set
614# CONFIG_AUXDISPLAY is not set
615# CONFIG_UIO is not set
616
617#
618# TI VLYNQ
619#
620# CONFIG_STAGING is not set
621
622#
623# File systems
624#
625CONFIG_EXT2_FS=y
626# CONFIG_EXT2_FS_XATTR is not set
627# CONFIG_EXT2_FS_XIP is not set
628# CONFIG_EXT3_FS is not set
629# CONFIG_EXT4_FS is not set
630# CONFIG_REISERFS_FS is not set
631# CONFIG_JFS_FS is not set
632CONFIG_FS_POSIX_ACL=y
633# CONFIG_XFS_FS is not set
634# CONFIG_GFS2_FS is not set
635# CONFIG_BTRFS_FS is not set
636# CONFIG_NILFS2_FS is not set
637CONFIG_FILE_LOCKING=y
638CONFIG_FSNOTIFY=y
639CONFIG_DNOTIFY=y
640CONFIG_INOTIFY=y
641CONFIG_INOTIFY_USER=y
642# CONFIG_QUOTA is not set
643# CONFIG_AUTOFS_FS is not set
644# CONFIG_AUTOFS4_FS is not set
645# CONFIG_FUSE_FS is not set
646CONFIG_GENERIC_ACL=y
647
648#
649# Caches
650#
651# CONFIG_FSCACHE is not set
652
653#
654# CD-ROM/DVD Filesystems
655#
656# CONFIG_ISO9660_FS is not set
657# CONFIG_UDF_FS is not set
658
659#
660# DOS/FAT/NT Filesystems
661#
662CONFIG_FAT_FS=y
663CONFIG_MSDOS_FS=y
664CONFIG_VFAT_FS=y
665CONFIG_FAT_DEFAULT_CODEPAGE=437
666CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
667# CONFIG_NTFS_FS is not set
668
669#
670# Pseudo filesystems
671#
672CONFIG_PROC_FS=y
673CONFIG_PROC_SYSCTL=y
674CONFIG_PROC_PAGE_MONITOR=y
675CONFIG_SYSFS=y
676CONFIG_TMPFS=y
677CONFIG_TMPFS_POSIX_ACL=y
678# CONFIG_HUGETLB_PAGE is not set
679# CONFIG_CONFIGFS_FS is not set
680CONFIG_MISC_FILESYSTEMS=y
681# CONFIG_ADFS_FS is not set
682# CONFIG_AFFS_FS is not set
683# CONFIG_HFS_FS is not set
684# CONFIG_HFSPLUS_FS is not set
685# CONFIG_BEFS_FS is not set
686# CONFIG_BFS_FS is not set
687# CONFIG_EFS_FS is not set
688CONFIG_CRAMFS=y
689# CONFIG_SQUASHFS is not set
690# CONFIG_VXFS_FS is not set
691# CONFIG_MINIX_FS is not set
692# CONFIG_OMFS_FS is not set
693# CONFIG_HPFS_FS is not set
694# CONFIG_QNX4FS_FS is not set
695CONFIG_ROMFS_FS=y
696CONFIG_ROMFS_BACKED_BY_BLOCK=y
697# CONFIG_ROMFS_BACKED_BY_MTD is not set
698# CONFIG_ROMFS_BACKED_BY_BOTH is not set
699CONFIG_ROMFS_ON_BLOCK=y
700# CONFIG_SYSV_FS is not set
701# CONFIG_UFS_FS is not set
702
703#
704# Partition Types
705#
706CONFIG_PARTITION_ADVANCED=y
707# CONFIG_ACORN_PARTITION is not set
708# CONFIG_OSF_PARTITION is not set
709# CONFIG_AMIGA_PARTITION is not set
710# CONFIG_ATARI_PARTITION is not set
711# CONFIG_MAC_PARTITION is not set
712CONFIG_MSDOS_PARTITION=y
713CONFIG_BSD_DISKLABEL=y
714# CONFIG_MINIX_SUBPARTITION is not set
715CONFIG_SOLARIS_X86_PARTITION=y
716# CONFIG_UNIXWARE_DISKLABEL is not set
717# CONFIG_LDM_PARTITION is not set
718# CONFIG_SGI_PARTITION is not set
719# CONFIG_ULTRIX_PARTITION is not set
720# CONFIG_SUN_PARTITION is not set
721# CONFIG_KARMA_PARTITION is not set
722# CONFIG_EFI_PARTITION is not set
723# CONFIG_SYSV68_PARTITION is not set
724CONFIG_NLS=y
725CONFIG_NLS_DEFAULT="iso8859-1"
726CONFIG_NLS_CODEPAGE_437=y
727# CONFIG_NLS_CODEPAGE_737 is not set
728# CONFIG_NLS_CODEPAGE_775 is not set
729# CONFIG_NLS_CODEPAGE_850 is not set
730# CONFIG_NLS_CODEPAGE_852 is not set
731# CONFIG_NLS_CODEPAGE_855 is not set
732# CONFIG_NLS_CODEPAGE_857 is not set
733# CONFIG_NLS_CODEPAGE_860 is not set
734# CONFIG_NLS_CODEPAGE_861 is not set
735# CONFIG_NLS_CODEPAGE_862 is not set
736# CONFIG_NLS_CODEPAGE_863 is not set
737# CONFIG_NLS_CODEPAGE_864 is not set
738# CONFIG_NLS_CODEPAGE_865 is not set
739# CONFIG_NLS_CODEPAGE_866 is not set
740# CONFIG_NLS_CODEPAGE_869 is not set
741# CONFIG_NLS_CODEPAGE_936 is not set
742# CONFIG_NLS_CODEPAGE_950 is not set
743# CONFIG_NLS_CODEPAGE_932 is not set
744# CONFIG_NLS_CODEPAGE_949 is not set
745# CONFIG_NLS_CODEPAGE_874 is not set
746# CONFIG_NLS_ISO8859_8 is not set
747# CONFIG_NLS_CODEPAGE_1250 is not set
748# CONFIG_NLS_CODEPAGE_1251 is not set
749CONFIG_NLS_ASCII=y
750CONFIG_NLS_ISO8859_1=y
751# CONFIG_NLS_ISO8859_2 is not set
752# CONFIG_NLS_ISO8859_3 is not set
753# CONFIG_NLS_ISO8859_4 is not set
754# CONFIG_NLS_ISO8859_5 is not set
755# CONFIG_NLS_ISO8859_6 is not set
756# CONFIG_NLS_ISO8859_7 is not set
757# CONFIG_NLS_ISO8859_9 is not set
758# CONFIG_NLS_ISO8859_13 is not set
759# CONFIG_NLS_ISO8859_14 is not set
760# CONFIG_NLS_ISO8859_15 is not set
761# CONFIG_NLS_KOI8_R is not set
762# CONFIG_NLS_KOI8_U is not set
763# CONFIG_NLS_UTF8 is not set
764
765#
766# Kernel hacking
767#
768# CONFIG_PRINTK_TIME is not set
769CONFIG_ENABLE_WARN_DEPRECATED=y
770CONFIG_ENABLE_MUST_CHECK=y
771CONFIG_FRAME_WARN=1024
772CONFIG_MAGIC_SYSRQ=y
773# CONFIG_STRIP_ASM_SYMS is not set
774# CONFIG_UNUSED_SYMBOLS is not set
775# CONFIG_DEBUG_FS is not set
776# CONFIG_HEADERS_CHECK is not set
777CONFIG_DEBUG_KERNEL=y
778# CONFIG_DEBUG_SHIRQ is not set
779CONFIG_DETECT_SOFTLOCKUP=y
780# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
781CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
782CONFIG_DETECT_HUNG_TASK=y
783# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
784CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
785CONFIG_SCHED_DEBUG=y
786# CONFIG_SCHEDSTATS is not set
787# CONFIG_TIMER_STATS is not set
788# CONFIG_DEBUG_OBJECTS is not set
789# CONFIG_SLUB_DEBUG_ON is not set
790# CONFIG_SLUB_STATS is not set
791# CONFIG_DEBUG_KMEMLEAK is not set
792CONFIG_DEBUG_RT_MUTEXES=y
793CONFIG_DEBUG_PI_LIST=y
794# CONFIG_RT_MUTEX_TESTER is not set
795CONFIG_DEBUG_SPINLOCK=y
796CONFIG_DEBUG_MUTEXES=y
797# CONFIG_DEBUG_LOCK_ALLOC is not set
798# CONFIG_PROVE_LOCKING is not set
799# CONFIG_LOCK_STAT is not set
800CONFIG_DEBUG_SPINLOCK_SLEEP=y
801# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
802# CONFIG_DEBUG_KOBJECT is not set
803CONFIG_DEBUG_BUGVERBOSE=y
804CONFIG_DEBUG_INFO=y
805# CONFIG_DEBUG_VM is not set
806# CONFIG_DEBUG_WRITECOUNT is not set
807CONFIG_DEBUG_MEMORY_INIT=y
808# CONFIG_DEBUG_LIST is not set
809# CONFIG_DEBUG_SG is not set
810# CONFIG_DEBUG_NOTIFIERS is not set
811# CONFIG_DEBUG_CREDENTIALS is not set
812CONFIG_FRAME_POINTER=y
813# CONFIG_BOOT_PRINTK_DELAY is not set
814# CONFIG_RCU_TORTURE_TEST is not set
815# CONFIG_RCU_CPU_STALL_DETECTOR is not set
816# CONFIG_BACKTRACE_SELF_TEST is not set
817# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
818# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
819# CONFIG_FAULT_INJECTION is not set
820# CONFIG_LATENCYTOP is not set
821CONFIG_SYSCTL_SYSCALL_CHECK=y
822# CONFIG_PAGE_POISONING is not set
823CONFIG_HAVE_FUNCTION_TRACER=y
824CONFIG_TRACING_SUPPORT=y
825CONFIG_FTRACE=y
826# CONFIG_FUNCTION_TRACER is not set
827# CONFIG_SCHED_TRACER is not set
828# CONFIG_ENABLE_DEFAULT_TRACERS is not set
829# CONFIG_BOOT_TRACER is not set
830CONFIG_BRANCH_PROFILE_NONE=y
831# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
832# CONFIG_PROFILE_ALL_BRANCHES is not set
833# CONFIG_STACK_TRACER is not set
834# CONFIG_KMEMTRACE is not set
835# CONFIG_WORKQUEUE_TRACER is not set
836# CONFIG_BLK_DEV_IO_TRACE is not set
837# CONFIG_SAMPLES is not set
838CONFIG_HAVE_ARCH_KGDB=y
839# CONFIG_KGDB is not set
840# CONFIG_ARM_UNWIND is not set
841CONFIG_DEBUG_USER=y
842CONFIG_DEBUG_ERRORS=y
843# CONFIG_DEBUG_STACK_USAGE is not set
844CONFIG_DEBUG_LL=y
845# CONFIG_EARLY_PRINTK is not set
846# CONFIG_DEBUG_ICEDCC is not set
847# CONFIG_OC_ETM is not set
848CONFIG_DEBUG_S3C_UART=1
849
850#
851# Security options
852#
853# CONFIG_KEYS is not set
854# CONFIG_SECURITY is not set
855# CONFIG_SECURITYFS is not set
856# CONFIG_DEFAULT_SECURITY_SELINUX is not set
857# CONFIG_DEFAULT_SECURITY_SMACK is not set
858# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
859CONFIG_DEFAULT_SECURITY_DAC=y
860CONFIG_DEFAULT_SECURITY=""
861# CONFIG_CRYPTO is not set
862# CONFIG_BINARY_PRINTF is not set
863
864#
865# Library routines
866#
867CONFIG_BITREVERSE=y
868CONFIG_GENERIC_FIND_LAST_BIT=y
869CONFIG_CRC_CCITT=y
870# CONFIG_CRC16 is not set
871# CONFIG_CRC_T10DIF is not set
872# CONFIG_CRC_ITU_T is not set
873CONFIG_CRC32=y
874# CONFIG_CRC7 is not set
875# CONFIG_LIBCRC32C is not set
876CONFIG_ZLIB_INFLATE=y
877CONFIG_LZO_DECOMPRESS=y
878CONFIG_DECOMPRESS_GZIP=y
879CONFIG_DECOMPRESS_BZIP2=y
880CONFIG_DECOMPRESS_LZMA=y
881CONFIG_DECOMPRESS_LZO=y
882CONFIG_HAS_IOMEM=y
883CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/s5pc110_defconfig b/arch/arm/configs/s5pc110_defconfig
new file mode 100644
index 000000000000..6ea636131ac8
--- /dev/null
+++ b/arch/arm/configs/s5pc110_defconfig
@@ -0,0 +1,894 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc4
4# Wed Feb 24 15:36:54 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_NO_IOPORT=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_ARM_L1_CACHE_SHIFT_6=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
41CONFIG_SWAP=y
42# CONFIG_SYSVIPC is not set
43# CONFIG_BSD_PROCESS_ACCT is not set
44
45#
46# RCU Subsystem
47#
48CONFIG_TREE_RCU=y
49# CONFIG_TREE_PREEMPT_RCU is not set
50# CONFIG_TINY_RCU is not set
51# CONFIG_RCU_TRACE is not set
52CONFIG_RCU_FANOUT=32
53# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_IKCONFIG is not set
56CONFIG_LOG_BUF_SHIFT=17
57# CONFIG_GROUP_SCHED is not set
58# CONFIG_CGROUPS is not set
59CONFIG_SYSFS_DEPRECATED=y
60CONFIG_SYSFS_DEPRECATED_V2=y
61# CONFIG_RELAY is not set
62CONFIG_NAMESPACES=y
63# CONFIG_UTS_NS is not set
64# CONFIG_USER_NS is not set
65# CONFIG_PID_NS is not set
66CONFIG_BLK_DEV_INITRD=y
67CONFIG_INITRAMFS_SOURCE=""
68CONFIG_RD_GZIP=y
69CONFIG_RD_BZIP2=y
70CONFIG_RD_LZMA=y
71CONFIG_RD_LZO=y
72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
73CONFIG_SYSCTL=y
74CONFIG_ANON_INODES=y
75# CONFIG_EMBEDDED is not set
76CONFIG_UID16=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79CONFIG_KALLSYMS_ALL=y
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y
91CONFIG_SHMEM=y
92CONFIG_AIO=y
93
94#
95# Kernel Performance Events And Counters
96#
97CONFIG_VM_EVENT_COUNTERS=y
98CONFIG_SLUB_DEBUG=y
99CONFIG_COMPAT_BRK=y
100# CONFIG_SLAB is not set
101CONFIG_SLUB=y
102# CONFIG_SLOB is not set
103# CONFIG_PROFILING is not set
104CONFIG_HAVE_OPROFILE=y
105# CONFIG_KPROBES is not set
106CONFIG_HAVE_KPROBES=y
107CONFIG_HAVE_KRETPROBES=y
108CONFIG_HAVE_CLK=y
109
110#
111# GCOV-based kernel profiling
112#
113# CONFIG_SLOW_WORK is not set
114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
115CONFIG_SLABINFO=y
116CONFIG_RT_MUTEXES=y
117CONFIG_BASE_SMALL=0
118CONFIG_MODULES=y
119# CONFIG_MODULE_FORCE_LOAD is not set
120CONFIG_MODULE_UNLOAD=y
121# CONFIG_MODULE_FORCE_UNLOAD is not set
122# CONFIG_MODVERSIONS is not set
123# CONFIG_MODULE_SRCVERSION_ALL is not set
124CONFIG_BLOCK=y
125CONFIG_LBDAF=y
126# CONFIG_BLK_DEV_BSG is not set
127# CONFIG_BLK_DEV_INTEGRITY is not set
128
129#
130# IO Schedulers
131#
132CONFIG_IOSCHED_NOOP=y
133CONFIG_IOSCHED_DEADLINE=y
134CONFIG_IOSCHED_CFQ=y
135# CONFIG_DEFAULT_DEADLINE is not set
136CONFIG_DEFAULT_CFQ=y
137# CONFIG_DEFAULT_NOOP is not set
138CONFIG_DEFAULT_IOSCHED="cfq"
139# CONFIG_INLINE_SPIN_TRYLOCK is not set
140# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
141# CONFIG_INLINE_SPIN_LOCK is not set
142# CONFIG_INLINE_SPIN_LOCK_BH is not set
143# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
144# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
145# CONFIG_INLINE_SPIN_UNLOCK is not set
146# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
147# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
148# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
149# CONFIG_INLINE_READ_TRYLOCK is not set
150# CONFIG_INLINE_READ_LOCK is not set
151# CONFIG_INLINE_READ_LOCK_BH is not set
152# CONFIG_INLINE_READ_LOCK_IRQ is not set
153# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
154# CONFIG_INLINE_READ_UNLOCK is not set
155# CONFIG_INLINE_READ_UNLOCK_BH is not set
156# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
157# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
158# CONFIG_INLINE_WRITE_TRYLOCK is not set
159# CONFIG_INLINE_WRITE_LOCK is not set
160# CONFIG_INLINE_WRITE_LOCK_BH is not set
161# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
162# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
163# CONFIG_INLINE_WRITE_UNLOCK is not set
164# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
165# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
166# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
167# CONFIG_MUTEX_SPIN_ON_OWNER is not set
168# CONFIG_FREEZER is not set
169
170#
171# System Type
172#
173CONFIG_MMU=y
174# CONFIG_ARCH_AAEC2000 is not set
175# CONFIG_ARCH_INTEGRATOR is not set
176# CONFIG_ARCH_REALVIEW is not set
177# CONFIG_ARCH_VERSATILE is not set
178# CONFIG_ARCH_AT91 is not set
179# CONFIG_ARCH_CLPS711X is not set
180# CONFIG_ARCH_GEMINI is not set
181# CONFIG_ARCH_EBSA110 is not set
182# CONFIG_ARCH_EP93XX is not set
183# CONFIG_ARCH_FOOTBRIDGE is not set
184# CONFIG_ARCH_MXC is not set
185# CONFIG_ARCH_STMP3XXX is not set
186# CONFIG_ARCH_NETX is not set
187# CONFIG_ARCH_H720X is not set
188# CONFIG_ARCH_NOMADIK is not set
189# CONFIG_ARCH_IOP13XX is not set
190# CONFIG_ARCH_IOP32X is not set
191# CONFIG_ARCH_IOP33X is not set
192# CONFIG_ARCH_IXP23XX is not set
193# CONFIG_ARCH_IXP2000 is not set
194# CONFIG_ARCH_IXP4XX is not set
195# CONFIG_ARCH_L7200 is not set
196# CONFIG_ARCH_DOVE is not set
197# CONFIG_ARCH_KIRKWOOD is not set
198# CONFIG_ARCH_LOKI is not set
199# CONFIG_ARCH_MV78XX0 is not set
200# CONFIG_ARCH_ORION5X is not set
201# CONFIG_ARCH_MMP is not set
202# CONFIG_ARCH_KS8695 is not set
203# CONFIG_ARCH_NS9XXX is not set
204# CONFIG_ARCH_W90X900 is not set
205# CONFIG_ARCH_PNX4008 is not set
206# CONFIG_ARCH_PXA is not set
207# CONFIG_ARCH_MSM is not set
208# CONFIG_ARCH_RPC is not set
209# CONFIG_ARCH_SA1100 is not set
210# CONFIG_ARCH_S3C2410 is not set
211# CONFIG_ARCH_S3C64XX is not set
212# CONFIG_ARCH_S5P6440 is not set
213# CONFIG_ARCH_S5P6442 is not set
214# CONFIG_ARCH_S5PC1XX is not set
215CONFIG_ARCH_S5PV210=y
216# CONFIG_ARCH_SHARK is not set
217# CONFIG_ARCH_LH7A40X is not set
218# CONFIG_ARCH_U300 is not set
219# CONFIG_ARCH_DAVINCI is not set
220# CONFIG_ARCH_OMAP is not set
221# CONFIG_ARCH_BCMRING is not set
222# CONFIG_ARCH_U8500 is not set
223CONFIG_PLAT_SAMSUNG=y
224
225#
226# Boot options
227#
228# CONFIG_S3C_BOOT_ERROR_RESET is not set
229CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
230CONFIG_S3C_LOWLEVEL_UART_PORT=1
231CONFIG_SAMSUNG_CLKSRC=y
232CONFIG_SAMSUNG_IRQ_VIC_TIMER=y
233CONFIG_SAMSUNG_IRQ_UART=y
234CONFIG_SAMSUNG_GPIOLIB_4BIT=y
235CONFIG_S3C_GPIO_CFG_S3C24XX=y
236CONFIG_S3C_GPIO_CFG_S3C64XX=y
237CONFIG_S3C_GPIO_PULL_UPDOWN=y
238CONFIG_SAMSUNG_GPIO_EXTRA=0
239CONFIG_S3C_GPIO_SPACE=0
240CONFIG_S3C_GPIO_TRACK=y
241# CONFIG_S3C_ADC is not set
242
243#
244# Power management
245#
246CONFIG_PLAT_S5P=y
247CONFIG_CPU_S5PV210=y
248# CONFIG_MACH_SMDKV210 is not set
249CONFIG_MACH_SMDKC110=y
250
251#
252# Processor Type
253#
254CONFIG_CPU_32v6K=y
255CONFIG_CPU_V7=y
256CONFIG_CPU_32v7=y
257CONFIG_CPU_ABRT_EV7=y
258CONFIG_CPU_PABRT_V7=y
259CONFIG_CPU_CACHE_V7=y
260CONFIG_CPU_CACHE_VIPT=y
261CONFIG_CPU_COPY_V6=y
262CONFIG_CPU_TLB_V7=y
263CONFIG_CPU_HAS_ASID=y
264CONFIG_CPU_CP15=y
265CONFIG_CPU_CP15_MMU=y
266
267#
268# Processor Features
269#
270CONFIG_ARM_THUMB=y
271# CONFIG_ARM_THUMBEE is not set
272# CONFIG_CPU_ICACHE_DISABLE is not set
273# CONFIG_CPU_DCACHE_DISABLE is not set
274# CONFIG_CPU_BPREDICT_DISABLE is not set
275CONFIG_HAS_TLS_REG=y
276CONFIG_ARM_L1_CACHE_SHIFT=6
277# CONFIG_ARM_ERRATA_430973 is not set
278# CONFIG_ARM_ERRATA_458693 is not set
279# CONFIG_ARM_ERRATA_460075 is not set
280CONFIG_ARM_VIC=y
281CONFIG_ARM_VIC_NR=2
282
283#
284# Bus support
285#
286# CONFIG_PCI_SYSCALL is not set
287# CONFIG_ARCH_SUPPORTS_MSI is not set
288# CONFIG_PCCARD is not set
289
290#
291# Kernel Features
292#
293# CONFIG_VMSPLIT_3G is not set
294CONFIG_VMSPLIT_2G=y
295# CONFIG_VMSPLIT_1G is not set
296CONFIG_PAGE_OFFSET=0x80000000
297# CONFIG_PREEMPT_NONE is not set
298# CONFIG_PREEMPT_VOLUNTARY is not set
299CONFIG_PREEMPT=y
300CONFIG_HZ=200
301# CONFIG_THUMB2_KERNEL is not set
302CONFIG_AEABI=y
303CONFIG_OABI_COMPAT=y
304CONFIG_ARCH_SPARSEMEM_ENABLE=y
305CONFIG_ARCH_SPARSEMEM_DEFAULT=y
306# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
307# CONFIG_HIGHMEM is not set
308CONFIG_SELECT_MEMORY_MODEL=y
309# CONFIG_FLATMEM_MANUAL is not set
310# CONFIG_DISCONTIGMEM_MANUAL is not set
311CONFIG_SPARSEMEM_MANUAL=y
312CONFIG_SPARSEMEM=y
313CONFIG_HAVE_MEMORY_PRESENT=y
314CONFIG_SPARSEMEM_EXTREME=y
315CONFIG_SPLIT_PTLOCK_CPUS=999999
316# CONFIG_PHYS_ADDR_T_64BIT is not set
317CONFIG_ZONE_DMA_FLAG=0
318CONFIG_VIRT_TO_BUS=y
319# CONFIG_KSM is not set
320CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
321CONFIG_ALIGNMENT_TRAP=y
322# CONFIG_UACCESS_WITH_MEMCPY is not set
323
324#
325# Boot options
326#
327CONFIG_ZBOOT_ROM_TEXT=0
328CONFIG_ZBOOT_ROM_BSS=0
329CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
330# CONFIG_XIP_KERNEL is not set
331# CONFIG_KEXEC is not set
332
333#
334# CPU Power Management
335#
336# CONFIG_CPU_IDLE is not set
337
338#
339# Floating point emulation
340#
341
342#
343# At least one emulation must be selected
344#
345# CONFIG_FPE_NWFPE is not set
346# CONFIG_FPE_FASTFPE is not set
347CONFIG_VFP=y
348CONFIG_VFPv3=y
349CONFIG_NEON=y
350
351#
352# Userspace binary formats
353#
354CONFIG_BINFMT_ELF=y
355# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
356CONFIG_HAVE_AOUT=y
357# CONFIG_BINFMT_AOUT is not set
358# CONFIG_BINFMT_MISC is not set
359
360#
361# Power management options
362#
363# CONFIG_PM is not set
364CONFIG_ARCH_SUSPEND_POSSIBLE=y
365# CONFIG_NET is not set
366
367#
368# Device Drivers
369#
370
371#
372# Generic Driver Options
373#
374CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
375# CONFIG_DEVTMPFS is not set
376CONFIG_STANDALONE=y
377CONFIG_PREVENT_FIRMWARE_BUILD=y
378CONFIG_FW_LOADER=y
379CONFIG_FIRMWARE_IN_KERNEL=y
380CONFIG_EXTRA_FIRMWARE=""
381# CONFIG_DEBUG_DRIVER is not set
382# CONFIG_DEBUG_DEVRES is not set
383# CONFIG_SYS_HYPERVISOR is not set
384# CONFIG_MTD is not set
385# CONFIG_PARPORT is not set
386CONFIG_BLK_DEV=y
387# CONFIG_BLK_DEV_COW_COMMON is not set
388CONFIG_BLK_DEV_LOOP=y
389# CONFIG_BLK_DEV_CRYPTOLOOP is not set
390
391#
392# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
393#
394CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16
396CONFIG_BLK_DEV_RAM_SIZE=8192
397# CONFIG_BLK_DEV_XIP is not set
398# CONFIG_CDROM_PKTCDVD is not set
399# CONFIG_MG_DISK is not set
400# CONFIG_MISC_DEVICES is not set
401CONFIG_HAVE_IDE=y
402# CONFIG_IDE is not set
403
404#
405# SCSI device support
406#
407# CONFIG_RAID_ATTRS is not set
408CONFIG_SCSI=y
409CONFIG_SCSI_DMA=y
410# CONFIG_SCSI_TGT is not set
411# CONFIG_SCSI_NETLINK is not set
412CONFIG_SCSI_PROC_FS=y
413
414#
415# SCSI support type (disk, tape, CD-ROM)
416#
417CONFIG_BLK_DEV_SD=y
418# CONFIG_CHR_DEV_ST is not set
419# CONFIG_CHR_DEV_OSST is not set
420# CONFIG_BLK_DEV_SR is not set
421CONFIG_CHR_DEV_SG=y
422# CONFIG_CHR_DEV_SCH is not set
423# CONFIG_SCSI_MULTI_LUN is not set
424# CONFIG_SCSI_CONSTANTS is not set
425# CONFIG_SCSI_LOGGING is not set
426# CONFIG_SCSI_SCAN_ASYNC is not set
427CONFIG_SCSI_WAIT_SCAN=m
428
429#
430# SCSI Transports
431#
432# CONFIG_SCSI_SPI_ATTRS is not set
433# CONFIG_SCSI_FC_ATTRS is not set
434# CONFIG_SCSI_SAS_LIBSAS is not set
435# CONFIG_SCSI_SRP_ATTRS is not set
436CONFIG_SCSI_LOWLEVEL=y
437# CONFIG_LIBFC is not set
438# CONFIG_LIBFCOE is not set
439# CONFIG_SCSI_DEBUG is not set
440# CONFIG_SCSI_DH is not set
441# CONFIG_SCSI_OSD_INITIATOR is not set
442# CONFIG_ATA is not set
443# CONFIG_MD is not set
444# CONFIG_PHONE is not set
445
446#
447# Input device support
448#
449CONFIG_INPUT=y
450# CONFIG_INPUT_FF_MEMLESS is not set
451# CONFIG_INPUT_POLLDEV is not set
452# CONFIG_INPUT_SPARSEKMAP is not set
453
454#
455# Userland interfaces
456#
457CONFIG_INPUT_MOUSEDEV=y
458CONFIG_INPUT_MOUSEDEV_PSAUX=y
459CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
460CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
461# CONFIG_INPUT_JOYDEV is not set
462CONFIG_INPUT_EVDEV=y
463# CONFIG_INPUT_EVBUG is not set
464
465#
466# Input Device Drivers
467#
468# CONFIG_INPUT_KEYBOARD is not set
469# CONFIG_INPUT_MOUSE is not set
470# CONFIG_INPUT_JOYSTICK is not set
471# CONFIG_INPUT_TABLET is not set
472CONFIG_INPUT_TOUCHSCREEN=y
473# CONFIG_TOUCHSCREEN_AD7879 is not set
474# CONFIG_TOUCHSCREEN_DYNAPRO is not set
475# CONFIG_TOUCHSCREEN_FUJITSU is not set
476# CONFIG_TOUCHSCREEN_GUNZE is not set
477# CONFIG_TOUCHSCREEN_ELO is not set
478# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
479# CONFIG_TOUCHSCREEN_MTOUCH is not set
480# CONFIG_TOUCHSCREEN_INEXIO is not set
481# CONFIG_TOUCHSCREEN_MK712 is not set
482# CONFIG_TOUCHSCREEN_PENMOUNT is not set
483# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
484# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
485# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
486# CONFIG_TOUCHSCREEN_W90X900 is not set
487# CONFIG_INPUT_MISC is not set
488
489#
490# Hardware I/O ports
491#
492CONFIG_SERIO=y
493CONFIG_SERIO_SERPORT=y
494# CONFIG_SERIO_RAW is not set
495# CONFIG_SERIO_ALTERA_PS2 is not set
496# CONFIG_GAMEPORT is not set
497
498#
499# Character devices
500#
501CONFIG_VT=y
502CONFIG_CONSOLE_TRANSLATIONS=y
503CONFIG_VT_CONSOLE=y
504CONFIG_HW_CONSOLE=y
505# CONFIG_VT_HW_CONSOLE_BINDING is not set
506CONFIG_DEVKMEM=y
507# CONFIG_SERIAL_NONSTANDARD is not set
508
509#
510# Serial drivers
511#
512CONFIG_SERIAL_8250=y
513# CONFIG_SERIAL_8250_CONSOLE is not set
514CONFIG_SERIAL_8250_NR_UARTS=4
515CONFIG_SERIAL_8250_RUNTIME_UARTS=4
516# CONFIG_SERIAL_8250_EXTENDED is not set
517
518#
519# Non-8250 serial port support
520#
521CONFIG_SERIAL_SAMSUNG=y
522CONFIG_SERIAL_SAMSUNG_UARTS_4=y
523CONFIG_SERIAL_SAMSUNG_UARTS=4
524# CONFIG_SERIAL_SAMSUNG_DEBUG is not set
525CONFIG_SERIAL_SAMSUNG_CONSOLE=y
526CONFIG_SERIAL_S5PV210=y
527CONFIG_SERIAL_CORE=y
528CONFIG_SERIAL_CORE_CONSOLE=y
529CONFIG_UNIX98_PTYS=y
530# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
531CONFIG_LEGACY_PTYS=y
532CONFIG_LEGACY_PTY_COUNT=256
533# CONFIG_IPMI_HANDLER is not set
534CONFIG_HW_RANDOM=y
535# CONFIG_HW_RANDOM_TIMERIOMEM is not set
536# CONFIG_R3964 is not set
537# CONFIG_RAW_DRIVER is not set
538# CONFIG_TCG_TPM is not set
539# CONFIG_I2C is not set
540# CONFIG_SPI is not set
541
542#
543# PPS support
544#
545# CONFIG_PPS is not set
546CONFIG_ARCH_REQUIRE_GPIOLIB=y
547CONFIG_GPIOLIB=y
548# CONFIG_DEBUG_GPIO is not set
549# CONFIG_GPIO_SYSFS is not set
550
551#
552# Memory mapped GPIO expanders:
553#
554
555#
556# I2C GPIO expanders:
557#
558
559#
560# PCI GPIO expanders:
561#
562
563#
564# SPI GPIO expanders:
565#
566
567#
568# AC97 GPIO expanders:
569#
570# CONFIG_W1 is not set
571# CONFIG_POWER_SUPPLY is not set
572# CONFIG_HWMON is not set
573# CONFIG_THERMAL is not set
574# CONFIG_WATCHDOG is not set
575CONFIG_SSB_POSSIBLE=y
576
577#
578# Sonics Silicon Backplane
579#
580# CONFIG_SSB is not set
581
582#
583# Multifunction device drivers
584#
585# CONFIG_MFD_CORE is not set
586# CONFIG_MFD_SM501 is not set
587# CONFIG_MFD_ASIC3 is not set
588# CONFIG_HTC_EGPIO is not set
589# CONFIG_HTC_PASIC3 is not set
590# CONFIG_MFD_TMIO is not set
591# CONFIG_MFD_T7L66XB is not set
592# CONFIG_MFD_TC6387XB is not set
593# CONFIG_MFD_TC6393XB is not set
594# CONFIG_REGULATOR is not set
595# CONFIG_MEDIA_SUPPORT is not set
596
597#
598# Graphics support
599#
600# CONFIG_VGASTATE is not set
601# CONFIG_VIDEO_OUTPUT_CONTROL is not set
602# CONFIG_FB is not set
603# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
604
605#
606# Display device support
607#
608# CONFIG_DISPLAY_SUPPORT is not set
609
610#
611# Console display driver support
612#
613# CONFIG_VGA_CONSOLE is not set
614CONFIG_DUMMY_CONSOLE=y
615# CONFIG_SOUND is not set
616# CONFIG_HID_SUPPORT is not set
617# CONFIG_USB_SUPPORT is not set
618# CONFIG_MMC is not set
619# CONFIG_MEMSTICK is not set
620# CONFIG_NEW_LEDS is not set
621# CONFIG_ACCESSIBILITY is not set
622CONFIG_RTC_LIB=y
623# CONFIG_RTC_CLASS is not set
624# CONFIG_DMADEVICES is not set
625# CONFIG_AUXDISPLAY is not set
626# CONFIG_UIO is not set
627
628#
629# TI VLYNQ
630#
631# CONFIG_STAGING is not set
632
633#
634# File systems
635#
636CONFIG_EXT2_FS=y
637# CONFIG_EXT2_FS_XATTR is not set
638# CONFIG_EXT2_FS_XIP is not set
639# CONFIG_EXT3_FS is not set
640# CONFIG_EXT4_FS is not set
641# CONFIG_REISERFS_FS is not set
642# CONFIG_JFS_FS is not set
643CONFIG_FS_POSIX_ACL=y
644# CONFIG_XFS_FS is not set
645# CONFIG_GFS2_FS is not set
646# CONFIG_BTRFS_FS is not set
647# CONFIG_NILFS2_FS is not set
648CONFIG_FILE_LOCKING=y
649CONFIG_FSNOTIFY=y
650CONFIG_DNOTIFY=y
651CONFIG_INOTIFY=y
652CONFIG_INOTIFY_USER=y
653# CONFIG_QUOTA is not set
654# CONFIG_AUTOFS_FS is not set
655# CONFIG_AUTOFS4_FS is not set
656# CONFIG_FUSE_FS is not set
657CONFIG_GENERIC_ACL=y
658
659#
660# Caches
661#
662# CONFIG_FSCACHE is not set
663
664#
665# CD-ROM/DVD Filesystems
666#
667# CONFIG_ISO9660_FS is not set
668# CONFIG_UDF_FS is not set
669
670#
671# DOS/FAT/NT Filesystems
672#
673CONFIG_FAT_FS=y
674CONFIG_MSDOS_FS=y
675CONFIG_VFAT_FS=y
676CONFIG_FAT_DEFAULT_CODEPAGE=437
677CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
678# CONFIG_NTFS_FS is not set
679
680#
681# Pseudo filesystems
682#
683CONFIG_PROC_FS=y
684CONFIG_PROC_SYSCTL=y
685CONFIG_PROC_PAGE_MONITOR=y
686CONFIG_SYSFS=y
687CONFIG_TMPFS=y
688CONFIG_TMPFS_POSIX_ACL=y
689# CONFIG_HUGETLB_PAGE is not set
690# CONFIG_CONFIGFS_FS is not set
691CONFIG_MISC_FILESYSTEMS=y
692# CONFIG_ADFS_FS is not set
693# CONFIG_AFFS_FS is not set
694# CONFIG_HFS_FS is not set
695# CONFIG_HFSPLUS_FS is not set
696# CONFIG_BEFS_FS is not set
697# CONFIG_BFS_FS is not set
698# CONFIG_EFS_FS is not set
699CONFIG_CRAMFS=y
700# CONFIG_SQUASHFS is not set
701# CONFIG_VXFS_FS is not set
702# CONFIG_MINIX_FS is not set
703# CONFIG_OMFS_FS is not set
704# CONFIG_HPFS_FS is not set
705# CONFIG_QNX4FS_FS is not set
706CONFIG_ROMFS_FS=y
707CONFIG_ROMFS_BACKED_BY_BLOCK=y
708# CONFIG_ROMFS_BACKED_BY_MTD is not set
709# CONFIG_ROMFS_BACKED_BY_BOTH is not set
710CONFIG_ROMFS_ON_BLOCK=y
711# CONFIG_SYSV_FS is not set
712# CONFIG_UFS_FS is not set
713
714#
715# Partition Types
716#
717CONFIG_PARTITION_ADVANCED=y
718# CONFIG_ACORN_PARTITION is not set
719# CONFIG_OSF_PARTITION is not set
720# CONFIG_AMIGA_PARTITION is not set
721# CONFIG_ATARI_PARTITION is not set
722# CONFIG_MAC_PARTITION is not set
723CONFIG_MSDOS_PARTITION=y
724CONFIG_BSD_DISKLABEL=y
725# CONFIG_MINIX_SUBPARTITION is not set
726CONFIG_SOLARIS_X86_PARTITION=y
727# CONFIG_UNIXWARE_DISKLABEL is not set
728# CONFIG_LDM_PARTITION is not set
729# CONFIG_SGI_PARTITION is not set
730# CONFIG_ULTRIX_PARTITION is not set
731# CONFIG_SUN_PARTITION is not set
732# CONFIG_KARMA_PARTITION is not set
733# CONFIG_EFI_PARTITION is not set
734# CONFIG_SYSV68_PARTITION is not set
735CONFIG_NLS=y
736CONFIG_NLS_DEFAULT="iso8859-1"
737CONFIG_NLS_CODEPAGE_437=y
738# CONFIG_NLS_CODEPAGE_737 is not set
739# CONFIG_NLS_CODEPAGE_775 is not set
740# CONFIG_NLS_CODEPAGE_850 is not set
741# CONFIG_NLS_CODEPAGE_852 is not set
742# CONFIG_NLS_CODEPAGE_855 is not set
743# CONFIG_NLS_CODEPAGE_857 is not set
744# CONFIG_NLS_CODEPAGE_860 is not set
745# CONFIG_NLS_CODEPAGE_861 is not set
746# CONFIG_NLS_CODEPAGE_862 is not set
747# CONFIG_NLS_CODEPAGE_863 is not set
748# CONFIG_NLS_CODEPAGE_864 is not set
749# CONFIG_NLS_CODEPAGE_865 is not set
750# CONFIG_NLS_CODEPAGE_866 is not set
751# CONFIG_NLS_CODEPAGE_869 is not set
752# CONFIG_NLS_CODEPAGE_936 is not set
753# CONFIG_NLS_CODEPAGE_950 is not set
754# CONFIG_NLS_CODEPAGE_932 is not set
755# CONFIG_NLS_CODEPAGE_949 is not set
756# CONFIG_NLS_CODEPAGE_874 is not set
757# CONFIG_NLS_ISO8859_8 is not set
758# CONFIG_NLS_CODEPAGE_1250 is not set
759# CONFIG_NLS_CODEPAGE_1251 is not set
760CONFIG_NLS_ASCII=y
761CONFIG_NLS_ISO8859_1=y
762# CONFIG_NLS_ISO8859_2 is not set
763# CONFIG_NLS_ISO8859_3 is not set
764# CONFIG_NLS_ISO8859_4 is not set
765# CONFIG_NLS_ISO8859_5 is not set
766# CONFIG_NLS_ISO8859_6 is not set
767# CONFIG_NLS_ISO8859_7 is not set
768# CONFIG_NLS_ISO8859_9 is not set
769# CONFIG_NLS_ISO8859_13 is not set
770# CONFIG_NLS_ISO8859_14 is not set
771# CONFIG_NLS_ISO8859_15 is not set
772# CONFIG_NLS_KOI8_R is not set
773# CONFIG_NLS_KOI8_U is not set
774# CONFIG_NLS_UTF8 is not set
775
776#
777# Kernel hacking
778#
779# CONFIG_PRINTK_TIME is not set
780CONFIG_ENABLE_WARN_DEPRECATED=y
781CONFIG_ENABLE_MUST_CHECK=y
782CONFIG_FRAME_WARN=1024
783CONFIG_MAGIC_SYSRQ=y
784# CONFIG_STRIP_ASM_SYMS is not set
785# CONFIG_UNUSED_SYMBOLS is not set
786# CONFIG_DEBUG_FS is not set
787# CONFIG_HEADERS_CHECK is not set
788CONFIG_DEBUG_KERNEL=y
789# CONFIG_DEBUG_SHIRQ is not set
790CONFIG_DETECT_SOFTLOCKUP=y
791# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
792CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
793CONFIG_DETECT_HUNG_TASK=y
794# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
795CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
796CONFIG_SCHED_DEBUG=y
797# CONFIG_SCHEDSTATS is not set
798# CONFIG_TIMER_STATS is not set
799# CONFIG_DEBUG_OBJECTS is not set
800# CONFIG_SLUB_DEBUG_ON is not set
801# CONFIG_SLUB_STATS is not set
802# CONFIG_DEBUG_KMEMLEAK is not set
803# CONFIG_DEBUG_PREEMPT is not set
804CONFIG_DEBUG_RT_MUTEXES=y
805CONFIG_DEBUG_PI_LIST=y
806# CONFIG_RT_MUTEX_TESTER is not set
807CONFIG_DEBUG_SPINLOCK=y
808CONFIG_DEBUG_MUTEXES=y
809# CONFIG_DEBUG_LOCK_ALLOC is not set
810# CONFIG_PROVE_LOCKING is not set
811# CONFIG_LOCK_STAT is not set
812CONFIG_DEBUG_SPINLOCK_SLEEP=y
813# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
814# CONFIG_DEBUG_KOBJECT is not set
815CONFIG_DEBUG_BUGVERBOSE=y
816CONFIG_DEBUG_INFO=y
817# CONFIG_DEBUG_VM is not set
818# CONFIG_DEBUG_WRITECOUNT is not set
819CONFIG_DEBUG_MEMORY_INIT=y
820# CONFIG_DEBUG_LIST is not set
821# CONFIG_DEBUG_SG is not set
822# CONFIG_DEBUG_NOTIFIERS is not set
823# CONFIG_DEBUG_CREDENTIALS is not set
824# CONFIG_BOOT_PRINTK_DELAY is not set
825# CONFIG_RCU_TORTURE_TEST is not set
826# CONFIG_RCU_CPU_STALL_DETECTOR is not set
827# CONFIG_BACKTRACE_SELF_TEST is not set
828# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
829# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
830# CONFIG_FAULT_INJECTION is not set
831# CONFIG_LATENCYTOP is not set
832CONFIG_SYSCTL_SYSCALL_CHECK=y
833# CONFIG_PAGE_POISONING is not set
834CONFIG_HAVE_FUNCTION_TRACER=y
835CONFIG_TRACING_SUPPORT=y
836CONFIG_FTRACE=y
837# CONFIG_FUNCTION_TRACER is not set
838# CONFIG_SCHED_TRACER is not set
839# CONFIG_ENABLE_DEFAULT_TRACERS is not set
840# CONFIG_BOOT_TRACER is not set
841CONFIG_BRANCH_PROFILE_NONE=y
842# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
843# CONFIG_PROFILE_ALL_BRANCHES is not set
844# CONFIG_STACK_TRACER is not set
845# CONFIG_KMEMTRACE is not set
846# CONFIG_WORKQUEUE_TRACER is not set
847# CONFIG_BLK_DEV_IO_TRACE is not set
848# CONFIG_SAMPLES is not set
849CONFIG_HAVE_ARCH_KGDB=y
850# CONFIG_KGDB is not set
851CONFIG_ARM_UNWIND=y
852CONFIG_DEBUG_USER=y
853CONFIG_DEBUG_ERRORS=y
854# CONFIG_DEBUG_STACK_USAGE is not set
855CONFIG_DEBUG_LL=y
856CONFIG_EARLY_PRINTK=y
857# CONFIG_DEBUG_ICEDCC is not set
858# CONFIG_OC_ETM is not set
859CONFIG_DEBUG_S3C_UART=1
860
861#
862# Security options
863#
864# CONFIG_KEYS is not set
865# CONFIG_SECURITY is not set
866# CONFIG_SECURITYFS is not set
867# CONFIG_DEFAULT_SECURITY_SELINUX is not set
868# CONFIG_DEFAULT_SECURITY_SMACK is not set
869# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
870CONFIG_DEFAULT_SECURITY_DAC=y
871CONFIG_DEFAULT_SECURITY=""
872# CONFIG_CRYPTO is not set
873# CONFIG_BINARY_PRINTF is not set
874
875#
876# Library routines
877#
878CONFIG_BITREVERSE=y
879CONFIG_GENERIC_FIND_LAST_BIT=y
880CONFIG_CRC_CCITT=y
881# CONFIG_CRC16 is not set
882# CONFIG_CRC_T10DIF is not set
883# CONFIG_CRC_ITU_T is not set
884CONFIG_CRC32=y
885# CONFIG_CRC7 is not set
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_LZO_DECOMPRESS=y
889CONFIG_DECOMPRESS_GZIP=y
890CONFIG_DECOMPRESS_BZIP2=y
891CONFIG_DECOMPRESS_LZMA=y
892CONFIG_DECOMPRESS_LZO=y
893CONFIG_HAS_IOMEM=y
894CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig
new file mode 100644
index 000000000000..3f7d47491b54
--- /dev/null
+++ b/arch/arm/configs/s5pv210_defconfig
@@ -0,0 +1,894 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.33-rc4
4# Wed Feb 24 15:36:16 2010
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_NO_IOPORT=y
10CONFIG_GENERIC_HARDIRQS=y
11CONFIG_STACKTRACE_SUPPORT=y
12CONFIG_HAVE_LATENCYTOP_SUPPORT=y
13CONFIG_LOCKDEP_SUPPORT=y
14CONFIG_TRACE_IRQFLAGS_SUPPORT=y
15CONFIG_HARDIRQS_SW_RESEND=y
16CONFIG_GENERIC_IRQ_PROBE=y
17CONFIG_RWSEM_GENERIC_SPINLOCK=y
18CONFIG_GENERIC_HWEIGHT=y
19CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
21CONFIG_ARM_L1_CACHE_SHIFT_6=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24CONFIG_CONSTRUCTORS=y
25
26#
27# General setup
28#
29CONFIG_EXPERIMENTAL=y
30CONFIG_BROKEN_ON_SMP=y
31CONFIG_LOCK_KERNEL=y
32CONFIG_INIT_ENV_ARG_LIMIT=32
33CONFIG_LOCALVERSION=""
34CONFIG_LOCALVERSION_AUTO=y
35CONFIG_HAVE_KERNEL_GZIP=y
36CONFIG_HAVE_KERNEL_LZO=y
37CONFIG_KERNEL_GZIP=y
38# CONFIG_KERNEL_BZIP2 is not set
39# CONFIG_KERNEL_LZMA is not set
40# CONFIG_KERNEL_LZO is not set
41CONFIG_SWAP=y
42# CONFIG_SYSVIPC is not set
43# CONFIG_BSD_PROCESS_ACCT is not set
44
45#
46# RCU Subsystem
47#
48CONFIG_TREE_RCU=y
49# CONFIG_TREE_PREEMPT_RCU is not set
50# CONFIG_TINY_RCU is not set
51# CONFIG_RCU_TRACE is not set
52CONFIG_RCU_FANOUT=32
53# CONFIG_RCU_FANOUT_EXACT is not set
54# CONFIG_TREE_RCU_TRACE is not set
55# CONFIG_IKCONFIG is not set
56CONFIG_LOG_BUF_SHIFT=17
57# CONFIG_GROUP_SCHED is not set
58# CONFIG_CGROUPS is not set
59CONFIG_SYSFS_DEPRECATED=y
60CONFIG_SYSFS_DEPRECATED_V2=y
61# CONFIG_RELAY is not set
62CONFIG_NAMESPACES=y
63# CONFIG_UTS_NS is not set
64# CONFIG_USER_NS is not set
65# CONFIG_PID_NS is not set
66CONFIG_BLK_DEV_INITRD=y
67CONFIG_INITRAMFS_SOURCE=""
68CONFIG_RD_GZIP=y
69CONFIG_RD_BZIP2=y
70CONFIG_RD_LZMA=y
71CONFIG_RD_LZO=y
72CONFIG_CC_OPTIMIZE_FOR_SIZE=y
73CONFIG_SYSCTL=y
74CONFIG_ANON_INODES=y
75# CONFIG_EMBEDDED is not set
76CONFIG_UID16=y
77CONFIG_SYSCTL_SYSCALL=y
78CONFIG_KALLSYMS=y
79CONFIG_KALLSYMS_ALL=y
80# CONFIG_KALLSYMS_EXTRA_PASS is not set
81CONFIG_HOTPLUG=y
82CONFIG_PRINTK=y
83CONFIG_BUG=y
84CONFIG_ELF_CORE=y
85CONFIG_BASE_FULL=y
86CONFIG_FUTEX=y
87CONFIG_EPOLL=y
88CONFIG_SIGNALFD=y
89CONFIG_TIMERFD=y
90CONFIG_EVENTFD=y
91CONFIG_SHMEM=y
92CONFIG_AIO=y
93
94#
95# Kernel Performance Events And Counters
96#
97CONFIG_VM_EVENT_COUNTERS=y
98CONFIG_SLUB_DEBUG=y
99CONFIG_COMPAT_BRK=y
100# CONFIG_SLAB is not set
101CONFIG_SLUB=y
102# CONFIG_SLOB is not set
103# CONFIG_PROFILING is not set
104CONFIG_HAVE_OPROFILE=y
105# CONFIG_KPROBES is not set
106CONFIG_HAVE_KPROBES=y
107CONFIG_HAVE_KRETPROBES=y
108CONFIG_HAVE_CLK=y
109
110#
111# GCOV-based kernel profiling
112#
113# CONFIG_SLOW_WORK is not set
114CONFIG_HAVE_GENERIC_DMA_COHERENT=y
115CONFIG_SLABINFO=y
116CONFIG_RT_MUTEXES=y
117CONFIG_BASE_SMALL=0
118CONFIG_MODULES=y
119# CONFIG_MODULE_FORCE_LOAD is not set
120CONFIG_MODULE_UNLOAD=y
121# CONFIG_MODULE_FORCE_UNLOAD is not set
122# CONFIG_MODVERSIONS is not set
123# CONFIG_MODULE_SRCVERSION_ALL is not set
124CONFIG_BLOCK=y
125CONFIG_LBDAF=y
126# CONFIG_BLK_DEV_BSG is not set
127# CONFIG_BLK_DEV_INTEGRITY is not set
128
129#
130# IO Schedulers
131#
132CONFIG_IOSCHED_NOOP=y
133CONFIG_IOSCHED_DEADLINE=y
134CONFIG_IOSCHED_CFQ=y
135# CONFIG_DEFAULT_DEADLINE is not set
136CONFIG_DEFAULT_CFQ=y
137# CONFIG_DEFAULT_NOOP is not set
138CONFIG_DEFAULT_IOSCHED="cfq"
139# CONFIG_INLINE_SPIN_TRYLOCK is not set
140# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
141# CONFIG_INLINE_SPIN_LOCK is not set
142# CONFIG_INLINE_SPIN_LOCK_BH is not set
143# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
144# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
145# CONFIG_INLINE_SPIN_UNLOCK is not set
146# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
147# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
148# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
149# CONFIG_INLINE_READ_TRYLOCK is not set
150# CONFIG_INLINE_READ_LOCK is not set
151# CONFIG_INLINE_READ_LOCK_BH is not set
152# CONFIG_INLINE_READ_LOCK_IRQ is not set
153# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
154# CONFIG_INLINE_READ_UNLOCK is not set
155# CONFIG_INLINE_READ_UNLOCK_BH is not set
156# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
157# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
158# CONFIG_INLINE_WRITE_TRYLOCK is not set
159# CONFIG_INLINE_WRITE_LOCK is not set
160# CONFIG_INLINE_WRITE_LOCK_BH is not set
161# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
162# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
163# CONFIG_INLINE_WRITE_UNLOCK is not set
164# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
165# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
166# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
167# CONFIG_MUTEX_SPIN_ON_OWNER is not set
168# CONFIG_FREEZER is not set
169
170#
171# System Type
172#
173CONFIG_MMU=y
174# CONFIG_ARCH_AAEC2000 is not set
175# CONFIG_ARCH_INTEGRATOR is not set
176# CONFIG_ARCH_REALVIEW is not set
177# CONFIG_ARCH_VERSATILE is not set
178# CONFIG_ARCH_AT91 is not set
179# CONFIG_ARCH_CLPS711X is not set
180# CONFIG_ARCH_GEMINI is not set
181# CONFIG_ARCH_EBSA110 is not set
182# CONFIG_ARCH_EP93XX is not set
183# CONFIG_ARCH_FOOTBRIDGE is not set
184# CONFIG_ARCH_MXC is not set
185# CONFIG_ARCH_STMP3XXX is not set
186# CONFIG_ARCH_NETX is not set
187# CONFIG_ARCH_H720X is not set
188# CONFIG_ARCH_NOMADIK is not set
189# CONFIG_ARCH_IOP13XX is not set
190# CONFIG_ARCH_IOP32X is not set
191# CONFIG_ARCH_IOP33X is not set
192# CONFIG_ARCH_IXP23XX is not set
193# CONFIG_ARCH_IXP2000 is not set
194# CONFIG_ARCH_IXP4XX is not set
195# CONFIG_ARCH_L7200 is not set
196# CONFIG_ARCH_DOVE is not set
197# CONFIG_ARCH_KIRKWOOD is not set
198# CONFIG_ARCH_LOKI is not set
199# CONFIG_ARCH_MV78XX0 is not set
200# CONFIG_ARCH_ORION5X is not set
201# CONFIG_ARCH_MMP is not set
202# CONFIG_ARCH_KS8695 is not set
203# CONFIG_ARCH_NS9XXX is not set
204# CONFIG_ARCH_W90X900 is not set
205# CONFIG_ARCH_PNX4008 is not set
206# CONFIG_ARCH_PXA is not set
207# CONFIG_ARCH_MSM is not set
208# CONFIG_ARCH_RPC is not set
209# CONFIG_ARCH_SA1100 is not set
210# CONFIG_ARCH_S3C2410 is not set
211# CONFIG_ARCH_S3C64XX is not set
212# CONFIG_ARCH_S5P6440 is not set
213# CONFIG_ARCH_S5P6442 is not set
214# CONFIG_ARCH_S5PC1XX is not set
215CONFIG_ARCH_S5PV210=y
216# CONFIG_ARCH_SHARK is not set
217# CONFIG_ARCH_LH7A40X is not set
218# CONFIG_ARCH_U300 is not set
219# CONFIG_ARCH_DAVINCI is not set
220# CONFIG_ARCH_OMAP is not set
221# CONFIG_ARCH_BCMRING is not set
222# CONFIG_ARCH_U8500 is not set
223CONFIG_PLAT_SAMSUNG=y
224
225#
226# Boot options
227#
228# CONFIG_S3C_BOOT_ERROR_RESET is not set
229CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
230CONFIG_S3C_LOWLEVEL_UART_PORT=1
231CONFIG_SAMSUNG_CLKSRC=y
232CONFIG_SAMSUNG_IRQ_VIC_TIMER=y
233CONFIG_SAMSUNG_IRQ_UART=y
234CONFIG_SAMSUNG_GPIOLIB_4BIT=y
235CONFIG_S3C_GPIO_CFG_S3C24XX=y
236CONFIG_S3C_GPIO_CFG_S3C64XX=y
237CONFIG_S3C_GPIO_PULL_UPDOWN=y
238CONFIG_SAMSUNG_GPIO_EXTRA=0
239CONFIG_S3C_GPIO_SPACE=0
240CONFIG_S3C_GPIO_TRACK=y
241# CONFIG_S3C_ADC is not set
242
243#
244# Power management
245#
246CONFIG_PLAT_S5P=y
247CONFIG_CPU_S5PV210=y
248CONFIG_MACH_SMDKV210=y
249# CONFIG_MACH_SMDKC110 is not set
250
251#
252# Processor Type
253#
254CONFIG_CPU_32v6K=y
255CONFIG_CPU_V7=y
256CONFIG_CPU_32v7=y
257CONFIG_CPU_ABRT_EV7=y
258CONFIG_CPU_PABRT_V7=y
259CONFIG_CPU_CACHE_V7=y
260CONFIG_CPU_CACHE_VIPT=y
261CONFIG_CPU_COPY_V6=y
262CONFIG_CPU_TLB_V7=y
263CONFIG_CPU_HAS_ASID=y
264CONFIG_CPU_CP15=y
265CONFIG_CPU_CP15_MMU=y
266
267#
268# Processor Features
269#
270CONFIG_ARM_THUMB=y
271# CONFIG_ARM_THUMBEE is not set
272# CONFIG_CPU_ICACHE_DISABLE is not set
273# CONFIG_CPU_DCACHE_DISABLE is not set
274# CONFIG_CPU_BPREDICT_DISABLE is not set
275CONFIG_HAS_TLS_REG=y
276CONFIG_ARM_L1_CACHE_SHIFT=6
277# CONFIG_ARM_ERRATA_430973 is not set
278# CONFIG_ARM_ERRATA_458693 is not set
279# CONFIG_ARM_ERRATA_460075 is not set
280CONFIG_ARM_VIC=y
281CONFIG_ARM_VIC_NR=2
282
283#
284# Bus support
285#
286# CONFIG_PCI_SYSCALL is not set
287# CONFIG_ARCH_SUPPORTS_MSI is not set
288# CONFIG_PCCARD is not set
289
290#
291# Kernel Features
292#
293# CONFIG_VMSPLIT_3G is not set
294CONFIG_VMSPLIT_2G=y
295# CONFIG_VMSPLIT_1G is not set
296CONFIG_PAGE_OFFSET=0x80000000
297# CONFIG_PREEMPT_NONE is not set
298# CONFIG_PREEMPT_VOLUNTARY is not set
299CONFIG_PREEMPT=y
300CONFIG_HZ=200
301# CONFIG_THUMB2_KERNEL is not set
302CONFIG_AEABI=y
303CONFIG_OABI_COMPAT=y
304CONFIG_ARCH_SPARSEMEM_ENABLE=y
305CONFIG_ARCH_SPARSEMEM_DEFAULT=y
306# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
307# CONFIG_HIGHMEM is not set
308CONFIG_SELECT_MEMORY_MODEL=y
309# CONFIG_FLATMEM_MANUAL is not set
310# CONFIG_DISCONTIGMEM_MANUAL is not set
311CONFIG_SPARSEMEM_MANUAL=y
312CONFIG_SPARSEMEM=y
313CONFIG_HAVE_MEMORY_PRESENT=y
314CONFIG_SPARSEMEM_EXTREME=y
315CONFIG_SPLIT_PTLOCK_CPUS=999999
316# CONFIG_PHYS_ADDR_T_64BIT is not set
317CONFIG_ZONE_DMA_FLAG=0
318CONFIG_VIRT_TO_BUS=y
319# CONFIG_KSM is not set
320CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
321CONFIG_ALIGNMENT_TRAP=y
322# CONFIG_UACCESS_WITH_MEMCPY is not set
323
324#
325# Boot options
326#
327CONFIG_ZBOOT_ROM_TEXT=0
328CONFIG_ZBOOT_ROM_BSS=0
329CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x20800000,8M console=ttySAC1,115200 init=/linuxrc"
330# CONFIG_XIP_KERNEL is not set
331# CONFIG_KEXEC is not set
332
333#
334# CPU Power Management
335#
336# CONFIG_CPU_IDLE is not set
337
338#
339# Floating point emulation
340#
341
342#
343# At least one emulation must be selected
344#
345# CONFIG_FPE_NWFPE is not set
346# CONFIG_FPE_FASTFPE is not set
347CONFIG_VFP=y
348CONFIG_VFPv3=y
349CONFIG_NEON=y
350
351#
352# Userspace binary formats
353#
354CONFIG_BINFMT_ELF=y
355# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
356CONFIG_HAVE_AOUT=y
357# CONFIG_BINFMT_AOUT is not set
358# CONFIG_BINFMT_MISC is not set
359
360#
361# Power management options
362#
363# CONFIG_PM is not set
364CONFIG_ARCH_SUSPEND_POSSIBLE=y
365# CONFIG_NET is not set
366
367#
368# Device Drivers
369#
370
371#
372# Generic Driver Options
373#
374CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
375# CONFIG_DEVTMPFS is not set
376CONFIG_STANDALONE=y
377CONFIG_PREVENT_FIRMWARE_BUILD=y
378CONFIG_FW_LOADER=y
379CONFIG_FIRMWARE_IN_KERNEL=y
380CONFIG_EXTRA_FIRMWARE=""
381# CONFIG_DEBUG_DRIVER is not set
382# CONFIG_DEBUG_DEVRES is not set
383# CONFIG_SYS_HYPERVISOR is not set
384# CONFIG_MTD is not set
385# CONFIG_PARPORT is not set
386CONFIG_BLK_DEV=y
387# CONFIG_BLK_DEV_COW_COMMON is not set
388CONFIG_BLK_DEV_LOOP=y
389# CONFIG_BLK_DEV_CRYPTOLOOP is not set
390
391#
392# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
393#
394CONFIG_BLK_DEV_RAM=y
395CONFIG_BLK_DEV_RAM_COUNT=16
396CONFIG_BLK_DEV_RAM_SIZE=8192
397# CONFIG_BLK_DEV_XIP is not set
398# CONFIG_CDROM_PKTCDVD is not set
399# CONFIG_MG_DISK is not set
400# CONFIG_MISC_DEVICES is not set
401CONFIG_HAVE_IDE=y
402# CONFIG_IDE is not set
403
404#
405# SCSI device support
406#
407# CONFIG_RAID_ATTRS is not set
408CONFIG_SCSI=y
409CONFIG_SCSI_DMA=y
410# CONFIG_SCSI_TGT is not set
411# CONFIG_SCSI_NETLINK is not set
412CONFIG_SCSI_PROC_FS=y
413
414#
415# SCSI support type (disk, tape, CD-ROM)
416#
417CONFIG_BLK_DEV_SD=y
418# CONFIG_CHR_DEV_ST is not set
419# CONFIG_CHR_DEV_OSST is not set
420# CONFIG_BLK_DEV_SR is not set
421CONFIG_CHR_DEV_SG=y
422# CONFIG_CHR_DEV_SCH is not set
423# CONFIG_SCSI_MULTI_LUN is not set
424# CONFIG_SCSI_CONSTANTS is not set
425# CONFIG_SCSI_LOGGING is not set
426# CONFIG_SCSI_SCAN_ASYNC is not set
427CONFIG_SCSI_WAIT_SCAN=m
428
429#
430# SCSI Transports
431#
432# CONFIG_SCSI_SPI_ATTRS is not set
433# CONFIG_SCSI_FC_ATTRS is not set
434# CONFIG_SCSI_SAS_LIBSAS is not set
435# CONFIG_SCSI_SRP_ATTRS is not set
436CONFIG_SCSI_LOWLEVEL=y
437# CONFIG_LIBFC is not set
438# CONFIG_LIBFCOE is not set
439# CONFIG_SCSI_DEBUG is not set
440# CONFIG_SCSI_DH is not set
441# CONFIG_SCSI_OSD_INITIATOR is not set
442# CONFIG_ATA is not set
443# CONFIG_MD is not set
444# CONFIG_PHONE is not set
445
446#
447# Input device support
448#
449CONFIG_INPUT=y
450# CONFIG_INPUT_FF_MEMLESS is not set
451# CONFIG_INPUT_POLLDEV is not set
452# CONFIG_INPUT_SPARSEKMAP is not set
453
454#
455# Userland interfaces
456#
457CONFIG_INPUT_MOUSEDEV=y
458CONFIG_INPUT_MOUSEDEV_PSAUX=y
459CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
460CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
461# CONFIG_INPUT_JOYDEV is not set
462CONFIG_INPUT_EVDEV=y
463# CONFIG_INPUT_EVBUG is not set
464
465#
466# Input Device Drivers
467#
468# CONFIG_INPUT_KEYBOARD is not set
469# CONFIG_INPUT_MOUSE is not set
470# CONFIG_INPUT_JOYSTICK is not set
471# CONFIG_INPUT_TABLET is not set
472CONFIG_INPUT_TOUCHSCREEN=y
473# CONFIG_TOUCHSCREEN_AD7879 is not set
474# CONFIG_TOUCHSCREEN_DYNAPRO is not set
475# CONFIG_TOUCHSCREEN_FUJITSU is not set
476# CONFIG_TOUCHSCREEN_GUNZE is not set
477# CONFIG_TOUCHSCREEN_ELO is not set
478# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
479# CONFIG_TOUCHSCREEN_MTOUCH is not set
480# CONFIG_TOUCHSCREEN_INEXIO is not set
481# CONFIG_TOUCHSCREEN_MK712 is not set
482# CONFIG_TOUCHSCREEN_PENMOUNT is not set
483# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
484# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
485# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
486# CONFIG_TOUCHSCREEN_W90X900 is not set
487# CONFIG_INPUT_MISC is not set
488
489#
490# Hardware I/O ports
491#
492CONFIG_SERIO=y
493CONFIG_SERIO_SERPORT=y
494# CONFIG_SERIO_RAW is not set
495# CONFIG_SERIO_ALTERA_PS2 is not set
496# CONFIG_GAMEPORT is not set
497
498#
499# Character devices
500#
501CONFIG_VT=y
502CONFIG_CONSOLE_TRANSLATIONS=y
503CONFIG_VT_CONSOLE=y
504CONFIG_HW_CONSOLE=y
505# CONFIG_VT_HW_CONSOLE_BINDING is not set
506CONFIG_DEVKMEM=y
507# CONFIG_SERIAL_NONSTANDARD is not set
508
509#
510# Serial drivers
511#
512CONFIG_SERIAL_8250=y
513# CONFIG_SERIAL_8250_CONSOLE is not set
514CONFIG_SERIAL_8250_NR_UARTS=4
515CONFIG_SERIAL_8250_RUNTIME_UARTS=4
516# CONFIG_SERIAL_8250_EXTENDED is not set
517
518#
519# Non-8250 serial port support
520#
521CONFIG_SERIAL_SAMSUNG=y
522CONFIG_SERIAL_SAMSUNG_UARTS_4=y
523CONFIG_SERIAL_SAMSUNG_UARTS=4
524# CONFIG_SERIAL_SAMSUNG_DEBUG is not set
525CONFIG_SERIAL_SAMSUNG_CONSOLE=y
526CONFIG_SERIAL_S5PV210=y
527CONFIG_SERIAL_CORE=y
528CONFIG_SERIAL_CORE_CONSOLE=y
529CONFIG_UNIX98_PTYS=y
530# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
531CONFIG_LEGACY_PTYS=y
532CONFIG_LEGACY_PTY_COUNT=256
533# CONFIG_IPMI_HANDLER is not set
534CONFIG_HW_RANDOM=y
535# CONFIG_HW_RANDOM_TIMERIOMEM is not set
536# CONFIG_R3964 is not set
537# CONFIG_RAW_DRIVER is not set
538# CONFIG_TCG_TPM is not set
539# CONFIG_I2C is not set
540# CONFIG_SPI is not set
541
542#
543# PPS support
544#
545# CONFIG_PPS is not set
546CONFIG_ARCH_REQUIRE_GPIOLIB=y
547CONFIG_GPIOLIB=y
548# CONFIG_DEBUG_GPIO is not set
549# CONFIG_GPIO_SYSFS is not set
550
551#
552# Memory mapped GPIO expanders:
553#
554
555#
556# I2C GPIO expanders:
557#
558
559#
560# PCI GPIO expanders:
561#
562
563#
564# SPI GPIO expanders:
565#
566
567#
568# AC97 GPIO expanders:
569#
570# CONFIG_W1 is not set
571# CONFIG_POWER_SUPPLY is not set
572# CONFIG_HWMON is not set
573# CONFIG_THERMAL is not set
574# CONFIG_WATCHDOG is not set
575CONFIG_SSB_POSSIBLE=y
576
577#
578# Sonics Silicon Backplane
579#
580# CONFIG_SSB is not set
581
582#
583# Multifunction device drivers
584#
585# CONFIG_MFD_CORE is not set
586# CONFIG_MFD_SM501 is not set
587# CONFIG_MFD_ASIC3 is not set
588# CONFIG_HTC_EGPIO is not set
589# CONFIG_HTC_PASIC3 is not set
590# CONFIG_MFD_TMIO is not set
591# CONFIG_MFD_T7L66XB is not set
592# CONFIG_MFD_TC6387XB is not set
593# CONFIG_MFD_TC6393XB is not set
594# CONFIG_REGULATOR is not set
595# CONFIG_MEDIA_SUPPORT is not set
596
597#
598# Graphics support
599#
600# CONFIG_VGASTATE is not set
601# CONFIG_VIDEO_OUTPUT_CONTROL is not set
602# CONFIG_FB is not set
603# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
604
605#
606# Display device support
607#
608# CONFIG_DISPLAY_SUPPORT is not set
609
610#
611# Console display driver support
612#
613# CONFIG_VGA_CONSOLE is not set
614CONFIG_DUMMY_CONSOLE=y
615# CONFIG_SOUND is not set
616# CONFIG_HID_SUPPORT is not set
617# CONFIG_USB_SUPPORT is not set
618# CONFIG_MMC is not set
619# CONFIG_MEMSTICK is not set
620# CONFIG_NEW_LEDS is not set
621# CONFIG_ACCESSIBILITY is not set
622CONFIG_RTC_LIB=y
623# CONFIG_RTC_CLASS is not set
624# CONFIG_DMADEVICES is not set
625# CONFIG_AUXDISPLAY is not set
626# CONFIG_UIO is not set
627
628#
629# TI VLYNQ
630#
631# CONFIG_STAGING is not set
632
633#
634# File systems
635#
636CONFIG_EXT2_FS=y
637# CONFIG_EXT2_FS_XATTR is not set
638# CONFIG_EXT2_FS_XIP is not set
639# CONFIG_EXT3_FS is not set
640# CONFIG_EXT4_FS is not set
641# CONFIG_REISERFS_FS is not set
642# CONFIG_JFS_FS is not set
643CONFIG_FS_POSIX_ACL=y
644# CONFIG_XFS_FS is not set
645# CONFIG_GFS2_FS is not set
646# CONFIG_BTRFS_FS is not set
647# CONFIG_NILFS2_FS is not set
648CONFIG_FILE_LOCKING=y
649CONFIG_FSNOTIFY=y
650CONFIG_DNOTIFY=y
651CONFIG_INOTIFY=y
652CONFIG_INOTIFY_USER=y
653# CONFIG_QUOTA is not set
654# CONFIG_AUTOFS_FS is not set
655# CONFIG_AUTOFS4_FS is not set
656# CONFIG_FUSE_FS is not set
657CONFIG_GENERIC_ACL=y
658
659#
660# Caches
661#
662# CONFIG_FSCACHE is not set
663
664#
665# CD-ROM/DVD Filesystems
666#
667# CONFIG_ISO9660_FS is not set
668# CONFIG_UDF_FS is not set
669
670#
671# DOS/FAT/NT Filesystems
672#
673CONFIG_FAT_FS=y
674CONFIG_MSDOS_FS=y
675CONFIG_VFAT_FS=y
676CONFIG_FAT_DEFAULT_CODEPAGE=437
677CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
678# CONFIG_NTFS_FS is not set
679
680#
681# Pseudo filesystems
682#
683CONFIG_PROC_FS=y
684CONFIG_PROC_SYSCTL=y
685CONFIG_PROC_PAGE_MONITOR=y
686CONFIG_SYSFS=y
687CONFIG_TMPFS=y
688CONFIG_TMPFS_POSIX_ACL=y
689# CONFIG_HUGETLB_PAGE is not set
690# CONFIG_CONFIGFS_FS is not set
691CONFIG_MISC_FILESYSTEMS=y
692# CONFIG_ADFS_FS is not set
693# CONFIG_AFFS_FS is not set
694# CONFIG_HFS_FS is not set
695# CONFIG_HFSPLUS_FS is not set
696# CONFIG_BEFS_FS is not set
697# CONFIG_BFS_FS is not set
698# CONFIG_EFS_FS is not set
699CONFIG_CRAMFS=y
700# CONFIG_SQUASHFS is not set
701# CONFIG_VXFS_FS is not set
702# CONFIG_MINIX_FS is not set
703# CONFIG_OMFS_FS is not set
704# CONFIG_HPFS_FS is not set
705# CONFIG_QNX4FS_FS is not set
706CONFIG_ROMFS_FS=y
707CONFIG_ROMFS_BACKED_BY_BLOCK=y
708# CONFIG_ROMFS_BACKED_BY_MTD is not set
709# CONFIG_ROMFS_BACKED_BY_BOTH is not set
710CONFIG_ROMFS_ON_BLOCK=y
711# CONFIG_SYSV_FS is not set
712# CONFIG_UFS_FS is not set
713
714#
715# Partition Types
716#
717CONFIG_PARTITION_ADVANCED=y
718# CONFIG_ACORN_PARTITION is not set
719# CONFIG_OSF_PARTITION is not set
720# CONFIG_AMIGA_PARTITION is not set
721# CONFIG_ATARI_PARTITION is not set
722# CONFIG_MAC_PARTITION is not set
723CONFIG_MSDOS_PARTITION=y
724CONFIG_BSD_DISKLABEL=y
725# CONFIG_MINIX_SUBPARTITION is not set
726CONFIG_SOLARIS_X86_PARTITION=y
727# CONFIG_UNIXWARE_DISKLABEL is not set
728# CONFIG_LDM_PARTITION is not set
729# CONFIG_SGI_PARTITION is not set
730# CONFIG_ULTRIX_PARTITION is not set
731# CONFIG_SUN_PARTITION is not set
732# CONFIG_KARMA_PARTITION is not set
733# CONFIG_EFI_PARTITION is not set
734# CONFIG_SYSV68_PARTITION is not set
735CONFIG_NLS=y
736CONFIG_NLS_DEFAULT="iso8859-1"
737CONFIG_NLS_CODEPAGE_437=y
738# CONFIG_NLS_CODEPAGE_737 is not set
739# CONFIG_NLS_CODEPAGE_775 is not set
740# CONFIG_NLS_CODEPAGE_850 is not set
741# CONFIG_NLS_CODEPAGE_852 is not set
742# CONFIG_NLS_CODEPAGE_855 is not set
743# CONFIG_NLS_CODEPAGE_857 is not set
744# CONFIG_NLS_CODEPAGE_860 is not set
745# CONFIG_NLS_CODEPAGE_861 is not set
746# CONFIG_NLS_CODEPAGE_862 is not set
747# CONFIG_NLS_CODEPAGE_863 is not set
748# CONFIG_NLS_CODEPAGE_864 is not set
749# CONFIG_NLS_CODEPAGE_865 is not set
750# CONFIG_NLS_CODEPAGE_866 is not set
751# CONFIG_NLS_CODEPAGE_869 is not set
752# CONFIG_NLS_CODEPAGE_936 is not set
753# CONFIG_NLS_CODEPAGE_950 is not set
754# CONFIG_NLS_CODEPAGE_932 is not set
755# CONFIG_NLS_CODEPAGE_949 is not set
756# CONFIG_NLS_CODEPAGE_874 is not set
757# CONFIG_NLS_ISO8859_8 is not set
758# CONFIG_NLS_CODEPAGE_1250 is not set
759# CONFIG_NLS_CODEPAGE_1251 is not set
760CONFIG_NLS_ASCII=y
761CONFIG_NLS_ISO8859_1=y
762# CONFIG_NLS_ISO8859_2 is not set
763# CONFIG_NLS_ISO8859_3 is not set
764# CONFIG_NLS_ISO8859_4 is not set
765# CONFIG_NLS_ISO8859_5 is not set
766# CONFIG_NLS_ISO8859_6 is not set
767# CONFIG_NLS_ISO8859_7 is not set
768# CONFIG_NLS_ISO8859_9 is not set
769# CONFIG_NLS_ISO8859_13 is not set
770# CONFIG_NLS_ISO8859_14 is not set
771# CONFIG_NLS_ISO8859_15 is not set
772# CONFIG_NLS_KOI8_R is not set
773# CONFIG_NLS_KOI8_U is not set
774# CONFIG_NLS_UTF8 is not set
775
776#
777# Kernel hacking
778#
779# CONFIG_PRINTK_TIME is not set
780CONFIG_ENABLE_WARN_DEPRECATED=y
781CONFIG_ENABLE_MUST_CHECK=y
782CONFIG_FRAME_WARN=1024
783CONFIG_MAGIC_SYSRQ=y
784# CONFIG_STRIP_ASM_SYMS is not set
785# CONFIG_UNUSED_SYMBOLS is not set
786# CONFIG_DEBUG_FS is not set
787# CONFIG_HEADERS_CHECK is not set
788CONFIG_DEBUG_KERNEL=y
789# CONFIG_DEBUG_SHIRQ is not set
790CONFIG_DETECT_SOFTLOCKUP=y
791# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
792CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
793CONFIG_DETECT_HUNG_TASK=y
794# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
795CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
796CONFIG_SCHED_DEBUG=y
797# CONFIG_SCHEDSTATS is not set
798# CONFIG_TIMER_STATS is not set
799# CONFIG_DEBUG_OBJECTS is not set
800# CONFIG_SLUB_DEBUG_ON is not set
801# CONFIG_SLUB_STATS is not set
802# CONFIG_DEBUG_KMEMLEAK is not set
803# CONFIG_DEBUG_PREEMPT is not set
804CONFIG_DEBUG_RT_MUTEXES=y
805CONFIG_DEBUG_PI_LIST=y
806# CONFIG_RT_MUTEX_TESTER is not set
807CONFIG_DEBUG_SPINLOCK=y
808CONFIG_DEBUG_MUTEXES=y
809# CONFIG_DEBUG_LOCK_ALLOC is not set
810# CONFIG_PROVE_LOCKING is not set
811# CONFIG_LOCK_STAT is not set
812CONFIG_DEBUG_SPINLOCK_SLEEP=y
813# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
814# CONFIG_DEBUG_KOBJECT is not set
815CONFIG_DEBUG_BUGVERBOSE=y
816CONFIG_DEBUG_INFO=y
817# CONFIG_DEBUG_VM is not set
818# CONFIG_DEBUG_WRITECOUNT is not set
819CONFIG_DEBUG_MEMORY_INIT=y
820# CONFIG_DEBUG_LIST is not set
821# CONFIG_DEBUG_SG is not set
822# CONFIG_DEBUG_NOTIFIERS is not set
823# CONFIG_DEBUG_CREDENTIALS is not set
824# CONFIG_BOOT_PRINTK_DELAY is not set
825# CONFIG_RCU_TORTURE_TEST is not set
826# CONFIG_RCU_CPU_STALL_DETECTOR is not set
827# CONFIG_BACKTRACE_SELF_TEST is not set
828# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
829# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
830# CONFIG_FAULT_INJECTION is not set
831# CONFIG_LATENCYTOP is not set
832CONFIG_SYSCTL_SYSCALL_CHECK=y
833# CONFIG_PAGE_POISONING is not set
834CONFIG_HAVE_FUNCTION_TRACER=y
835CONFIG_TRACING_SUPPORT=y
836CONFIG_FTRACE=y
837# CONFIG_FUNCTION_TRACER is not set
838# CONFIG_SCHED_TRACER is not set
839# CONFIG_ENABLE_DEFAULT_TRACERS is not set
840# CONFIG_BOOT_TRACER is not set
841CONFIG_BRANCH_PROFILE_NONE=y
842# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
843# CONFIG_PROFILE_ALL_BRANCHES is not set
844# CONFIG_STACK_TRACER is not set
845# CONFIG_KMEMTRACE is not set
846# CONFIG_WORKQUEUE_TRACER is not set
847# CONFIG_BLK_DEV_IO_TRACE is not set
848# CONFIG_SAMPLES is not set
849CONFIG_HAVE_ARCH_KGDB=y
850# CONFIG_KGDB is not set
851CONFIG_ARM_UNWIND=y
852CONFIG_DEBUG_USER=y
853CONFIG_DEBUG_ERRORS=y
854# CONFIG_DEBUG_STACK_USAGE is not set
855CONFIG_DEBUG_LL=y
856CONFIG_EARLY_PRINTK=y
857# CONFIG_DEBUG_ICEDCC is not set
858# CONFIG_OC_ETM is not set
859CONFIG_DEBUG_S3C_UART=1
860
861#
862# Security options
863#
864# CONFIG_KEYS is not set
865# CONFIG_SECURITY is not set
866# CONFIG_SECURITYFS is not set
867# CONFIG_DEFAULT_SECURITY_SELINUX is not set
868# CONFIG_DEFAULT_SECURITY_SMACK is not set
869# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
870CONFIG_DEFAULT_SECURITY_DAC=y
871CONFIG_DEFAULT_SECURITY=""
872# CONFIG_CRYPTO is not set
873# CONFIG_BINARY_PRINTF is not set
874
875#
876# Library routines
877#
878CONFIG_BITREVERSE=y
879CONFIG_GENERIC_FIND_LAST_BIT=y
880CONFIG_CRC_CCITT=y
881# CONFIG_CRC16 is not set
882# CONFIG_CRC_T10DIF is not set
883# CONFIG_CRC_ITU_T is not set
884CONFIG_CRC32=y
885# CONFIG_CRC7 is not set
886# CONFIG_LIBCRC32C is not set
887CONFIG_ZLIB_INFLATE=y
888CONFIG_LZO_DECOMPRESS=y
889CONFIG_DECOMPRESS_GZIP=y
890CONFIG_DECOMPRESS_BZIP2=y
891CONFIG_DECOMPRESS_LZMA=y
892CONFIG_DECOMPRESS_LZO=y
893CONFIG_HAS_IOMEM=y
894CONFIG_HAS_DMA=y
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index 256ee1c9f51a..69ce0727edb5 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -128,6 +128,14 @@ static inline int dma_supported(struct device *dev, u64 mask)
128 128
129static inline int dma_set_mask(struct device *dev, u64 dma_mask) 129static inline int dma_set_mask(struct device *dev, u64 dma_mask)
130{ 130{
131#ifdef CONFIG_DMABOUNCE
132 if (dev->archdata.dmabounce) {
133 if (dma_mask >= ISA_DMA_THRESHOLD)
134 return 0;
135 else
136 return -EIO;
137 }
138#endif
131 if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 139 if (!dev->dma_mask || !dma_supported(dev, dma_mask))
132 return -EIO; 140 return -EIO;
133 141
diff --git a/arch/arm/mach-s3c6400/include/mach/entry-macro.S b/arch/arm/include/asm/entry-macro-vic2.S
index fbd90d2cf355..3ceb85e43850 100644
--- a/arch/arm/mach-s3c6400/include/mach/entry-macro.S
+++ b/arch/arm/include/asm/entry-macro-vic2.S
@@ -1,26 +1,39 @@
1/* arch/arm/mach-s3c6400/include/mach/entry-macro.S 1/* arch/arm/include/asm/entry-macro-vic2.S
2 *
3 * Originally arch/arm/mach-s3c6400/include/mach/entry-macro.S
2 * 4 *
3 * Copyright 2008 Openmoko, Inc. 5 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 6 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/ 7 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk> 8 * Ben Dooks <ben@simtec.co.uk>
7 * 9 *
8 * Low-level IRQ helper macros for the Samsung S3C64XX series 10 * Low-level IRQ helper macros for a device with two VICs
9 * 11 *
10 * This file is licensed under the terms of the GNU General Public 12 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any 13 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied. 14 * warranty of any kind, whether express or implied.
13*/ 15*/
14 16
17/* This should be included from <mach/entry-macro.S> with the necessary
18 * defines for virtual addresses and IRQ bases for the two vics.
19 *
20 * The code needs the following defined:
21 * IRQ_VIC0_BASE IRQ number of VIC0's first IRQ
22 * IRQ_VIC1_BASE IRQ number of VIC1's first IRQ
23 * VA_VIC0 Virtual address of VIC0
24 * VA_VIC1 Virtual address of VIC1
25 *
26 * Note, code assumes VIC0's virtual address is an ARM immediate constant
27 * away from VIC1.
28*/
29
15#include <asm/hardware/vic.h> 30#include <asm/hardware/vic.h>
16#include <mach/map.h>
17#include <plat/irqs.h>
18 31
19 .macro disable_fiq 32 .macro disable_fiq
20 .endm 33 .endm
21 34
22 .macro get_irqnr_preamble, base, tmp 35 .macro get_irqnr_preamble, base, tmp
23 ldr \base, =S3C_VA_VIC0 36 ldr \base, =VA_VIC0
24 .endm 37 .endm
25 38
26 .macro arch_ret_to_user, tmp1, tmp2 39 .macro arch_ret_to_user, tmp1, tmp2
@@ -29,13 +42,13 @@
29 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 42 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
30 43
31 @ check the vic0 44 @ check the vic0
32 mov \irqnr, # S3C_IRQ_OFFSET + 31 45 mov \irqnr, #IRQ_VIC0_BASE + 31
33 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ] 46 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
34 teq \irqstat, #0 47 teq \irqstat, #0
35 48
36 @ otherwise try vic1 49 @ otherwise try vic1
37 addeq \tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0) 50 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
38 addeq \irqnr, \irqnr, #32 51 addeq \irqnr, \irqnr, #(IRQ_VIC1_BASE - IRQ_VIC0_BASE)
39 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ] 52 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
40 teqeq \irqstat, #0 53 teqeq \irqstat, #0
41 54
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h
index 74b5fff7f575..6700c7fc7ebd 100644
--- a/arch/arm/include/asm/hardware/it8152.h
+++ b/arch/arm/include/asm/hardware/it8152.h
@@ -75,6 +75,18 @@ extern unsigned long it8152_base_address;
75 IT8152_PD_IRQ(1) USB (USBR) 75 IT8152_PD_IRQ(1) USB (USBR)
76 IT8152_PD_IRQ(0) Audio controller (ACR) 76 IT8152_PD_IRQ(0) Audio controller (ACR)
77 */ 77 */
78#define IT8152_IRQ(x) (IRQ_BOARD_END + (x))
79
80/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
81#define IT8152_LD_IRQ_COUNT 9
82#define IT8152_LP_IRQ_COUNT 16
83#define IT8152_PD_IRQ_COUNT 15
84
85/* Priorities: */
86#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
87#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
88#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
89
78/* frequently used interrupts */ 90/* frequently used interrupts */
79#define IT8152_PCISERR IT8152_PD_IRQ(14) 91#define IT8152_PCISERR IT8152_PD_IRQ(14)
80#define IT8152_H2PTADR IT8152_PD_IRQ(13) 92#define IT8152_H2PTADR IT8152_PD_IRQ(13)
diff --git a/arch/arm/include/asm/hardware/locomo.h b/arch/arm/include/asm/hardware/locomo.h
index 954b1be991b4..74e51d6bd93f 100644
--- a/arch/arm/include/asm/hardware/locomo.h
+++ b/arch/arm/include/asm/hardware/locomo.h
@@ -214,4 +214,8 @@ void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int
214/* Frontlight control */ 214/* Frontlight control */
215void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf); 215void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf);
216 216
217struct locomo_platform_data {
218 int irq_base; /* IRQ base for cascaded on-chip IRQs */
219};
220
217#endif 221#endif
diff --git a/arch/arm/include/asm/hardware/sa1111.h b/arch/arm/include/asm/hardware/sa1111.h
index 5da2595759e5..92ed254c175b 100644
--- a/arch/arm/include/asm/hardware/sa1111.h
+++ b/arch/arm/include/asm/hardware/sa1111.h
@@ -578,4 +578,8 @@ void sa1111_set_io_dir(struct sa1111_dev *sadev, unsigned int bits, unsigned int
578void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v); 578void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
579void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v); 579void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v);
580 580
581struct sa1111_platform_data {
582 int irq_base; /* base for cascaded on-chip IRQs */
583};
584
581#endif /* _ASM_ARCH_SA1111 */ 585#endif /* _ASM_ARCH_SA1111 */
diff --git a/arch/arm/include/asm/pci.h b/arch/arm/include/asm/pci.h
index 226cddd2fb65..47980118d0a5 100644
--- a/arch/arm/include/asm/pci.h
+++ b/arch/arm/include/asm/pci.h
@@ -30,17 +30,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
30 */ 30 */
31#define PCI_DMA_BUS_IS_PHYS (1) 31#define PCI_DMA_BUS_IS_PHYS (1)
32 32
33/*
34 * Whether pci_unmap_{single,page} is a nop depends upon the
35 * configuration.
36 */
37#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
38#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
39#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
40#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
41#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
42#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
43
44#ifdef CONFIG_PCI 33#ifdef CONFIG_PCI
45static inline void pci_dma_burst_advice(struct pci_dev *pdev, 34static inline void pci_dma_burst_advice(struct pci_dev *pdev,
46 enum pci_dma_burst_strategy *strat, 35 enum pci_dma_burst_strategy *strat,
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index eec6e897ceb2..9dcb11e59026 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -128,6 +128,8 @@ struct pt_regs {
128 128
129#ifdef __KERNEL__ 129#ifdef __KERNEL__
130 130
131#define arch_has_single_step() (1)
132
131#define user_mode(regs) \ 133#define user_mode(regs) \
132 (((regs)->ARM_cpsr & 0xf) == 0) 134 (((regs)->ARM_cpsr & 0xf) == 0)
133 135
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index cf9cdaa2d4d4..dd2bf53000fe 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -443,9 +443,12 @@
443#define __ARCH_WANT_SYS_SIGPROCMASK 443#define __ARCH_WANT_SYS_SIGPROCMASK
444#define __ARCH_WANT_SYS_RT_SIGACTION 444#define __ARCH_WANT_SYS_RT_SIGACTION
445#define __ARCH_WANT_SYS_RT_SIGSUSPEND 445#define __ARCH_WANT_SYS_RT_SIGSUSPEND
446#define __ARCH_WANT_SYS_OLD_MMAP
447#define __ARCH_WANT_SYS_OLD_SELECT
446 448
447#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) 449#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
448#define __ARCH_WANT_SYS_TIME 450#define __ARCH_WANT_SYS_TIME
451#define __ARCH_WANT_SYS_IPC
449#define __ARCH_WANT_SYS_OLDUMOUNT 452#define __ARCH_WANT_SYS_OLDUMOUNT
450#define __ARCH_WANT_SYS_ALARM 453#define __ARCH_WANT_SYS_ALARM
451#define __ARCH_WANT_SYS_UTIME 454#define __ARCH_WANT_SYS_UTIME
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 9314a2d681f1..37ae301cc47c 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -91,7 +91,7 @@
91 CALL(sys_settimeofday) 91 CALL(sys_settimeofday)
92/* 80 */ CALL(sys_getgroups16) 92/* 80 */ CALL(sys_getgroups16)
93 CALL(sys_setgroups16) 93 CALL(sys_setgroups16)
94 CALL(OBSOLETE(old_select)) /* used by libc4 */ 94 CALL(OBSOLETE(sys_old_select)) /* used by libc4 */
95 CALL(sys_symlink) 95 CALL(sys_symlink)
96 CALL(sys_ni_syscall) /* was sys_lstat */ 96 CALL(sys_ni_syscall) /* was sys_lstat */
97/* 85 */ CALL(sys_readlink) 97/* 85 */ CALL(sys_readlink)
@@ -99,7 +99,7 @@
99 CALL(sys_swapon) 99 CALL(sys_swapon)
100 CALL(sys_reboot) 100 CALL(sys_reboot)
101 CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */ 101 CALL(OBSOLETE(sys_old_readdir)) /* used by libc4 */
102/* 90 */ CALL(OBSOLETE(old_mmap)) /* used by libc4 */ 102/* 90 */ CALL(OBSOLETE(sys_old_mmap)) /* used by libc4 */
103 CALL(sys_munmap) 103 CALL(sys_munmap)
104 CALL(sys_truncate) 104 CALL(sys_truncate)
105 CALL(sys_ftruncate) 105 CALL(sys_ftruncate)
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 08f899fb76a6..3f562a7c0a99 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -452,12 +452,23 @@ void ptrace_cancel_bpt(struct task_struct *child)
452 clear_breakpoint(child, &child->thread.debug.bp[i]); 452 clear_breakpoint(child, &child->thread.debug.bp[i]);
453} 453}
454 454
455void user_disable_single_step(struct task_struct *task)
456{
457 task->ptrace &= ~PT_SINGLESTEP;
458 ptrace_cancel_bpt(task);
459}
460
461void user_enable_single_step(struct task_struct *task)
462{
463 task->ptrace |= PT_SINGLESTEP;
464}
465
455/* 466/*
456 * Called by kernel/ptrace.c when detaching.. 467 * Called by kernel/ptrace.c when detaching..
457 */ 468 */
458void ptrace_disable(struct task_struct *child) 469void ptrace_disable(struct task_struct *child)
459{ 470{
460 single_step_disable(child); 471 user_disable_single_step(child);
461} 472}
462 473
463/* 474/*
@@ -753,53 +764,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
753 ret = ptrace_write_user(child, addr, data); 764 ret = ptrace_write_user(child, addr, data);
754 break; 765 break;
755 766
756 /*
757 * continue/restart and stop at next (return from) syscall
758 */
759 case PTRACE_SYSCALL:
760 case PTRACE_CONT:
761 ret = -EIO;
762 if (!valid_signal(data))
763 break;
764 if (request == PTRACE_SYSCALL)
765 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
766 else
767 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
768 child->exit_code = data;
769 single_step_disable(child);
770 wake_up_process(child);
771 ret = 0;
772 break;
773
774 /*
775 * make the child exit. Best I can do is send it a sigkill.
776 * perhaps it should be put in the status that it wants to
777 * exit.
778 */
779 case PTRACE_KILL:
780 single_step_disable(child);
781 if (child->exit_state != EXIT_ZOMBIE) {
782 child->exit_code = SIGKILL;
783 wake_up_process(child);
784 }
785 ret = 0;
786 break;
787
788 /*
789 * execute single instruction.
790 */
791 case PTRACE_SINGLESTEP:
792 ret = -EIO;
793 if (!valid_signal(data))
794 break;
795 single_step_enable(child);
796 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
797 child->exit_code = data;
798 /* give it a chance to run. */
799 wake_up_process(child);
800 ret = 0;
801 break;
802
803 case PTRACE_GETREGS: 767 case PTRACE_GETREGS:
804 ret = ptrace_getregs(child, (void __user *)data); 768 ret = ptrace_getregs(child, (void __user *)data);
805 break; 769 break;
diff --git a/arch/arm/kernel/ptrace.h b/arch/arm/kernel/ptrace.h
index def3b6184a79..3926605b82ea 100644
--- a/arch/arm/kernel/ptrace.h
+++ b/arch/arm/kernel/ptrace.h
@@ -14,20 +14,6 @@ extern void ptrace_set_bpt(struct task_struct *);
14extern void ptrace_break(struct task_struct *, struct pt_regs *); 14extern void ptrace_break(struct task_struct *, struct pt_regs *);
15 15
16/* 16/*
17 * make sure single-step breakpoint is gone.
18 */
19static inline void single_step_disable(struct task_struct *task)
20{
21 task->ptrace &= ~PT_SINGLESTEP;
22 ptrace_cancel_bpt(task);
23}
24
25static inline void single_step_enable(struct task_struct *task)
26{
27 task->ptrace |= PT_SINGLESTEP;
28}
29
30/*
31 * Send SIGTRAP if we're single-stepping 17 * Send SIGTRAP if we're single-stepping
32 */ 18 */
33static inline void single_step_trap(struct task_struct *task) 19static inline void single_step_trap(struct task_struct *task)
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index ae4027bd01bd..4350f75e578c 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -28,135 +28,6 @@
28#include <linux/ipc.h> 28#include <linux/ipc.h>
29#include <linux/uaccess.h> 29#include <linux/uaccess.h>
30 30
31struct mmap_arg_struct {
32 unsigned long addr;
33 unsigned long len;
34 unsigned long prot;
35 unsigned long flags;
36 unsigned long fd;
37 unsigned long offset;
38};
39
40asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
41{
42 int error = -EFAULT;
43 struct mmap_arg_struct a;
44
45 if (copy_from_user(&a, arg, sizeof(a)))
46 goto out;
47
48 error = -EINVAL;
49 if (a.offset & ~PAGE_MASK)
50 goto out;
51
52 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
53out:
54 return error;
55}
56
57/*
58 * Perform the select(nd, in, out, ex, tv) and mmap() system
59 * calls.
60 */
61
62struct sel_arg_struct {
63 unsigned long n;
64 fd_set __user *inp, *outp, *exp;
65 struct timeval __user *tvp;
66};
67
68asmlinkage int old_select(struct sel_arg_struct __user *arg)
69{
70 struct sel_arg_struct a;
71
72 if (copy_from_user(&a, arg, sizeof(a)))
73 return -EFAULT;
74 /* sys_select() does the appropriate kernel locking */
75 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
76}
77
78#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
79/*
80 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
81 *
82 * This is really horribly ugly.
83 */
84asmlinkage int sys_ipc(uint call, int first, int second, int third,
85 void __user *ptr, long fifth)
86{
87 int version, ret;
88
89 version = call >> 16; /* hack for backward compatibility */
90 call &= 0xffff;
91
92 switch (call) {
93 case SEMOP:
94 return sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
95 case SEMTIMEDOP:
96 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
97 (const struct timespec __user *)fifth);
98
99 case SEMGET:
100 return sys_semget (first, second, third);
101 case SEMCTL: {
102 union semun fourth;
103 if (!ptr)
104 return -EINVAL;
105 if (get_user(fourth.__pad, (void __user * __user *) ptr))
106 return -EFAULT;
107 return sys_semctl (first, second, third, fourth);
108 }
109
110 case MSGSND:
111 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
112 second, third);
113 case MSGRCV:
114 switch (version) {
115 case 0: {
116 struct ipc_kludge tmp;
117 if (!ptr)
118 return -EINVAL;
119 if (copy_from_user(&tmp,(struct ipc_kludge __user *)ptr,
120 sizeof (tmp)))
121 return -EFAULT;
122 return sys_msgrcv (first, tmp.msgp, second,
123 tmp.msgtyp, third);
124 }
125 default:
126 return sys_msgrcv (first,
127 (struct msgbuf __user *) ptr,
128 second, fifth, third);
129 }
130 case MSGGET:
131 return sys_msgget ((key_t) first, second);
132 case MSGCTL:
133 return sys_msgctl(first, second, (struct msqid_ds __user *)ptr);
134
135 case SHMAT:
136 switch (version) {
137 default: {
138 ulong raddr;
139 ret = do_shmat(first, (char __user *)ptr, second, &raddr);
140 if (ret)
141 return ret;
142 return put_user(raddr, (ulong __user *)third);
143 }
144 case 1: /* Of course, we don't support iBCS2! */
145 return -EINVAL;
146 }
147 case SHMDT:
148 return sys_shmdt ((char __user *)ptr);
149 case SHMGET:
150 return sys_shmget (first, second, third);
151 case SHMCTL:
152 return sys_shmctl (first, second,
153 (struct shmid_ds __user *) ptr);
154 default:
155 return -ENOSYS;
156 }
157}
158#endif
159
160/* Fork a new task - this creates a new program thread. 31/* Fork a new task - this creates a new program thread.
161 * This is called indirectly via a small wrapper 32 * This is called indirectly via a small wrapper
162 */ 33 */
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c
index d59a0cd537f0..33ff678e32f2 100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
@@ -346,9 +346,6 @@ asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops,
346 return sys_oabi_semtimedop(semid, tsops, nsops, NULL); 346 return sys_oabi_semtimedop(semid, tsops, nsops, NULL);
347} 347}
348 348
349extern asmlinkage int sys_ipc(uint call, int first, int second, int third,
350 void __user *ptr, long fifth);
351
352asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third, 349asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
353 void __user *ptr, long fifth) 350 void __user *ptr, long fifth)
354{ 351{
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index 786ac2b6914a..50292cd9c120 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -359,7 +359,9 @@ void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk)
359 frame.fp = regs->ARM_fp; 359 frame.fp = regs->ARM_fp;
360 frame.sp = regs->ARM_sp; 360 frame.sp = regs->ARM_sp;
361 frame.lr = regs->ARM_lr; 361 frame.lr = regs->ARM_lr;
362 frame.pc = regs->ARM_pc; 362 /* PC might be corrupted, use LR in that case. */
363 frame.pc = kernel_text_address(regs->ARM_pc)
364 ? regs->ARM_pc : regs->ARM_lr;
363 } else if (tsk == current) { 365 } else if (tsk == current) {
364 frame.fp = (unsigned long)__builtin_frame_address(0); 366 frame.fp = (unsigned long)__builtin_frame_address(0);
365 frame.sp = current_sp; 367 frame.sp = current_sp;
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index 309f3511aa20..2500f41d8d2d 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -58,6 +58,12 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id)
58{ 58{
59 u32 sr = at91_sys_read(AT91_ST_SR) & irqmask; 59 u32 sr = at91_sys_read(AT91_ST_SR) & irqmask;
60 60
61 /*
62 * irqs should be disabled here, but as the irq is shared they are only
63 * guaranteed to be off if the timer irq is registered first.
64 */
65 WARN_ON_ONCE(!irqs_disabled());
66
61 /* simulate "oneshot" timer with alarm */ 67 /* simulate "oneshot" timer with alarm */
62 if (sr & AT91_ST_ALMS) { 68 if (sr & AT91_ST_ALMS) {
63 clkevt.event_handler(&clkevt); 69 clkevt.event_handler(&clkevt);
@@ -132,24 +138,11 @@ clkevt32k_mode(enum clock_event_mode mode, struct clock_event_device *dev)
132static int 138static int
133clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev) 139clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
134{ 140{
135 unsigned long flags;
136 u32 alm; 141 u32 alm;
137 int status = 0; 142 int status = 0;
138 143
139 BUG_ON(delta < 2); 144 BUG_ON(delta < 2);
140 145
141 /* Use "raw" primitives so we behave correctly on RT kernels. */
142 raw_local_irq_save(flags);
143
144 /*
145 * According to Thomas Gleixner irqs are already disabled here. Simply
146 * removing raw_local_irq_save above (and the matching
147 * raw_local_irq_restore) was not accepted. See
148 * http://thread.gmane.org/gmane.linux.ports.arm.kernel/41174
149 * So for now (2008-11-20) just warn once if irqs were not disabled ...
150 */
151 WARN_ON_ONCE(!raw_irqs_disabled_flags(flags));
152
153 /* The alarm IRQ uses absolute time (now+delta), not the relative 146 /* The alarm IRQ uses absolute time (now+delta), not the relative
154 * time (delta) in our calling convention. Like all clockevents 147 * time (delta) in our calling convention. Like all clockevents
155 * using such "match" hardware, we have a race to defend against. 148 * using such "match" hardware, we have a race to defend against.
@@ -169,7 +162,6 @@ clkevt32k_next_event(unsigned long delta, struct clock_event_device *dev)
169 alm += delta; 162 alm += delta;
170 at91_sys_write(AT91_ST_RTAR, alm); 163 at91_sys_write(AT91_ST_RTAR, alm);
171 164
172 raw_local_irq_restore(flags);
173 return status; 165 return status;
174} 166}
175 167
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 4bd56aee4370..608a63240b64 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -62,16 +62,12 @@ static struct clocksource pit_clk = {
62static void 62static void
63pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) 63pit_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
64{ 64{
65 unsigned long flags;
66
67 switch (mode) { 65 switch (mode) {
68 case CLOCK_EVT_MODE_PERIODIC: 66 case CLOCK_EVT_MODE_PERIODIC:
69 /* update clocksource counter, then enable the IRQ */ 67 /* update clocksource counter */
70 raw_local_irq_save(flags);
71 pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR)); 68 pit_cnt += pit_cycle * PIT_PICNT(at91_sys_read(AT91_PIT_PIVR));
72 at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN 69 at91_sys_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
73 | AT91_PIT_PITIEN); 70 | AT91_PIT_PITIEN);
74 raw_local_irq_restore(flags);
75 break; 71 break;
76 case CLOCK_EVT_MODE_ONESHOT: 72 case CLOCK_EVT_MODE_ONESHOT:
77 BUG(); 73 BUG();
@@ -100,6 +96,11 @@ static struct clock_event_device pit_clkevt = {
100 */ 96 */
101static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id) 97static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id)
102{ 98{
99 /*
100 * irqs should be disabled here, but as the irq is shared they are only
101 * guaranteed to be off if the timer irq is registered first.
102 */
103 WARN_ON_ONCE(!irqs_disabled());
103 104
104 /* The PIT interrupt may be disabled, and is shared */ 105 /* The PIT interrupt may be disabled, and is shared */
105 if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC) 106 if ((pit_clkevt.mode == CLOCK_EVT_MODE_PERIODIC)
diff --git a/arch/arm/mach-at91/include/mach/at91_mci.h b/arch/arm/mach-at91/include/mach/at91_mci.h
index 550d503a1bca..57f8ee154943 100644
--- a/arch/arm/mach-at91/include/mach/at91_mci.h
+++ b/arch/arm/mach-at91/include/mach/at91_mci.h
@@ -77,7 +77,7 @@
77 77
78#define AT91_MCI_BLKR 0x18 /* Block Register */ 78#define AT91_MCI_BLKR 0x18 /* Block Register */
79#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */ 79#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */
80#define AT91_MCI_BLKR_BLKLEN(n) ((0xffff & (n)) << 16) /* Block lenght */ 80#define AT91_MCI_BLKR_BLKLEN(n) ((0xffff & (n)) << 16) /* Block length */
81 81
82#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */ 82#define AT91_MCI_RSPR(n) (0x20 + ((n) * 4)) /* Response Registers 0-3 */
83#define AT91_MCR_RDR 0x30 /* Receive Data Register */ 83#define AT91_MCR_RDR 0x30 /* Receive Data Register */
diff --git a/arch/arm/mach-davinci/include/mach/i2c.h b/arch/arm/mach-davinci/include/mach/i2c.h
index 39fdceac8414..2312d197dfb7 100644
--- a/arch/arm/mach-davinci/include/mach/i2c.h
+++ b/arch/arm/mach-davinci/include/mach/i2c.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * DaVinci I2C controller platfrom_device info 2 * DaVinci I2C controller platform_device info
3 * 3 *
4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com> 4 * Author: Vladimir Barinov, MontaVista Software, Inc. <source@mvista.com>
5 * 5 *
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 806972a68c87..5da2cf402c81 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -605,7 +605,7 @@ static struct platform_device dove_xor00_channel = {
605 .dev = { 605 .dev = {
606 .dma_mask = &dove_xor0_dmamask, 606 .dma_mask = &dove_xor0_dmamask,
607 .coherent_dma_mask = DMA_BIT_MASK(64), 607 .coherent_dma_mask = DMA_BIT_MASK(64),
608 .platform_data = (void *)&dove_xor00_data, 608 .platform_data = &dove_xor00_data,
609 }, 609 },
610}; 610};
611 611
@@ -631,7 +631,7 @@ static struct platform_device dove_xor01_channel = {
631 .dev = { 631 .dev = {
632 .dma_mask = &dove_xor0_dmamask, 632 .dma_mask = &dove_xor0_dmamask,
633 .coherent_dma_mask = DMA_BIT_MASK(64), 633 .coherent_dma_mask = DMA_BIT_MASK(64),
634 .platform_data = (void *)&dove_xor01_data, 634 .platform_data = &dove_xor01_data,
635 }, 635 },
636}; 636};
637 637
@@ -704,7 +704,7 @@ static struct platform_device dove_xor10_channel = {
704 .dev = { 704 .dev = {
705 .dma_mask = &dove_xor1_dmamask, 705 .dma_mask = &dove_xor1_dmamask,
706 .coherent_dma_mask = DMA_BIT_MASK(64), 706 .coherent_dma_mask = DMA_BIT_MASK(64),
707 .platform_data = (void *)&dove_xor10_data, 707 .platform_data = &dove_xor10_data,
708 }, 708 },
709}; 709};
710 710
@@ -730,7 +730,7 @@ static struct platform_device dove_xor11_channel = {
730 .dev = { 730 .dev = {
731 .dma_mask = &dove_xor1_dmamask, 731 .dma_mask = &dove_xor1_dmamask,
732 .coherent_dma_mask = DMA_BIT_MASK(64), 732 .coherent_dma_mask = DMA_BIT_MASK(64),
733 .platform_data = (void *)&dove_xor11_data, 733 .platform_data = &dove_xor11_data,
734 }, 734 },
735}; 735};
736 736
diff --git a/arch/arm/mach-ep93xx/micro9.c b/arch/arm/mach-ep93xx/micro9.c
index f3757a1c5a10..c33360e82868 100644
--- a/arch/arm/mach-ep93xx/micro9.c
+++ b/arch/arm/mach-ep93xx/micro9.c
@@ -28,7 +28,7 @@
28 * 28 *
29 * Micro9-High has up to 64MB of 32-bit flash on CS1 29 * Micro9-High has up to 64MB of 32-bit flash on CS1
30 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1 30 * Micro9-Mid has up to 64MB of either 32-bit or 16-bit flash on CS1
31 * Micro9-Lite uses a seperate MTD map driver for flash support 31 * Micro9-Lite uses a separate MTD map driver for flash support
32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1 32 * Micro9-Slim has up to 64MB of either 32-bit or 16-bit flash on CS1
33 *************************************************************************/ 33 *************************************************************************/
34static struct physmap_flash_data micro9_flash_data; 34static struct physmap_flash_data micro9_flash_data;
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index c4a01594c761..e3181534c7f9 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -502,32 +502,6 @@ struct pci_bus * __devinit ixp4xx_scan_bus(int nr, struct pci_sys_data *sys)
502 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys); 502 return pci_scan_bus(sys->busnr, &ixp4xx_ops, sys);
503} 503}
504 504
505/*
506 * We override these so we properly do dmabounce otherwise drivers
507 * are able to set the dma_mask to 0xffffffff and we can no longer
508 * trap bounces. :(
509 *
510 * We just return true on everyhing except for < 64MB in which case
511 * we will fail miseralby and die since we can't handle that case.
512 */
513int
514pci_set_dma_mask(struct pci_dev *dev, u64 mask)
515{
516 if (mask >= SZ_64M - 1 )
517 return 0;
518
519 return -EIO;
520}
521
522int
523pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
524{
525 if (mask >= SZ_64M - 1 )
526 return 0;
527
528 return -EIO;
529}
530
531EXPORT_SYMBOL(ixp4xx_pci_read); 505EXPORT_SYMBOL(ixp4xx_pci_read);
532EXPORT_SYMBOL(ixp4xx_pci_write); 506EXPORT_SYMBOL(ixp4xx_pci_write);
533 507
diff --git a/arch/arm/mach-ixp4xx/include/mach/hardware.h b/arch/arm/mach-ixp4xx/include/mach/hardware.h
index f9d1c43e4a54..f91ca6d4fbe8 100644
--- a/arch/arm/mach-ixp4xx/include/mach/hardware.h
+++ b/arch/arm/mach-ixp4xx/include/mach/hardware.h
@@ -26,11 +26,6 @@
26#define PCIBIOS_MAX_MEM 0x4BFFFFFF 26#define PCIBIOS_MAX_MEM 0x4BFFFFFF
27#endif 27#endif
28 28
29/*
30 * We override the standard dma-mask routines for bouncing.
31 */
32#define HAVE_ARCH_PCI_SET_DMA_MASK
33
34#define pcibios_assign_all_busses() 1 29#define pcibios_assign_all_busses() 1
35 30
36/* Register locations and bits */ 31/* Register locations and bits */
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index f6c6196a51fa..17879a876be6 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -32,6 +32,12 @@ config MACH_SHEEVAPLUG
32 Say 'Y' here if you want your kernel to support the 32 Say 'Y' here if you want your kernel to support the
33 Marvell SheevaPlug Reference Board. 33 Marvell SheevaPlug Reference Board.
34 34
35config MACH_ESATA_SHEEVAPLUG
36 bool "Marvell eSATA SheevaPlug Reference Board"
37 help
38 Say 'Y' here if you want your kernel to support the
39 Marvell eSATA SheevaPlug Reference Board.
40
35config MACH_TS219 41config MACH_TS219
36 bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS" 42 bool "QNAP TS-110, TS-119, TS-210, TS-219 and TS-219P Turbo NAS"
37 help 43 help
@@ -46,18 +52,35 @@ config MACH_TS41X
46 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS 52 QNAP TS-410, TS-410U, TS-419P and TS-419U Turbo NAS
47 devices. 53 devices.
48 54
55config MACH_OPENRD
56 bool
57
49config MACH_OPENRD_BASE 58config MACH_OPENRD_BASE
50 bool "Marvell OpenRD Base Board" 59 bool "Marvell OpenRD Base Board"
60 select MACH_OPENRD
51 help 61 help
52 Say 'Y' here if you want your kernel to support the 62 Say 'Y' here if you want your kernel to support the
53 Marvell OpenRD Base Board. 63 Marvell OpenRD Base Board.
54 64
65config MACH_OPENRD_CLIENT
66 bool "Marvell OpenRD Client Board"
67 select MACH_OPENRD
68 help
69 Say 'Y' here if you want your kernel to support the
70 Marvell OpenRD Client Board.
71
55config MACH_NETSPACE_V2 72config MACH_NETSPACE_V2
56 bool "LaCie Network Space v2 NAS Board" 73 bool "LaCie Network Space v2 NAS Board"
57 help 74 help
58 Say 'Y' here if you want your kernel to support the 75 Say 'Y' here if you want your kernel to support the
59 LaCie Network Space v2 NAS. 76 LaCie Network Space v2 NAS.
60 77
78config MACH_INETSPACE_V2
79 bool "LaCie Internet Space v2 NAS Board"
80 help
81 Say 'Y' here if you want your kernel to support the
82 LaCie Internet Space v2 NAS.
83
61endmenu 84endmenu
62 85
63endif 86endif
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index d4d7f53b0fb9..a5530e36ba3e 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -5,9 +5,11 @@ obj-$(CONFIG_MACH_RD88F6192_NAS) += rd88f6192-nas-setup.o
5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o 5obj-$(CONFIG_MACH_RD88F6281) += rd88f6281-setup.o
6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o 6obj-$(CONFIG_MACH_MV88F6281GTW_GE) += mv88f6281gtw_ge-setup.o
7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o 7obj-$(CONFIG_MACH_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_ESATA_SHEEVAPLUG) += sheevaplug-setup.o
8obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o 9obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
9obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o 10obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
10obj-$(CONFIG_MACH_OPENRD_BASE) += openrd_base-setup.o 11obj-$(CONFIG_MACH_OPENRD) += openrd-setup.o
11obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o 12obj-$(CONFIG_MACH_NETSPACE_V2) += netspace_v2-setup.o
13obj-$(CONFIG_MACH_INETSPACE_V2) += netspace_v2-setup.o
12 14
13obj-$(CONFIG_CPU_IDLE) += cpuidle.o 15obj-$(CONFIG_CPU_IDLE) += cpuidle.o
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 242dd0775343..f759ca243925 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -656,7 +656,7 @@ static struct platform_device kirkwood_xor00_channel = {
656 .dev = { 656 .dev = {
657 .dma_mask = &kirkwood_xor_dmamask, 657 .dma_mask = &kirkwood_xor_dmamask,
658 .coherent_dma_mask = DMA_BIT_MASK(64), 658 .coherent_dma_mask = DMA_BIT_MASK(64),
659 .platform_data = (void *)&kirkwood_xor00_data, 659 .platform_data = &kirkwood_xor00_data,
660 }, 660 },
661}; 661};
662 662
@@ -682,7 +682,7 @@ static struct platform_device kirkwood_xor01_channel = {
682 .dev = { 682 .dev = {
683 .dma_mask = &kirkwood_xor_dmamask, 683 .dma_mask = &kirkwood_xor_dmamask,
684 .coherent_dma_mask = DMA_BIT_MASK(64), 684 .coherent_dma_mask = DMA_BIT_MASK(64),
685 .platform_data = (void *)&kirkwood_xor01_data, 685 .platform_data = &kirkwood_xor01_data,
686 }, 686 },
687}; 687};
688 688
@@ -755,7 +755,7 @@ static struct platform_device kirkwood_xor10_channel = {
755 .dev = { 755 .dev = {
756 .dma_mask = &kirkwood_xor_dmamask, 756 .dma_mask = &kirkwood_xor_dmamask,
757 .coherent_dma_mask = DMA_BIT_MASK(64), 757 .coherent_dma_mask = DMA_BIT_MASK(64),
758 .platform_data = (void *)&kirkwood_xor10_data, 758 .platform_data = &kirkwood_xor10_data,
759 }, 759 },
760}; 760};
761 761
@@ -781,7 +781,7 @@ static struct platform_device kirkwood_xor11_channel = {
781 .dev = { 781 .dev = {
782 .dma_mask = &kirkwood_xor_dmamask, 782 .dma_mask = &kirkwood_xor_dmamask,
783 .coherent_dma_mask = DMA_BIT_MASK(64), 783 .coherent_dma_mask = DMA_BIT_MASK(64),
784 .platform_data = (void *)&kirkwood_xor11_data, 784 .platform_data = &kirkwood_xor11_data,
785 }, 785 },
786}; 786};
787 787
diff --git a/arch/arm/mach-kirkwood/netspace_v2-setup.c b/arch/arm/mach-kirkwood/netspace_v2-setup.c
index 9a064065bebe..3ae158d72681 100644
--- a/arch/arm/mach-kirkwood/netspace_v2-setup.c
+++ b/arch/arm/mach-kirkwood/netspace_v2-setup.c
@@ -182,8 +182,14 @@ static struct platform_device netspace_v2_gpio_buttons = {
182 182
183static struct gpio_led netspace_v2_gpio_led_pins[] = { 183static struct gpio_led netspace_v2_gpio_led_pins[] = {
184 { 184 {
185 .name = "ns_v2:red:fail", 185 .name = "ns_v2:blue:sata",
186 .gpio = NETSPACE_V2_GPIO_RED_LED, 186 .default_trigger = "default-on",
187 .gpio = NETSPACE_V2_GPIO_BLUE_LED_CMD,
188 .active_low = 1,
189 },
190 {
191 .name = "ns_v2:red:fail",
192 .gpio = NETSPACE_V2_GPIO_RED_LED,
187 }, 193 },
188}; 194};
189 195
@@ -202,30 +208,19 @@ static struct platform_device netspace_v2_gpio_leds = {
202 208
203static void __init netspace_v2_gpio_leds_init(void) 209static void __init netspace_v2_gpio_leds_init(void)
204{ 210{
205 platform_device_register(&netspace_v2_gpio_leds); 211 int err;
206 212
207 /* 213 /* Configure register slow_led to allow SATA activity LED blinking */
208 * Configure the front blue LED to blink in relation with the SATA 214 err = gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, "blue LED slow");
209 * activity. 215 if (err == 0) {
210 */ 216 err = gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0);
211 if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 217 if (err)
212 "SATA blue LED slow") != 0) 218 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
213 return; 219 }
214 if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_SLOW, 0) != 0) 220 if (err)
215 goto err_free_1; 221 pr_err("netspace_v2: failed to configure blue LED slow GPIO\n");
216 if (gpio_request(NETSPACE_V2_GPIO_BLUE_LED_CMD, 222
217 "SATA blue LED command") != 0) 223 platform_device_register(&netspace_v2_gpio_leds);
218 goto err_free_1;
219 if (gpio_direction_output(NETSPACE_V2_GPIO_BLUE_LED_CMD, 0) != 0)
220 goto err_free_2;
221
222 return;
223
224err_free_2:
225 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_CMD);
226err_free_1:
227 gpio_free(NETSPACE_V2_GPIO_BLUE_LED_SLOW);
228 pr_err("netspace_v2: failed to configure SATA blue LED\n");
229} 224}
230 225
231/***************************************************************************** 226/*****************************************************************************
@@ -314,6 +309,7 @@ static void __init netspace_v2_init(void)
314 pr_err("netspace_v2: failed to configure power-off GPIO\n"); 309 pr_err("netspace_v2: failed to configure power-off GPIO\n");
315} 310}
316 311
312#ifdef CONFIG_MACH_NETSPACE_V2
317MACHINE_START(NETSPACE_V2, "LaCie Network Space v2") 313MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
318 .phys_io = KIRKWOOD_REGS_PHYS_BASE, 314 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
319 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc, 315 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
@@ -323,3 +319,16 @@ MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
323 .init_irq = kirkwood_init_irq, 319 .init_irq = kirkwood_init_irq,
324 .timer = &netspace_v2_timer, 320 .timer = &netspace_v2_timer,
325MACHINE_END 321MACHINE_END
322#endif
323
324#ifdef CONFIG_MACH_INETSPACE_V2
325MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
326 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
327 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
328 .boot_params = 0x00000100,
329 .init_machine = netspace_v2_init,
330 .map_io = kirkwood_map_io,
331 .init_irq = kirkwood_init_irq,
332 .timer = &netspace_v2_timer,
333MACHINE_END
334#endif
diff --git a/arch/arm/mach-kirkwood/openrd-setup.c b/arch/arm/mach-kirkwood/openrd-setup.c
new file mode 100644
index 000000000000..ad3f1ec33796
--- /dev/null
+++ b/arch/arm/mach-kirkwood/openrd-setup.c
@@ -0,0 +1,118 @@
1/*
2 * arch/arm/mach-kirkwood/openrd-setup.c
3 *
4 * Marvell OpenRD (Base|Client) Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/nand.h>
15#include <linux/mtd/partitions.h>
16#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h>
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <mach/kirkwood.h>
21#include <plat/mvsdio.h>
22#include "common.h"
23#include "mpp.h"
24
25static struct mtd_partition openrd_nand_parts[] = {
26 {
27 .name = "u-boot",
28 .offset = 0,
29 .size = SZ_1M,
30 .mask_flags = MTD_WRITEABLE
31 }, {
32 .name = "uImage",
33 .offset = MTDPART_OFS_NXTBLK,
34 .size = SZ_4M
35 }, {
36 .name = "root",
37 .offset = MTDPART_OFS_NXTBLK,
38 .size = MTDPART_SIZ_FULL
39 },
40};
41
42static struct mv643xx_eth_platform_data openrd_ge00_data = {
43 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
44};
45
46static struct mv643xx_eth_platform_data openrd_ge01_data = {
47 .phy_addr = MV643XX_ETH_PHY_ADDR(24),
48};
49
50static struct mv_sata_platform_data openrd_sata_data = {
51 .n_ports = 2,
52};
53
54static struct mvsdio_platform_data openrd_mvsdio_data = {
55 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
56};
57
58static unsigned int openrd_mpp_config[] __initdata = {
59 MPP29_GPIO,
60 0
61};
62
63static void __init openrd_init(void)
64{
65 /*
66 * Basic setup. Needs to be called early.
67 */
68 kirkwood_init();
69 kirkwood_mpp_conf(openrd_mpp_config);
70
71 kirkwood_uart0_init();
72 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_nand_parts), 25);
73
74 kirkwood_ehci_init();
75
76 kirkwood_ge00_init(&openrd_ge00_data);
77 if (machine_is_openrd_client())
78 kirkwood_ge01_init(&openrd_ge01_data);
79 kirkwood_sata_init(&openrd_sata_data);
80 kirkwood_sdio_init(&openrd_mvsdio_data);
81
82 kirkwood_i2c_init();
83}
84
85static int __init openrd_pci_init(void)
86{
87 if (machine_is_openrd_base() || machine_is_openrd_client())
88 kirkwood_pcie_init();
89
90 return 0;
91}
92subsys_initcall(openrd_pci_init);
93
94#ifdef CONFIG_MACH_OPENRD_BASE
95MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
96 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
97 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
98 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
99 .boot_params = 0x00000100,
100 .init_machine = openrd_init,
101 .map_io = kirkwood_map_io,
102 .init_irq = kirkwood_init_irq,
103 .timer = &kirkwood_timer,
104MACHINE_END
105#endif
106
107#ifdef CONFIG_MACH_OPENRD_CLIENT
108MACHINE_START(OPENRD_CLIENT, "Marvell OpenRD Client Board")
109 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
110 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
111 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
112 .boot_params = 0x00000100,
113 .init_machine = openrd_init,
114 .map_io = kirkwood_map_io,
115 .init_irq = kirkwood_init_irq,
116 .timer = &kirkwood_timer,
117MACHINE_END
118#endif
diff --git a/arch/arm/mach-kirkwood/openrd_base-setup.c b/arch/arm/mach-kirkwood/openrd_base-setup.c
deleted file mode 100644
index 77617c722299..000000000000
--- a/arch/arm/mach-kirkwood/openrd_base-setup.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/openrd_base-setup.c
3 *
4 * Marvell OpenRD Base Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/partitions.h>
15#include <linux/ata_platform.h>
16#include <linux/mv643xx_eth.h>
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/kirkwood.h>
20#include <plat/mvsdio.h>
21#include "common.h"
22#include "mpp.h"
23
24static struct mtd_partition openrd_base_nand_parts[] = {
25 {
26 .name = "u-boot",
27 .offset = 0,
28 .size = SZ_1M
29 }, {
30 .name = "uImage",
31 .offset = MTDPART_OFS_NXTBLK,
32 .size = SZ_4M
33 }, {
34 .name = "root",
35 .offset = MTDPART_OFS_NXTBLK,
36 .size = MTDPART_SIZ_FULL
37 },
38};
39
40static struct mv643xx_eth_platform_data openrd_base_ge00_data = {
41 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
42};
43
44static struct mv_sata_platform_data openrd_base_sata_data = {
45 .n_ports = 2,
46};
47
48static struct mvsdio_platform_data openrd_base_mvsdio_data = {
49 .gpio_card_detect = 29, /* MPP29 used as SD card detect */
50};
51
52static unsigned int openrd_base_mpp_config[] __initdata = {
53 MPP29_GPIO,
54 0
55};
56
57static void __init openrd_base_init(void)
58{
59 /*
60 * Basic setup. Needs to be called early.
61 */
62 kirkwood_init();
63 kirkwood_mpp_conf(openrd_base_mpp_config);
64
65 kirkwood_uart0_init();
66 kirkwood_nand_init(ARRAY_AND_SIZE(openrd_base_nand_parts), 25);
67
68 kirkwood_ehci_init();
69
70 kirkwood_ge00_init(&openrd_base_ge00_data);
71 kirkwood_sata_init(&openrd_base_sata_data);
72 kirkwood_sdio_init(&openrd_base_mvsdio_data);
73
74 kirkwood_i2c_init();
75}
76
77static int __init openrd_base_pci_init(void)
78{
79 if (machine_is_openrd_base())
80 kirkwood_pcie_init();
81
82 return 0;
83 }
84subsys_initcall(openrd_base_pci_init);
85
86
87MACHINE_START(OPENRD_BASE, "Marvell OpenRD Base Board")
88 /* Maintainer: Dhaval Vasa <dhaval.vasa@einfochips.com> */
89 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
90 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
91 .boot_params = 0x00000100,
92 .init_machine = openrd_base_init,
93 .map_io = kirkwood_map_io,
94 .init_irq = kirkwood_init_irq,
95 .timer = &kirkwood_timer,
96MACHINE_END
diff --git a/arch/arm/mach-kirkwood/sheevaplug-setup.c b/arch/arm/mach-kirkwood/sheevaplug-setup.c
index c7319eeac8bb..a00879d34d54 100644
--- a/arch/arm/mach-kirkwood/sheevaplug-setup.c
+++ b/arch/arm/mach-kirkwood/sheevaplug-setup.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/ata_platform.h>
14#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
15#include <linux/mv643xx_eth.h> 16#include <linux/mv643xx_eth.h>
16#include <linux/gpio.h> 17#include <linux/gpio.h>
@@ -42,10 +43,19 @@ static struct mv643xx_eth_platform_data sheevaplug_ge00_data = {
42 .phy_addr = MV643XX_ETH_PHY_ADDR(0), 43 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
43}; 44};
44 45
46static struct mv_sata_platform_data sheeva_esata_sata_data = {
47 .n_ports = 2,
48};
49
45static struct mvsdio_platform_data sheevaplug_mvsdio_data = { 50static struct mvsdio_platform_data sheevaplug_mvsdio_data = {
46 /* unfortunately the CD signal has not been connected */ 51 /* unfortunately the CD signal has not been connected */
47}; 52};
48 53
54static struct mvsdio_platform_data sheeva_esata_mvsdio_data = {
55 .gpio_write_protect = 44, /* MPP44 used as SD write protect */
56 .gpio_card_detect = 47, /* MPP47 used as SD card detect */
57};
58
49static struct gpio_led sheevaplug_led_pins[] = { 59static struct gpio_led sheevaplug_led_pins[] = {
50 { 60 {
51 .name = "plug:green:health", 61 .name = "plug:green:health",
@@ -74,13 +84,26 @@ static unsigned int sheevaplug_mpp_config[] __initdata = {
74 0 84 0
75}; 85};
76 86
87static unsigned int sheeva_esata_mpp_config[] __initdata = {
88 MPP29_GPIO, /* USB Power Enable */
89 MPP44_GPIO, /* SD Write Protect */
90 MPP47_GPIO, /* SD Card Detect */
91 MPP49_GPIO, /* LED Green */
92 0
93};
94
77static void __init sheevaplug_init(void) 95static void __init sheevaplug_init(void)
78{ 96{
79 /* 97 /*
80 * Basic setup. Needs to be called early. 98 * Basic setup. Needs to be called early.
81 */ 99 */
82 kirkwood_init(); 100 kirkwood_init();
83 kirkwood_mpp_conf(sheevaplug_mpp_config); 101
102 /* setup gpio pin select */
103 if (machine_is_sheeva_esata())
104 kirkwood_mpp_conf(sheeva_esata_mpp_config);
105 else
106 kirkwood_mpp_conf(sheevaplug_mpp_config);
84 107
85 kirkwood_uart0_init(); 108 kirkwood_uart0_init();
86 kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25); 109 kirkwood_nand_init(ARRAY_AND_SIZE(sheevaplug_nand_parts), 25);
@@ -91,11 +114,21 @@ static void __init sheevaplug_init(void)
91 kirkwood_ehci_init(); 114 kirkwood_ehci_init();
92 115
93 kirkwood_ge00_init(&sheevaplug_ge00_data); 116 kirkwood_ge00_init(&sheevaplug_ge00_data);
94 kirkwood_sdio_init(&sheevaplug_mvsdio_data); 117
118 /* honor lower power consumption for plugs with out eSATA */
119 if (machine_is_sheeva_esata())
120 kirkwood_sata_init(&sheeva_esata_sata_data);
121
122 /* enable sd wp and sd cd on plugs with esata */
123 if (machine_is_sheeva_esata())
124 kirkwood_sdio_init(&sheeva_esata_mvsdio_data);
125 else
126 kirkwood_sdio_init(&sheevaplug_mvsdio_data);
95 127
96 platform_device_register(&sheevaplug_leds); 128 platform_device_register(&sheevaplug_leds);
97} 129}
98 130
131#ifdef CONFIG_MACH_SHEEVAPLUG
99MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board") 132MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
100 /* Maintainer: shadi Ammouri <shadi@marvell.com> */ 133 /* Maintainer: shadi Ammouri <shadi@marvell.com> */
101 .phys_io = KIRKWOOD_REGS_PHYS_BASE, 134 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
@@ -106,3 +139,16 @@ MACHINE_START(SHEEVAPLUG, "Marvell SheevaPlug Reference Board")
106 .init_irq = kirkwood_init_irq, 139 .init_irq = kirkwood_init_irq,
107 .timer = &kirkwood_timer, 140 .timer = &kirkwood_timer,
108MACHINE_END 141MACHINE_END
142#endif
143
144#ifdef CONFIG_MACH_ESATA_SHEEVAPLUG
145MACHINE_START(ESATA_SHEEVAPLUG, "Marvell eSATA SheevaPlug Reference Board")
146 .phys_io = KIRKWOOD_REGS_PHYS_BASE,
147 .io_pg_offst = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
148 .boot_params = 0x00000100,
149 .init_machine = sheevaplug_init,
150 .map_io = kirkwood_map_io,
151 .init_irq = kirkwood_init_irq,
152 .timer = &kirkwood_timer,
153MACHINE_END
154#endif
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index c6a564fc4a7c..6ab843eaa35b 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -1,6 +1,6 @@
1if ARCH_MMP 1if ARCH_MMP
2 2
3menu "Marvell PXA168/910 Implmentations" 3menu "Marvell PXA168/910/MMP2 Implmentations"
4 4
5config MACH_ASPENITE 5config MACH_ASPENITE
6 bool "Marvell's PXA168 Aspenite Development Board" 6 bool "Marvell's PXA168 Aspenite Development Board"
@@ -16,6 +16,13 @@ config MACH_ZYLONITE2
16 Say 'Y' here if you want to support the Marvell PXA168-based 16 Say 'Y' here if you want to support the Marvell PXA168-based
17 Zylonite2 Development Board. 17 Zylonite2 Development Board.
18 18
19config MACH_AVENGERS_LITE
20 bool "Marvell's PXA168 Avengers Lite Development Board"
21 select CPU_PXA168
22 help
23 Say 'Y' here if you want to support the Marvell PXA168-based
24 Avengers Lite Development Board.
25
19config MACH_TAVOREVB 26config MACH_TAVOREVB
20 bool "Marvell's PXA910 TavorEVB Development Board" 27 bool "Marvell's PXA910 TavorEVB Development Board"
21 select CPU_PXA910 28 select CPU_PXA910
@@ -30,6 +37,26 @@ config MACH_TTC_DKB
30 Say 'Y' here if you want to support the Marvell PXA910-based 37 Say 'Y' here if you want to support the Marvell PXA910-based
31 TTC_DKB Development Board. 38 TTC_DKB Development Board.
32 39
40config MACH_FLINT
41 bool "Marvell's Flint Development Platform"
42 select CPU_MMP2
43 help
44 Say 'Y' here if you want to support the Marvell MMP2-based
45 Flint Development Platform.
46 MMP2-based board can't be co-existed with PXA168-based &
47 PXA910-based development board. Since MMP2 is compatible to
48 ARMv6 architecture.
49
50config MACH_MARVELL_JASPER
51 bool "Marvell's Jasper Development Platform"
52 select CPU_MMP2
53 help
54 Say 'Y' here if you want to support the Marvell MMP2-base
55 Jasper Development Platform.
56 MMP2-based board can't be co-existed with PXA168-based &
57 PXA910-based development board. Since MMP2 is compatible to
58 ARMv6 architecture.
59
33endmenu 60endmenu
34 61
35config CPU_PXA168 62config CPU_PXA168
@@ -44,4 +71,10 @@ config CPU_PXA910
44 help 71 help
45 Select code specific to PXA910 72 Select code specific to PXA910
46 73
74config CPU_MMP2
75 bool
76 select CPU_V6
77 select CPU_32v6K
78 help
79 Select code specific to MMP2. MMP2 is ARMv6 compatible.
47endif 80endif
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile
index 6883e6584883..8b66d06739c4 100644
--- a/arch/arm/mach-mmp/Makefile
+++ b/arch/arm/mach-mmp/Makefile
@@ -2,14 +2,18 @@
2# Makefile for Marvell's PXA168 processors line 2# Makefile for Marvell's PXA168 processors line
3# 3#
4 4
5obj-y += common.o clock.o devices.o irq.o time.o 5obj-y += common.o clock.o devices.o time.o
6 6
7# SoC support 7# SoC support
8obj-$(CONFIG_CPU_PXA168) += pxa168.o 8obj-$(CONFIG_CPU_PXA168) += pxa168.o irq-pxa168.o
9obj-$(CONFIG_CPU_PXA910) += pxa910.o 9obj-$(CONFIG_CPU_PXA910) += pxa910.o irq-pxa168.o
10obj-$(CONFIG_CPU_MMP2) += mmp2.o irq-mmp2.o
10 11
11# board support 12# board support
12obj-$(CONFIG_MACH_ASPENITE) += aspenite.o 13obj-$(CONFIG_MACH_ASPENITE) += aspenite.o
13obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o 14obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o
15obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o
14obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o 16obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o
15obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o 17obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o
18obj-$(CONFIG_MACH_FLINT) += flint.o
19obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
diff --git a/arch/arm/mach-mmp/avengers_lite.c b/arch/arm/mach-mmp/avengers_lite.c
new file mode 100644
index 000000000000..8c3fa5d14f4b
--- /dev/null
+++ b/arch/arm/mach-mmp/avengers_lite.c
@@ -0,0 +1,51 @@
1/*
2 * linux/arch/arm/mach-mmp/avengers_lite.c
3 *
4 * Support for the Marvell PXA168-based Avengers lite Development Platform.
5 *
6 * Copyright (C) 2009-2010 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * publishhed by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16
17#include <asm/mach-types.h>
18#include <asm/mach/arch.h>
19#include <mach/addr-map.h>
20#include <mach/mfp-pxa168.h>
21#include <mach/pxa168.h>
22#include <mach/irqs.h>
23
24
25#include "common.h"
26#include <linux/delay.h>
27
28/* Avengers lite MFP configurations */
29static unsigned long avengers_lite_pin_config_V16F[] __initdata = {
30 /* DEBUG_UART */
31 GPIO88_UART2_TXD,
32 GPIO89_UART2_RXD,
33};
34
35static void __init avengers_lite_init(void)
36{
37 mfp_config(ARRAY_AND_SIZE(avengers_lite_pin_config_V16F));
38
39 /* on-chip devices */
40 pxa168_add_uart(2);
41}
42
43MACHINE_START(AVENGERS_LITE, "PXA168 Avengers lite Development Platform")
44 .phys_io = APB_PHYS_BASE,
45 .boot_params = 0x00000100,
46 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
47 .map_io = pxa_map_io,
48 .init_irq = pxa168_init_irq,
49 .timer = &pxa168_timer,
50 .init_machine = avengers_lite_init,
51MACHINE_END
diff --git a/arch/arm/mach-mmp/common.h b/arch/arm/mach-mmp/common.h
index c33fbbc49417..b4a0ba05a0f4 100644
--- a/arch/arm/mach-mmp/common.h
+++ b/arch/arm/mach-mmp/common.h
@@ -3,11 +3,15 @@
3struct sys_timer; 3struct sys_timer;
4 4
5extern void timer_init(int irq); 5extern void timer_init(int irq);
6extern void mmp2_clear_pmic_int(void);
6 7
7extern struct sys_timer pxa168_timer; 8extern struct sys_timer pxa168_timer;
8extern struct sys_timer pxa910_timer; 9extern struct sys_timer pxa910_timer;
10extern struct sys_timer mmp2_timer;
9extern void __init pxa168_init_irq(void); 11extern void __init pxa168_init_irq(void);
10extern void __init pxa910_init_irq(void); 12extern void __init pxa910_init_irq(void);
13extern void __init mmp2_init_icu(void);
14extern void __init mmp2_init_irq(void);
11 15
12extern void __init icu_init_irq(void); 16extern void __init icu_init_irq(void);
13extern void __init pxa_map_io(void); 17extern void __init pxa_map_io(void);
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c
new file mode 100644
index 000000000000..4ec7709a3462
--- /dev/null
+++ b/arch/arm/mach-mmp/flint.c
@@ -0,0 +1,123 @@
1/*
2 * linux/arch/arm/mach-mmp/flint.c
3 *
4 * Support for the Marvell Flint Development Platform.
5 *
6 * Copyright (C) 2009 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * publishhed by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/smc91x.h>
17#include <linux/io.h>
18#include <linux/gpio.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22#include <mach/addr-map.h>
23#include <mach/mfp-mmp2.h>
24#include <mach/mmp2.h>
25
26#include "common.h"
27
28static unsigned long flint_pin_config[] __initdata = {
29 /* UART1 */
30 GPIO45_UART1_RXD,
31 GPIO46_UART1_TXD,
32
33 /* UART2 */
34 GPIO47_UART2_RXD,
35 GPIO48_UART2_TXD,
36
37 /* SMC */
38 GPIO151_SMC_SCLK,
39 GPIO145_SMC_nCS0,
40 GPIO146_SMC_nCS1,
41 GPIO152_SMC_BE0,
42 GPIO153_SMC_BE1,
43 GPIO154_SMC_IRQ,
44 GPIO113_SMC_RDY,
45
46 /*Ethernet*/
47 GPIO155_GPIO155,
48
49 /* DFI */
50 GPIO168_DFI_D0,
51 GPIO167_DFI_D1,
52 GPIO166_DFI_D2,
53 GPIO165_DFI_D3,
54 GPIO107_DFI_D4,
55 GPIO106_DFI_D5,
56 GPIO105_DFI_D6,
57 GPIO104_DFI_D7,
58 GPIO111_DFI_D8,
59 GPIO164_DFI_D9,
60 GPIO163_DFI_D10,
61 GPIO162_DFI_D11,
62 GPIO161_DFI_D12,
63 GPIO110_DFI_D13,
64 GPIO109_DFI_D14,
65 GPIO108_DFI_D15,
66 GPIO143_ND_nCS0,
67 GPIO144_ND_nCS1,
68 GPIO147_ND_nWE,
69 GPIO148_ND_nRE,
70 GPIO150_ND_ALE,
71 GPIO149_ND_CLE,
72 GPIO112_ND_RDY0,
73 GPIO160_ND_RDY1,
74};
75
76static struct smc91x_platdata flint_smc91x_info = {
77 .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
78};
79
80static struct resource smc91x_resources[] = {
81 [0] = {
82 .start = SMC_CS1_PHYS_BASE + 0x300,
83 .end = SMC_CS1_PHYS_BASE + 0xfffff,
84 .flags = IORESOURCE_MEM,
85 },
86 [1] = {
87 .start = gpio_to_irq(155),
88 .end = gpio_to_irq(155),
89 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
90 }
91};
92
93static struct platform_device smc91x_device = {
94 .name = "smc91x",
95 .id = 0,
96 .dev = {
97 .platform_data = &flint_smc91x_info,
98 },
99 .num_resources = ARRAY_SIZE(smc91x_resources),
100 .resource = smc91x_resources,
101};
102
103static void __init flint_init(void)
104{
105 mfp_config(ARRAY_AND_SIZE(flint_pin_config));
106
107 /* on-chip devices */
108 mmp2_add_uart(1);
109 mmp2_add_uart(2);
110
111 /* off-chip devices */
112 platform_device_register(&smc91x_device);
113}
114
115MACHINE_START(FLINT, "Flint Development Platform")
116 .phys_io = APB_PHYS_BASE,
117 .boot_params = 0x00000100,
118 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
119 .map_io = pxa_map_io,
120 .init_irq = mmp2_init_irq,
121 .timer = &mmp2_timer,
122 .init_machine = flint_init,
123MACHINE_END
diff --git a/arch/arm/mach-mmp/include/mach/cputype.h b/arch/arm/mach-mmp/include/mach/cputype.h
index 25e797b09083..83b18721d933 100644
--- a/arch/arm/mach-mmp/include/mach/cputype.h
+++ b/arch/arm/mach-mmp/include/mach/cputype.h
@@ -8,6 +8,7 @@
8 * 8 *
9 * PXA168 A0 0x41159263 0x56158400 0x00A0A333 9 * PXA168 A0 0x41159263 0x56158400 0x00A0A333
10 * PXA910 Y0 0x41159262 0x56158000 0x00F0C910 10 * PXA910 Y0 0x41159262 0x56158000 0x00F0C910
11 * MMP2 Z0 0x560f5811
11 */ 12 */
12 13
13#ifdef CONFIG_CPU_PXA168 14#ifdef CONFIG_CPU_PXA168
@@ -24,7 +25,15 @@
24# define __cpu_is_pxa910(id) (0) 25# define __cpu_is_pxa910(id) (0)
25#endif 26#endif
26 27
28#ifdef CONFIG_CPU_MMP2
29# define __cpu_is_mmp2(id) \
30 ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x58; })
31#else
32# define __cpu_is_mmp2(id) (0)
33#endif
34
27#define cpu_is_pxa168() ({ __cpu_is_pxa168(read_cpuid_id()); }) 35#define cpu_is_pxa168() ({ __cpu_is_pxa168(read_cpuid_id()); })
28#define cpu_is_pxa910() ({ __cpu_is_pxa910(read_cpuid_id()); }) 36#define cpu_is_pxa910() ({ __cpu_is_pxa910(read_cpuid_id()); })
37#define cpu_is_mmp2() ({ __cpu_is_mmp2(read_cpuid_id()); })
29 38
30#endif /* __ASM_MACH_CPUTYPE_H */ 39#endif /* __ASM_MACH_CPUTYPE_H */
diff --git a/arch/arm/mach-mmp/include/mach/devices.h b/arch/arm/mach-mmp/include/mach/devices.h
index 24585397217e..1fa0a492454a 100644
--- a/arch/arm/mach-mmp/include/mach/devices.h
+++ b/arch/arm/mach-mmp/include/mach/devices.h
@@ -34,4 +34,16 @@ struct pxa_device_desc pxa910_device_##_name __initdata = { \
34 .size = _size, \ 34 .size = _size, \
35 .dma = { _dma }, \ 35 .dma = { _dma }, \
36}; 36};
37
38#define MMP2_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \
39struct pxa_device_desc mmp2_device_##_name __initdata = { \
40 .dev_name = "mmp2-" #_name, \
41 .drv_name = _drv, \
42 .id = _id, \
43 .irq = IRQ_MMP2_##_irq, \
44 .start = _start, \
45 .size = _size, \
46 .dma = { _dma }, \
47}
48
37extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); 49extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
diff --git a/arch/arm/mach-mmp/include/mach/entry-macro.S b/arch/arm/mach-mmp/include/mach/entry-macro.S
index 6d3cd35478b5..c42d9d4e892d 100644
--- a/arch/arm/mach-mmp/include/mach/entry-macro.S
+++ b/arch/arm/mach-mmp/include/mach/entry-macro.S
@@ -15,7 +15,12 @@
15 .endm 15 .endm
16 16
17 .macro get_irqnr_preamble, base, tmp 17 .macro get_irqnr_preamble, base, tmp
18 ldr \base, =ICU_AP_IRQ_SEL_INT_NUM 18 mrc p15, 0, \tmp, c0, c0, 0 @ CPUID
19 and \tmp, \tmp, #0xff00
20 cmp \tmp, #0x5800
21 ldr \base, =ICU_VIRT_BASE
22 addne \base, \base, #0x10c @ PJ1 AP INT SEL register
23 addeq \base, \base, #0x104 @ PJ4 IRQ SEL register
19 .endm 24 .endm
20 25
21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 26 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
diff --git a/arch/arm/mach-mmp/include/mach/irqs.h b/arch/arm/mach-mmp/include/mach/irqs.h
index d68871b0f28c..02701196ea03 100644
--- a/arch/arm/mach-mmp/include/mach/irqs.h
+++ b/arch/arm/mach-mmp/include/mach/irqs.h
@@ -113,10 +113,119 @@
113#define IRQ_PXA910_AP_PMU 60 113#define IRQ_PXA910_AP_PMU 60
114#define IRQ_PXA910_SM_INT 63 /* from PinMux */ 114#define IRQ_PXA910_SM_INT 63 /* from PinMux */
115 115
116#define IRQ_GPIO_START 64 116/*
117#define IRQ_GPIO_NUM 128 117 * Interrupt numbers for MMP2
118 */
119#define IRQ_MMP2_NONE (-1)
120#define IRQ_MMP2_SSP1 0
121#define IRQ_MMP2_SSP2 1
122#define IRQ_MMP2_SSPA1 2
123#define IRQ_MMP2_SSPA2 3
124#define IRQ_MMP2_PMIC_MUX 4 /* PMIC & Charger */
125#define IRQ_MMP2_RTC_MUX 5
126#define IRQ_MMP2_TWSI1 7
127#define IRQ_MMP2_GPU 8
128#define IRQ_MMP2_KEYPAD 9
129#define IRQ_MMP2_ROTARY 10
130#define IRQ_MMP2_TRACKBALL 11
131#define IRQ_MMP2_ONEWIRE 12
132#define IRQ_MMP2_TIMER1 13
133#define IRQ_MMP2_TIMER2 14
134#define IRQ_MMP2_TIMER3 15
135#define IRQ_MMP2_RIPC 16
136#define IRQ_MMP2_TWSI_MUX 17 /* TWSI2 ~ TWSI6 */
137#define IRQ_MMP2_HDMI 19
138#define IRQ_MMP2_SSP3 20
139#define IRQ_MMP2_SSP4 21
140#define IRQ_MMP2_USB_HS1 22
141#define IRQ_MMP2_USB_HS2 23
142#define IRQ_MMP2_UART3 24
143#define IRQ_MMP2_UART1 27
144#define IRQ_MMP2_UART2 28
145#define IRQ_MMP2_MIPI_DSI 29
146#define IRQ_MMP2_CI2 30
147#define IRQ_MMP2_PMU_TIMER1 31
148#define IRQ_MMP2_PMU_TIMER2 32
149#define IRQ_MMP2_PMU_TIMER3 33
150#define IRQ_MMP2_USB_FS 34
151#define IRQ_MMP2_MISC_MUX 35
152#define IRQ_MMP2_WDT1 36
153#define IRQ_MMP2_NAND_DMA 37
154#define IRQ_MMP2_USIM 38
155#define IRQ_MMP2_MMC 39
156#define IRQ_MMP2_WTM 40
157#define IRQ_MMP2_LCD 41
158#define IRQ_MMP2_CI 42
159#define IRQ_MMP2_IRE 43
160#define IRQ_MMP2_USB_OTG 44
161#define IRQ_MMP2_NAND 45
162#define IRQ_MMP2_UART4 46
163#define IRQ_MMP2_DMA_FIQ 47
164#define IRQ_MMP2_DMA_RIQ 48
165#define IRQ_MMP2_GPIO 49
166#define IRQ_MMP2_SSP_MUX 51
167#define IRQ_MMP2_MMC2 52
168#define IRQ_MMP2_MMC3 53
169#define IRQ_MMP2_MMC4 54
170#define IRQ_MMP2_MIPI_HSI 55
171#define IRQ_MMP2_MSP 58
172#define IRQ_MMP2_MIPI_SLIM_DMA 59
173#define IRQ_MMP2_PJ4_FREQ_CHG 60
174#define IRQ_MMP2_MIPI_SLIM 62
175#define IRQ_MMP2_SM 63
176
177#define IRQ_MMP2_MUX_BASE 64
178
179/* secondary interrupt of INT #4 */
180#define IRQ_MMP2_PMIC_BASE (IRQ_MMP2_MUX_BASE)
181#define IRQ_MMP2_CHARGER (IRQ_MMP2_PMIC_BASE + 0)
182#define IRQ_MMP2_PMIC (IRQ_MMP2_PMIC_BASE + 1)
183
184/* secondary interrupt of INT #5 */
185#define IRQ_MMP2_RTC_BASE (IRQ_MMP2_PMIC_BASE + 2)
186#define IRQ_MMP2_RTC_ALARM (IRQ_MMP2_RTC_BASE + 0)
187#define IRQ_MMP2_RTC (IRQ_MMP2_RTC_BASE + 1)
188
189/* secondary interrupt of INT #17 */
190#define IRQ_MMP2_TWSI_BASE (IRQ_MMP2_RTC_BASE + 2)
191#define IRQ_MMP2_TWSI2 (IRQ_MMP2_TWSI_BASE + 0)
192#define IRQ_MMP2_TWSI3 (IRQ_MMP2_TWSI_BASE + 1)
193#define IRQ_MMP2_TWSI4 (IRQ_MMP2_TWSI_BASE + 2)
194#define IRQ_MMP2_TWSI5 (IRQ_MMP2_TWSI_BASE + 3)
195#define IRQ_MMP2_TWSI6 (IRQ_MMP2_TWSI_BASE + 4)
196
197/* secondary interrupt of INT #35 */
198#define IRQ_MMP2_MISC_BASE (IRQ_MMP2_TWSI_BASE + 5)
199#define IRQ_MMP2_PERF (IRQ_MMP2_MISC_BASE + 0)
200#define IRQ_MMP2_L2_PA_ECC (IRQ_MMP2_MISC_BASE + 1)
201#define IRQ_MMP2_L2_ECC (IRQ_MMP2_MISC_BASE + 2)
202#define IRQ_MMP2_L2_UECC (IRQ_MMP2_MISC_BASE + 3)
203#define IRQ_MMP2_DDR (IRQ_MMP2_MISC_BASE + 4)
204#define IRQ_MMP2_FAB0_TIMEOUT (IRQ_MMP2_MISC_BASE + 5)
205#define IRQ_MMP2_FAB1_TIMEOUT (IRQ_MMP2_MISC_BASE + 6)
206#define IRQ_MMP2_FAB2_TIMEOUT (IRQ_MMP2_MISC_BASE + 7)
207#define IRQ_MMP2_THERMAL (IRQ_MMP2_MISC_BASE + 9)
208#define IRQ_MMP2_MAIN_PMU (IRQ_MMP2_MISC_BASE + 10)
209#define IRQ_MMP2_WDT2 (IRQ_MMP2_MISC_BASE + 11)
210#define IRQ_MMP2_CORESIGHT (IRQ_MMP2_MISC_BASE + 12)
211#define IRQ_MMP2_COMMTX (IRQ_MMP2_MISC_BASE + 13)
212#define IRQ_MMP2_COMMRX (IRQ_MMP2_MISC_BASE + 14)
213
214/* secondary interrupt of INT #51 */
215#define IRQ_MMP2_SSP_BASE (IRQ_MMP2_MISC_BASE + 15)
216#define IRQ_MMP2_SSP1_SRDY (IRQ_MMP2_SSP_BASE + 0)
217#define IRQ_MMP2_SSP3_SRDY (IRQ_MMP2_SSP_BASE + 1)
218
219#define IRQ_MMP2_MUX_END (IRQ_MMP2_SSP_BASE + 2)
220
221#define IRQ_GPIO_START 128
222#define IRQ_GPIO_NUM 192
118#define IRQ_GPIO(x) (IRQ_GPIO_START + (x)) 223#define IRQ_GPIO(x) (IRQ_GPIO_START + (x))
119 224
120#define NR_IRQS (IRQ_GPIO_START + IRQ_GPIO_NUM) 225/* Board IRQ - 64 by default, increase if not enough */
226#define IRQ_BOARD_START (IRQ_GPIO_START + IRQ_GPIO_NUM)
227#define IRQ_BOARD_END (IRQ_BOARD_START + 64)
228
229#define NR_IRQS (IRQ_BOARD_END)
121 230
122#endif /* __ASM_MACH_IRQS_H */ 231#endif /* __ASM_MACH_IRQS_H */
diff --git a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h
new file mode 100644
index 000000000000..9f9f8143e272
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h
@@ -0,0 +1,240 @@
1#ifndef __ASM_MACH_MFP_MMP2_H
2#define __ASM_MACH_MFP_MMP2_H
3
4#include <mach/mfp.h>
5
6#define MFP_DRIVE_VERY_SLOW (0x0 << 13)
7#define MFP_DRIVE_SLOW (0x2 << 13)
8#define MFP_DRIVE_MEDIUM (0x4 << 13)
9#define MFP_DRIVE_FAST (0x8 << 13)
10
11/* GPIO */
12
13/* DFI */
14#define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0)
15#define GPIO109_DFI_D14 MFP_CFG(GPIO109, AF0)
16#define GPIO110_DFI_D13 MFP_CFG(GPIO110, AF0)
17#define GPIO161_DFI_D12 MFP_CFG(GPIO161, AF0)
18#define GPIO162_DFI_D11 MFP_CFG(GPIO162, AF0)
19#define GPIO163_DFI_D10 MFP_CFG(GPIO163, AF0)
20#define GPIO164_DFI_D9 MFP_CFG(GPIO164, AF0)
21#define GPIO111_DFI_D8 MFP_CFG(GPIO111, AF0)
22#define GPIO104_DFI_D7 MFP_CFG(GPIO104, AF0)
23#define GPIO105_DFI_D6 MFP_CFG(GPIO105, AF0)
24#define GPIO106_DFI_D5 MFP_CFG(GPIO106, AF0)
25#define GPIO107_DFI_D4 MFP_CFG(GPIO107, AF0)
26#define GPIO165_DFI_D3 MFP_CFG(GPIO165, AF0)
27#define GPIO166_DFI_D2 MFP_CFG(GPIO166, AF0)
28#define GPIO167_DFI_D1 MFP_CFG(GPIO167, AF0)
29#define GPIO168_DFI_D0 MFP_CFG(GPIO168, AF0)
30#define GPIO143_ND_nCS0 MFP_CFG(GPIO143, AF0)
31#define GPIO144_ND_nCS1 MFP_CFG(GPIO144, AF0)
32#define GPIO147_ND_nWE MFP_CFG(GPIO147, AF0)
33#define GPIO148_ND_nRE MFP_CFG(GPIO148, AF0)
34#define GPIO150_ND_ALE MFP_CFG(GPIO150, AF0)
35#define GPIO149_ND_CLE MFP_CFG(GPIO149, AF0)
36#define GPIO112_ND_RDY0 MFP_CFG(GPIO112, AF0)
37#define GPIO160_ND_RDY1 MFP_CFG(GPIO160, AF0)
38
39/* Static Memory Controller */
40#define GPIO145_SMC_nCS0 MFP_CFG(GPIO145, AF0)
41#define GPIO146_SMC_nCS1 MFP_CFG(GPIO146, AF0)
42#define GPIO152_SMC_BE0 MFP_CFG(GPIO152, AF0)
43#define GPIO153_SMC_BE1 MFP_CFG(GPIO153, AF0)
44#define GPIO154_SMC_IRQ MFP_CFG(GPIO154, AF0)
45#define GPIO113_SMC_RDY MFP_CFG(GPIO113, AF0)
46#define GPIO151_SMC_SCLK MFP_CFG(GPIO151, AF0)
47
48/* Ethernet */
49#define GPIO155_SM_ADVMUX MFP_CFG(GPIO155, AF2)
50#define GPIO155_GPIO155 MFP_CFG(GPIO155, AF1)
51
52/* UART1 */
53#define GPIO45_UART1_RXD MFP_CFG(GPIO45, AF1)
54#define GPIO46_UART1_TXD MFP_CFG(GPIO46, AF1)
55#define GPIO29_UART1_RXD MFP_CFG(GPIO29, AF1)
56#define GPIO30_UART1_TXD MFP_CFG(GPIO30, AF1)
57#define GPIO31_UART1_CTS MFP_CFG(GPIO31, AF1)
58#define GPIO32_UART1_RTS MFP_CFG(GPIO32, AF1)
59
60/* UART2 */
61#define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF1)
62#define GPIO48_UART2_TXD MFP_CFG(GPIO48, AF1)
63#define GPIO49_UART2_CTS MFP_CFG(GPIO49, AF1)
64#define GPIO50_UART2_RTS MFP_CFG(GPIO50, AF1)
65
66/* UART3 */
67#define GPIO51_UART3_RXD MFP_CFG(GPIO51, AF1)
68#define GPIO52_UART3_TXD MFP_CFG(GPIO52, AF1)
69#define GPIO53_UART3_CTS MFP_CFG(GPIO53, AF1)
70#define GPIO54_UART3_RTS MFP_CFG(GPIO54, AF1)
71
72/* MMC1 */
73#define GPIO124_MMC1_DAT7 MFP_CFG_DRV(GPIO124, AF1, FAST)
74#define GPIO125_MMC1_DAT6 MFP_CFG_DRV(GPIO125, AF1, FAST)
75#define GPIO129_MMC1_DAT5 MFP_CFG_DRV(GPIO129, AF1, FAST)
76#define GPIO130_MMC1_DAT4 MFP_CFG_DRV(GPIO130, AF1, FAST)
77#define GPIO131_MMC1_DAT3 MFP_CFG_DRV(GPIO131, AF1, FAST)
78#define GPIO132_MMC1_DAT2 MFP_CFG_DRV(GPIO132, AF1, FAST)
79#define GPIO133_MMC1_DAT1 MFP_CFG_DRV(GPIO133, AF1, FAST)
80#define GPIO134_MMC1_DAT0 MFP_CFG_DRV(GPIO134, AF1, FAST)
81#define GPIO136_MMC1_CMD MFP_CFG_DRV(GPIO136, AF1, FAST)
82#define GPIO139_MMC1_CLK MFP_CFG_DRV(GPIO139, AF1, FAST)
83#define GPIO140_MMC1_CD MFP_CFG_DRV(GPIO140, AF1, FAST)
84#define GPIO141_MMC1_WP MFP_CFG_DRV(GPIO141, AF1, FAST)
85
86/*MMC2*/
87#define GPIO37_MMC2_DAT3 MFP_CFG_DRV(GPIO37, AF1, FAST)
88#define GPIO38_MMC2_DAT2 MFP_CFG_DRV(GPIO38, AF1, FAST)
89#define GPIO39_MMC2_DAT1 MFP_CFG_DRV(GPIO39, AF1, FAST)
90#define GPIO40_MMC2_DAT0 MFP_CFG_DRV(GPIO40, AF1, FAST)
91#define GPIO41_MMC2_CMD MFP_CFG_DRV(GPIO41, AF1, FAST)
92#define GPIO42_MMC2_CLK MFP_CFG_DRV(GPIO42, AF1, FAST)
93
94/*MMC3*/
95#define GPIO165_MMC3_DAT7 MFP_CFG_DRV(GPIO165, AF2, FAST)
96#define GPIO162_MMC3_DAT6 MFP_CFG_DRV(GPIO162, AF2, FAST)
97#define GPIO166_MMC3_DAT5 MFP_CFG_DRV(GPIO166, AF2, FAST)
98#define GPIO163_MMC3_DAT4 MFP_CFG_DRV(GPIO163, AF2, FAST)
99#define GPIO167_MMC3_DAT3 MFP_CFG_DRV(GPIO167, AF2, FAST)
100#define GPIO164_MMC3_DAT2 MFP_CFG_DRV(GPIO164, AF2, FAST)
101#define GPIO168_MMC3_DAT1 MFP_CFG_DRV(GPIO168, AF2, FAST)
102#define GPIO111_MMC3_DAT0 MFP_CFG_DRV(GPIO111, AF2, FAST)
103#define GPIO112_MMC3_CMD MFP_CFG_DRV(GPIO112, AF2, FAST)
104#define GPIO151_MMC3_CLK MFP_CFG_DRV(GPIO151, AF2, FAST)
105
106/* LCD */
107#define GPIO74_LCD_FCLK MFP_CFG_DRV(GPIO74, AF1, FAST)
108#define GPIO75_LCD_LCLK MFP_CFG_DRV(GPIO75, AF1, FAST)
109#define GPIO76_LCD_PCLK MFP_CFG_DRV(GPIO76, AF1, FAST)
110#define GPIO77_LCD_DENA MFP_CFG_DRV(GPIO77, AF1, FAST)
111#define GPIO78_LCD_DD0 MFP_CFG_DRV(GPIO78, AF1, FAST)
112#define GPIO79_LCD_DD1 MFP_CFG_DRV(GPIO79, AF1, FAST)
113#define GPIO80_LCD_DD2 MFP_CFG_DRV(GPIO80, AF1, FAST)
114#define GPIO81_LCD_DD3 MFP_CFG_DRV(GPIO81, AF1, FAST)
115#define GPIO82_LCD_DD4 MFP_CFG_DRV(GPIO82, AF1, FAST)
116#define GPIO83_LCD_DD5 MFP_CFG_DRV(GPIO83, AF1, FAST)
117#define GPIO84_LCD_DD6 MFP_CFG_DRV(GPIO84, AF1, FAST)
118#define GPIO85_LCD_DD7 MFP_CFG_DRV(GPIO85, AF1, FAST)
119#define GPIO86_LCD_DD8 MFP_CFG_DRV(GPIO86, AF1, FAST)
120#define GPIO87_LCD_DD9 MFP_CFG_DRV(GPIO87, AF1, FAST)
121#define GPIO88_LCD_DD10 MFP_CFG_DRV(GPIO88, AF1, FAST)
122#define GPIO89_LCD_DD11 MFP_CFG_DRV(GPIO89, AF1, FAST)
123#define GPIO90_LCD_DD12 MFP_CFG_DRV(GPIO90, AF1, FAST)
124#define GPIO91_LCD_DD13 MFP_CFG_DRV(GPIO91, AF1, FAST)
125#define GPIO92_LCD_DD14 MFP_CFG_DRV(GPIO92, AF1, FAST)
126#define GPIO93_LCD_DD15 MFP_CFG_DRV(GPIO93, AF1, FAST)
127#define GPIO94_LCD_DD16 MFP_CFG_DRV(GPIO94, AF1, FAST)
128#define GPIO95_LCD_DD17 MFP_CFG_DRV(GPIO95, AF1, FAST)
129#define GPIO96_LCD_DD18 MFP_CFG_DRV(GPIO96, AF1, FAST)
130#define GPIO97_LCD_DD19 MFP_CFG_DRV(GPIO97, AF1, FAST)
131#define GPIO98_LCD_DD20 MFP_CFG_DRV(GPIO98, AF1, FAST)
132#define GPIO99_LCD_DD21 MFP_CFG_DRV(GPIO99, AF1, FAST)
133#define GPIO100_LCD_DD22 MFP_CFG_DRV(GPIO100, AF1, FAST)
134#define GPIO101_LCD_DD23 MFP_CFG_DRV(GPIO101, AF1, FAST)
135#define GPIO94_SPI_DCLK MFP_CFG_DRV(GPIO94, AF3, FAST)
136#define GPIO95_SPI_CS0 MFP_CFG_DRV(GPIO95, AF3, FAST)
137#define GPIO96_SPI_DIN MFP_CFG_DRV(GPIO96, AF3, FAST)
138#define GPIO97_SPI_DOUT MFP_CFG_DRV(GPIO97, AF3, FAST)
139#define GPIO98_LCD_RST MFP_CFG_DRV(GPIO98, AF0, FAST)
140
141#define GPIO114_MN_CLK_OUT MFP_CFG_DRV(GPIO114, AF1, FAST)
142
143/*LCD TV path*/
144#define GPIO124_LCD_DD24 MFP_CFG_DRV(GPIO124, AF2, FAST)
145#define GPIO125_LCD_DD25 MFP_CFG_DRV(GPIO125, AF2, FAST)
146#define GPIO126_LCD_DD33 MFP_CFG_DRV(GPIO126, AF2, FAST)
147#define GPIO127_LCD_DD26 MFP_CFG_DRV(GPIO127, AF2, FAST)
148#define GPIO128_LCD_DD27 MFP_CFG_DRV(GPIO128, AF2, FAST)
149#define GPIO129_LCD_DD28 MFP_CFG_DRV(GPIO129, AF2, FAST)
150#define GPIO130_LCD_DD29 MFP_CFG_DRV(GPIO130, AF2, FAST)
151#define GPIO135_LCD_DD30 MFP_CFG_DRV(GPIO135, AF2, FAST)
152#define GPIO137_LCD_DD31 MFP_CFG_DRV(GPIO137, AF2, FAST)
153#define GPIO138_LCD_DD32 MFP_CFG_DRV(GPIO138, AF2, FAST)
154#define GPIO140_LCD_DD34 MFP_CFG_DRV(GPIO140, AF2, FAST)
155#define GPIO141_LCD_DD35 MFP_CFG_DRV(GPIO141, AF2, FAST)
156
157/* I2C */
158#define GPIO43_TWSI2_SCL MFP_CFG_DRV(GPIO43, AF1, SLOW)
159#define GPIO44_TWSI2_SDA MFP_CFG_DRV(GPIO44, AF1, SLOW)
160#define GPIO71_TWSI3_SCL MFP_CFG_DRV(GPIO71, AF1, SLOW)
161#define GPIO72_TWSI3_SDA MFP_CFG_DRV(GPIO72, AF1, SLOW)
162#define GPIO99_TWSI5_SCL MFP_CFG_DRV(GPIO99, AF4, SLOW)
163#define GPIO100_TWSI5_SDA MFP_CFG_DRV(GPIO100, AF4, SLOW)
164#define GPIO97_TWSI6_SCL MFP_CFG_DRV(GPIO97, AF2, SLOW)
165#define GPIO98_TWSI6_SDA MFP_CFG_DRV(GPIO98, AF2, SLOW)
166
167/* SSPA1 */
168#define GPIO24_I2S_SYSCLK MFP_CFG(GPIO24, AF1)
169#define GPIO25_I2S_BITCLK MFP_CFG(GPIO25, AF1)
170#define GPIO26_I2S_SYNC MFP_CFG(GPIO26, AF1)
171#define GPIO27_I2S_DATA_OUT MFP_CFG(GPIO27, AF1)
172#define GPIO28_I2S_SDATA_IN MFP_CFG(GPIO28, AF1)
173#define GPIO114_I2S_MCLK MFP_CFG(GPIO114, AF1)
174
175/* SSPA2 */
176#define GPIO33_SSPA2_CLK MFP_CFG(GPIO33, AF1)
177#define GPIO34_SSPA2_FRM MFP_CFG(GPIO34, AF1)
178#define GPIO35_SSPA2_TXD MFP_CFG(GPIO35, AF1)
179#define GPIO36_SSPA2_RXD MFP_CFG(GPIO36, AF1)
180
181/* Keypad */
182#define GPIO00_KP_MKIN0 MFP_CFG(GPIO0, AF1)
183#define GPIO01_KP_MKOUT0 MFP_CFG(GPIO1, AF1)
184#define GPIO02_KP_MKIN1 MFP_CFG(GPIO2, AF1)
185#define GPIO03_KP_MKOUT1 MFP_CFG(GPIO3, AF1)
186#define GPIO04_KP_MKIN2 MFP_CFG(GPIO4, AF1)
187#define GPIO05_KP_MKOUT2 MFP_CFG(GPIO5, AF1)
188#define GPIO06_KP_MKIN3 MFP_CFG(GPIO6, AF1)
189#define GPIO07_KP_MKOUT3 MFP_CFG(GPIO7, AF1)
190#define GPIO08_KP_MKIN4 MFP_CFG(GPIO8, AF1)
191#define GPIO09_KP_MKOUT4 MFP_CFG(GPIO9, AF1)
192#define GPIO10_KP_MKIN5 MFP_CFG(GPIO10, AF1)
193#define GPIO11_KP_MKOUT5 MFP_CFG(GPIO11, AF1)
194#define GPIO12_KP_MKIN6 MFP_CFG(GPIO12, AF1)
195#define GPIO13_KP_MKOUT6 MFP_CFG(GPIO13, AF1)
196#define GPIO14_KP_MKIN7 MFP_CFG(GPIO14, AF1)
197#define GPIO15_KP_MKOUT7 MFP_CFG(GPIO15, AF1)
198#define GPIO16_KP_DKIN0 MFP_CFG(GPIO16, AF1)
199#define GPIO17_KP_DKIN1 MFP_CFG(GPIO17, AF1)
200#define GPIO18_KP_DKIN2 MFP_CFG(GPIO18, AF1)
201#define GPIO19_KP_DKIN3 MFP_CFG(GPIO19, AF1)
202#define GPIO20_KP_DKIN4 MFP_CFG(GPIO20, AF1)
203#define GPIO21_KP_DKIN5 MFP_CFG(GPIO21, AF1)
204#define GPIO22_KP_DKIN6 MFP_CFG(GPIO22, AF1)
205#define GPIO23_KP_DKIN7 MFP_CFG(GPIO23, AF1)
206
207/* CAMERA */
208#define GPIO59_CCIC_IN7 MFP_CFG_DRV(GPIO59, AF1, FAST)
209#define GPIO60_CCIC_IN6 MFP_CFG_DRV(GPIO60, AF1, FAST)
210#define GPIO61_CCIC_IN5 MFP_CFG_DRV(GPIO61, AF1, FAST)
211#define GPIO62_CCIC_IN4 MFP_CFG_DRV(GPIO62, AF1, FAST)
212#define GPIO63_CCIC_IN3 MFP_CFG_DRV(GPIO63, AF1, FAST)
213#define GPIO64_CCIC_IN2 MFP_CFG_DRV(GPIO64, AF1, FAST)
214#define GPIO65_CCIC_IN1 MFP_CFG_DRV(GPIO65, AF1, FAST)
215#define GPIO66_CCIC_IN0 MFP_CFG_DRV(GPIO66, AF1, FAST)
216#define GPIO67_CAM_HSYNC MFP_CFG_DRV(GPIO67, AF1, FAST)
217#define GPIO68_CAM_VSYNC MFP_CFG_DRV(GPIO68, AF1, FAST)
218#define GPIO69_CAM_MCLK MFP_CFG_DRV(GPIO69, AF1, FAST)
219#define GPIO70_CAM_PCLK MFP_CFG_DRV(GPIO70, AF1, FAST)
220
221/* Wifi */
222#define GPIO45_GPIO45 MFP_CFG(GPIO45, AF0)
223#define GPIO46_GPIO46 MFP_CFG(GPIO46, AF0)
224#define GPIO21_GPIO21 MFP_CFG(GPIO21, AF0)
225#define GPIO22_GPIO22 MFP_CFG(GPIO22, AF0)
226#define GPIO55_GPIO55 MFP_CFG(GPIO55, AF0)
227#define GPIO56_GPIO56 MFP_CFG(GPIO56, AF0)
228#define GPIO57_GPIO57 MFP_CFG(GPIO57, AF0)
229#define GPIO58_GPIO58 MFP_CFG(GPIO58, AF0)
230
231/* Codec*/
232#define GPIO23_GPIO23 MFP_CFG(GPIO23, AF0)
233
234#define GPIO101_GPIO101 MFP_CFG(GPIO101, AF0)
235
236/* PMIC */
237#define PMIC_PMIC_INT MFP_CFG(PMIC_INT, AF0)
238
239#endif /* __ASM_MACH_MFP_MMP2_H */
240
diff --git a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
index 3b216bf41e7f..ded43c455ec3 100644
--- a/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/mfp-pxa168.h
@@ -193,7 +193,9 @@
193#define GPIO32_CF_nCD1 MFP_CFG(GPIO32, AF3) 193#define GPIO32_CF_nCD1 MFP_CFG(GPIO32, AF3)
194#define GPIO33_CF_nCD2 MFP_CFG(GPIO33, AF3) 194#define GPIO33_CF_nCD2 MFP_CFG(GPIO33, AF3)
195 195
196/* UART1 */ 196/* UART */
197#define GPIO88_UART2_TXD MFP_CFG(GPIO88, AF2)
198#define GPIO89_UART2_RXD MFP_CFG(GPIO89, AF2)
197#define GPIO107_UART1_TXD MFP_CFG_DRV(GPIO107, AF1, FAST) 199#define GPIO107_UART1_TXD MFP_CFG_DRV(GPIO107, AF1, FAST)
198#define GPIO107_UART1_RXD MFP_CFG_DRV(GPIO107, AF2, FAST) 200#define GPIO107_UART1_RXD MFP_CFG_DRV(GPIO107, AF2, FAST)
199#define GPIO108_UART1_RXD MFP_CFG_DRV(GPIO108, AF1, FAST) 201#define GPIO108_UART1_RXD MFP_CFG_DRV(GPIO108, AF1, FAST)
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h
new file mode 100644
index 000000000000..459f3be9cfb2
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/mmp2.h
@@ -0,0 +1,60 @@
1#ifndef __ASM_MACH_MMP2_H
2#define __ASM_MACH_MMP2_H
3
4#include <linux/i2c.h>
5#include <mach/devices.h>
6#include <plat/i2c.h>
7
8extern struct pxa_device_desc mmp2_device_uart1;
9extern struct pxa_device_desc mmp2_device_uart2;
10extern struct pxa_device_desc mmp2_device_uart3;
11extern struct pxa_device_desc mmp2_device_uart4;
12extern struct pxa_device_desc mmp2_device_twsi1;
13extern struct pxa_device_desc mmp2_device_twsi2;
14extern struct pxa_device_desc mmp2_device_twsi3;
15extern struct pxa_device_desc mmp2_device_twsi4;
16extern struct pxa_device_desc mmp2_device_twsi5;
17extern struct pxa_device_desc mmp2_device_twsi6;
18
19static inline int mmp2_add_uart(int id)
20{
21 struct pxa_device_desc *d = NULL;
22
23 switch (id) {
24 case 1: d = &mmp2_device_uart1; break;
25 case 2: d = &mmp2_device_uart2; break;
26 case 3: d = &mmp2_device_uart3; break;
27 case 4: d = &mmp2_device_uart4; break;
28 default:
29 return -EINVAL;
30 }
31
32 return pxa_register_device(d, NULL, 0);
33}
34
35static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data,
36 struct i2c_board_info *info, unsigned size)
37{
38 struct pxa_device_desc *d = NULL;
39 int ret;
40
41 switch (id) {
42 case 0: d = &mmp2_device_twsi1; break;
43 case 1: d = &mmp2_device_twsi2; break;
44 case 2: d = &mmp2_device_twsi3; break;
45 case 3: d = &mmp2_device_twsi4; break;
46 case 4: d = &mmp2_device_twsi5; break;
47 case 5: d = &mmp2_device_twsi6; break;
48 default:
49 return -EINVAL;
50 }
51
52 ret = i2c_register_board_info(id, info, size);
53 if (ret)
54 return ret;
55
56 return pxa_register_device(d, data, sizeof(*data));
57}
58
59#endif /* __ASM_MACH_MMP2_H */
60
diff --git a/arch/arm/mach-mmp/include/mach/regs-apbc.h b/arch/arm/mach-mmp/include/mach/regs-apbc.h
index 98ccbee4bd0c..712af03fd1af 100644
--- a/arch/arm/mach-mmp/include/mach/regs-apbc.h
+++ b/arch/arm/mach-mmp/include/mach/regs-apbc.h
@@ -69,6 +69,47 @@
69#define APBC_PXA910_ASFAR APBC_REG(0x050) 69#define APBC_PXA910_ASFAR APBC_REG(0x050)
70#define APBC_PXA910_ASSAR APBC_REG(0x054) 70#define APBC_PXA910_ASSAR APBC_REG(0x054)
71 71
72/*
73 * APB Clock register offsets for MMP2
74 */
75#define APBC_MMP2_RTC APBC_REG(0x000)
76#define APBC_MMP2_TWSI1 APBC_REG(0x004)
77#define APBC_MMP2_TWSI2 APBC_REG(0x008)
78#define APBC_MMP2_TWSI3 APBC_REG(0x00c)
79#define APBC_MMP2_TWSI4 APBC_REG(0x010)
80#define APBC_MMP2_ONEWIRE APBC_REG(0x014)
81#define APBC_MMP2_KPC APBC_REG(0x018)
82#define APBC_MMP2_TB_ROTARY APBC_REG(0x01c)
83#define APBC_MMP2_SW_JTAG APBC_REG(0x020)
84#define APBC_MMP2_TIMERS APBC_REG(0x024)
85#define APBC_MMP2_UART1 APBC_REG(0x02c)
86#define APBC_MMP2_UART2 APBC_REG(0x030)
87#define APBC_MMP2_UART3 APBC_REG(0x034)
88#define APBC_MMP2_GPIO APBC_REG(0x038)
89#define APBC_MMP2_PWM0 APBC_REG(0x03c)
90#define APBC_MMP2_PWM1 APBC_REG(0x040)
91#define APBC_MMP2_PWM2 APBC_REG(0x044)
92#define APBC_MMP2_PWM3 APBC_REG(0x048)
93#define APBC_MMP2_SSP0 APBC_REG(0x04c)
94#define APBC_MMP2_SSP1 APBC_REG(0x050)
95#define APBC_MMP2_SSP2 APBC_REG(0x054)
96#define APBC_MMP2_SSP3 APBC_REG(0x058)
97#define APBC_MMP2_SSP4 APBC_REG(0x05c)
98#define APBC_MMP2_SSP5 APBC_REG(0x060)
99#define APBC_MMP2_AIB APBC_REG(0x064)
100#define APBC_MMP2_ASFAR APBC_REG(0x068)
101#define APBC_MMP2_ASSAR APBC_REG(0x06c)
102#define APBC_MMP2_USIM APBC_REG(0x070)
103#define APBC_MMP2_MPMU APBC_REG(0x074)
104#define APBC_MMP2_IPC APBC_REG(0x078)
105#define APBC_MMP2_TWSI5 APBC_REG(0x07c)
106#define APBC_MMP2_TWSI6 APBC_REG(0x080)
107#define APBC_MMP2_TWSI_INTSTS APBC_REG(0x084)
108#define APBC_MMP2_UART4 APBC_REG(0x088)
109#define APBC_MMP2_RIPC APBC_REG(0x08c)
110#define APBC_MMP2_THSENS1 APBC_REG(0x090) /* Thermal Sensor */
111#define APBC_MMP2_THSENS_INTSTS APBC_REG(0x0a4)
112
72/* Common APB clock register bit definitions */ 113/* Common APB clock register bit definitions */
73#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */ 114#define APBC_APBCLK (1 << 0) /* APB Bus Clock Enable */
74#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */ 115#define APBC_FNCLK (1 << 1) /* Functional Clock Enable */
diff --git a/arch/arm/mach-mmp/include/mach/regs-icu.h b/arch/arm/mach-mmp/include/mach/regs-icu.h
index e5f08723e0cc..f882d91894be 100644
--- a/arch/arm/mach-mmp/include/mach/regs-icu.h
+++ b/arch/arm/mach-mmp/include/mach/regs-icu.h
@@ -17,10 +17,12 @@
17#define ICU_REG(x) (ICU_VIRT_BASE + (x)) 17#define ICU_REG(x) (ICU_VIRT_BASE + (x))
18 18
19#define ICU_INT_CONF(n) ICU_REG((n) << 2) 19#define ICU_INT_CONF(n) ICU_REG((n) << 2)
20#define ICU_INT_CONF_MASK (0xf)
21
22/************ PXA168/PXA910 (MMP) *********************/
20#define ICU_INT_CONF_AP_INT (1 << 6) 23#define ICU_INT_CONF_AP_INT (1 << 6)
21#define ICU_INT_CONF_CP_INT (1 << 5) 24#define ICU_INT_CONF_CP_INT (1 << 5)
22#define ICU_INT_CONF_IRQ (1 << 4) 25#define ICU_INT_CONF_IRQ (1 << 4)
23#define ICU_INT_CONF_MASK (0xf)
24 26
25#define ICU_AP_FIQ_SEL_INT_NUM ICU_REG(0x108) /* AP FIQ Selected Interrupt */ 27#define ICU_AP_FIQ_SEL_INT_NUM ICU_REG(0x108) /* AP FIQ Selected Interrupt */
26#define ICU_AP_IRQ_SEL_INT_NUM ICU_REG(0x10C) /* AP IRQ Selected Interrupt */ 28#define ICU_AP_IRQ_SEL_INT_NUM ICU_REG(0x10C) /* AP IRQ Selected Interrupt */
@@ -28,4 +30,42 @@
28#define ICU_INT_STATUS_0 ICU_REG(0x128) /* Interrupt Stuats 0 */ 30#define ICU_INT_STATUS_0 ICU_REG(0x128) /* Interrupt Stuats 0 */
29#define ICU_INT_STATUS_1 ICU_REG(0x12C) /* Interrupt Status 1 */ 31#define ICU_INT_STATUS_1 ICU_REG(0x12C) /* Interrupt Status 1 */
30 32
33/************************** MMP2 ***********************/
34
35/*
36 * IRQ0/FIQ0 is routed to SP IRQ/FIQ.
37 * IRQ1 is routed to PJ4 IRQ, and IRQ2 is routes to PJ4 FIQ.
38 */
39#define ICU_INT_ROUTE_SP_IRQ (1 << 4)
40#define ICU_INT_ROUTE_PJ4_IRQ (1 << 5)
41#define ICU_INT_ROUTE_PJ4_FIQ (1 << 6)
42
43#define MMP2_ICU_PJ4_IRQ_STATUS0 ICU_REG(0x138)
44#define MMP2_ICU_PJ4_IRQ_STATUS1 ICU_REG(0x13c)
45#define MMP2_ICU_PJ4_FIQ_STATUS0 ICU_REG(0x140)
46#define MMP2_ICU_PJ4_FIQ_STATUS1 ICU_REG(0x144)
47
48#define MMP2_ICU_INT4_STATUS ICU_REG(0x150)
49#define MMP2_ICU_INT5_STATUS ICU_REG(0x154)
50#define MMP2_ICU_INT17_STATUS ICU_REG(0x158)
51#define MMP2_ICU_INT35_STATUS ICU_REG(0x15c)
52#define MMP2_ICU_INT51_STATUS ICU_REG(0x160)
53
54#define MMP2_ICU_INT4_MASK ICU_REG(0x168)
55#define MMP2_ICU_INT5_MASK ICU_REG(0x16C)
56#define MMP2_ICU_INT17_MASK ICU_REG(0x170)
57#define MMP2_ICU_INT35_MASK ICU_REG(0x174)
58#define MMP2_ICU_INT51_MASK ICU_REG(0x178)
59
60#define MMP2_ICU_SP_IRQ_SEL ICU_REG(0x100)
61#define MMP2_ICU_PJ4_IRQ_SEL ICU_REG(0x104)
62#define MMP2_ICU_PJ4_FIQ_SEL ICU_REG(0x108)
63
64#define MMP2_ICU_INVERT ICU_REG(0x164)
65
66#define MMP2_ICU_INV_PMIC (1 << 0)
67#define MMP2_ICU_INV_PERF (1 << 1)
68#define MMP2_ICU_INV_COMMTX (1 << 2)
69#define MMP2_ICU_INV_COMMRX (1 << 3)
70
31#endif /* __ASM_MACH_ICU_H */ 71#endif /* __ASM_MACH_ICU_H */
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index c93d5fa5865c..a7dcc5307216 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -8,15 +8,16 @@
8 8
9#include <linux/serial_reg.h> 9#include <linux/serial_reg.h>
10#include <mach/addr-map.h> 10#include <mach/addr-map.h>
11#include <asm/mach-types.h>
11 12
12#define UART1_BASE (APB_PHYS_BASE + 0x36000) 13#define UART1_BASE (APB_PHYS_BASE + 0x36000)
13#define UART2_BASE (APB_PHYS_BASE + 0x17000) 14#define UART2_BASE (APB_PHYS_BASE + 0x17000)
14#define UART3_BASE (APB_PHYS_BASE + 0x18000) 15#define UART3_BASE (APB_PHYS_BASE + 0x18000)
15 16
17static volatile unsigned long *UART = (unsigned long *)UART2_BASE;
18
16static inline void putc(char c) 19static inline void putc(char c)
17{ 20{
18 volatile unsigned long *UART = (unsigned long *)UART2_BASE;
19
20 /* UART enabled? */ 21 /* UART enabled? */
21 if (!(UART[UART_IER] & UART_IER_UUE)) 22 if (!(UART[UART_IER] & UART_IER_UUE))
22 return; 23 return;
@@ -34,8 +35,14 @@ static inline void flush(void)
34{ 35{
35} 36}
36 37
38static inline void arch_decomp_setup(void)
39{
40 if (machine_is_avengers_lite())
41 UART = (unsigned long *)UART3_BASE;
42}
43
37/* 44/*
38 * nothing to do 45 * nothing to do
39 */ 46 */
40#define arch_decomp_setup() 47
41#define arch_decomp_wdog() 48#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mmp/irq-mmp2.c b/arch/arm/mach-mmp/irq-mmp2.c
new file mode 100644
index 000000000000..cb18221c0af3
--- /dev/null
+++ b/arch/arm/mach-mmp/irq-mmp2.c
@@ -0,0 +1,154 @@
1/*
2 * linux/arch/arm/mach-mmp/irq-mmp2.c
3 *
4 * Generic IRQ handling, GPIO IRQ demultiplexing, etc.
5 *
6 * Author: Haojian Zhuang <haojian.zhuang@marvell.com>
7 * Copyright: Marvell International Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/init.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17
18#include <mach/regs-icu.h>
19
20#include "common.h"
21
22static void icu_mask_irq(unsigned int irq)
23{
24 uint32_t r = __raw_readl(ICU_INT_CONF(irq));
25
26 r &= ~ICU_INT_ROUTE_PJ4_IRQ;
27 __raw_writel(r, ICU_INT_CONF(irq));
28}
29
30static void icu_unmask_irq(unsigned int irq)
31{
32 uint32_t r = __raw_readl(ICU_INT_CONF(irq));
33
34 r |= ICU_INT_ROUTE_PJ4_IRQ;
35 __raw_writel(r, ICU_INT_CONF(irq));
36}
37
38static struct irq_chip icu_irq_chip = {
39 .name = "icu_irq",
40 .mask = icu_mask_irq,
41 .mask_ack = icu_mask_irq,
42 .unmask = icu_unmask_irq,
43};
44
45static void pmic_irq_ack(unsigned int irq)
46{
47 if (irq == IRQ_MMP2_PMIC)
48 mmp2_clear_pmic_int();
49}
50
51#define SECOND_IRQ_MASK(_name_, irq_base, prefix) \
52static void _name_##_mask_irq(unsigned int irq) \
53{ \
54 uint32_t r; \
55 r = __raw_readl(prefix##_MASK) | (1 << (irq - irq_base)); \
56 __raw_writel(r, prefix##_MASK); \
57}
58
59#define SECOND_IRQ_UNMASK(_name_, irq_base, prefix) \
60static void _name_##_unmask_irq(unsigned int irq) \
61{ \
62 uint32_t r; \
63 r = __raw_readl(prefix##_MASK) & ~(1 << (irq - irq_base)); \
64 __raw_writel(r, prefix##_MASK); \
65}
66
67#define SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \
68static void _name_##_irq_demux(unsigned int irq, struct irq_desc *desc) \
69{ \
70 unsigned long status, mask, n; \
71 mask = __raw_readl(prefix##_MASK); \
72 while (1) { \
73 status = __raw_readl(prefix##_STATUS) & ~mask; \
74 if (status == 0) \
75 break; \
76 n = find_first_bit(&status, BITS_PER_LONG); \
77 while (n < BITS_PER_LONG) { \
78 generic_handle_irq(irq_base + n); \
79 n = find_next_bit(&status, BITS_PER_LONG, n+1); \
80 } \
81 } \
82}
83
84#define SECOND_IRQ_CHIP(_name_, irq_base, prefix) \
85SECOND_IRQ_MASK(_name_, irq_base, prefix) \
86SECOND_IRQ_UNMASK(_name_, irq_base, prefix) \
87SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \
88static struct irq_chip _name_##_irq_chip = { \
89 .name = #_name_, \
90 .mask = _name_##_mask_irq, \
91 .unmask = _name_##_unmask_irq, \
92}
93
94SECOND_IRQ_CHIP(pmic, IRQ_MMP2_PMIC_BASE, MMP2_ICU_INT4);
95SECOND_IRQ_CHIP(rtc, IRQ_MMP2_RTC_BASE, MMP2_ICU_INT5);
96SECOND_IRQ_CHIP(twsi, IRQ_MMP2_TWSI_BASE, MMP2_ICU_INT17);
97SECOND_IRQ_CHIP(misc, IRQ_MMP2_MISC_BASE, MMP2_ICU_INT35);
98SECOND_IRQ_CHIP(ssp, IRQ_MMP2_SSP_BASE, MMP2_ICU_INT51);
99
100static void init_mux_irq(struct irq_chip *chip, int start, int num)
101{
102 int irq;
103
104 for (irq = start; num > 0; irq++, num--) {
105 /* mask and clear the IRQ */
106 chip->mask(irq);
107 if (chip->ack)
108 chip->ack(irq);
109
110 set_irq_chip(irq, chip);
111 set_irq_flags(irq, IRQF_VALID);
112 set_irq_handler(irq, handle_level_irq);
113 }
114}
115
116void __init mmp2_init_icu(void)
117{
118 int irq;
119
120 for (irq = 0; irq < IRQ_MMP2_MUX_BASE; irq++) {
121 icu_mask_irq(irq);
122 set_irq_chip(irq, &icu_irq_chip);
123 set_irq_flags(irq, IRQF_VALID);
124
125 switch (irq) {
126 case IRQ_MMP2_PMIC_MUX:
127 case IRQ_MMP2_RTC_MUX:
128 case IRQ_MMP2_TWSI_MUX:
129 case IRQ_MMP2_MISC_MUX:
130 case IRQ_MMP2_SSP_MUX:
131 break;
132 default:
133 set_irq_handler(irq, handle_level_irq);
134 break;
135 }
136 }
137
138 /* NOTE: IRQ_MMP2_PMIC requires the PMIC MFPR register
139 * to be written to clear the interrupt
140 */
141 pmic_irq_chip.ack = pmic_irq_ack;
142
143 init_mux_irq(&pmic_irq_chip, IRQ_MMP2_PMIC_BASE, 2);
144 init_mux_irq(&rtc_irq_chip, IRQ_MMP2_RTC_BASE, 2);
145 init_mux_irq(&twsi_irq_chip, IRQ_MMP2_TWSI_BASE, 5);
146 init_mux_irq(&misc_irq_chip, IRQ_MMP2_MISC_BASE, 15);
147 init_mux_irq(&ssp_irq_chip, IRQ_MMP2_SSP_BASE, 2);
148
149 set_irq_chained_handler(IRQ_MMP2_PMIC_MUX, pmic_irq_demux);
150 set_irq_chained_handler(IRQ_MMP2_RTC_MUX, rtc_irq_demux);
151 set_irq_chained_handler(IRQ_MMP2_TWSI_MUX, twsi_irq_demux);
152 set_irq_chained_handler(IRQ_MMP2_MISC_MUX, misc_irq_demux);
153 set_irq_chained_handler(IRQ_MMP2_SSP_MUX, ssp_irq_demux);
154}
diff --git a/arch/arm/mach-mmp/irq.c b/arch/arm/mach-mmp/irq-pxa168.c
index 52ff2f065eba..52ff2f065eba 100644
--- a/arch/arm/mach-mmp/irq.c
+++ b/arch/arm/mach-mmp/irq-pxa168.c
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c
new file mode 100644
index 000000000000..cfd4d66ef800
--- /dev/null
+++ b/arch/arm/mach-mmp/jasper.c
@@ -0,0 +1,80 @@
1/*
2 * linux/arch/arm/mach-mmp/jasper.c
3 *
4 * Support for the Marvell Jasper Development Platform.
5 *
6 * Copyright (C) 2009-2010 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * publishhed by the Free Software Foundation.
11 */
12
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/io.h>
17#include <linux/gpio.h>
18
19#include <asm/mach-types.h>
20#include <asm/mach/arch.h>
21#include <mach/addr-map.h>
22#include <mach/mfp-mmp2.h>
23#include <mach/mmp2.h>
24
25#include "common.h"
26
27static unsigned long jasper_pin_config[] __initdata = {
28 /* UART1 */
29 GPIO29_UART1_RXD,
30 GPIO30_UART1_TXD,
31
32 /* UART3 */
33 GPIO51_UART3_RXD,
34 GPIO52_UART3_TXD,
35
36 /* DFI */
37 GPIO168_DFI_D0,
38 GPIO167_DFI_D1,
39 GPIO166_DFI_D2,
40 GPIO165_DFI_D3,
41 GPIO107_DFI_D4,
42 GPIO106_DFI_D5,
43 GPIO105_DFI_D6,
44 GPIO104_DFI_D7,
45 GPIO111_DFI_D8,
46 GPIO164_DFI_D9,
47 GPIO163_DFI_D10,
48 GPIO162_DFI_D11,
49 GPIO161_DFI_D12,
50 GPIO110_DFI_D13,
51 GPIO109_DFI_D14,
52 GPIO108_DFI_D15,
53 GPIO143_ND_nCS0,
54 GPIO144_ND_nCS1,
55 GPIO147_ND_nWE,
56 GPIO148_ND_nRE,
57 GPIO150_ND_ALE,
58 GPIO149_ND_CLE,
59 GPIO112_ND_RDY0,
60 GPIO160_ND_RDY1,
61};
62
63static void __init jasper_init(void)
64{
65 mfp_config(ARRAY_AND_SIZE(jasper_pin_config));
66
67 /* on-chip devices */
68 mmp2_add_uart(1);
69 mmp2_add_uart(3);
70}
71
72MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
73 .phys_io = APB_PHYS_BASE,
74 .boot_params = 0x00000100,
75 .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
76 .map_io = pxa_map_io,
77 .init_irq = mmp2_init_irq,
78 .timer = &mmp2_timer,
79 .init_machine = jasper_init,
80MACHINE_END
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c
new file mode 100644
index 000000000000..72eb9daeea99
--- /dev/null
+++ b/arch/arm/mach-mmp/mmp2.c
@@ -0,0 +1,123 @@
1/*
2 * linux/arch/arm/mach-mmp/mmp2.c
3 *
4 * code name MMP2
5 *
6 * Copyright (C) 2009 Marvell International Ltd.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/io.h>
17
18#include <mach/addr-map.h>
19#include <mach/regs-apbc.h>
20#include <mach/regs-apmu.h>
21#include <mach/cputype.h>
22#include <mach/irqs.h>
23#include <mach/mfp.h>
24#include <mach/gpio.h>
25#include <mach/devices.h>
26
27#include "common.h"
28#include "clock.h"
29
30#define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000)
31
32#define APMASK(i) (GPIO_REGS_VIRT + BANK_OFF(i) + 0x9c)
33
34static struct mfp_addr_map mmp2_addr_map[] __initdata = {
35 MFP_ADDR(PMIC_INT, 0x2c4),
36
37 MFP_ADDR_END,
38};
39
40void mmp2_clear_pmic_int(void)
41{
42 unsigned long mfpr_pmic, data;
43
44 mfpr_pmic = APB_VIRT_BASE + 0x1e000 + 0x2c4;
45 data = __raw_readl(mfpr_pmic);
46 __raw_writel(data | (1 << 6), mfpr_pmic);
47 __raw_writel(data, mfpr_pmic);
48}
49
50static void __init mmp2_init_gpio(void)
51{
52 int i;
53
54 /* enable GPIO clock */
55 __raw_writel(APBC_APBCLK | APBC_FNCLK, APBC_MMP2_GPIO);
56
57 /* unmask GPIO edge detection for all 6 banks -- APMASKx */
58 for (i = 0; i < 6; i++)
59 __raw_writel(0xffffffff, APMASK(i));
60
61 pxa_init_gpio(IRQ_MMP2_GPIO, 0, 167, NULL);
62}
63
64void __init mmp2_init_irq(void)
65{
66 mmp2_init_icu();
67 mmp2_init_gpio();
68}
69
70/* APB peripheral clocks */
71static APBC_CLK(uart1, MMP2_UART1, 1, 26000000);
72static APBC_CLK(uart2, MMP2_UART2, 1, 26000000);
73static APBC_CLK(uart3, MMP2_UART3, 1, 26000000);
74static APBC_CLK(uart4, MMP2_UART4, 1, 26000000);
75static APBC_CLK(twsi1, MMP2_TWSI1, 0, 26000000);
76static APBC_CLK(twsi2, MMP2_TWSI2, 0, 26000000);
77static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000);
78static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000);
79static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000);
80static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000);
81static APBC_CLK(rtc, MMP2_RTC, 0, 32768);
82
83static APMU_CLK(nand, NAND, 0xbf, 100000000);
84
85static struct clk_lookup mmp2_clkregs[] = {
86 INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
87 INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
88 INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
89 INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL),
90 INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL),
91 INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL),
92 INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL),
93 INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL),
94 INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL),
95 INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL),
96 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
97};
98
99static int __init mmp2_init(void)
100{
101 if (cpu_is_mmp2()) {
102 mfp_init_base(MFPR_VIRT_BASE);
103 mfp_init_addr(mmp2_addr_map);
104 clks_register(ARRAY_AND_SIZE(mmp2_clkregs));
105 }
106
107 return 0;
108}
109postcore_initcall(mmp2_init);
110
111/* on-chip devices */
112MMP2_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4030000, 0x30, 4, 5);
113MMP2_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4017000, 0x30, 20, 21);
114MMP2_DEVICE(uart3, "pxa2xx-uart", 2, UART3, 0xd4018000, 0x30, 22, 23);
115MMP2_DEVICE(uart4, "pxa2xx-uart", 3, UART4, 0xd4016000, 0x30, 18, 19);
116MMP2_DEVICE(twsi1, "pxa2xx-i2c", 0, TWSI1, 0xd4011000, 0x70);
117MMP2_DEVICE(twsi2, "pxa2xx-i2c", 1, TWSI2, 0xd4031000, 0x70);
118MMP2_DEVICE(twsi3, "pxa2xx-i2c", 2, TWSI3, 0xd4032000, 0x70);
119MMP2_DEVICE(twsi4, "pxa2xx-i2c", 3, TWSI4, 0xd4033000, 0x70);
120MMP2_DEVICE(twsi5, "pxa2xx-i2c", 4, TWSI5, 0xd4033800, 0x70);
121MMP2_DEVICE(twsi6, "pxa2xx-i2c", 5, TWSI6, 0xd4034000, 0x70);
122MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29);
123
diff --git a/arch/arm/mach-mmp/time.c b/arch/arm/mach-mmp/time.c
index a8400bb891e7..cf75694e9687 100644
--- a/arch/arm/mach-mmp/time.c
+++ b/arch/arm/mach-mmp/time.c
@@ -30,7 +30,10 @@
30 30
31#include <mach/addr-map.h> 31#include <mach/addr-map.h>
32#include <mach/regs-timers.h> 32#include <mach/regs-timers.h>
33#include <mach/regs-apbc.h>
33#include <mach/irqs.h> 34#include <mach/irqs.h>
35#include <mach/cputype.h>
36#include <asm/mach/time.h>
34 37
35#include "clock.h" 38#include "clock.h"
36 39
@@ -158,7 +161,7 @@ static void __init timer_config(void)
158 161
159 __raw_writel(cer & ~0x1, TIMERS_VIRT_BASE + TMR_CER); /* disable */ 162 __raw_writel(cer & ~0x1, TIMERS_VIRT_BASE + TMR_CER); /* disable */
160 163
161 ccr &= TMR_CCR_CS_0(0x3); 164 ccr &= (cpu_is_mmp2()) ? TMR_CCR_CS_0(0) : TMR_CCR_CS_0(3);
162 __raw_writel(ccr, TIMERS_VIRT_BASE + TMR_CCR); 165 __raw_writel(ccr, TIMERS_VIRT_BASE + TMR_CCR);
163 166
164 /* free-running mode */ 167 /* free-running mode */
@@ -197,3 +200,24 @@ void __init timer_init(int irq)
197 clocksource_register(&cksrc); 200 clocksource_register(&cksrc);
198 clockevents_register_device(&ckevt); 201 clockevents_register_device(&ckevt);
199} 202}
203
204static void __init mmp2_timer_init(void)
205{
206 unsigned long clk_rst;
207
208 __raw_writel(APBC_APBCLK | APBC_RST, APBC_MMP2_TIMERS);
209
210 /*
211 * enable bus/functional clock, enable 6.5MHz (divider 4),
212 * release reset
213 */
214 clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1);
215 __raw_writel(clk_rst, APBC_MMP2_TIMERS);
216
217 timer_init(IRQ_MMP2_TIMER1);
218}
219
220struct sys_timer mmp2_timer = {
221 .init = mmp2_timer_init,
222};
223
diff --git a/arch/arm/mach-mv78xx0/Kconfig b/arch/arm/mach-mv78xx0/Kconfig
index 6fbe68fe4412..f2d309d0619e 100644
--- a/arch/arm/mach-mv78xx0/Kconfig
+++ b/arch/arm/mach-mv78xx0/Kconfig
@@ -14,6 +14,12 @@ config MACH_RD78X00_MASA
14 Say 'Y' here if you want your kernel to support the 14 Say 'Y' here if you want your kernel to support the
15 Marvell RD-78x00-mASA Reference Design. 15 Marvell RD-78x00-mASA Reference Design.
16 16
17config MACH_TERASTATION_WXL
18 bool "Buffalo WLX (Terastation Duo) NAS"
19 help
20 Say 'Y' here if you want your kernel to support the
21 Buffalo WXL Nas.
22
17endmenu 23endmenu
18 24
19endif 25endif
diff --git a/arch/arm/mach-mv78xx0/Makefile b/arch/arm/mach-mv78xx0/Makefile
index da628b7f3bb6..67a13f9bfe64 100644
--- a/arch/arm/mach-mv78xx0/Makefile
+++ b/arch/arm/mach-mv78xx0/Makefile
@@ -1,3 +1,4 @@
1obj-y += common.o addr-map.o irq.o pcie.o 1obj-y += common.o addr-map.o mpp.o irq.o pcie.o
2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o 2obj-$(CONFIG_MACH_DB78X00_BP) += db78x00-bp-setup.o
3obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o 3obj-$(CONFIG_MACH_RD78X00_MASA) += rd78x00-masa-setup.o
4obj-$(CONFIG_MACH_TERASTATION_WXL) += buffalo-wxl-setup.o
diff --git a/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
new file mode 100644
index 000000000000..61e5e583603b
--- /dev/null
+++ b/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
@@ -0,0 +1,155 @@
1/*
2 * arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
3 *
4 * Buffalo WXL (Terastation Duo) Setup routines
5 *
6 * sebastien requiem <sebastien@requiem.fr>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/ata_platform.h>
17#include <linux/mv643xx_eth.h>
18#include <linux/ethtool.h>
19#include <linux/i2c.h>
20#include <mach/mv78xx0.h>
21#include <asm/mach-types.h>
22#include <asm/mach/arch.h>
23#include "common.h"
24#include "mpp.h"
25
26
27/* This arch has 2 Giga Ethernet */
28
29static struct mv643xx_eth_platform_data db78x00_ge00_data = {
30 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
31};
32
33static struct mv643xx_eth_platform_data db78x00_ge01_data = {
34 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
35};
36
37
38/* 2 SATA controller supporting HotPlug */
39
40static struct mv_sata_platform_data db78x00_sata_data = {
41 .n_ports = 2,
42};
43
44static struct i2c_board_info __initdata db78x00_i2c_rtc = {
45 I2C_BOARD_INFO("ds1338", 0x68),
46};
47
48
49static unsigned int wxl_mpp_config[] __initdata = {
50 MPP0_GE1_TXCLK,
51 MPP1_GE1_TXCTL,
52 MPP2_GE1_RXCTL,
53 MPP3_GE1_RXCLK,
54 MPP4_GE1_TXD0,
55 MPP5_GE1_TXD1,
56 MPP6_GE1_TXD2,
57 MPP7_GE1_TXD3,
58 MPP8_GE1_RXD0,
59 MPP9_GE1_RXD1,
60 MPP10_GE1_RXD2,
61 MPP11_GE1_RXD3,
62 MPP12_GPIO,
63 MPP13_SYSRST_OUTn,
64 MPP14_SATA1_ACTn,
65 MPP15_SATA0_ACTn,
66 MPP16_GPIO,
67 MPP17_GPIO,
68 MPP18_GPIO,
69 MPP19_GPIO,
70 MPP20_GPIO,
71 MPP21_GPIO,
72 MPP22_GPIO,
73 MPP23_GPIO,
74 MPP24_UA2_TXD,
75 MPP25_UA2_RXD,
76 MPP26_UA2_CTSn,
77 MPP27_UA2_RTSn,
78 MPP28_GPIO,
79 MPP29_SYSRST_OUTn,
80 MPP30_GPIO,
81 MPP31_GPIO,
82 MPP32_GPIO,
83 MPP33_GPIO,
84 MPP34_GPIO,
85 MPP35_GPIO,
86 MPP36_GPIO,
87 MPP37_GPIO,
88 MPP38_GPIO,
89 MPP39_GPIO,
90 MPP40_UNUSED,
91 MPP41_UNUSED,
92 MPP42_UNUSED,
93 MPP43_UNUSED,
94 MPP44_UNUSED,
95 MPP45_UNUSED,
96 MPP46_UNUSED,
97 MPP47_UNUSED,
98 MPP48_SATA1_ACTn,
99 MPP49_SATA0_ACTn,
100 0
101};
102
103
104static void __init wxl_init(void)
105{
106 /*
107 * Basic MV78xx0 setup. Needs to be called early.
108 */
109 mv78xx0_init();
110 mv78xx0_mpp_conf(wxl_mpp_config);
111
112 /*
113 * Partition on-chip peripherals between the two CPU cores.
114 */
115 mv78xx0_ehci0_init();
116 mv78xx0_ehci1_init();
117 mv78xx0_ehci2_init();
118 mv78xx0_ge00_init(&db78x00_ge00_data);
119 mv78xx0_ge01_init(&db78x00_ge01_data);
120 mv78xx0_sata_init(&db78x00_sata_data);
121 mv78xx0_uart0_init();
122 mv78xx0_uart1_init();
123 mv78xx0_uart2_init();
124 mv78xx0_uart3_init();
125 mv78xx0_i2c_init();
126 i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
127}
128
129static int __init wxl_pci_init(void)
130{
131 if (machine_is_terastation_wxl()) {
132 /*
133 * Assign the x16 PCIe slot on the board to CPU core
134 * #0, and let CPU core #1 have the four x1 slots.
135 */
136 if (mv78xx0_core_index() == 0)
137 mv78xx0_pcie_init(0, 1);
138 else
139 mv78xx0_pcie_init(1, 0);
140 }
141
142 return 0;
143}
144subsys_initcall(wxl_pci_init);
145
146MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
147 /* Maintainer: Sebastien Requiem <sebastien@requiem.fr> */
148 .phys_io = MV78XX0_REGS_PHYS_BASE,
149 .io_pg_offst = ((MV78XX0_REGS_VIRT_BASE) >> 18) & 0xfffc,
150 .boot_params = 0x00000100,
151 .init_machine = wxl_init,
152 .map_io = mv78xx0_map_io,
153 .init_irq = mv78xx0_init_irq,
154 .timer = &mv78xx0_timer,
155MACHINE_END
diff --git a/arch/arm/mach-mv78xx0/mpp.c b/arch/arm/mach-mv78xx0/mpp.c
new file mode 100644
index 000000000000..354ac514eb89
--- /dev/null
+++ b/arch/arm/mach-mv78xx0/mpp.c
@@ -0,0 +1,96 @@
1/*
2 * arch/arm/mach-mv78x00/mpp.c
3 *
4 * MPP functions for Marvell MV78x00 SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/mbus.h>
14#include <linux/io.h>
15#include <asm/gpio.h>
16#include <mach/hardware.h>
17#include "common.h"
18#include "mpp.h"
19
20static unsigned int __init mv78xx0_variant(void)
21{
22 u32 dev, rev;
23
24 mv78xx0_pcie_id(&dev, &rev);
25
26 if (dev == MV78100_DEV_ID && rev >= MV78100_REV_A0)
27 return MPP_78100_A0_MASK;
28
29 printk(KERN_ERR "MPP setup: unknown mv78x00 variant "
30 "(dev %#x rev %#x)\n", dev, rev);
31 return 0;
32}
33
34#define MPP_CTRL(i) (DEV_BUS_VIRT_BASE + (i) * 4)
35#define MPP_NR_REGS (1 + MPP_MAX/8)
36
37void __init mv78xx0_mpp_conf(unsigned int *mpp_list)
38{
39 u32 mpp_ctrl[MPP_NR_REGS];
40 unsigned int variant_mask;
41 int i;
42
43 variant_mask = mv78xx0_variant();
44 if (!variant_mask)
45 return;
46
47 /* Initialize gpiolib. */
48 orion_gpio_init();
49
50 printk(KERN_DEBUG "initial MPP regs:");
51 for (i = 0; i < MPP_NR_REGS; i++) {
52 mpp_ctrl[i] = readl(MPP_CTRL(i));
53 printk(" %08x", mpp_ctrl[i]);
54 }
55 printk("\n");
56
57 while (*mpp_list) {
58 unsigned int num = MPP_NUM(*mpp_list);
59 unsigned int sel = MPP_SEL(*mpp_list);
60 int shift, gpio_mode;
61
62 if (num > MPP_MAX) {
63 printk(KERN_ERR "mv78xx0_mpp_conf: invalid MPP "
64 "number (%u)\n", num);
65 continue;
66 }
67 if (!(*mpp_list & variant_mask)) {
68 printk(KERN_WARNING
69 "mv78xx0_mpp_conf: requested MPP%u config "
70 "unavailable on this hardware\n", num);
71 continue;
72 }
73
74 shift = (num & 7) << 2;
75 mpp_ctrl[num / 8] &= ~(0xf << shift);
76 mpp_ctrl[num / 8] |= sel << shift;
77
78 gpio_mode = 0;
79 if (*mpp_list & MPP_INPUT_MASK)
80 gpio_mode |= GPIO_INPUT_OK;
81 if (*mpp_list & MPP_OUTPUT_MASK)
82 gpio_mode |= GPIO_OUTPUT_OK;
83 if (sel != 0)
84 gpio_mode = 0;
85 orion_gpio_set_valid(num, gpio_mode);
86
87 mpp_list++;
88 }
89
90 printk(KERN_DEBUG " final MPP regs:");
91 for (i = 0; i < MPP_NR_REGS; i++) {
92 writel(mpp_ctrl[i], MPP_CTRL(i));
93 printk(" %08x", mpp_ctrl[i]);
94 }
95 printk("\n");
96}
diff --git a/arch/arm/mach-mv78xx0/mpp.h b/arch/arm/mach-mv78xx0/mpp.h
new file mode 100644
index 000000000000..80840b781eaa
--- /dev/null
+++ b/arch/arm/mach-mv78xx0/mpp.h
@@ -0,0 +1,347 @@
1/*
2 * linux/arch/arm/mach-mv78xx0/mpp.h -- Multi Purpose Pins
3 *
4 *
5 * sebastien requiem <sebastien@requiem.fr>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#ifndef __MV78X00_MPP_H
13#define __MV78X00_MPP_H
14
15#define MPP(_num, _sel, _in, _out, _78100_A0) (\
16 /* MPP number */ ((_num) & 0xff) | \
17 /* MPP select value */ (((_sel) & 0xf) << 8) | \
18 /* may be input signal */ ((!!(_in)) << 12) | \
19 /* may be output signal */ ((!!(_out)) << 13) | \
20 /* available on A0 */ ((!!(_78100_A0)) << 14))
21
22#define MPP_NUM(x) ((x) & 0xff)
23#define MPP_SEL(x) (((x) >> 8) & 0xf)
24
25 /* num sel i o 78100_A0 */
26
27#define MPP_INPUT_MASK MPP(0, 0x0, 1, 0, 0)
28#define MPP_OUTPUT_MASK MPP(0, 0x0, 0, 1, 0)
29
30#define MPP_78100_A0_MASK MPP(0, 0x0, 0, 0, 1)
31
32#define MPP0_GPIO MPP(0, 0x0, 1, 1, 1)
33#define MPP0_GE0_COL MPP(0, 0x1, 1, 0, 1)
34#define MPP0_GE1_TXCLK MPP(0, 0x2, 0, 1, 1)
35#define MPP0_UNUSED MPP(0, 0x3, 0, 0, 1)
36
37#define MPP1_GPIO MPP(1, 0x0, 1, 1, 1)
38#define MPP1_GE0_RXERR MPP(1, 0x1, 1, 0, 1)
39#define MPP1_GE1_TXCTL MPP(1, 0x2, 0, 1, 1)
40#define MPP1_UNUSED MPP(1, 0x3, 0, 0, 1)
41
42#define MPP2_GPIO MPP(2, 0x0, 1, 1, 1)
43#define MPP2_GE0_CRS MPP(2, 0x1, 1, 0, 1)
44#define MPP2_GE1_RXCTL MPP(2, 0x2, 1, 0, 1)
45#define MPP2_UNUSED MPP(2, 0x3, 0, 0, 1)
46
47#define MPP3_GPIO MPP(3, 0x0, 1, 1, 1)
48#define MPP3_GE0_TXERR MPP(3, 0x1, 0, 1, 1)
49#define MPP3_GE1_RXCLK MPP(3, 0x2, 1, 0, 1)
50#define MPP3_UNUSED MPP(3, 0x3, 0, 0, 1)
51
52#define MPP4_GPIO MPP(4, 0x0, 1, 1, 1)
53#define MPP4_GE0_TXD4 MPP(4, 0x1, 0, 1, 1)
54#define MPP4_GE1_TXD0 MPP(4, 0x2, 0, 1, 1)
55#define MPP4_UNUSED MPP(4, 0x3, 0, 0, 1)
56
57#define MPP5_GPIO MPP(5, 0x0, 1, 1, 1)
58#define MPP5_GE0_TXD5 MPP(5, 0x1, 0, 1, 1)
59#define MPP5_GE1_TXD1 MPP(5, 0x2, 0, 1, 1)
60#define MPP5_UNUSED MPP(5, 0x3, 0, 0, 1)
61
62#define MPP6_GPIO MPP(6, 0x0, 1, 1, 1)
63#define MPP6_GE0_TXD6 MPP(6, 0x1, 0, 1, 1)
64#define MPP6_GE1_TXD2 MPP(6, 0x2, 0, 1, 1)
65#define MPP6_UNUSED MPP(6, 0x3, 0, 0, 1)
66
67#define MPP7_GPIO MPP(7, 0x0, 1, 1, 1)
68#define MPP7_GE0_TXD7 MPP(7, 0x1, 0, 1, 1)
69#define MPP7_GE1_TXD3 MPP(7, 0x2, 0, 1, 1)
70#define MPP7_UNUSED MPP(7, 0x3, 0, 0, 1)
71
72#define MPP8_GPIO MPP(8, 0x0, 1, 1, 1)
73#define MPP8_GE0_RXD4 MPP(8, 0x1, 1, 0, 1)
74#define MPP8_GE1_RXD0 MPP(8, 0x2, 1, 0, 1)
75#define MPP8_UNUSED MPP(8, 0x3, 0, 0, 1)
76
77#define MPP9_GPIO MPP(9, 0x0, 1, 1, 1)
78#define MPP9_GE0_RXD5 MPP(9, 0x1, 1, 0, 1)
79#define MPP9_GE1_RXD1 MPP(9, 0x2, 1, 0, 1)
80#define MPP9_UNUSED MPP(9, 0x3, 0, 0, 1)
81
82#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1)
83#define MPP10_GE0_RXD6 MPP(10, 0x1, 1, 0, 1)
84#define MPP10_GE1_RXD2 MPP(10, 0x2, 1, 0, 1)
85#define MPP10_UNUSED MPP(10, 0x3, 0, 0, 1)
86
87#define MPP11_GPIO MPP(11, 0x0, 1, 1, 1)
88#define MPP11_GE0_RXD7 MPP(11, 0x1, 1, 0, 1)
89#define MPP11_GE1_RXD3 MPP(11, 0x2, 1, 0, 1)
90#define MPP11_UNUSED MPP(11, 0x3, 0, 0, 1)
91
92#define MPP12_GPIO MPP(12, 0x0, 1, 1, 1)
93#define MPP12_M_BB MPP(12, 0x3, 1, 0, 1)
94#define MPP12_UA0_CTSn MPP(12, 0x4, 1, 0, 1)
95#define MPP12_NAND_FLASH_REn0 MPP(12, 0x5, 0, 1, 1)
96#define MPP12_TDM0_SCSn MPP(12, 0X6, 0, 1, 1)
97#define MPP12_UNUSED MPP(12, 0x1, 0, 0, 1)
98
99#define MPP13_GPIO MPP(13, 0x0, 1, 1, 1)
100#define MPP13_SYSRST_OUTn MPP(13, 0x3, 0, 1, 1)
101#define MPP13_UA0_RTSn MPP(13, 0x4, 0, 1, 1)
102#define MPP13_NAN_FLASH_WEn0 MPP(13, 0x5, 0, 1, 1)
103#define MPP13_TDM_SCLK MPP(13, 0x6, 0, 1, 1)
104#define MPP13_UNUSED MPP(13, 0x1, 0, 0, 1)
105
106#define MPP14_GPIO MPP(14, 0x0, 1, 1, 1)
107#define MPP14_SATA1_ACTn MPP(14, 0x3, 0, 1, 1)
108#define MPP14_UA1_CTSn MPP(14, 0x4, 1, 0, 1)
109#define MPP14_NAND_FLASH_REn1 MPP(14, 0x5, 0, 1, 1)
110#define MPP14_TDM_SMOSI MPP(14, 0x6, 0, 1, 1)
111#define MPP14_UNUSED MPP(14, 0x1, 0, 0, 1)
112
113#define MPP15_GPIO MPP(15, 0x0, 1, 1, 1)
114#define MPP15_SATA0_ACTn MPP(15, 0x3, 0, 1, 1)
115#define MPP15_UA1_RTSn MPP(15, 0x4, 0, 1, 1)
116#define MPP15_NAND_FLASH_WEn1 MPP(15, 0x5, 0, 1, 1)
117#define MPP15_TDM_SMISO MPP(15, 0x6, 1, 0, 1)
118#define MPP15_UNUSED MPP(15, 0x1, 0, 0, 1)
119
120#define MPP16_GPIO MPP(16, 0x0, 1, 1, 1)
121#define MPP16_SATA1_PRESENTn MPP(16, 0x3, 0, 1, 1)
122#define MPP16_UA2_TXD MPP(16, 0x4, 0, 1, 1)
123#define MPP16_NAND_FLASH_REn3 MPP(16, 0x5, 0, 1, 1)
124#define MPP16_TDM_INTn MPP(16, 0x6, 1, 0, 1)
125#define MPP16_UNUSED MPP(16, 0x1, 0, 0, 1)
126
127
128#define MPP17_GPIO MPP(17, 0x0, 1, 1, 1)
129#define MPP17_SATA0_PRESENTn MPP(17, 0x3, 0, 1, 1)
130#define MPP17_UA2_RXD MPP(17, 0x4, 1, 0, 1)
131#define MPP17_NAND_FLASH_WEn3 MPP(17, 0x5, 0, 1, 1)
132#define MPP17_TDM_RSTn MPP(17, 0x6, 0, 1, 1)
133#define MPP17_UNUSED MPP(17, 0x1, 0, 0, 1)
134
135
136#define MPP18_GPIO MPP(18, 0x0, 1, 1, 1)
137#define MPP18_UA0_CTSn MPP(18, 0x4, 1, 0, 1)
138#define MPP18_BOOT_FLASH_REn MPP(18, 0x5, 0, 1, 1)
139#define MPP18_UNUSED MPP(18, 0x1, 0, 0, 1)
140
141
142
143#define MPP19_GPIO MPP(19, 0x0, 1, 1, 1)
144#define MPP19_UA0_CTSn MPP(19, 0x4, 0, 1, 1)
145#define MPP19_BOOT_FLASH_WEn MPP(19, 0x5, 0, 1, 1)
146#define MPP19_UNUSED MPP(19, 0x1, 0, 0, 1)
147
148
149#define MPP20_GPIO MPP(20, 0x0, 1, 1, 1)
150#define MPP20_UA1_CTSs MPP(20, 0x4, 1, 0, 1)
151#define MPP20_TDM_PCLK MPP(20, 0x6, 1, 1, 0)
152#define MPP20_UNUSED MPP(20, 0x1, 0, 0, 1)
153
154
155
156#define MPP21_GPIO MPP(21, 0x0, 1, 1, 1)
157#define MPP21_UA1_CTSs MPP(21, 0x4, 0, 1, 1)
158#define MPP21_TDM_FSYNC MPP(21, 0x6, 1, 1, 0)
159#define MPP21_UNUSED MPP(21, 0x1, 0, 0, 1)
160
161
162
163#define MPP22_GPIO MPP(22, 0x0, 1, 1, 1)
164#define MPP22_UA3_TDX MPP(22, 0x4, 0, 1, 1)
165#define MPP22_NAND_FLASH_REn2 MPP(22, 0x5, 0, 1, 1)
166#define MPP22_TDM_DRX MPP(22, 0x6, 1, 0, 1)
167#define MPP22_UNUSED MPP(22, 0x1, 0, 0, 1)
168
169
170
171#define MPP23_GPIO MPP(23, 0x0, 1, 1, 1)
172#define MPP23_UA3_RDX MPP(23, 0x4, 1, 0, 1)
173#define MPP23_NAND_FLASH_WEn2 MPP(23, 0x5, 0, 1, 1)
174#define MPP23_TDM_DTX MPP(23, 0x6, 0, 1, 1)
175#define MPP23_UNUSED MPP(23, 0x1, 0, 0, 1)
176
177
178#define MPP24_GPIO MPP(24, 0x0, 1, 1, 1)
179#define MPP24_UA2_TXD MPP(24, 0x4, 0, 1, 1)
180#define MPP24_TDM_INTn MPP(24, 0x6, 1, 0, 1)
181#define MPP24_UNUSED MPP(24, 0x1, 0, 0, 1)
182
183
184#define MPP25_GPIO MPP(25, 0x0, 1, 1, 1)
185#define MPP25_UA2_RXD MPP(25, 0x4, 1, 0, 1)
186#define MPP25_TDM_RSTn MPP(25, 0x6, 0, 1, 1)
187#define MPP25_UNUSED MPP(25, 0x1, 0, 0, 1)
188
189
190#define MPP26_GPIO MPP(26, 0x0, 1, 1, 1)
191#define MPP26_UA2_CTSn MPP(26, 0x4, 1, 0, 1)
192#define MPP26_TDM_PCLK MPP(26, 0x6, 1, 1, 1)
193#define MPP26_UNUSED MPP(26, 0x1, 0, 0, 1)
194
195
196#define MPP27_GPIO MPP(27, 0x0, 1, 1, 1)
197#define MPP27_UA2_RTSn MPP(27, 0x4, 0, 1, 1)
198#define MPP27_TDM_FSYNC MPP(27, 0x6, 1, 1, 1)
199#define MPP27_UNUSED MPP(27, 0x1, 0, 0, 1)
200
201
202#define MPP28_GPIO MPP(28, 0x0, 1, 1, 1)
203#define MPP28_UA3_TXD MPP(28, 0x4, 0, 1, 1)
204#define MPP28_TDM_DRX MPP(28, 0x6, 1, 0, 1)
205#define MPP28_UNUSED MPP(28, 0x1, 0, 0, 1)
206
207#define MPP29_GPIO MPP(29, 0x0, 1, 1, 1)
208#define MPP29_UA3_RXD MPP(29, 0x4, 1, 0, 1)
209#define MPP29_SYSRST_OUTn MPP(29, 0x5, 0, 1, 1)
210#define MPP29_TDM_DTX MPP(29, 0x6, 0, 1, 1)
211#define MPP29_UNUSED MPP(29, 0x1, 0, 0, 1)
212
213#define MPP30_GPIO MPP(30, 0x0, 1, 1, 1)
214#define MPP30_UA3_CTSn MPP(30, 0x4, 1, 0, 1)
215#define MPP30_UNUSED MPP(30, 0x1, 0, 0, 1)
216
217#define MPP31_GPIO MPP(31, 0x0, 1, 1, 1)
218#define MPP31_UA3_RTSn MPP(31, 0x4, 0, 1, 1)
219#define MPP31_TDM1_SCSn MPP(31, 0x6, 0, 1, 1)
220#define MPP31_UNUSED MPP(31, 0x1, 0, 0, 1)
221
222
223#define MPP32_GPIO MPP(32, 0x1, 1, 1, 1)
224#define MPP32_UA3_TDX MPP(32, 0x4, 0, 1, 1)
225#define MPP32_SYSRST_OUTn MPP(32, 0x5, 0, 1, 1)
226#define MPP32_TDM0_RXQ MPP(32, 0x6, 0, 1, 1)
227#define MPP32_UNUSED MPP(32, 0x3, 0, 0, 1)
228
229
230#define MPP33_GPIO MPP(33, 0x1, 1, 1, 1)
231#define MPP33_UA3_RDX MPP(33, 0x4, 1, 0, 1)
232#define MPP33_TDM0_TXQ MPP(33, 0x6, 0, 1, 1)
233#define MPP33_UNUSED MPP(33, 0x3, 0, 0, 1)
234
235
236
237#define MPP34_GPIO MPP(34, 0x1, 1, 1, 1)
238#define MPP34_UA2_TDX MPP(34, 0x4, 0, 1, 1)
239#define MPP34_TDM1_RXQ MPP(34, 0x6, 0, 1, 1)
240#define MPP34_UNUSED MPP(34, 0x3, 0, 0, 1)
241
242
243
244#define MPP35_GPIO MPP(35, 0x1, 1, 1, 1)
245#define MPP35_UA2_RDX MPP(35, 0x4, 1, 0, 1)
246#define MPP35_TDM1_TXQ MPP(35, 0x6, 0, 1, 1)
247#define MPP35_UNUSED MPP(35, 0x3, 0, 0, 1)
248
249#define MPP36_GPIO MPP(36, 0x1, 1, 1, 1)
250#define MPP36_UA0_CTSn MPP(36, 0x2, 1, 0, 1)
251#define MPP36_UA2_TDX MPP(36, 0x4, 0, 1, 1)
252#define MPP36_TDM0_SCSn MPP(36, 0x6, 0, 1, 1)
253#define MPP36_UNUSED MPP(36, 0x3, 0, 0, 1)
254
255
256#define MPP37_GPIO MPP(37, 0x1, 1, 1, 1)
257#define MPP37_UA0_RTSn MPP(37, 0x2, 0, 1, 1)
258#define MPP37_UA2_RXD MPP(37, 0x4, 1, 0, 1)
259#define MPP37_SYSRST_OUTn MPP(37, 0x5, 0, 1, 1)
260#define MPP37_TDM_SCLK MPP(37, 0x6, 0, 1, 1)
261#define MPP37_UNUSED MPP(37, 0x3, 0, 0, 1)
262
263
264
265
266#define MPP38_GPIO MPP(38, 0x1, 1, 1, 1)
267#define MPP38_UA1_CTSn MPP(38, 0x2, 1, 0, 1)
268#define MPP38_UA3_TXD MPP(38, 0x4, 0, 1, 1)
269#define MPP38_SYSRST_OUTn MPP(38, 0x5, 0, 1, 1)
270#define MPP38_TDM_SMOSI MPP(38, 0x6, 0, 1, 1)
271#define MPP38_UNUSED MPP(38, 0x3, 0, 0, 1)
272
273
274
275
276#define MPP39_GPIO MPP(39, 0x1, 1, 1, 1)
277#define MPP39_UA1_RTSn MPP(39, 0x2, 0, 1, 1)
278#define MPP39_UA3_RXD MPP(39, 0x4, 1, 0, 1)
279#define MPP39_SYSRST_OUTn MPP(39, 0x5, 0, 1, 1)
280#define MPP39_TDM_SMISO MPP(39, 0x6, 1, 0, 1)
281#define MPP39_UNUSED MPP(39, 0x3, 0, 0, 1)
282
283
284
285#define MPP40_GPIO MPP(40, 0x1, 1, 1, 1)
286#define MPP40_TDM_INTn MPP(40, 0x6, 1, 0, 1)
287#define MPP40_UNUSED MPP(40, 0x0, 0, 0, 1)
288
289
290
291#define MPP41_GPIO MPP(41, 0x1, 1, 1, 1)
292#define MPP41_TDM_RSTn MPP(41, 0x6, 0, 1, 1)
293#define MPP41_UNUSED MPP(41, 0x0, 0, 0, 1)
294
295
296
297#define MPP42_GPIO MPP(42, 0x1, 1, 1, 1)
298#define MPP42_TDM_PCLK MPP(42, 0x6, 1, 1, 1)
299#define MPP42_UNUSED MPP(42, 0x0, 0, 0, 1)
300
301
302
303#define MPP43_GPIO MPP(43, 0x1, 1, 1, 1)
304#define MPP43_TDM_FSYNC MPP(43, 0x6, 1, 1, 1)
305#define MPP43_UNUSED MPP(43, 0x0, 0, 0, 1)
306
307
308
309#define MPP44_GPIO MPP(44, 0x1, 1, 1, 1)
310#define MPP44_TDM_DRX MPP(44, 0x6, 1, 0, 1)
311#define MPP44_UNUSED MPP(44, 0x0, 0, 0, 1)
312
313
314
315#define MPP45_GPIO MPP(45, 0x1, 1, 1, 1)
316#define MPP45_SATA0_ACTn MPP(45, 0x3, 0, 1, 1)
317#define MPP45_TDM_DRX MPP(45, 0x6, 0, 1, 1)
318#define MPP45_UNUSED MPP(45, 0x0, 0, 0, 1)
319
320
321#define MPP46_GPIO MPP(46, 0x1, 1, 1, 1)
322#define MPP46_TDM_SCSn MPP(46, 0x6, 0, 1, 1)
323#define MPP46_UNUSED MPP(46, 0x0, 0, 0, 1)
324
325
326#define MPP47_GPIO MPP(47, 0x1, 1, 1, 1)
327#define MPP47_UNUSED MPP(47, 0x0, 0, 0, 1)
328
329
330
331#define MPP48_GPIO MPP(48, 0x1, 1, 1, 1)
332#define MPP48_SATA1_ACTn MPP(48, 0x3, 0, 1, 1)
333#define MPP48_UNUSED MPP(48, 0x2, 0, 0, 1)
334
335
336
337#define MPP49_GPIO MPP(49, 0x1, 1, 1, 1)
338#define MPP49_SATA0_ACTn MPP(49, 0x3, 0, 1, 1)
339#define MPP49_M_BB MPP(49, 0x4, 1, 0, 1)
340#define MPP49_UNUSED MPP(49, 0x2, 0, 0, 1)
341
342
343#define MPP_MAX 49
344
345void mv78xx0_mpp_conf(unsigned int *mpp_list);
346
347#endif
diff --git a/arch/arm/mach-mx1/Makefile b/arch/arm/mach-mx1/Makefile
index 7f86fe073ec6..fc2ddf82441b 100644
--- a/arch/arm/mach-mx1/Makefile
+++ b/arch/arm/mach-mx1/Makefile
@@ -4,11 +4,12 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7EXTRA_CFLAGS += -DIMX_NEEDS_DEPRECATED_SYMBOLS
7obj-y += generic.o clock.o devices.o 8obj-y += generic.o clock.o devices.o
8 9
9# Support for CMOS sensor interface 10# Support for CMOS sensor interface
10obj-$(CONFIG_MX1_VIDEO) += ksym_mx1.o mx1_camera_fiq.o 11obj-$(CONFIG_MX1_VIDEO) += ksym_mx1.o mx1_camera_fiq.o
11 12
12# Specific board support 13# Specific board support
13obj-$(CONFIG_ARCH_MX1ADS) += mx1ads.o 14obj-$(CONFIG_ARCH_MX1ADS) += mach-mx1ads.o
14obj-$(CONFIG_MACH_SCB9328) += scb9328.o \ No newline at end of file 15obj-$(CONFIG_MACH_SCB9328) += mach-scb9328.o
diff --git a/arch/arm/mach-mx1/mx1ads.c b/arch/arm/mach-mx1/mach-mx1ads.c
index 30f04e56fafe..51f3cfd83db2 100644
--- a/arch/arm/mach-mx1/mx1ads.c
+++ b/arch/arm/mach-mx1/mach-mx1ads.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-imx/mx1ads.c 2 * arch/arm/mach-imx/mach-mx1ads.c
3 * 3 *
4 * Initially based on: 4 * Initially based on:
5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c 5 * linux-2.6.7-imx/arch/arm/mach-imx/scb9328.c
@@ -27,7 +27,7 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/i2c.h> 28#include <mach/i2c.h>
29#include <mach/imx-uart.h> 29#include <mach/imx-uart.h>
30#include <mach/iomux.h> 30#include <mach/iomux-mx1.h>
31#include <mach/irqs.h> 31#include <mach/irqs.h>
32 32
33#include "devices.h" 33#include "devices.h"
@@ -147,7 +147,7 @@ MACHINE_START(MX1ADS, "Freescale MX1ADS")
147 /* Maintainer: Sascha Hauer, Pengutronix */ 147 /* Maintainer: Sascha Hauer, Pengutronix */
148 .phys_io = IMX_IO_PHYS, 148 .phys_io = IMX_IO_PHYS,
149 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 149 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
150 .boot_params = PHYS_OFFSET + 0x100, 150 .boot_params = MX1_PHYS_OFFSET + 0x100,
151 .map_io = mx1_map_io, 151 .map_io = mx1_map_io,
152 .init_irq = mx1_init_irq, 152 .init_irq = mx1_init_irq,
153 .timer = &mx1ads_timer, 153 .timer = &mx1ads_timer,
@@ -157,7 +157,7 @@ MACHINE_END
157MACHINE_START(MXLADS, "Freescale MXLADS") 157MACHINE_START(MXLADS, "Freescale MXLADS")
158 .phys_io = IMX_IO_PHYS, 158 .phys_io = IMX_IO_PHYS,
159 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc, 159 .io_pg_offst = (IMX_IO_BASE >> 18) & 0xfffc,
160 .boot_params = PHYS_OFFSET + 0x100, 160 .boot_params = MX1_PHYS_OFFSET + 0x100,
161 .map_io = mx1_map_io, 161 .map_io = mx1_map_io,
162 .init_irq = mx1_init_irq, 162 .init_irq = mx1_init_irq,
163 .timer = &mx1ads_timer, 163 .timer = &mx1ads_timer,
diff --git a/arch/arm/mach-mx1/scb9328.c b/arch/arm/mach-mx1/mach-scb9328.c
index 325d98df6053..7587a7a12460 100644
--- a/arch/arm/mach-mx1/scb9328.c
+++ b/arch/arm/mach-mx1/mach-scb9328.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-mx1/scb9328.c 2 * linux/arch/arm/mach-mx1/mach-scb9328.c
3 * 3 *
4 * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de> 4 * Copyright (c) 2004 Sascha Hauer <saschahauer@web.de>
5 * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net> 5 * Copyright (c) 2006-2008 Juergen Beisert <jbeisert@netscape.net>
@@ -23,7 +23,7 @@
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/irqs.h> 24#include <mach/irqs.h>
25#include <mach/imx-uart.h> 25#include <mach/imx-uart.h>
26#include <mach/iomux.h> 26#include <mach/iomux-mx1.h>
27 27
28#include "devices.h" 28#include "devices.h"
29 29
diff --git a/arch/arm/mach-mx2/Kconfig b/arch/arm/mach-mx2/Kconfig
index b96c6a389363..742fd4e6dcb9 100644
--- a/arch/arm/mach-mx2/Kconfig
+++ b/arch/arm/mach-mx2/Kconfig
@@ -37,6 +37,7 @@ config MACH_MX27ADS
37config MACH_PCM038 37config MACH_PCM038
38 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)" 38 bool "Phytec phyCORE-i.MX27 CPU module (pcm038)"
39 depends on MACH_MX27 39 depends on MACH_MX27
40 select MXC_ULPI if USB_ULPI
40 help 41 help
41 Include support for phyCORE-i.MX27 (aka pcm038) platform. This 42 Include support for phyCORE-i.MX27 (aka pcm038) platform. This
42 includes specific configurations for the module and its peripherals. 43 includes specific configurations for the module and its peripherals.
@@ -55,7 +56,7 @@ config MACH_PCM970_BASEBOARD
55 56
56endchoice 57endchoice
57 58
58config MACH_EUKREA_CPUIMX27 59config MACH_CPUIMX27
59 bool "Eukrea CPUIMX27 module" 60 bool "Eukrea CPUIMX27 module"
60 depends on MACH_MX27 61 depends on MACH_MX27
61 help 62 help
@@ -64,14 +65,14 @@ config MACH_EUKREA_CPUIMX27
64 65
65config MACH_EUKREA_CPUIMX27_USESDHC2 66config MACH_EUKREA_CPUIMX27_USESDHC2
66 bool "CPUIMX27 integrates SDHC2 module" 67 bool "CPUIMX27 integrates SDHC2 module"
67 depends on MACH_EUKREA_CPUIMX27 68 depends on MACH_CPUIMX27
68 help 69 help
69 This adds support for the internal SDHC2 used on CPUIMX27 used 70 This adds support for the internal SDHC2 used on CPUIMX27 used
70 for wifi or eMMC. 71 for wifi or eMMC.
71 72
72choice 73choice
73 prompt "Baseboard" 74 prompt "Baseboard"
74 depends on MACH_EUKREA_CPUIMX27 75 depends on MACH_CPUIMX27
75 default MACH_EUKREA_MBIMX27_BASEBOARD 76 default MACH_EUKREA_MBIMX27_BASEBOARD
76 77
77config MACH_EUKREA_MBIMX27_BASEBOARD 78config MACH_EUKREA_MBIMX27_BASEBOARD
@@ -90,7 +91,7 @@ config MACH_MX27_3DS
90 Include support for MX27PDK platform. This includes specific 91 Include support for MX27PDK platform. This includes specific
91 configurations for the board and its peripherals. 92 configurations for the board and its peripherals.
92 93
93config MACH_MX27LITE 94config MACH_IMX27LITE
94 bool "LogicPD MX27 LITEKIT platform" 95 bool "LogicPD MX27 LITEKIT platform"
95 depends on MACH_MX27 96 depends on MACH_MX27
96 help 97 help
@@ -100,6 +101,7 @@ config MACH_MX27LITE
100config MACH_PCA100 101config MACH_PCA100
101 bool "Phytec phyCARD-s (pca100)" 102 bool "Phytec phyCARD-s (pca100)"
102 depends on MACH_MX27 103 depends on MACH_MX27
104 select MXC_ULPI if USB_ULPI
103 help 105 help
104 Include support for phyCARD-s (aka pca100) platform. This 106 Include support for phyCARD-s (aka pca100) platform. This
105 includes specific configurations for the module and its peripherals. 107 includes specific configurations for the module and its peripherals.
diff --git a/arch/arm/mach-mx2/Makefile b/arch/arm/mach-mx2/Makefile
index 52aca0aaf9b5..e3254faac828 100644
--- a/arch/arm/mach-mx2/Makefile
+++ b/arch/arm/mach-mx2/Makefile
@@ -4,21 +4,20 @@
4 4
5# Object file lists. 5# Object file lists.
6 6
7obj-y := generic.o devices.o serial.o 7obj-y := devices.o serial.o
8 8
9obj-$(CONFIG_MACH_MX21) += clock_imx21.o 9obj-$(CONFIG_MACH_MX21) += clock_imx21.o mm-imx21.o
10 10
11obj-$(CONFIG_MACH_MX27) += cpu_imx27.o 11obj-$(CONFIG_MACH_MX27) += cpu_imx27.o
12obj-$(CONFIG_MACH_MX27) += clock_imx27.o 12obj-$(CONFIG_MACH_MX27) += clock_imx27.o mm-imx27.o
13 13
14obj-$(CONFIG_MACH_MX21ADS) += mx21ads.o 14obj-$(CONFIG_MACH_MX21ADS) += mach-mx21ads.o
15obj-$(CONFIG_MACH_MX27ADS) += mx27ads.o 15obj-$(CONFIG_MACH_MX27ADS) += mach-mx27ads.o
16obj-$(CONFIG_MACH_PCM038) += pcm038.o 16obj-$(CONFIG_MACH_PCM038) += mach-pcm038.o
17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o 17obj-$(CONFIG_MACH_PCM970_BASEBOARD) += pcm970-baseboard.o
18obj-$(CONFIG_MACH_MX27_3DS) += mx27pdk.o 18obj-$(CONFIG_MACH_MX27_3DS) += mach-mx27_3ds.o
19obj-$(CONFIG_MACH_MX27LITE) += mx27lite.o 19obj-$(CONFIG_MACH_IMX27LITE) += mach-imx27lite.o
20obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27.o 20obj-$(CONFIG_MACH_CPUIMX27) += mach-cpuimx27.o
21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o 21obj-$(CONFIG_MACH_EUKREA_MBIMX27_BASEBOARD) += eukrea_mbimx27-baseboard.o
22obj-$(CONFIG_MACH_PCA100) += pca100.o 22obj-$(CONFIG_MACH_PCA100) += mach-pca100.o
23obj-$(CONFIG_MACH_MXT_TD60) += mxt_td60.o 23obj-$(CONFIG_MACH_MXT_TD60) += mach-mxt_td60.o
24
diff --git a/arch/arm/mach-mx2/clock_imx21.c b/arch/arm/mach-mx2/clock_imx21.c
index e82b489d1215..bb419ef4d133 100644
--- a/arch/arm/mach-mx2/clock_imx21.c
+++ b/arch/arm/mach-mx2/clock_imx21.c
@@ -23,11 +23,242 @@
23#include <linux/module.h> 23#include <linux/module.h>
24 24
25#include <mach/clock.h> 25#include <mach/clock.h>
26#include <mach/hardware.h>
26#include <mach/common.h> 27#include <mach/common.h>
27#include <asm/clkdev.h> 28#include <asm/clkdev.h>
28#include <asm/div64.h> 29#include <asm/div64.h>
29 30
30#include "crm_regs.h" 31#define IO_ADDR_CCM(off) (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
32
33/* Register offsets */
34#define CCM_CSCR IO_ADDR_CCM(0x0)
35#define CCM_MPCTL0 IO_ADDR_CCM(0x4)
36#define CCM_MPCTL1 IO_ADDR_CCM(0x8)
37#define CCM_SPCTL0 IO_ADDR_CCM(0xc)
38#define CCM_SPCTL1 IO_ADDR_CCM(0x10)
39#define CCM_OSC26MCTL IO_ADDR_CCM(0x14)
40#define CCM_PCDR0 IO_ADDR_CCM(0x18)
41#define CCM_PCDR1 IO_ADDR_CCM(0x1c)
42#define CCM_PCCR0 IO_ADDR_CCM(0x20)
43#define CCM_PCCR1 IO_ADDR_CCM(0x24)
44#define CCM_CCSR IO_ADDR_CCM(0x28)
45#define CCM_PMCTL IO_ADDR_CCM(0x2c)
46#define CCM_PMCOUNT IO_ADDR_CCM(0x30)
47#define CCM_WKGDCTL IO_ADDR_CCM(0x34)
48
49#define CCM_CSCR_PRESC_OFFSET 29
50#define CCM_CSCR_PRESC_MASK (0x7 << CCM_CSCR_PRESC_OFFSET)
51
52#define CCM_CSCR_USB_OFFSET 26
53#define CCM_CSCR_USB_MASK (0x7 << CCM_CSCR_USB_OFFSET)
54#define CCM_CSCR_SD_OFFSET 24
55#define CCM_CSCR_SD_MASK (0x3 << CCM_CSCR_SD_OFFSET)
56#define CCM_CSCR_SPLLRES (1 << 22)
57#define CCM_CSCR_MPLLRES (1 << 21)
58#define CCM_CSCR_SSI2_OFFSET 20
59#define CCM_CSCR_SSI2 (1 << CCM_CSCR_SSI2_OFFSET)
60#define CCM_CSCR_SSI1_OFFSET 19
61#define CCM_CSCR_SSI1 (1 << CCM_CSCR_SSI1_OFFSET)
62#define CCM_CSCR_FIR_OFFSET 18
63#define CCM_CSCR_FIR (1 << CCM_CSCR_FIR_OFFSET)
64#define CCM_CSCR_SP (1 << 17)
65#define CCM_CSCR_MCU (1 << 16)
66#define CCM_CSCR_BCLK_OFFSET 10
67#define CCM_CSCR_BCLK_MASK (0xf << CCM_CSCR_BCLK_OFFSET)
68#define CCM_CSCR_IPDIV_OFFSET 9
69#define CCM_CSCR_IPDIV (1 << CCM_CSCR_IPDIV_OFFSET)
70
71#define CCM_CSCR_OSC26MDIV (1 << 4)
72#define CCM_CSCR_OSC26M (1 << 3)
73#define CCM_CSCR_FPM (1 << 2)
74#define CCM_CSCR_SPEN (1 << 1)
75#define CCM_CSCR_MPEN 1
76
77#define CCM_MPCTL0_CPLM (1 << 31)
78#define CCM_MPCTL0_PD_OFFSET 26
79#define CCM_MPCTL0_PD_MASK (0xf << 26)
80#define CCM_MPCTL0_MFD_OFFSET 16
81#define CCM_MPCTL0_MFD_MASK (0x3ff << 16)
82#define CCM_MPCTL0_MFI_OFFSET 10
83#define CCM_MPCTL0_MFI_MASK (0xf << 10)
84#define CCM_MPCTL0_MFN_OFFSET 0
85#define CCM_MPCTL0_MFN_MASK 0x3ff
86
87#define CCM_MPCTL1_LF (1 << 15)
88#define CCM_MPCTL1_BRMO (1 << 6)
89
90#define CCM_SPCTL0_CPLM (1 << 31)
91#define CCM_SPCTL0_PD_OFFSET 26
92#define CCM_SPCTL0_PD_MASK (0xf << 26)
93#define CCM_SPCTL0_MFD_OFFSET 16
94#define CCM_SPCTL0_MFD_MASK (0x3ff << 16)
95#define CCM_SPCTL0_MFI_OFFSET 10
96#define CCM_SPCTL0_MFI_MASK (0xf << 10)
97#define CCM_SPCTL0_MFN_OFFSET 0
98#define CCM_SPCTL0_MFN_MASK 0x3ff
99
100#define CCM_SPCTL1_LF (1 << 15)
101#define CCM_SPCTL1_BRMO (1 << 6)
102
103#define CCM_OSC26MCTL_PEAK_OFFSET 16
104#define CCM_OSC26MCTL_PEAK_MASK (0x3 << 16)
105#define CCM_OSC26MCTL_AGC_OFFSET 8
106#define CCM_OSC26MCTL_AGC_MASK (0x3f << 8)
107#define CCM_OSC26MCTL_ANATEST_OFFSET 0
108#define CCM_OSC26MCTL_ANATEST_MASK 0x3f
109
110#define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26
111#define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26)
112#define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16
113#define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16)
114#define CCM_PCDR0_NFCDIV_OFFSET 12
115#define CCM_PCDR0_NFCDIV_MASK (0xf << 12)
116#define CCM_PCDR0_48MDIV_OFFSET 5
117#define CCM_PCDR0_48MDIV_MASK (0x7 << CCM_PCDR0_48MDIV_OFFSET)
118#define CCM_PCDR0_FIRIDIV_OFFSET 0
119#define CCM_PCDR0_FIRIDIV_MASK 0x1f
120#define CCM_PCDR1_PERDIV4_OFFSET 24
121#define CCM_PCDR1_PERDIV4_MASK (0x3f << 24)
122#define CCM_PCDR1_PERDIV3_OFFSET 16
123#define CCM_PCDR1_PERDIV3_MASK (0x3f << 16)
124#define CCM_PCDR1_PERDIV2_OFFSET 8
125#define CCM_PCDR1_PERDIV2_MASK (0x3f << 8)
126#define CCM_PCDR1_PERDIV1_OFFSET 0
127#define CCM_PCDR1_PERDIV1_MASK 0x3f
128
129#define CCM_PCCR_HCLK_CSI_OFFSET 31
130#define CCM_PCCR_HCLK_CSI_REG CCM_PCCR0
131#define CCM_PCCR_HCLK_DMA_OFFSET 30
132#define CCM_PCCR_HCLK_DMA_REG CCM_PCCR0
133#define CCM_PCCR_HCLK_BROM_OFFSET 28
134#define CCM_PCCR_HCLK_BROM_REG CCM_PCCR0
135#define CCM_PCCR_HCLK_EMMA_OFFSET 27
136#define CCM_PCCR_HCLK_EMMA_REG CCM_PCCR0
137#define CCM_PCCR_HCLK_LCDC_OFFSET 26
138#define CCM_PCCR_HCLK_LCDC_REG CCM_PCCR0
139#define CCM_PCCR_HCLK_SLCDC_OFFSET 25
140#define CCM_PCCR_HCLK_SLCDC_REG CCM_PCCR0
141#define CCM_PCCR_HCLK_USBOTG_OFFSET 24
142#define CCM_PCCR_HCLK_USBOTG_REG CCM_PCCR0
143#define CCM_PCCR_HCLK_BMI_OFFSET 23
144#define CCM_PCCR_BMI_MASK (1 << CCM_PCCR_BMI_MASK)
145#define CCM_PCCR_HCLK_BMI_REG CCM_PCCR0
146#define CCM_PCCR_PERCLK4_OFFSET 22
147#define CCM_PCCR_PERCLK4_REG CCM_PCCR0
148#define CCM_PCCR_SLCDC_OFFSET 21
149#define CCM_PCCR_SLCDC_REG CCM_PCCR0
150#define CCM_PCCR_FIRI_BAUD_OFFSET 20
151#define CCM_PCCR_FIRI_BAUD_MASK (1 << CCM_PCCR_FIRI_BAUD_MASK)
152#define CCM_PCCR_FIRI_BAUD_REG CCM_PCCR0
153#define CCM_PCCR_NFC_OFFSET 19
154#define CCM_PCCR_NFC_REG CCM_PCCR0
155#define CCM_PCCR_LCDC_OFFSET 18
156#define CCM_PCCR_LCDC_REG CCM_PCCR0
157#define CCM_PCCR_SSI1_BAUD_OFFSET 17
158#define CCM_PCCR_SSI1_BAUD_REG CCM_PCCR0
159#define CCM_PCCR_SSI2_BAUD_OFFSET 16
160#define CCM_PCCR_SSI2_BAUD_REG CCM_PCCR0
161#define CCM_PCCR_EMMA_OFFSET 15
162#define CCM_PCCR_EMMA_REG CCM_PCCR0
163#define CCM_PCCR_USBOTG_OFFSET 14
164#define CCM_PCCR_USBOTG_REG CCM_PCCR0
165#define CCM_PCCR_DMA_OFFSET 13
166#define CCM_PCCR_DMA_REG CCM_PCCR0
167#define CCM_PCCR_I2C1_OFFSET 12
168#define CCM_PCCR_I2C1_REG CCM_PCCR0
169#define CCM_PCCR_GPIO_OFFSET 11
170#define CCM_PCCR_GPIO_REG CCM_PCCR0
171#define CCM_PCCR_SDHC2_OFFSET 10
172#define CCM_PCCR_SDHC2_REG CCM_PCCR0
173#define CCM_PCCR_SDHC1_OFFSET 9
174#define CCM_PCCR_SDHC1_REG CCM_PCCR0
175#define CCM_PCCR_FIRI_OFFSET 8
176#define CCM_PCCR_FIRI_MASK (1 << CCM_PCCR_BAUD_MASK)
177#define CCM_PCCR_FIRI_REG CCM_PCCR0
178#define CCM_PCCR_SSI2_IPG_OFFSET 7
179#define CCM_PCCR_SSI2_REG CCM_PCCR0
180#define CCM_PCCR_SSI1_IPG_OFFSET 6
181#define CCM_PCCR_SSI1_REG CCM_PCCR0
182#define CCM_PCCR_CSPI2_OFFSET 5
183#define CCM_PCCR_CSPI2_REG CCM_PCCR0
184#define CCM_PCCR_CSPI1_OFFSET 4
185#define CCM_PCCR_CSPI1_REG CCM_PCCR0
186#define CCM_PCCR_UART4_OFFSET 3
187#define CCM_PCCR_UART4_REG CCM_PCCR0
188#define CCM_PCCR_UART3_OFFSET 2
189#define CCM_PCCR_UART3_REG CCM_PCCR0
190#define CCM_PCCR_UART2_OFFSET 1
191#define CCM_PCCR_UART2_REG CCM_PCCR0
192#define CCM_PCCR_UART1_OFFSET 0
193#define CCM_PCCR_UART1_REG CCM_PCCR0
194
195#define CCM_PCCR_OWIRE_OFFSET 31
196#define CCM_PCCR_OWIRE_REG CCM_PCCR1
197#define CCM_PCCR_KPP_OFFSET 30
198#define CCM_PCCR_KPP_REG CCM_PCCR1
199#define CCM_PCCR_RTC_OFFSET 29
200#define CCM_PCCR_RTC_REG CCM_PCCR1
201#define CCM_PCCR_PWM_OFFSET 28
202#define CCM_PCCR_PWM_REG CCM_PCCR1
203#define CCM_PCCR_GPT3_OFFSET 27
204#define CCM_PCCR_GPT3_REG CCM_PCCR1
205#define CCM_PCCR_GPT2_OFFSET 26
206#define CCM_PCCR_GPT2_REG CCM_PCCR1
207#define CCM_PCCR_GPT1_OFFSET 25
208#define CCM_PCCR_GPT1_REG CCM_PCCR1
209#define CCM_PCCR_WDT_OFFSET 24
210#define CCM_PCCR_WDT_REG CCM_PCCR1
211#define CCM_PCCR_CSPI3_OFFSET 23
212#define CCM_PCCR_CSPI3_REG CCM_PCCR1
213
214#define CCM_PCCR_CSPI1_MASK (1 << CCM_PCCR_CSPI1_OFFSET)
215#define CCM_PCCR_CSPI2_MASK (1 << CCM_PCCR_CSPI2_OFFSET)
216#define CCM_PCCR_CSPI3_MASK (1 << CCM_PCCR_CSPI3_OFFSET)
217#define CCM_PCCR_DMA_MASK (1 << CCM_PCCR_DMA_OFFSET)
218#define CCM_PCCR_EMMA_MASK (1 << CCM_PCCR_EMMA_OFFSET)
219#define CCM_PCCR_GPIO_MASK (1 << CCM_PCCR_GPIO_OFFSET)
220#define CCM_PCCR_GPT1_MASK (1 << CCM_PCCR_GPT1_OFFSET)
221#define CCM_PCCR_GPT2_MASK (1 << CCM_PCCR_GPT2_OFFSET)
222#define CCM_PCCR_GPT3_MASK (1 << CCM_PCCR_GPT3_OFFSET)
223#define CCM_PCCR_HCLK_BROM_MASK (1 << CCM_PCCR_HCLK_BROM_OFFSET)
224#define CCM_PCCR_HCLK_CSI_MASK (1 << CCM_PCCR_HCLK_CSI_OFFSET)
225#define CCM_PCCR_HCLK_DMA_MASK (1 << CCM_PCCR_HCLK_DMA_OFFSET)
226#define CCM_PCCR_HCLK_EMMA_MASK (1 << CCM_PCCR_HCLK_EMMA_OFFSET)
227#define CCM_PCCR_HCLK_LCDC_MASK (1 << CCM_PCCR_HCLK_LCDC_OFFSET)
228#define CCM_PCCR_HCLK_SLCDC_MASK (1 << CCM_PCCR_HCLK_SLCDC_OFFSET)
229#define CCM_PCCR_HCLK_USBOTG_MASK (1 << CCM_PCCR_HCLK_USBOTG_OFFSET)
230#define CCM_PCCR_I2C1_MASK (1 << CCM_PCCR_I2C1_OFFSET)
231#define CCM_PCCR_KPP_MASK (1 << CCM_PCCR_KPP_OFFSET)
232#define CCM_PCCR_LCDC_MASK (1 << CCM_PCCR_LCDC_OFFSET)
233#define CCM_PCCR_NFC_MASK (1 << CCM_PCCR_NFC_OFFSET)
234#define CCM_PCCR_OWIRE_MASK (1 << CCM_PCCR_OWIRE_OFFSET)
235#define CCM_PCCR_PERCLK4_MASK (1 << CCM_PCCR_PERCLK4_OFFSET)
236#define CCM_PCCR_PWM_MASK (1 << CCM_PCCR_PWM_OFFSET)
237#define CCM_PCCR_RTC_MASK (1 << CCM_PCCR_RTC_OFFSET)
238#define CCM_PCCR_SDHC1_MASK (1 << CCM_PCCR_SDHC1_OFFSET)
239#define CCM_PCCR_SDHC2_MASK (1 << CCM_PCCR_SDHC2_OFFSET)
240#define CCM_PCCR_SLCDC_MASK (1 << CCM_PCCR_SLCDC_OFFSET)
241#define CCM_PCCR_SSI1_BAUD_MASK (1 << CCM_PCCR_SSI1_BAUD_OFFSET)
242#define CCM_PCCR_SSI1_IPG_MASK (1 << CCM_PCCR_SSI1_IPG_OFFSET)
243#define CCM_PCCR_SSI2_BAUD_MASK (1 << CCM_PCCR_SSI2_BAUD_OFFSET)
244#define CCM_PCCR_SSI2_IPG_MASK (1 << CCM_PCCR_SSI2_IPG_OFFSET)
245#define CCM_PCCR_UART1_MASK (1 << CCM_PCCR_UART1_OFFSET)
246#define CCM_PCCR_UART2_MASK (1 << CCM_PCCR_UART2_OFFSET)
247#define CCM_PCCR_UART3_MASK (1 << CCM_PCCR_UART3_OFFSET)
248#define CCM_PCCR_UART4_MASK (1 << CCM_PCCR_UART4_OFFSET)
249#define CCM_PCCR_USBOTG_MASK (1 << CCM_PCCR_USBOTG_OFFSET)
250#define CCM_PCCR_WDT_MASK (1 << CCM_PCCR_WDT_OFFSET)
251
252#define CCM_CCSR_32KSR (1 << 15)
253
254#define CCM_CCSR_CLKMODE1 (1 << 9)
255#define CCM_CCSR_CLKMODE0 (1 << 8)
256
257#define CCM_CCSR_CLKOSEL_OFFSET 0
258#define CCM_CCSR_CLKOSEL_MASK 0x1f
259
260#define SYS_FMCR 0x14 /* Functional Muxing Control Reg */
261#define SYS_CHIP_ID 0x00 /* The offset of CHIP ID register */
31 262
32static int _clk_enable(struct clk *clk) 263static int _clk_enable(struct clk *clk)
33{ 264{
@@ -1002,6 +1233,7 @@ int __init mx21_clocks_init(unsigned long lref, unsigned long href)
1002 clk_enable(&uart_clk[0]); 1233 clk_enable(&uart_clk[0]);
1003#endif 1234#endif
1004 1235
1005 mxc_timer_init(&gpt_clk[0], IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT1); 1236 mxc_timer_init(&gpt_clk[0], MX21_IO_ADDRESS(MX21_GPT1_BASE_ADDR),
1237 MX21_INT_GPT1);
1006 return 0; 1238 return 0;
1007} 1239}
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c
index 18c53a6487fa..0f0823c8b170 100644
--- a/arch/arm/mach-mx2/clock_imx27.c
+++ b/arch/arm/mach-mx2/clock_imx27.c
@@ -29,21 +29,23 @@
29#include <mach/common.h> 29#include <mach/common.h>
30#include <mach/hardware.h> 30#include <mach/hardware.h>
31 31
32#define IO_ADDR_CCM(off) (MX27_IO_ADDRESS(MX27_CCM_BASE_ADDR + (off)))
33
32/* Register offsets */ 34/* Register offsets */
33#define CCM_CSCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x0) 35#define CCM_CSCR IO_ADDR_CCM(0x0)
34#define CCM_MPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4) 36#define CCM_MPCTL0 IO_ADDR_CCM(0x4)
35#define CCM_MPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x8) 37#define CCM_MPCTL1 IO_ADDR_CCM(0x8)
36#define CCM_SPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0xC) 38#define CCM_SPCTL0 IO_ADDR_CCM(0xc)
37#define CCM_SPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) 39#define CCM_SPCTL1 IO_ADDR_CCM(0x10)
38#define CCM_OSC26MCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) 40#define CCM_OSC26MCTL IO_ADDR_CCM(0x14)
39#define CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) 41#define CCM_PCDR0 IO_ADDR_CCM(0x18)
40#define CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1c) 42#define CCM_PCDR1 IO_ADDR_CCM(0x1c)
41#define CCM_PCCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) 43#define CCM_PCCR0 IO_ADDR_CCM(0x20)
42#define CCM_PCCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) 44#define CCM_PCCR1 IO_ADDR_CCM(0x24)
43#define CCM_CCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) 45#define CCM_CCSR IO_ADDR_CCM(0x28)
44#define CCM_PMCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x2c) 46#define CCM_PMCTL IO_ADDR_CCM(0x2c)
45#define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) 47#define CCM_PMCOUNT IO_ADDR_CCM(0x30)
46#define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) 48#define CCM_WKGDCTL IO_ADDR_CCM(0x34)
47 49
48#define CCM_CSCR_UPDATE_DIS (1 << 31) 50#define CCM_CSCR_UPDATE_DIS (1 << 31)
49#define CCM_CSCR_SSI2 (1 << 23) 51#define CCM_CSCR_SSI2 (1 << 23)
@@ -753,7 +755,8 @@ int __init mx27_clocks_init(unsigned long fref)
753 clk_enable(&uart1_clk); 755 clk_enable(&uart1_clk);
754#endif 756#endif
755 757
756 mxc_timer_init(&gpt1_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT1); 758 mxc_timer_init(&gpt1_clk, MX27_IO_ADDRESS(MX27_GPT1_BASE_ADDR),
759 MX27_INT_GPT1);
757 760
758 return 0; 761 return 0;
759} 762}
diff --git a/arch/arm/mach-mx2/cpu_imx27.c b/arch/arm/mach-mx2/cpu_imx27.c
index d9e3bf9644c9..d8d3b2d84dc5 100644
--- a/arch/arm/mach-mx2/cpu_imx27.c
+++ b/arch/arm/mach-mx2/cpu_imx27.c
@@ -39,7 +39,8 @@ static void query_silicon_parameter(void)
39 * the silicon revision very early we read it here to 39 * the silicon revision very early we read it here to
40 * avoid any further hooks 40 * avoid any further hooks
41 */ 41 */
42 val = __raw_readl(IO_ADDRESS(SYSCTRL_BASE_ADDR) + SYS_CHIP_ID); 42 val = __raw_readl(MX27_IO_ADDRESS(MX27_SYSCTRL_BASE_ADDR
43 + SYS_CHIP_ID));
43 44
44 cpu_silicon_rev = (int)(val >> 28); 45 cpu_silicon_rev = (int)(val >> 28);
45 cpu_partnumber = (int)((val >> 12) & 0xFFFF); 46 cpu_partnumber = (int)((val >> 12) & 0xFFFF);
diff --git a/arch/arm/mach-mx2/crm_regs.h b/arch/arm/mach-mx2/crm_regs.h
deleted file mode 100644
index 749de76b3f95..000000000000
--- a/arch/arm/mach-mx2/crm_regs.h
+++ /dev/null
@@ -1,258 +0,0 @@
1/*
2 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19
20#ifndef __ARCH_ARM_MACH_MX2_CRM_REGS_H__
21#define __ARCH_ARM_MACH_MX2_CRM_REGS_H__
22
23#include <mach/hardware.h>
24
25/* Register offsets */
26#define CCM_CSCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x0)
27#define CCM_MPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4)
28#define CCM_MPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x8)
29#define CCM_SPCTL0 (IO_ADDRESS(CCM_BASE_ADDR) + 0xC)
30#define CCM_SPCTL1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10)
31#define CCM_OSC26MCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x14)
32#define CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18)
33#define CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1c)
34#define CCM_PCCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20)
35#define CCM_PCCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24)
36#define CCM_CCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28)
37#define CCM_PMCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x2c)
38#define CCM_PMCOUNT (IO_ADDRESS(CCM_BASE_ADDR) + 0x30)
39#define CCM_WKGDCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x34)
40
41#define CCM_CSCR_PRESC_OFFSET 29
42#define CCM_CSCR_PRESC_MASK (0x7 << CCM_CSCR_PRESC_OFFSET)
43
44#define CCM_CSCR_USB_OFFSET 26
45#define CCM_CSCR_USB_MASK (0x7 << CCM_CSCR_USB_OFFSET)
46#define CCM_CSCR_SD_OFFSET 24
47#define CCM_CSCR_SD_MASK (0x3 << CCM_CSCR_SD_OFFSET)
48#define CCM_CSCR_SPLLRES (1 << 22)
49#define CCM_CSCR_MPLLRES (1 << 21)
50#define CCM_CSCR_SSI2_OFFSET 20
51#define CCM_CSCR_SSI2 (1 << CCM_CSCR_SSI2_OFFSET)
52#define CCM_CSCR_SSI1_OFFSET 19
53#define CCM_CSCR_SSI1 (1 << CCM_CSCR_SSI1_OFFSET)
54#define CCM_CSCR_FIR_OFFSET 18
55#define CCM_CSCR_FIR (1 << CCM_CSCR_FIR_OFFSET)
56#define CCM_CSCR_SP (1 << 17)
57#define CCM_CSCR_MCU (1 << 16)
58#define CCM_CSCR_BCLK_OFFSET 10
59#define CCM_CSCR_BCLK_MASK (0xf << CCM_CSCR_BCLK_OFFSET)
60#define CCM_CSCR_IPDIV_OFFSET 9
61#define CCM_CSCR_IPDIV (1 << CCM_CSCR_IPDIV_OFFSET)
62
63#define CCM_CSCR_OSC26MDIV (1 << 4)
64#define CCM_CSCR_OSC26M (1 << 3)
65#define CCM_CSCR_FPM (1 << 2)
66#define CCM_CSCR_SPEN (1 << 1)
67#define CCM_CSCR_MPEN 1
68
69
70
71#define CCM_MPCTL0_CPLM (1 << 31)
72#define CCM_MPCTL0_PD_OFFSET 26
73#define CCM_MPCTL0_PD_MASK (0xf << 26)
74#define CCM_MPCTL0_MFD_OFFSET 16
75#define CCM_MPCTL0_MFD_MASK (0x3ff << 16)
76#define CCM_MPCTL0_MFI_OFFSET 10
77#define CCM_MPCTL0_MFI_MASK (0xf << 10)
78#define CCM_MPCTL0_MFN_OFFSET 0
79#define CCM_MPCTL0_MFN_MASK 0x3ff
80
81#define CCM_MPCTL1_LF (1 << 15)
82#define CCM_MPCTL1_BRMO (1 << 6)
83
84#define CCM_SPCTL0_CPLM (1 << 31)
85#define CCM_SPCTL0_PD_OFFSET 26
86#define CCM_SPCTL0_PD_MASK (0xf << 26)
87#define CCM_SPCTL0_MFD_OFFSET 16
88#define CCM_SPCTL0_MFD_MASK (0x3ff << 16)
89#define CCM_SPCTL0_MFI_OFFSET 10
90#define CCM_SPCTL0_MFI_MASK (0xf << 10)
91#define CCM_SPCTL0_MFN_OFFSET 0
92#define CCM_SPCTL0_MFN_MASK 0x3ff
93
94#define CCM_SPCTL1_LF (1 << 15)
95#define CCM_SPCTL1_BRMO (1 << 6)
96
97#define CCM_OSC26MCTL_PEAK_OFFSET 16
98#define CCM_OSC26MCTL_PEAK_MASK (0x3 << 16)
99#define CCM_OSC26MCTL_AGC_OFFSET 8
100#define CCM_OSC26MCTL_AGC_MASK (0x3f << 8)
101#define CCM_OSC26MCTL_ANATEST_OFFSET 0
102#define CCM_OSC26MCTL_ANATEST_MASK 0x3f
103
104#define CCM_PCDR0_SSI2BAUDDIV_OFFSET 26
105#define CCM_PCDR0_SSI2BAUDDIV_MASK (0x3f << 26)
106#define CCM_PCDR0_SSI1BAUDDIV_OFFSET 16
107#define CCM_PCDR0_SSI1BAUDDIV_MASK (0x3f << 16)
108#define CCM_PCDR0_NFCDIV_OFFSET 12
109#define CCM_PCDR0_NFCDIV_MASK (0xf << 12)
110#define CCM_PCDR0_48MDIV_OFFSET 5
111#define CCM_PCDR0_48MDIV_MASK (0x7 << CCM_PCDR0_48MDIV_OFFSET)
112#define CCM_PCDR0_FIRIDIV_OFFSET 0
113#define CCM_PCDR0_FIRIDIV_MASK 0x1f
114#define CCM_PCDR1_PERDIV4_OFFSET 24
115#define CCM_PCDR1_PERDIV4_MASK (0x3f << 24)
116#define CCM_PCDR1_PERDIV3_OFFSET 16
117#define CCM_PCDR1_PERDIV3_MASK (0x3f << 16)
118#define CCM_PCDR1_PERDIV2_OFFSET 8
119#define CCM_PCDR1_PERDIV2_MASK (0x3f << 8)
120#define CCM_PCDR1_PERDIV1_OFFSET 0
121#define CCM_PCDR1_PERDIV1_MASK 0x3f
122
123#define CCM_PCCR_HCLK_CSI_OFFSET 31
124#define CCM_PCCR_HCLK_CSI_REG CCM_PCCR0
125#define CCM_PCCR_HCLK_DMA_OFFSET 30
126#define CCM_PCCR_HCLK_DMA_REG CCM_PCCR0
127#define CCM_PCCR_HCLK_BROM_OFFSET 28
128#define CCM_PCCR_HCLK_BROM_REG CCM_PCCR0
129#define CCM_PCCR_HCLK_EMMA_OFFSET 27
130#define CCM_PCCR_HCLK_EMMA_REG CCM_PCCR0
131#define CCM_PCCR_HCLK_LCDC_OFFSET 26
132#define CCM_PCCR_HCLK_LCDC_REG CCM_PCCR0
133#define CCM_PCCR_HCLK_SLCDC_OFFSET 25
134#define CCM_PCCR_HCLK_SLCDC_REG CCM_PCCR0
135#define CCM_PCCR_HCLK_USBOTG_OFFSET 24
136#define CCM_PCCR_HCLK_USBOTG_REG CCM_PCCR0
137#define CCM_PCCR_HCLK_BMI_OFFSET 23
138#define CCM_PCCR_BMI_MASK (1 << CCM_PCCR_BMI_MASK)
139#define CCM_PCCR_HCLK_BMI_REG CCM_PCCR0
140#define CCM_PCCR_PERCLK4_OFFSET 22
141#define CCM_PCCR_PERCLK4_REG CCM_PCCR0
142#define CCM_PCCR_SLCDC_OFFSET 21
143#define CCM_PCCR_SLCDC_REG CCM_PCCR0
144#define CCM_PCCR_FIRI_BAUD_OFFSET 20
145#define CCM_PCCR_FIRI_BAUD_MASK (1 << CCM_PCCR_FIRI_BAUD_MASK)
146#define CCM_PCCR_FIRI_BAUD_REG CCM_PCCR0
147#define CCM_PCCR_NFC_OFFSET 19
148#define CCM_PCCR_NFC_REG CCM_PCCR0
149#define CCM_PCCR_LCDC_OFFSET 18
150#define CCM_PCCR_LCDC_REG CCM_PCCR0
151#define CCM_PCCR_SSI1_BAUD_OFFSET 17
152#define CCM_PCCR_SSI1_BAUD_REG CCM_PCCR0
153#define CCM_PCCR_SSI2_BAUD_OFFSET 16
154#define CCM_PCCR_SSI2_BAUD_REG CCM_PCCR0
155#define CCM_PCCR_EMMA_OFFSET 15
156#define CCM_PCCR_EMMA_REG CCM_PCCR0
157#define CCM_PCCR_USBOTG_OFFSET 14
158#define CCM_PCCR_USBOTG_REG CCM_PCCR0
159#define CCM_PCCR_DMA_OFFSET 13
160#define CCM_PCCR_DMA_REG CCM_PCCR0
161#define CCM_PCCR_I2C1_OFFSET 12
162#define CCM_PCCR_I2C1_REG CCM_PCCR0
163#define CCM_PCCR_GPIO_OFFSET 11
164#define CCM_PCCR_GPIO_REG CCM_PCCR0
165#define CCM_PCCR_SDHC2_OFFSET 10
166#define CCM_PCCR_SDHC2_REG CCM_PCCR0
167#define CCM_PCCR_SDHC1_OFFSET 9
168#define CCM_PCCR_SDHC1_REG CCM_PCCR0
169#define CCM_PCCR_FIRI_OFFSET 8
170#define CCM_PCCR_FIRI_MASK (1 << CCM_PCCR_BAUD_MASK)
171#define CCM_PCCR_FIRI_REG CCM_PCCR0
172#define CCM_PCCR_SSI2_IPG_OFFSET 7
173#define CCM_PCCR_SSI2_REG CCM_PCCR0
174#define CCM_PCCR_SSI1_IPG_OFFSET 6
175#define CCM_PCCR_SSI1_REG CCM_PCCR0
176#define CCM_PCCR_CSPI2_OFFSET 5
177#define CCM_PCCR_CSPI2_REG CCM_PCCR0
178#define CCM_PCCR_CSPI1_OFFSET 4
179#define CCM_PCCR_CSPI1_REG CCM_PCCR0
180#define CCM_PCCR_UART4_OFFSET 3
181#define CCM_PCCR_UART4_REG CCM_PCCR0
182#define CCM_PCCR_UART3_OFFSET 2
183#define CCM_PCCR_UART3_REG CCM_PCCR0
184#define CCM_PCCR_UART2_OFFSET 1
185#define CCM_PCCR_UART2_REG CCM_PCCR0
186#define CCM_PCCR_UART1_OFFSET 0
187#define CCM_PCCR_UART1_REG CCM_PCCR0
188
189#define CCM_PCCR_OWIRE_OFFSET 31
190#define CCM_PCCR_OWIRE_REG CCM_PCCR1
191#define CCM_PCCR_KPP_OFFSET 30
192#define CCM_PCCR_KPP_REG CCM_PCCR1
193#define CCM_PCCR_RTC_OFFSET 29
194#define CCM_PCCR_RTC_REG CCM_PCCR1
195#define CCM_PCCR_PWM_OFFSET 28
196#define CCM_PCCR_PWM_REG CCM_PCCR1
197#define CCM_PCCR_GPT3_OFFSET 27
198#define CCM_PCCR_GPT3_REG CCM_PCCR1
199#define CCM_PCCR_GPT2_OFFSET 26
200#define CCM_PCCR_GPT2_REG CCM_PCCR1
201#define CCM_PCCR_GPT1_OFFSET 25
202#define CCM_PCCR_GPT1_REG CCM_PCCR1
203#define CCM_PCCR_WDT_OFFSET 24
204#define CCM_PCCR_WDT_REG CCM_PCCR1
205#define CCM_PCCR_CSPI3_OFFSET 23
206#define CCM_PCCR_CSPI3_REG CCM_PCCR1
207
208#define CCM_PCCR_CSPI1_MASK (1 << CCM_PCCR_CSPI1_OFFSET)
209#define CCM_PCCR_CSPI2_MASK (1 << CCM_PCCR_CSPI2_OFFSET)
210#define CCM_PCCR_CSPI3_MASK (1 << CCM_PCCR_CSPI3_OFFSET)
211#define CCM_PCCR_DMA_MASK (1 << CCM_PCCR_DMA_OFFSET)
212#define CCM_PCCR_EMMA_MASK (1 << CCM_PCCR_EMMA_OFFSET)
213#define CCM_PCCR_GPIO_MASK (1 << CCM_PCCR_GPIO_OFFSET)
214#define CCM_PCCR_GPT1_MASK (1 << CCM_PCCR_GPT1_OFFSET)
215#define CCM_PCCR_GPT2_MASK (1 << CCM_PCCR_GPT2_OFFSET)
216#define CCM_PCCR_GPT3_MASK (1 << CCM_PCCR_GPT3_OFFSET)
217#define CCM_PCCR_HCLK_BROM_MASK (1 << CCM_PCCR_HCLK_BROM_OFFSET)
218#define CCM_PCCR_HCLK_CSI_MASK (1 << CCM_PCCR_HCLK_CSI_OFFSET)
219#define CCM_PCCR_HCLK_DMA_MASK (1 << CCM_PCCR_HCLK_DMA_OFFSET)
220#define CCM_PCCR_HCLK_EMMA_MASK (1 << CCM_PCCR_HCLK_EMMA_OFFSET)
221#define CCM_PCCR_HCLK_LCDC_MASK (1 << CCM_PCCR_HCLK_LCDC_OFFSET)
222#define CCM_PCCR_HCLK_SLCDC_MASK (1 << CCM_PCCR_HCLK_SLCDC_OFFSET)
223#define CCM_PCCR_HCLK_USBOTG_MASK (1 << CCM_PCCR_HCLK_USBOTG_OFFSET)
224#define CCM_PCCR_I2C1_MASK (1 << CCM_PCCR_I2C1_OFFSET)
225#define CCM_PCCR_KPP_MASK (1 << CCM_PCCR_KPP_OFFSET)
226#define CCM_PCCR_LCDC_MASK (1 << CCM_PCCR_LCDC_OFFSET)
227#define CCM_PCCR_NFC_MASK (1 << CCM_PCCR_NFC_OFFSET)
228#define CCM_PCCR_OWIRE_MASK (1 << CCM_PCCR_OWIRE_OFFSET)
229#define CCM_PCCR_PERCLK4_MASK (1 << CCM_PCCR_PERCLK4_OFFSET)
230#define CCM_PCCR_PWM_MASK (1 << CCM_PCCR_PWM_OFFSET)
231#define CCM_PCCR_RTC_MASK (1 << CCM_PCCR_RTC_OFFSET)
232#define CCM_PCCR_SDHC1_MASK (1 << CCM_PCCR_SDHC1_OFFSET)
233#define CCM_PCCR_SDHC2_MASK (1 << CCM_PCCR_SDHC2_OFFSET)
234#define CCM_PCCR_SLCDC_MASK (1 << CCM_PCCR_SLCDC_OFFSET)
235#define CCM_PCCR_SSI1_BAUD_MASK (1 << CCM_PCCR_SSI1_BAUD_OFFSET)
236#define CCM_PCCR_SSI1_IPG_MASK (1 << CCM_PCCR_SSI1_IPG_OFFSET)
237#define CCM_PCCR_SSI2_BAUD_MASK (1 << CCM_PCCR_SSI2_BAUD_OFFSET)
238#define CCM_PCCR_SSI2_IPG_MASK (1 << CCM_PCCR_SSI2_IPG_OFFSET)
239#define CCM_PCCR_UART1_MASK (1 << CCM_PCCR_UART1_OFFSET)
240#define CCM_PCCR_UART2_MASK (1 << CCM_PCCR_UART2_OFFSET)
241#define CCM_PCCR_UART3_MASK (1 << CCM_PCCR_UART3_OFFSET)
242#define CCM_PCCR_UART4_MASK (1 << CCM_PCCR_UART4_OFFSET)
243#define CCM_PCCR_USBOTG_MASK (1 << CCM_PCCR_USBOTG_OFFSET)
244#define CCM_PCCR_WDT_MASK (1 << CCM_PCCR_WDT_OFFSET)
245
246
247#define CCM_CCSR_32KSR (1 << 15)
248
249#define CCM_CCSR_CLKMODE1 (1 << 9)
250#define CCM_CCSR_CLKMODE0 (1 << 8)
251
252#define CCM_CCSR_CLKOSEL_OFFSET 0
253#define CCM_CCSR_CLKOSEL_MASK 0x1f
254
255#define SYS_FMCR 0x14 /* Functional Muxing Control Reg */
256#define SYS_CHIP_ID 0x00 /* The offset of CHIP ID register */
257
258#endif /* __ARCH_ARM_MACH_MX2_CRM_REGS_H__ */
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index 3956d82b7c4e..b91e412f7b3e 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -47,65 +47,31 @@
47 * - i.MX21: 2 channel 47 * - i.MX21: 2 channel
48 * - i.MX27: 3 channel 48 * - i.MX27: 3 channel
49 */ 49 */
50static struct resource mxc_spi_resources0[] = { 50#define DEFINE_IMX_SPI_DEVICE(n, baseaddr, irq) \
51 { 51 static struct resource mxc_spi_resources ## n[] = { \
52 .start = CSPI1_BASE_ADDR, 52 { \
53 .end = CSPI1_BASE_ADDR + SZ_4K - 1, 53 .start = baseaddr, \
54 .flags = IORESOURCE_MEM, 54 .end = baseaddr + SZ_4K - 1, \
55 }, { 55 .flags = IORESOURCE_MEM, \
56 .start = MXC_INT_CSPI1, 56 }, { \
57 .end = MXC_INT_CSPI1, 57 .start = irq, \
58 .flags = IORESOURCE_IRQ, 58 .end = irq, \
59 }, 59 .flags = IORESOURCE_IRQ, \
60}; 60 }, \
61 61 }; \
62static struct resource mxc_spi_resources1[] = { 62 \
63 { 63 struct platform_device mxc_spi_device ## n = { \
64 .start = CSPI2_BASE_ADDR, 64 .name = "spi_imx", \
65 .end = CSPI2_BASE_ADDR + SZ_4K - 1, 65 .id = n, \
66 .flags = IORESOURCE_MEM, 66 .num_resources = ARRAY_SIZE(mxc_spi_resources ## n), \
67 }, { 67 .resource = mxc_spi_resources ## n, \
68 .start = MXC_INT_CSPI2, 68 }
69 .end = MXC_INT_CSPI2,
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74#ifdef CONFIG_MACH_MX27
75static struct resource mxc_spi_resources2[] = {
76 {
77 .start = CSPI3_BASE_ADDR,
78 .end = CSPI3_BASE_ADDR + SZ_4K - 1,
79 .flags = IORESOURCE_MEM,
80 }, {
81 .start = MXC_INT_CSPI3,
82 .end = MXC_INT_CSPI3,
83 .flags = IORESOURCE_IRQ,
84 },
85};
86#endif
87
88struct platform_device mxc_spi_device0 = {
89 .name = "spi_imx",
90 .id = 0,
91 .num_resources = ARRAY_SIZE(mxc_spi_resources0),
92 .resource = mxc_spi_resources0,
93};
94 69
95struct platform_device mxc_spi_device1 = { 70DEFINE_IMX_SPI_DEVICE(0, MX2x_CSPI1_BASE_ADDR, MX2x_INT_CSPI1);
96 .name = "spi_imx", 71DEFINE_IMX_SPI_DEVICE(1, MX2x_CSPI2_BASE_ADDR, MX2x_INT_CSPI2);
97 .id = 1,
98 .num_resources = ARRAY_SIZE(mxc_spi_resources1),
99 .resource = mxc_spi_resources1,
100};
101 72
102#ifdef CONFIG_MACH_MX27 73#ifdef CONFIG_MACH_MX27
103struct platform_device mxc_spi_device2 = { 74DEFINE_IMX_SPI_DEVICE(2, MX27_CSPI3_BASE_ADDR, MX27_INT_CSPI3);
104 .name = "spi_imx",
105 .id = 2,
106 .num_resources = ARRAY_SIZE(mxc_spi_resources2),
107 .resource = mxc_spi_resources2,
108};
109#endif 75#endif
110 76
111/* 77/*
@@ -113,104 +79,34 @@ struct platform_device mxc_spi_device2 = {
113 * - i.MX21: 3 timers 79 * - i.MX21: 3 timers
114 * - i.MX27: 6 timers 80 * - i.MX27: 6 timers
115 */ 81 */
116 82#define DEFINE_IMX_GPT_DEVICE(n, baseaddr, irq) \
117/* We use gpt0 as system timer, so do not add a device for this one */ 83 static struct resource timer ## n ##_resources[] = { \
118 84 { \
119static struct resource timer1_resources[] = { 85 .start = baseaddr, \
120 { 86 .end = baseaddr + SZ_4K - 1, \
121 .start = GPT2_BASE_ADDR, 87 .flags = IORESOURCE_MEM, \
122 .end = GPT2_BASE_ADDR + 0x17, 88 }, { \
123 .flags = IORESOURCE_MEM, 89 .start = irq, \
124 }, { 90 .end = irq, \
125 .start = MXC_INT_GPT2, 91 .flags = IORESOURCE_IRQ, \
126 .end = MXC_INT_GPT2, 92 } \
127 .flags = IORESOURCE_IRQ, 93 }; \
128 } 94 \
129}; 95 struct platform_device mxc_gpt ## n = { \
130 96 .name = "imx_gpt", \
131struct platform_device mxc_gpt1 = { 97 .id = n, \
132 .name = "imx_gpt", 98 .num_resources = ARRAY_SIZE(timer ## n ## _resources), \
133 .id = 1, 99 .resource = timer ## n ## _resources, \
134 .num_resources = ARRAY_SIZE(timer1_resources),
135 .resource = timer1_resources,
136};
137
138static struct resource timer2_resources[] = {
139 {
140 .start = GPT3_BASE_ADDR,
141 .end = GPT3_BASE_ADDR + 0x17,
142 .flags = IORESOURCE_MEM,
143 }, {
144 .start = MXC_INT_GPT3,
145 .end = MXC_INT_GPT3,
146 .flags = IORESOURCE_IRQ,
147 } 100 }
148};
149 101
150struct platform_device mxc_gpt2 = { 102/* We use gpt1 as system timer, so do not add a device for this one */
151 .name = "imx_gpt", 103DEFINE_IMX_GPT_DEVICE(1, MX2x_GPT2_BASE_ADDR, MX2x_INT_GPT2);
152 .id = 2, 104DEFINE_IMX_GPT_DEVICE(2, MX2x_GPT3_BASE_ADDR, MX2x_INT_GPT3);
153 .num_resources = ARRAY_SIZE(timer2_resources),
154 .resource = timer2_resources,
155};
156 105
157#ifdef CONFIG_MACH_MX27 106#ifdef CONFIG_MACH_MX27
158static struct resource timer3_resources[] = { 107DEFINE_IMX_GPT_DEVICE(3, MX27_GPT4_BASE_ADDR, MX27_INT_GPT4);
159 { 108DEFINE_IMX_GPT_DEVICE(4, MX27_GPT5_BASE_ADDR, MX27_INT_GPT5);
160 .start = GPT4_BASE_ADDR, 109DEFINE_IMX_GPT_DEVICE(5, MX27_GPT6_BASE_ADDR, MX27_INT_GPT6);
161 .end = GPT4_BASE_ADDR + 0x17,
162 .flags = IORESOURCE_MEM,
163 }, {
164 .start = MXC_INT_GPT4,
165 .end = MXC_INT_GPT4,
166 .flags = IORESOURCE_IRQ,
167 }
168};
169
170struct platform_device mxc_gpt3 = {
171 .name = "imx_gpt",
172 .id = 3,
173 .num_resources = ARRAY_SIZE(timer3_resources),
174 .resource = timer3_resources,
175};
176
177static struct resource timer4_resources[] = {
178 {
179 .start = GPT5_BASE_ADDR,
180 .end = GPT5_BASE_ADDR + 0x17,
181 .flags = IORESOURCE_MEM,
182 }, {
183 .start = MXC_INT_GPT5,
184 .end = MXC_INT_GPT5,
185 .flags = IORESOURCE_IRQ,
186 }
187};
188
189struct platform_device mxc_gpt4 = {
190 .name = "imx_gpt",
191 .id = 4,
192 .num_resources = ARRAY_SIZE(timer4_resources),
193 .resource = timer4_resources,
194};
195
196static struct resource timer5_resources[] = {
197 {
198 .start = GPT6_BASE_ADDR,
199 .end = GPT6_BASE_ADDR + 0x17,
200 .flags = IORESOURCE_MEM,
201 }, {
202 .start = MXC_INT_GPT6,
203 .end = MXC_INT_GPT6,
204 .flags = IORESOURCE_IRQ,
205 }
206};
207
208struct platform_device mxc_gpt5 = {
209 .name = "imx_gpt",
210 .id = 5,
211 .num_resources = ARRAY_SIZE(timer5_resources),
212 .resource = timer5_resources,
213};
214#endif 110#endif
215 111
216/* 112/*
@@ -221,9 +117,9 @@ struct platform_device mxc_gpt5 = {
221 */ 117 */
222static struct resource mxc_wdt_resources[] = { 118static struct resource mxc_wdt_resources[] = {
223 { 119 {
224 .start = WDOG_BASE_ADDR, 120 .start = MX2x_WDOG_BASE_ADDR,
225 .end = WDOG_BASE_ADDR + 0x30, 121 .end = MX2x_WDOG_BASE_ADDR + SZ_4K - 1,
226 .flags = IORESOURCE_MEM, 122 .flags = IORESOURCE_MEM,
227 }, 123 },
228}; 124};
229 125
@@ -236,8 +132,8 @@ struct platform_device mxc_wdt = {
236 132
237static struct resource mxc_w1_master_resources[] = { 133static struct resource mxc_w1_master_resources[] = {
238 { 134 {
239 .start = OWIRE_BASE_ADDR, 135 .start = MX2x_OWIRE_BASE_ADDR,
240 .end = OWIRE_BASE_ADDR + SZ_4K - 1, 136 .end = MX2x_OWIRE_BASE_ADDR + SZ_4K - 1,
241 .flags = IORESOURCE_MEM, 137 .flags = IORESOURCE_MEM,
242 }, 138 },
243}; 139};
@@ -249,24 +145,33 @@ struct platform_device mxc_w1_master_device = {
249 .resource = mxc_w1_master_resources, 145 .resource = mxc_w1_master_resources,
250}; 146};
251 147
252static struct resource mxc_nand_resources[] = { 148#define DEFINE_MXC_NAND_DEVICE(pfx, baseaddr, irq) \
253 { 149 static struct resource pfx ## _nand_resources[] = { \
254 .start = NFC_BASE_ADDR, 150 { \
255 .end = NFC_BASE_ADDR + 0xfff, 151 .start = baseaddr, \
256 .flags = IORESOURCE_MEM, 152 .end = baseaddr + SZ_4K - 1, \
257 }, { 153 .flags = IORESOURCE_MEM, \
258 .start = MXC_INT_NANDFC, 154 }, { \
259 .end = MXC_INT_NANDFC, 155 .start = irq, \
260 .flags = IORESOURCE_IRQ, 156 .end = irq, \
261 }, 157 .flags = IORESOURCE_IRQ, \
262}; 158 }, \
159 }; \
160 \
161 struct platform_device pfx ## _nand_device = { \
162 .name = "mxc_nand", \
163 .id = 0, \
164 .num_resources = ARRAY_SIZE(pfx ## _nand_resources), \
165 .resource = pfx ## _nand_resources, \
166 }
263 167
264struct platform_device mxc_nand_device = { 168#ifdef CONFIG_MACH_MX21
265 .name = "mxc_nand", 169DEFINE_MXC_NAND_DEVICE(imx21, MX21_NFC_BASE_ADDR, MX21_INT_NANDFC);
266 .id = 0, 170#endif
267 .num_resources = ARRAY_SIZE(mxc_nand_resources), 171
268 .resource = mxc_nand_resources, 172#ifdef CONFIG_MACH_MX27
269}; 173DEFINE_MXC_NAND_DEVICE(imx27, MX27_NFC_BASE_ADDR, MX27_INT_NANDFC);
174#endif
270 175
271/* 176/*
272 * lcdc: 177 * lcdc:
@@ -276,12 +181,12 @@ struct platform_device mxc_nand_device = {
276 */ 181 */
277static struct resource mxc_fb[] = { 182static struct resource mxc_fb[] = {
278 { 183 {
279 .start = LCDC_BASE_ADDR, 184 .start = MX2x_LCDC_BASE_ADDR,
280 .end = LCDC_BASE_ADDR + 0xFFF, 185 .end = MX2x_LCDC_BASE_ADDR + SZ_4K - 1,
281 .flags = IORESOURCE_MEM, 186 .flags = IORESOURCE_MEM,
282 }, { 187 }, {
283 .start = MXC_INT_LCDC, 188 .start = MX2x_INT_LCDC,
284 .end = MXC_INT_LCDC, 189 .end = MX2x_INT_LCDC,
285 .flags = IORESOURCE_IRQ, 190 .flags = IORESOURCE_IRQ,
286 } 191 }
287}; 192};
@@ -300,13 +205,13 @@ struct platform_device mxc_fb_device = {
300#ifdef CONFIG_MACH_MX27 205#ifdef CONFIG_MACH_MX27
301static struct resource mxc_fec_resources[] = { 206static struct resource mxc_fec_resources[] = {
302 { 207 {
303 .start = FEC_BASE_ADDR, 208 .start = MX27_FEC_BASE_ADDR,
304 .end = FEC_BASE_ADDR + 0xfff, 209 .end = MX27_FEC_BASE_ADDR + SZ_4K - 1,
305 .flags = IORESOURCE_MEM, 210 .flags = IORESOURCE_MEM,
306 }, { 211 }, {
307 .start = MXC_INT_FEC, 212 .start = MX27_INT_FEC,
308 .end = MXC_INT_FEC, 213 .end = MX27_INT_FEC,
309 .flags = IORESOURCE_IRQ, 214 .flags = IORESOURCE_IRQ,
310 }, 215 },
311}; 216};
312 217
@@ -318,55 +223,41 @@ struct platform_device mxc_fec_device = {
318}; 223};
319#endif 224#endif
320 225
321static struct resource mxc_i2c_1_resources[] = { 226#define DEFINE_IMX_I2C_DEVICE(n, baseaddr, irq) \
322 { 227 static struct resource mxc_i2c_resources ## n[] = { \
323 .start = I2C_BASE_ADDR, 228 { \
324 .end = I2C_BASE_ADDR + 0x0fff, 229 .start = baseaddr, \
325 .flags = IORESOURCE_MEM, 230 .end = baseaddr + SZ_4K - 1, \
326 }, { 231 .flags = IORESOURCE_MEM, \
327 .start = MXC_INT_I2C, 232 }, { \
328 .end = MXC_INT_I2C, 233 .start = irq, \
329 .flags = IORESOURCE_IRQ, 234 .end = irq, \
235 .flags = IORESOURCE_IRQ, \
236 } \
237 }; \
238 \
239 struct platform_device mxc_i2c_device ## n = { \
240 .name = "imx-i2c", \
241 .id = n, \
242 .num_resources = ARRAY_SIZE(mxc_i2c_resources ## n), \
243 .resource = mxc_i2c_resources ## n, \
330 } 244 }
331};
332 245
333struct platform_device mxc_i2c_device0 = { 246DEFINE_IMX_I2C_DEVICE(0, MX2x_I2C_BASE_ADDR, MX2x_INT_I2C);
334 .name = "imx-i2c",
335 .id = 0,
336 .num_resources = ARRAY_SIZE(mxc_i2c_1_resources),
337 .resource = mxc_i2c_1_resources,
338};
339 247
340#ifdef CONFIG_MACH_MX27 248#ifdef CONFIG_MACH_MX27
341static struct resource mxc_i2c_2_resources[] = { 249DEFINE_IMX_I2C_DEVICE(1, MX27_I2C2_BASE_ADDR, MX27_INT_I2C2);
342 {
343 .start = I2C2_BASE_ADDR,
344 .end = I2C2_BASE_ADDR + 0x0fff,
345 .flags = IORESOURCE_MEM,
346 }, {
347 .start = MXC_INT_I2C2,
348 .end = MXC_INT_I2C2,
349 .flags = IORESOURCE_IRQ,
350 }
351};
352
353struct platform_device mxc_i2c_device1 = {
354 .name = "imx-i2c",
355 .id = 1,
356 .num_resources = ARRAY_SIZE(mxc_i2c_2_resources),
357 .resource = mxc_i2c_2_resources,
358};
359#endif 250#endif
360 251
361static struct resource mxc_pwm_resources[] = { 252static struct resource mxc_pwm_resources[] = {
362 { 253 {
363 .start = PWM_BASE_ADDR, 254 .start = MX2x_PWM_BASE_ADDR,
364 .end = PWM_BASE_ADDR + 0x0fff, 255 .end = MX2x_PWM_BASE_ADDR + SZ_4K - 1,
365 .flags = IORESOURCE_MEM, 256 .flags = IORESOURCE_MEM,
366 }, { 257 }, {
367 .start = MXC_INT_PWM, 258 .start = MX2x_INT_PWM,
368 .end = MXC_INT_PWM, 259 .end = MX2x_INT_PWM,
369 .flags = IORESOURCE_IRQ, 260 .flags = IORESOURCE_IRQ,
370 } 261 }
371}; 262};
372 263
@@ -377,77 +268,49 @@ struct platform_device mxc_pwm_device = {
377 .resource = mxc_pwm_resources, 268 .resource = mxc_pwm_resources,
378}; 269};
379 270
380/* 271#define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \
381 * Resource definition for the MXC SDHC 272 static struct resource mxc_sdhc_resources ## n[] = { \
382 */ 273 { \
383static struct resource mxc_sdhc1_resources[] = { 274 .start = baseaddr, \
384 { 275 .end = baseaddr + SZ_4K - 1, \
385 .start = SDHC1_BASE_ADDR, 276 .flags = IORESOURCE_MEM, \
386 .end = SDHC1_BASE_ADDR + SZ_4K - 1, 277 }, { \
387 .flags = IORESOURCE_MEM, 278 .start = irq, \
388 }, { 279 .end = irq, \
389 .start = MXC_INT_SDHC1, 280 .flags = IORESOURCE_IRQ, \
390 .end = MXC_INT_SDHC1, 281 }, { \
391 .flags = IORESOURCE_IRQ, 282 .start = dmareq, \
392 }, { 283 .end = dmareq, \
393 .start = DMA_REQ_SDHC1, 284 .flags = IORESOURCE_DMA, \
394 .end = DMA_REQ_SDHC1, 285 }, \
395 .flags = IORESOURCE_DMA, 286 }; \
396 }, 287 \
397}; 288 static u64 mxc_sdhc ## n ## _dmamask = DMA_BIT_MASK(32); \
398 289 \
399static u64 mxc_sdhc1_dmamask = DMA_BIT_MASK(32); 290 struct platform_device mxc_sdhc_device ## n = { \
400 291 .name = "mxc-mmc", \
401struct platform_device mxc_sdhc_device0 = { 292 .id = n, \
402 .name = "mxc-mmc", 293 .dev = { \
403 .id = 0, 294 .dma_mask = &mxc_sdhc ## n ## _dmamask, \
404 .dev = { 295 .coherent_dma_mask = DMA_BIT_MASK(32), \
405 .dma_mask = &mxc_sdhc1_dmamask, 296 }, \
406 .coherent_dma_mask = DMA_BIT_MASK(32), 297 .num_resources = ARRAY_SIZE(mxc_sdhc_resources ## n), \
407 }, 298 .resource = mxc_sdhc_resources ## n, \
408 .num_resources = ARRAY_SIZE(mxc_sdhc1_resources), 299 }
409 .resource = mxc_sdhc1_resources,
410};
411
412static struct resource mxc_sdhc2_resources[] = {
413 {
414 .start = SDHC2_BASE_ADDR,
415 .end = SDHC2_BASE_ADDR + SZ_4K - 1,
416 .flags = IORESOURCE_MEM,
417 }, {
418 .start = MXC_INT_SDHC2,
419 .end = MXC_INT_SDHC2,
420 .flags = IORESOURCE_IRQ,
421 }, {
422 .start = DMA_REQ_SDHC2,
423 .end = DMA_REQ_SDHC2,
424 .flags = IORESOURCE_DMA,
425 },
426};
427
428static u64 mxc_sdhc2_dmamask = DMA_BIT_MASK(32);
429 300
430struct platform_device mxc_sdhc_device1 = { 301DEFINE_MXC_MMC_DEVICE(0, MX2x_SDHC1_BASE_ADDR, MX2x_INT_SDHC1, MX2x_DMA_REQ_SDHC1);
431 .name = "mxc-mmc", 302DEFINE_MXC_MMC_DEVICE(1, MX2x_SDHC2_BASE_ADDR, MX2x_INT_SDHC2, MX2x_DMA_REQ_SDHC2);
432 .id = 1,
433 .dev = {
434 .dma_mask = &mxc_sdhc2_dmamask,
435 .coherent_dma_mask = DMA_BIT_MASK(32),
436 },
437 .num_resources = ARRAY_SIZE(mxc_sdhc2_resources),
438 .resource = mxc_sdhc2_resources,
439};
440 303
441#ifdef CONFIG_MACH_MX27 304#ifdef CONFIG_MACH_MX27
442static struct resource otg_resources[] = { 305static struct resource otg_resources[] = {
443 { 306 {
444 .start = OTG_BASE_ADDR, 307 .start = MX27_USBOTG_BASE_ADDR,
445 .end = OTG_BASE_ADDR + 0x1ff, 308 .end = MX27_USBOTG_BASE_ADDR + 0x1ff,
446 .flags = IORESOURCE_MEM, 309 .flags = IORESOURCE_MEM,
447 }, { 310 }, {
448 .start = MXC_INT_USB3, 311 .start = MX27_INT_USB3,
449 .end = MXC_INT_USB3, 312 .end = MX27_INT_USB3,
450 .flags = IORESOURCE_IRQ, 313 .flags = IORESOURCE_IRQ,
451 }, 314 },
452}; 315};
453 316
@@ -483,12 +346,12 @@ static u64 usbh1_dmamask = DMA_BIT_MASK(32);
483 346
484static struct resource mxc_usbh1_resources[] = { 347static struct resource mxc_usbh1_resources[] = {
485 { 348 {
486 .start = OTG_BASE_ADDR + 0x200, 349 .start = MX27_USBOTG_BASE_ADDR + 0x200,
487 .end = OTG_BASE_ADDR + 0x3ff, 350 .end = MX27_USBOTG_BASE_ADDR + 0x3ff,
488 .flags = IORESOURCE_MEM, 351 .flags = IORESOURCE_MEM,
489 }, { 352 }, {
490 .start = MXC_INT_USB1, 353 .start = MX27_INT_USB1,
491 .end = MXC_INT_USB1, 354 .end = MX27_INT_USB1,
492 .flags = IORESOURCE_IRQ, 355 .flags = IORESOURCE_IRQ,
493 }, 356 },
494}; 357};
@@ -509,12 +372,12 @@ static u64 usbh2_dmamask = DMA_BIT_MASK(32);
509 372
510static struct resource mxc_usbh2_resources[] = { 373static struct resource mxc_usbh2_resources[] = {
511 { 374 {
512 .start = OTG_BASE_ADDR + 0x400, 375 .start = MX27_USBOTG_BASE_ADDR + 0x400,
513 .end = OTG_BASE_ADDR + 0x5ff, 376 .end = MX27_USBOTG_BASE_ADDR + 0x5ff,
514 .flags = IORESOURCE_MEM, 377 .flags = IORESOURCE_MEM,
515 }, { 378 }, {
516 .start = MXC_INT_USB2, 379 .start = MX27_INT_USB2,
517 .end = MXC_INT_USB2, 380 .end = MX27_INT_USB2,
518 .flags = IORESOURCE_IRQ, 381 .flags = IORESOURCE_IRQ,
519 }, 382 },
520}; 383};
@@ -531,129 +394,102 @@ struct platform_device mxc_usbh2 = {
531}; 394};
532#endif 395#endif
533 396
534static struct resource imx_ssi_resources0[] = { 397#define DEFINE_IMX_SSI_DMARES(_name, ssin, suffix) \
535 { 398 { \
536 .start = SSI1_BASE_ADDR, 399 .name = _name, \
537 .end = SSI1_BASE_ADDR + 0x6F, 400 .start = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \
538 .flags = IORESOURCE_MEM, 401 .end = MX2x_DMA_REQ_SSI ## ssin ## _ ## suffix, \
539 }, { 402 .flags = IORESOURCE_DMA, \
540 .start = MXC_INT_SSI1, 403 }
541 .end = MXC_INT_SSI1,
542 .flags = IORESOURCE_IRQ,
543 }, {
544 .name = "tx0",
545 .start = DMA_REQ_SSI1_TX0,
546 .end = DMA_REQ_SSI1_TX0,
547 .flags = IORESOURCE_DMA,
548 }, {
549 .name = "rx0",
550 .start = DMA_REQ_SSI1_RX0,
551 .end = DMA_REQ_SSI1_RX0,
552 .flags = IORESOURCE_DMA,
553 }, {
554 .name = "tx1",
555 .start = DMA_REQ_SSI1_TX1,
556 .end = DMA_REQ_SSI1_TX1,
557 .flags = IORESOURCE_DMA,
558 }, {
559 .name = "rx1",
560 .start = DMA_REQ_SSI1_RX1,
561 .end = DMA_REQ_SSI1_RX1,
562 .flags = IORESOURCE_DMA,
563 },
564};
565
566static struct resource imx_ssi_resources1[] = {
567 {
568 .start = SSI2_BASE_ADDR,
569 .end = SSI2_BASE_ADDR + 0x6F,
570 .flags = IORESOURCE_MEM,
571 }, {
572 .start = MXC_INT_SSI2,
573 .end = MXC_INT_SSI2,
574 .flags = IORESOURCE_IRQ,
575 }, {
576 .name = "tx0",
577 .start = DMA_REQ_SSI2_TX0,
578 .end = DMA_REQ_SSI2_TX0,
579 .flags = IORESOURCE_DMA,
580 }, {
581 .name = "rx0",
582 .start = DMA_REQ_SSI2_RX0,
583 .end = DMA_REQ_SSI2_RX0,
584 .flags = IORESOURCE_DMA,
585 }, {
586 .name = "tx1",
587 .start = DMA_REQ_SSI2_TX1,
588 .end = DMA_REQ_SSI2_TX1,
589 .flags = IORESOURCE_DMA,
590 }, {
591 .name = "rx1",
592 .start = DMA_REQ_SSI2_RX1,
593 .end = DMA_REQ_SSI2_RX1,
594 .flags = IORESOURCE_DMA,
595 },
596};
597 404
598struct platform_device imx_ssi_device0 = { 405#define DEFINE_IMX_SSI_DEVICE(n, ssin, baseaddr, irq) \
599 .name = "imx-ssi", 406 static struct resource imx_ssi_resources ## n[] = { \
600 .id = 0, 407 { \
601 .num_resources = ARRAY_SIZE(imx_ssi_resources0), 408 .start = MX2x_SSI ## ssin ## _BASE_ADDR, \
602 .resource = imx_ssi_resources0, 409 .end = MX2x_SSI ## ssin ## _BASE_ADDR + 0x6f, \
603}; 410 .flags = IORESOURCE_MEM, \
411 }, { \
412 .start = MX2x_INT_SSI1, \
413 .end = MX2x_INT_SSI1, \
414 .flags = IORESOURCE_IRQ, \
415 }, \
416 DEFINE_IMX_SSI_DMARES("tx0", ssin, TX0), \
417 DEFINE_IMX_SSI_DMARES("rx0", ssin, RX0), \
418 DEFINE_IMX_SSI_DMARES("tx1", ssin, TX1), \
419 DEFINE_IMX_SSI_DMARES("rx1", ssin, RX1), \
420 }; \
421 \
422 struct platform_device imx_ssi_device ## n = { \
423 .name = "imx-ssi", \
424 .id = n, \
425 .num_resources = ARRAY_SIZE(imx_ssi_resources ## n), \
426 .resource = imx_ssi_resources ## n, \
427 }
604 428
605struct platform_device imx_ssi_device1 = { 429DEFINE_IMX_SSI_DEVICE(0, 1, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1);
606 .name = "imx-ssi", 430DEFINE_IMX_SSI_DEVICE(1, 2, MX2x_SSI1_BASE_ADDR, MX2x_INT_SSI1);
607 .id = 1,
608 .num_resources = ARRAY_SIZE(imx_ssi_resources1),
609 .resource = imx_ssi_resources1,
610};
611 431
612/* GPIO port description */ 432/* GPIO port description */
613static struct mxc_gpio_port imx_gpio_ports[] = { 433#define DEFINE_MXC_GPIO_PORT_IRQ(SOC, n, _irq) \
614 { 434 { \
615 .chip.label = "gpio-0", 435 .chip.label = "gpio-" #n, \
616 .irq = MXC_INT_GPIO, 436 .irq = _irq, \
617 .base = IO_ADDRESS(GPIO_BASE_ADDR), 437 .base = SOC ## _IO_ADDRESS(MX2x_GPIO_BASE_ADDR + \
618 .virtual_irq_start = MXC_GPIO_IRQ_START, 438 n * 0x100), \
619 }, { 439 .virtual_irq_start = MXC_GPIO_IRQ_START + n * 32, \
620 .chip.label = "gpio-1",
621 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x100),
622 .virtual_irq_start = MXC_GPIO_IRQ_START + 32,
623 }, {
624 .chip.label = "gpio-2",
625 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x200),
626 .virtual_irq_start = MXC_GPIO_IRQ_START + 64,
627 }, {
628 .chip.label = "gpio-3",
629 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x300),
630 .virtual_irq_start = MXC_GPIO_IRQ_START + 96,
631 }, {
632 .chip.label = "gpio-4",
633 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x400),
634 .virtual_irq_start = MXC_GPIO_IRQ_START + 128,
635 }, {
636 .chip.label = "gpio-5",
637 .base = IO_ADDRESS(GPIO_BASE_ADDR + 0x500),
638 .virtual_irq_start = MXC_GPIO_IRQ_START + 160,
639 } 440 }
640}; 441
442#define DEFINE_MXC_GPIO_PORT(SOC, n) \
443 { \
444 .chip.label = "gpio-" #n, \
445 .base = SOC ## _IO_ADDRESS(MX2x_GPIO_BASE_ADDR + \
446 n * 0x100), \
447 .virtual_irq_start = MXC_GPIO_IRQ_START + n * 32, \
448 }
449
450#define DEFINE_MXC_GPIO_PORTS(SOC, pfx) \
451 static struct mxc_gpio_port pfx ## _gpio_ports[] = { \
452 DEFINE_MXC_GPIO_PORT_IRQ(SOC, 0, SOC ## _INT_GPIO), \
453 DEFINE_MXC_GPIO_PORT(SOC, 1), \
454 DEFINE_MXC_GPIO_PORT(SOC, 2), \
455 DEFINE_MXC_GPIO_PORT(SOC, 3), \
456 DEFINE_MXC_GPIO_PORT(SOC, 4), \
457 DEFINE_MXC_GPIO_PORT(SOC, 5), \
458 }
459
460#ifdef CONFIG_MACH_MX21
461DEFINE_MXC_GPIO_PORTS(MX21, imx21);
462#endif
463
464#ifdef CONFIG_MACH_MX27
465DEFINE_MXC_GPIO_PORTS(MX27, imx27);
466#endif
641 467
642int __init mxc_register_gpios(void) 468int __init mxc_register_gpios(void)
643{ 469{
644 return mxc_gpio_init(imx_gpio_ports, ARRAY_SIZE(imx_gpio_ports)); 470#ifdef CONFIG_MACH_MX21
471 if (cpu_is_mx21())
472 return mxc_gpio_init(imx21_gpio_ports, ARRAY_SIZE(imx21_gpio_ports));
473 else
474#endif
475#ifdef CONFIG_MACH_MX27
476 if (cpu_is_mx27())
477 return mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports));
478 else
479#endif
480 return 0;
645} 481}
646 482
647#ifdef CONFIG_MACH_MX21 483#ifdef CONFIG_MACH_MX21
648static struct resource mx21_usbhc_resources[] = { 484static struct resource mx21_usbhc_resources[] = {
649 { 485 {
650 .start = USBOTG_BASE_ADDR, 486 .start = MX21_BASE_ADDR,
651 .end = USBOTG_BASE_ADDR + 0x1FFF, 487 .end = MX21_BASE_ADDR + 0x1FFF,
652 .flags = IORESOURCE_MEM, 488 .flags = IORESOURCE_MEM,
653 }, 489 },
654 { 490 {
655 .start = MXC_INT_USBHOST, 491 .start = MX21_INT_USBHOST,
656 .end = MXC_INT_USBHOST, 492 .end = MX21_INT_USBHOST,
657 .flags = IORESOURCE_IRQ, 493 .flags = IORESOURCE_IRQ,
658 }, 494 },
659}; 495};
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h
index f12694b07369..84ed51380174 100644
--- a/arch/arm/mach-mx2/devices.h
+++ b/arch/arm/mach-mx2/devices.h
@@ -1,8 +1,10 @@
1extern struct platform_device mxc_gpt1; 1extern struct platform_device mxc_gpt1;
2extern struct platform_device mxc_gpt2; 2extern struct platform_device mxc_gpt2;
3#ifdef CONFIG_MACH_MX27
3extern struct platform_device mxc_gpt3; 4extern struct platform_device mxc_gpt3;
4extern struct platform_device mxc_gpt4; 5extern struct platform_device mxc_gpt4;
5extern struct platform_device mxc_gpt5; 6extern struct platform_device mxc_gpt5;
7#endif
6extern struct platform_device mxc_wdt; 8extern struct platform_device mxc_wdt;
7extern struct platform_device mxc_uart_device0; 9extern struct platform_device mxc_uart_device0;
8extern struct platform_device mxc_uart_device1; 10extern struct platform_device mxc_uart_device1;
@@ -11,12 +13,19 @@ extern struct platform_device mxc_uart_device3;
11extern struct platform_device mxc_uart_device4; 13extern struct platform_device mxc_uart_device4;
12extern struct platform_device mxc_uart_device5; 14extern struct platform_device mxc_uart_device5;
13extern struct platform_device mxc_w1_master_device; 15extern struct platform_device mxc_w1_master_device;
14extern struct platform_device mxc_nand_device; 16#ifdef CONFIG_MACH_MX21
17extern struct platform_device imx21_nand_device;
18#endif
19#ifdef CONFIG_MACH_MX27
20extern struct platform_device imx27_nand_device;
21#endif
15extern struct platform_device mxc_fb_device; 22extern struct platform_device mxc_fb_device;
16extern struct platform_device mxc_fec_device; 23extern struct platform_device mxc_fec_device;
17extern struct platform_device mxc_pwm_device; 24extern struct platform_device mxc_pwm_device;
18extern struct platform_device mxc_i2c_device0; 25extern struct platform_device mxc_i2c_device0;
26#ifdef CONFIG_MACH_MX27
19extern struct platform_device mxc_i2c_device1; 27extern struct platform_device mxc_i2c_device1;
28#endif
20extern struct platform_device mxc_sdhc_device0; 29extern struct platform_device mxc_sdhc_device0;
21extern struct platform_device mxc_sdhc_device1; 30extern struct platform_device mxc_sdhc_device1;
22extern struct platform_device mxc_otg_udc_device; 31extern struct platform_device mxc_otg_udc_device;
@@ -25,7 +34,9 @@ extern struct platform_device mxc_usbh1;
25extern struct platform_device mxc_usbh2; 34extern struct platform_device mxc_usbh2;
26extern struct platform_device mxc_spi_device0; 35extern struct platform_device mxc_spi_device0;
27extern struct platform_device mxc_spi_device1; 36extern struct platform_device mxc_spi_device1;
37#ifdef CONFIG_MACH_MX27
28extern struct platform_device mxc_spi_device2; 38extern struct platform_device mxc_spi_device2;
39#endif
29extern struct platform_device mx21_usbhc_device; 40extern struct platform_device mx21_usbhc_device;
30extern struct platform_device imx_ssi_device0; 41extern struct platform_device imx_ssi_device0;
31extern struct platform_device imx_ssi_device1; 42extern struct platform_device imx_ssi_device1;
diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index 7382b6d27ee1..f3b169d5245f 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -28,7 +28,7 @@
28#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
29 29
30#include <mach/common.h> 30#include <mach/common.h>
31#include <mach/iomux.h> 31#include <mach/iomux-mx27.h>
32#include <mach/imxfb.h> 32#include <mach/imxfb.h>
33#include <mach/hardware.h> 33#include <mach/hardware.h>
34#include <mach/mmc.h> 34#include <mach/mmc.h>
diff --git a/arch/arm/mach-mx2/eukrea_cpuimx27.c b/arch/arm/mach-mx2/mach-cpuimx27.c
index 7b187606682c..1f616dcaabc9 100644
--- a/arch/arm/mach-mx2/eukrea_cpuimx27.c
+++ b/arch/arm/mach-mx2/mach-cpuimx27.c
@@ -36,7 +36,7 @@
36#include <mach/common.h> 36#include <mach/common.h>
37#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <mach/i2c.h> 38#include <mach/i2c.h>
39#include <mach/iomux.h> 39#include <mach/iomux-mx27.h>
40#include <mach/imx-uart.h> 40#include <mach/imx-uart.h>
41#include <mach/mxc_nand.h> 41#include <mach/mxc_nand.h>
42 42
@@ -142,28 +142,28 @@ static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = {
142#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 142#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
143static struct plat_serial8250_port serial_platform_data[] = { 143static struct plat_serial8250_port serial_platform_data[] = {
144 { 144 {
145 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x200000), 145 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000),
146 .irq = IRQ_GPIOB(23), 146 .irq = IRQ_GPIOB(23),
147 .uartclk = 14745600, 147 .uartclk = 14745600,
148 .regshift = 1, 148 .regshift = 1,
149 .iotype = UPIO_MEM, 149 .iotype = UPIO_MEM,
150 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 150 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
151 }, { 151 }, {
152 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x400000), 152 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000),
153 .irq = IRQ_GPIOB(22), 153 .irq = IRQ_GPIOB(22),
154 .uartclk = 14745600, 154 .uartclk = 14745600,
155 .regshift = 1, 155 .regshift = 1,
156 .iotype = UPIO_MEM, 156 .iotype = UPIO_MEM,
157 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 157 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
158 }, { 158 }, {
159 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x800000), 159 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000),
160 .irq = IRQ_GPIOB(27), 160 .irq = IRQ_GPIOB(27),
161 .uartclk = 14745600, 161 .uartclk = 14745600,
162 .regshift = 1, 162 .regshift = 1,
163 .iotype = UPIO_MEM, 163 .iotype = UPIO_MEM,
164 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, 164 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
165 }, { 165 }, {
166 .mapbase = (unsigned long)(CS3_BASE_ADDR + 0x1000000), 166 .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000),
167 .irq = IRQ_GPIOB(30), 167 .irq = IRQ_GPIOB(30),
168 .uartclk = 14745600, 168 .uartclk = 14745600,
169 .regshift = 1, 169 .regshift = 1,
@@ -189,7 +189,8 @@ static void __init eukrea_cpuimx27_init(void)
189 189
190 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); 190 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
191 191
192 mxc_register_device(&mxc_nand_device, &eukrea_cpuimx27_nand_board_info); 192 mxc_register_device(&imx27_nand_device,
193 &eukrea_cpuimx27_nand_board_info);
193 194
194 i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices, 195 i2c_register_board_info(0, eukrea_cpuimx27_i2c_devices,
195 ARRAY_SIZE(eukrea_cpuimx27_i2c_devices)); 196 ARRAY_SIZE(eukrea_cpuimx27_i2c_devices));
@@ -224,9 +225,9 @@ static struct sys_timer eukrea_cpuimx27_timer = {
224}; 225};
225 226
226MACHINE_START(CPUIMX27, "EUKREA CPUIMX27") 227MACHINE_START(CPUIMX27, "EUKREA CPUIMX27")
227 .phys_io = AIPI_BASE_ADDR, 228 .phys_io = MX27_AIPI_BASE_ADDR,
228 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 229 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
229 .boot_params = PHYS_OFFSET + 0x100, 230 .boot_params = MX27_PHYS_OFFSET + 0x100,
230 .map_io = mx27_map_io, 231 .map_io = mx27_map_io,
231 .init_irq = mx27_init_irq, 232 .init_irq = mx27_init_irq,
232 .init_machine = eukrea_cpuimx27_init, 233 .init_machine = eukrea_cpuimx27_init,
diff --git a/arch/arm/mach-mx2/mx27lite.c b/arch/arm/mach-mx2/mach-imx27lite.c
index 82ea227ea0cf..b5710bf18b96 100644
--- a/arch/arm/mach-mx2/mx27lite.c
+++ b/arch/arm/mach-mx2/mach-imx27lite.c
@@ -27,7 +27,7 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/common.h> 28#include <mach/common.h>
29#include <mach/imx-uart.h> 29#include <mach/imx-uart.h>
30#include <mach/iomux.h> 30#include <mach/iomux-mx27.h>
31#include <mach/board-mx27lite.h> 31#include <mach/board-mx27lite.h>
32 32
33#include "devices.h" 33#include "devices.h"
@@ -85,9 +85,9 @@ static struct sys_timer mx27lite_timer = {
85}; 85};
86 86
87MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE") 87MACHINE_START(IMX27LITE, "LogicPD i.MX27LITE")
88 .phys_io = AIPI_BASE_ADDR, 88 .phys_io = MX27_AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 89 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100, 90 .boot_params = MX27_PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io, 91 .map_io = mx27_map_io,
92 .init_irq = mx27_init_irq, 92 .init_irq = mx27_init_irq,
93 .init_machine = mx27lite_init, 93 .init_machine = mx27lite_init,
diff --git a/arch/arm/mach-mx2/mx21ads.c b/arch/arm/mach-mx2/mach-mx21ads.c
index cf5f77cbc2f1..113e58d7cb40 100644
--- a/arch/arm/mach-mx2/mx21ads.c
+++ b/arch/arm/mach-mx2/mach-mx21ads.c
@@ -30,7 +30,7 @@
30#include <asm/mach/map.h> 30#include <asm/mach/map.h>
31#include <mach/imx-uart.h> 31#include <mach/imx-uart.h>
32#include <mach/imxfb.h> 32#include <mach/imxfb.h>
33#include <mach/iomux.h> 33#include <mach/iomux-mx21.h>
34#include <mach/mxc_nand.h> 34#include <mach/mxc_nand.h>
35#include <mach/mmc.h> 35#include <mach/mmc.h>
36#include <mach/board-mx21ads.h> 36#include <mach/board-mx21ads.h>
@@ -118,8 +118,8 @@ static struct physmap_flash_data mx21ads_flash_data = {
118}; 118};
119 119
120static struct resource mx21ads_flash_resource = { 120static struct resource mx21ads_flash_resource = {
121 .start = CS0_BASE_ADDR, 121 .start = MX21_CS0_BASE_ADDR,
122 .end = CS0_BASE_ADDR + 0x02000000 - 1, 122 .end = MX21_CS0_BASE_ADDR + 0x02000000 - 1,
123 .flags = IORESOURCE_MEM, 123 .flags = IORESOURCE_MEM,
124}; 124};
125 125
@@ -242,7 +242,7 @@ static struct map_desc mx21ads_io_desc[] __initdata = {
242 */ 242 */
243 { 243 {
244 .virtual = MX21ADS_MMIO_BASE_ADDR, 244 .virtual = MX21ADS_MMIO_BASE_ADDR,
245 .pfn = __phys_to_pfn(CS1_BASE_ADDR), 245 .pfn = __phys_to_pfn(MX21_CS1_BASE_ADDR),
246 .length = MX21ADS_MMIO_SIZE, 246 .length = MX21ADS_MMIO_SIZE,
247 .type = MT_DEVICE, 247 .type = MT_DEVICE,
248 }, 248 },
@@ -268,7 +268,7 @@ static void __init mx21ads_board_init(void)
268 mxc_register_device(&mxc_uart_device3, &uart_pdata); 268 mxc_register_device(&mxc_uart_device3, &uart_pdata);
269 mxc_register_device(&mxc_fb_device, &mx21ads_fb_data); 269 mxc_register_device(&mxc_fb_device, &mx21ads_fb_data);
270 mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); 270 mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata);
271 mxc_register_device(&mxc_nand_device, &mx21ads_nand_board_info); 271 mxc_register_device(&imx21_nand_device, &mx21ads_nand_board_info);
272 272
273 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 273 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
274} 274}
@@ -284,9 +284,9 @@ static struct sys_timer mx21ads_timer = {
284 284
285MACHINE_START(MX21ADS, "Freescale i.MX21ADS") 285MACHINE_START(MX21ADS, "Freescale i.MX21ADS")
286 /* maintainer: Freescale Semiconductor, Inc. */ 286 /* maintainer: Freescale Semiconductor, Inc. */
287 .phys_io = AIPI_BASE_ADDR, 287 .phys_io = MX21_AIPI_BASE_ADDR,
288 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 288 .io_pg_offst = ((MX21_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
289 .boot_params = PHYS_OFFSET + 0x100, 289 .boot_params = MX21_PHYS_OFFSET + 0x100,
290 .map_io = mx21ads_map_io, 290 .map_io = mx21ads_map_io,
291 .init_irq = mx21_init_irq, 291 .init_irq = mx21_init_irq,
292 .init_machine = mx21ads_board_init, 292 .init_machine = mx21ads_board_init,
diff --git a/arch/arm/mach-mx2/mx27pdk.c b/arch/arm/mach-mx2/mach-mx27_3ds.c
index 6761d1b79e43..b2f4e0db3fb3 100644
--- a/arch/arm/mach-mx2/mx27pdk.c
+++ b/arch/arm/mach-mx2/mach-mx27_3ds.c
@@ -26,7 +26,7 @@
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/common.h> 27#include <mach/common.h>
28#include <mach/imx-uart.h> 28#include <mach/imx-uart.h>
29#include <mach/iomux.h> 29#include <mach/iomux-mx27.h>
30#include <mach/board-mx27pdk.h> 30#include <mach/board-mx27pdk.h>
31 31
32#include "devices.h" 32#include "devices.h"
@@ -85,9 +85,9 @@ static struct sys_timer mx27pdk_timer = {
85 85
86MACHINE_START(MX27_3DS, "Freescale MX27PDK") 86MACHINE_START(MX27_3DS, "Freescale MX27PDK")
87 /* maintainer: Freescale Semiconductor, Inc. */ 87 /* maintainer: Freescale Semiconductor, Inc. */
88 .phys_io = AIPI_BASE_ADDR, 88 .phys_io = MX27_AIPI_BASE_ADDR,
89 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 89 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
90 .boot_params = PHYS_OFFSET + 0x100, 90 .boot_params = MX27_PHYS_OFFSET + 0x100,
91 .map_io = mx27_map_io, 91 .map_io = mx27_map_io,
92 .init_irq = mx27_init_irq, 92 .init_irq = mx27_init_irq,
93 .init_machine = mx27pdk_init, 93 .init_machine = mx27pdk_init,
diff --git a/arch/arm/mach-mx2/mx27ads.c b/arch/arm/mach-mx2/mach-mx27ads.c
index 83e412b713e6..6ce323669e58 100644
--- a/arch/arm/mach-mx2/mx27ads.c
+++ b/arch/arm/mach-mx2/mach-mx27ads.c
@@ -33,7 +33,7 @@
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <mach/gpio.h> 34#include <mach/gpio.h>
35#include <mach/imx-uart.h> 35#include <mach/imx-uart.h>
36#include <mach/iomux.h> 36#include <mach/iomux-mx27.h>
37#include <mach/board-mx27ads.h> 37#include <mach/board-mx27ads.h>
38#include <mach/mxc_nand.h> 38#include <mach/mxc_nand.h>
39#include <mach/i2c.h> 39#include <mach/i2c.h>
@@ -290,7 +290,7 @@ static void __init mx27ads_board_init(void)
290 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]); 290 mxc_register_device(&mxc_uart_device3, &uart_pdata[3]);
291 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]); 291 mxc_register_device(&mxc_uart_device4, &uart_pdata[4]);
292 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]); 292 mxc_register_device(&mxc_uart_device5, &uart_pdata[5]);
293 mxc_register_device(&mxc_nand_device, &mx27ads_nand_board_info); 293 mxc_register_device(&imx27_nand_device, &mx27ads_nand_board_info);
294 294
295 /* only the i2c master 1 is used on this CPU card */ 295 /* only the i2c master 1 is used on this CPU card */
296 i2c_register_board_info(1, mx27ads_i2c_devices, 296 i2c_register_board_info(1, mx27ads_i2c_devices,
@@ -320,7 +320,7 @@ static struct sys_timer mx27ads_timer = {
320static struct map_desc mx27ads_io_desc[] __initdata = { 320static struct map_desc mx27ads_io_desc[] __initdata = {
321 { 321 {
322 .virtual = PBC_BASE_ADDRESS, 322 .virtual = PBC_BASE_ADDRESS,
323 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 323 .pfn = __phys_to_pfn(MX27_CS4_BASE_ADDR),
324 .length = SZ_1M, 324 .length = SZ_1M,
325 .type = MT_DEVICE, 325 .type = MT_DEVICE,
326 }, 326 },
@@ -334,9 +334,9 @@ static void __init mx27ads_map_io(void)
334 334
335MACHINE_START(MX27ADS, "Freescale i.MX27ADS") 335MACHINE_START(MX27ADS, "Freescale i.MX27ADS")
336 /* maintainer: Freescale Semiconductor, Inc. */ 336 /* maintainer: Freescale Semiconductor, Inc. */
337 .phys_io = AIPI_BASE_ADDR, 337 .phys_io = MX27_AIPI_BASE_ADDR,
338 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 338 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
339 .boot_params = PHYS_OFFSET + 0x100, 339 .boot_params = MX27_PHYS_OFFSET + 0x100,
340 .map_io = mx27ads_map_io, 340 .map_io = mx27ads_map_io,
341 .init_irq = mx27_init_irq, 341 .init_irq = mx27_init_irq,
342 .init_machine = mx27ads_board_init, 342 .init_machine = mx27ads_board_init,
diff --git a/arch/arm/mach-mx2/mxt_td60.c b/arch/arm/mach-mx2/mach-mxt_td60.c
index 8bcc1a5b8829..bc3855992677 100644
--- a/arch/arm/mach-mx2/mxt_td60.c
+++ b/arch/arm/mach-mx2/mach-mxt_td60.c
@@ -33,7 +33,7 @@
33#include <asm/mach/map.h> 33#include <asm/mach/map.h>
34#include <linux/gpio.h> 34#include <linux/gpio.h>
35#include <mach/imx-uart.h> 35#include <mach/imx-uart.h>
36#include <mach/iomux.h> 36#include <mach/iomux-mx27.h>
37#include <mach/mxc_nand.h> 37#include <mach/mxc_nand.h>
38#include <mach/i2c.h> 38#include <mach/i2c.h>
39#include <linux/i2c/pca953x.h> 39#include <linux/i2c/pca953x.h>
@@ -257,7 +257,7 @@ static void __init mxt_td60_board_init(void)
257 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]); 257 mxc_register_device(&mxc_uart_device0, &uart_pdata[0]);
258 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]); 258 mxc_register_device(&mxc_uart_device1, &uart_pdata[1]);
259 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); 259 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
260 mxc_register_device(&mxc_nand_device, &mxt_td60_nand_board_info); 260 mxc_register_device(&imx27_nand_device, &mxt_td60_nand_board_info);
261 261
262 i2c_register_board_info(0, mxt_td60_i2c_devices, 262 i2c_register_board_info(0, mxt_td60_i2c_devices,
263 ARRAY_SIZE(mxt_td60_i2c_devices)); 263 ARRAY_SIZE(mxt_td60_i2c_devices));
@@ -284,9 +284,9 @@ static struct sys_timer mxt_td60_timer = {
284 284
285MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60") 285MACHINE_START(MXT_TD60, "Maxtrack i-MXT TD60")
286 /* maintainer: Maxtrack Industrial */ 286 /* maintainer: Maxtrack Industrial */
287 .phys_io = AIPI_BASE_ADDR, 287 .phys_io = MX27_AIPI_BASE_ADDR,
288 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 288 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
289 .boot_params = PHYS_OFFSET + 0x100, 289 .boot_params = MX27_PHYS_OFFSET + 0x100,
290 .map_io = mx27_map_io, 290 .map_io = mx27_map_io,
291 .init_irq = mx27_init_irq, 291 .init_irq = mx27_init_irq,
292 .init_machine = mxt_td60_board_init, 292 .init_machine = mxt_td60_board_init,
diff --git a/arch/arm/mach-mx2/pca100.c b/arch/arm/mach-mx2/mach-pca100.c
index aea3d340d2e1..778fff230918 100644
--- a/arch/arm/mach-mx2/pca100.c
+++ b/arch/arm/mach-mx2/mach-pca100.c
@@ -25,25 +25,36 @@
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/eeprom.h> 26#include <linux/spi/eeprom.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <linux/delay.h>
28#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/usb/otg.h>
31#include <linux/usb/ulpi.h>
32#include <linux/fsl_devices.h>
29 33
30#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
31#include <asm/mach-types.h> 35#include <asm/mach-types.h>
32#include <mach/common.h> 36#include <mach/common.h>
33#include <mach/hardware.h> 37#include <mach/hardware.h>
34#include <mach/iomux.h> 38#include <mach/iomux-mx27.h>
35#include <mach/i2c.h> 39#include <mach/i2c.h>
36#include <asm/mach/time.h> 40#include <asm/mach/time.h>
37#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE) 41#if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
38#include <mach/spi.h> 42#include <mach/spi.h>
39#endif 43#endif
40#include <mach/imx-uart.h> 44#include <mach/imx-uart.h>
45#include <mach/audmux.h>
46#include <mach/ssi.h>
41#include <mach/mxc_nand.h> 47#include <mach/mxc_nand.h>
42#include <mach/irqs.h> 48#include <mach/irqs.h>
43#include <mach/mmc.h> 49#include <mach/mmc.h>
50#include <mach/mxc_ehci.h>
51#include <mach/ulpi.h>
44 52
45#include "devices.h" 53#include "devices.h"
46 54
55#define OTG_PHY_CS_GPIO (GPIO_PORTB + 23)
56#define USBH2_PHY_CS_GPIO (GPIO_PORTB + 24)
57
47static int pca100_pins[] = { 58static int pca100_pins[] = {
48 /* UART1 */ 59 /* UART1 */
49 PE12_PF_UART1_TXD, 60 PE12_PF_UART1_TXD,
@@ -92,6 +103,34 @@ static int pca100_pins[] = {
92 PD29_PF_CSPI1_SCLK, 103 PD29_PF_CSPI1_SCLK,
93 PD30_PF_CSPI1_MISO, 104 PD30_PF_CSPI1_MISO,
94 PD31_PF_CSPI1_MOSI, 105 PD31_PF_CSPI1_MOSI,
106 /* OTG */
107 OTG_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT,
108 PC7_PF_USBOTG_DATA5,
109 PC8_PF_USBOTG_DATA6,
110 PC9_PF_USBOTG_DATA0,
111 PC10_PF_USBOTG_DATA2,
112 PC11_PF_USBOTG_DATA1,
113 PC12_PF_USBOTG_DATA4,
114 PC13_PF_USBOTG_DATA3,
115 PE0_PF_USBOTG_NXT,
116 PE1_PF_USBOTG_STP,
117 PE2_PF_USBOTG_DIR,
118 PE24_PF_USBOTG_CLK,
119 PE25_PF_USBOTG_DATA7,
120 /* USBH2 */
121 USBH2_PHY_CS_GPIO | GPIO_GPIO | GPIO_OUT,
122 PA0_PF_USBH2_CLK,
123 PA1_PF_USBH2_DIR,
124 PA2_PF_USBH2_DATA7,
125 PA3_PF_USBH2_NXT,
126 PA4_PF_USBH2_STP,
127 PD19_AF_USBH2_DATA4,
128 PD20_AF_USBH2_DATA3,
129 PD21_AF_USBH2_DATA6,
130 PD22_AF_USBH2_DATA0,
131 PD23_AF_USBH2_DATA2,
132 PD24_AF_USBH2_DATA1,
133 PD26_AF_USBH2_DATA5,
95}; 134};
96 135
97static struct imxuart_platform_data uart_pdata = { 136static struct imxuart_platform_data uart_pdata = {
@@ -157,6 +196,37 @@ static struct spi_imx_master pca100_spi_0_data = {
157}; 196};
158#endif 197#endif
159 198
199static void pca100_ac97_warm_reset(struct snd_ac97 *ac97)
200{
201 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT);
202 gpio_set_value(GPIO_PORTC + 20, 1);
203 udelay(2);
204 gpio_set_value(GPIO_PORTC + 20, 0);
205 mxc_gpio_mode(PC20_PF_SSI1_FS);
206 msleep(2);
207}
208
209static void pca100_ac97_cold_reset(struct snd_ac97 *ac97)
210{
211 mxc_gpio_mode(GPIO_PORTC | 20 | GPIO_GPIO | GPIO_OUT); /* FS */
212 gpio_set_value(GPIO_PORTC + 20, 0);
213 mxc_gpio_mode(GPIO_PORTC | 22 | GPIO_GPIO | GPIO_OUT); /* TX */
214 gpio_set_value(GPIO_PORTC + 22, 0);
215 mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_OUT); /* reset */
216 gpio_set_value(GPIO_PORTC + 28, 0);
217 udelay(10);
218 gpio_set_value(GPIO_PORTC + 28, 1);
219 mxc_gpio_mode(PC20_PF_SSI1_FS);
220 mxc_gpio_mode(PC22_PF_SSI1_TXD);
221 msleep(2);
222}
223
224static struct imx_ssi_platform_data pca100_ssi_pdata = {
225 .ac97_reset = pca100_ac97_cold_reset,
226 .ac97_warm_reset = pca100_ac97_warm_reset,
227 .flags = IMX_SSI_USE_AC97,
228};
229
160static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 230static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
161 void *data) 231 void *data)
162{ 232{
@@ -182,21 +252,79 @@ static struct imxmmc_platform_data sdhc_pdata = {
182 .exit = pca100_sdhc2_exit, 252 .exit = pca100_sdhc2_exit,
183}; 253};
184 254
255static int otg_phy_init(struct platform_device *pdev)
256{
257 gpio_set_value(OTG_PHY_CS_GPIO, 0);
258 return 0;
259}
260
261static struct mxc_usbh_platform_data otg_pdata = {
262 .init = otg_phy_init,
263 .portsc = MXC_EHCI_MODE_ULPI,
264 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
265};
266
267static int usbh2_phy_init(struct platform_device *pdev)
268{
269 gpio_set_value(USBH2_PHY_CS_GPIO, 0);
270 return 0;
271}
272
273static struct mxc_usbh_platform_data usbh2_pdata = {
274 .init = usbh2_phy_init,
275 .portsc = MXC_EHCI_MODE_ULPI,
276 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
277};
278
279static struct fsl_usb2_platform_data otg_device_pdata = {
280 .operating_mode = FSL_USB2_DR_DEVICE,
281 .phy_mode = FSL_USB2_PHY_ULPI,
282};
283
284static int otg_mode_host;
285
286static int __init pca100_otg_mode(char *options)
287{
288 if (!strcmp(options, "host"))
289 otg_mode_host = 1;
290 else if (!strcmp(options, "device"))
291 otg_mode_host = 0;
292 else
293 pr_info("otg_mode neither \"host\" nor \"device\". "
294 "Defaulting to device\n");
295 return 0;
296}
297__setup("otg_mode=", pca100_otg_mode);
298
185static void __init pca100_init(void) 299static void __init pca100_init(void)
186{ 300{
187 int ret; 301 int ret;
188 302
303 /* SSI unit */
304 mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
305 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
306 MXC_AUDMUX_V1_PCR_TFCSEL(3) |
307 MXC_AUDMUX_V1_PCR_TCLKDIR | /* clock is output */
308 MXC_AUDMUX_V1_PCR_RXDSEL(3));
309 mxc_audmux_v1_configure_port(3,
310 MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
311 MXC_AUDMUX_V1_PCR_TFCSEL(0) |
312 MXC_AUDMUX_V1_PCR_TFSDIR |
313 MXC_AUDMUX_V1_PCR_RXDSEL(0));
314
189 ret = mxc_gpio_setup_multiple_pins(pca100_pins, 315 ret = mxc_gpio_setup_multiple_pins(pca100_pins,
190 ARRAY_SIZE(pca100_pins), "PCA100"); 316 ARRAY_SIZE(pca100_pins), "PCA100");
191 if (ret) 317 if (ret)
192 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret); 318 printk(KERN_ERR "pca100: Failed to setup pins (%d)\n", ret);
193 319
320 mxc_register_device(&imx_ssi_device0, &pca100_ssi_pdata);
321
194 mxc_register_device(&mxc_uart_device0, &uart_pdata); 322 mxc_register_device(&mxc_uart_device0, &uart_pdata);
195 323
196 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN); 324 mxc_gpio_mode(GPIO_PORTC | 29 | GPIO_GPIO | GPIO_IN);
197 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata); 325 mxc_register_device(&mxc_sdhc_device1, &sdhc_pdata);
198 326
199 mxc_register_device(&mxc_nand_device, &pca100_nand_board_info); 327 mxc_register_device(&imx27_nand_device, &pca100_nand_board_info);
200 328
201 /* only the i2c master 1 is used on this CPU card */ 329 /* only the i2c master 1 is used on this CPU card */
202 i2c_register_board_info(1, pca100_i2c_devices, 330 i2c_register_board_info(1, pca100_i2c_devices,
@@ -220,6 +348,29 @@ static void __init pca100_init(void)
220 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data); 348 mxc_register_device(&mxc_spi_device0, &pca100_spi_0_data);
221#endif 349#endif
222 350
351 gpio_request(OTG_PHY_CS_GPIO, "usb-otg-cs");
352 gpio_direction_output(OTG_PHY_CS_GPIO, 1);
353 gpio_request(USBH2_PHY_CS_GPIO, "usb-host2-cs");
354 gpio_direction_output(USBH2_PHY_CS_GPIO, 1);
355
356#if defined(CONFIG_USB_ULPI)
357 if (otg_mode_host) {
358 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
359 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
360
361 mxc_register_device(&mxc_otg_host, &otg_pdata);
362 }
363
364 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
365 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
366
367 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
368#endif
369 if (!otg_mode_host) {
370 gpio_set_value(OTG_PHY_CS_GPIO, 0);
371 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
372 }
373
223 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 374 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
224} 375}
225 376
@@ -233,9 +384,9 @@ static struct sys_timer pca100_timer = {
233}; 384};
234 385
235MACHINE_START(PCA100, "phyCARD-i.MX27") 386MACHINE_START(PCA100, "phyCARD-i.MX27")
236 .phys_io = AIPI_BASE_ADDR, 387 .phys_io = MX27_AIPI_BASE_ADDR,
237 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 388 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
238 .boot_params = PHYS_OFFSET + 0x100, 389 .boot_params = MX27_PHYS_OFFSET + 0x100,
239 .map_io = mx27_map_io, 390 .map_io = mx27_map_io,
240 .init_irq = mx27_init_irq, 391 .init_irq = mx27_init_irq,
241 .init_machine = pca100_init, 392 .init_machine = pca100_init,
diff --git a/arch/arm/mach-mx2/pcm038.c b/arch/arm/mach-mx2/mach-pcm038.c
index 906d59b0a7aa..035fbe046ec0 100644
--- a/arch/arm/mach-mx2/pcm038.c
+++ b/arch/arm/mach-mx2/mach-pcm038.c
@@ -36,10 +36,12 @@
36#include <mach/common.h> 36#include <mach/common.h>
37#include <mach/hardware.h> 37#include <mach/hardware.h>
38#include <mach/i2c.h> 38#include <mach/i2c.h>
39#include <mach/iomux.h> 39#include <mach/iomux-mx27.h>
40#include <mach/imx-uart.h> 40#include <mach/imx-uart.h>
41#include <mach/mxc_nand.h> 41#include <mach/mxc_nand.h>
42#include <mach/spi.h> 42#include <mach/spi.h>
43#include <mach/mxc_ehci.h>
44#include <mach/ulpi.h>
43 45
44#include "devices.h" 46#include "devices.h"
45 47
@@ -96,6 +98,19 @@ static int pcm038_pins[] = {
96 PC17_PF_SSI4_RXD, 98 PC17_PF_SSI4_RXD,
97 PC18_PF_SSI4_TXD, 99 PC18_PF_SSI4_TXD,
98 PC19_PF_SSI4_CLK, 100 PC19_PF_SSI4_CLK,
101 /* USB host */
102 PA0_PF_USBH2_CLK,
103 PA1_PF_USBH2_DIR,
104 PA2_PF_USBH2_DATA7,
105 PA3_PF_USBH2_NXT,
106 PA4_PF_USBH2_STP,
107 PD19_AF_USBH2_DATA4,
108 PD20_AF_USBH2_DATA3,
109 PD21_AF_USBH2_DATA6,
110 PD22_AF_USBH2_DATA0,
111 PD23_AF_USBH2_DATA2,
112 PD24_AF_USBH2_DATA1,
113 PD26_AF_USBH2_DATA5,
99}; 114};
100 115
101/* 116/*
@@ -108,8 +123,8 @@ static struct platdata_mtd_ram pcm038_sram_data = {
108}; 123};
109 124
110static struct resource pcm038_sram_resource = { 125static struct resource pcm038_sram_resource = {
111 .start = CS1_BASE_ADDR, 126 .start = MX27_CS1_BASE_ADDR,
112 .end = CS1_BASE_ADDR + 512 * 1024 - 1, 127 .end = MX27_CS1_BASE_ADDR + 512 * 1024 - 1,
113 .flags = IORESOURCE_MEM, 128 .flags = IORESOURCE_MEM,
114}; 129};
115 130
@@ -173,9 +188,7 @@ static struct platform_device *platform_devices[] __initdata = {
173 * setup other stuffs to access the sram. */ 188 * setup other stuffs to access the sram. */
174static void __init pcm038_init_sram(void) 189static void __init pcm038_init_sram(void)
175{ 190{
176 __raw_writel(0x0000d843, CSCR_U(1)); 191 mx27_setup_weimcs(1, 0x0000d843, 0x22252521, 0x22220a00);
177 __raw_writel(0x22252521, CSCR_L(1));
178 __raw_writel(0x22220a00, CSCR_A(1));
179} 192}
180 193
181static struct imxi2c_platform_data pcm038_i2c_1_data = { 194static struct imxi2c_platform_data pcm038_i2c_1_data = {
@@ -279,6 +292,11 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = {
279 } 292 }
280}; 293};
281 294
295static struct mxc_usbh_platform_data usbh2_pdata = {
296 .portsc = MXC_EHCI_MODE_ULPI,
297 .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI,
298};
299
282static void __init pcm038_init(void) 300static void __init pcm038_init(void)
283{ 301{
284 mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins), 302 mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
@@ -291,7 +309,7 @@ static void __init pcm038_init(void)
291 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]); 309 mxc_register_device(&mxc_uart_device2, &uart_pdata[2]);
292 310
293 mxc_gpio_mode(PE16_AF_OWIRE); 311 mxc_gpio_mode(PE16_AF_OWIRE);
294 mxc_register_device(&mxc_nand_device, &pcm038_nand_board_info); 312 mxc_register_device(&imx27_nand_device, &pcm038_nand_board_info);
295 313
296 /* only the i2c master 1 is used on this CPU card */ 314 /* only the i2c master 1 is used on this CPU card */
297 i2c_register_board_info(1, pcm038_i2c_devices, 315 i2c_register_board_info(1, pcm038_i2c_devices,
@@ -311,6 +329,8 @@ static void __init pcm038_init(void)
311 spi_register_board_info(pcm038_spi_board_info, 329 spi_register_board_info(pcm038_spi_board_info,
312 ARRAY_SIZE(pcm038_spi_board_info)); 330 ARRAY_SIZE(pcm038_spi_board_info));
313 331
332 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
333
314 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 334 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
315 335
316#ifdef CONFIG_MACH_PCM970_BASEBOARD 336#ifdef CONFIG_MACH_PCM970_BASEBOARD
@@ -328,9 +348,9 @@ static struct sys_timer pcm038_timer = {
328}; 348};
329 349
330MACHINE_START(PCM038, "phyCORE-i.MX27") 350MACHINE_START(PCM038, "phyCORE-i.MX27")
331 .phys_io = AIPI_BASE_ADDR, 351 .phys_io = MX27_AIPI_BASE_ADDR,
332 .io_pg_offst = ((AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc, 352 .io_pg_offst = ((MX27_AIPI_BASE_ADDR_VIRT) >> 18) & 0xfffc,
333 .boot_params = PHYS_OFFSET + 0x100, 353 .boot_params = MX27_PHYS_OFFSET + 0x100,
334 .map_io = mx27_map_io, 354 .map_io = mx27_map_io,
335 .init_irq = mx27_init_irq, 355 .init_irq = mx27_init_irq,
336 .init_machine = pcm038_init, 356 .init_machine = pcm038_init,
diff --git a/arch/arm/mach-mx2/mm-imx21.c b/arch/arm/mach-mx2/mm-imx21.c
new file mode 100644
index 000000000000..64134314d012
--- /dev/null
+++ b/arch/arm/mach-mx2/mm-imx21.c
@@ -0,0 +1,83 @@
1/*
2 * arch/arm/mach-mx2/mm-imx21.c
3 *
4 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA.
19 */
20
21#include <linux/mm.h>
22#include <linux/init.h>
23#include <mach/hardware.h>
24#include <mach/common.h>
25#include <asm/pgtable.h>
26#include <asm/mach/map.h>
27
28/* MX21 memory map definition */
29static struct map_desc imx21_io_desc[] __initdata = {
30 /*
31 * this fixed mapping covers:
32 * - AIPI1
33 * - AIPI2
34 * - AITC
35 * - ROM Patch
36 * - and some reserved space
37 */
38 {
39 .virtual = MX21_AIPI_BASE_ADDR_VIRT,
40 .pfn = __phys_to_pfn(MX21_AIPI_BASE_ADDR),
41 .length = MX21_AIPI_SIZE,
42 .type = MT_DEVICE
43 },
44 /*
45 * this fixed mapping covers:
46 * - CSI
47 * - ATA
48 */
49 {
50 .virtual = MX21_SAHB1_BASE_ADDR_VIRT,
51 .pfn = __phys_to_pfn(MX21_SAHB1_BASE_ADDR),
52 .length = MX21_SAHB1_SIZE,
53 .type = MT_DEVICE
54 },
55 /*
56 * this fixed mapping covers:
57 * - EMI
58 */
59 {
60 .virtual = MX21_X_MEMC_BASE_ADDR_VIRT,
61 .pfn = __phys_to_pfn(MX21_X_MEMC_BASE_ADDR),
62 .length = MX21_X_MEMC_SIZE,
63 .type = MT_DEVICE
64 },
65};
66
67/*
68 * Initialize the memory map. It is called during the
69 * system startup to create static physical to virtual
70 * memory map for the IO modules.
71 */
72void __init mx21_map_io(void)
73{
74 mxc_set_cpu_type(MXC_CPU_MX21);
75 mxc_arch_reset_init(MX21_IO_ADDRESS(MX21_WDOG_BASE_ADDR));
76
77 iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
78}
79
80void __init mx21_init_irq(void)
81{
82 mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
83}
diff --git a/arch/arm/mach-mx2/generic.c b/arch/arm/mach-mx2/mm-imx27.c
index ae8f759134d1..3366ed44cfd5 100644
--- a/arch/arm/mach-mx2/generic.c
+++ b/arch/arm/mach-mx2/mm-imx27.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * generic.c 2 * arch/arm/mach-mx2/mm-imx27.c
3 * 3 *
4 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de) 4 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)
5 * 5 *
@@ -26,7 +26,7 @@
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
27 27
28/* MX27 memory map definition */ 28/* MX27 memory map definition */
29static struct map_desc mxc_io_desc[] __initdata = { 29static struct map_desc imx27_io_desc[] __initdata = {
30 /* 30 /*
31 * this fixed mapping covers: 31 * this fixed mapping covers:
32 * - AIPI1 32 * - AIPI1
@@ -36,9 +36,9 @@ static struct map_desc mxc_io_desc[] __initdata = {
36 * - and some reserved space 36 * - and some reserved space
37 */ 37 */
38 { 38 {
39 .virtual = AIPI_BASE_ADDR_VIRT, 39 .virtual = MX27_AIPI_BASE_ADDR_VIRT,
40 .pfn = __phys_to_pfn(AIPI_BASE_ADDR), 40 .pfn = __phys_to_pfn(MX27_AIPI_BASE_ADDR),
41 .length = AIPI_SIZE, 41 .length = MX27_AIPI_SIZE,
42 .type = MT_DEVICE 42 .type = MT_DEVICE
43 }, 43 },
44 /* 44 /*
@@ -47,9 +47,9 @@ static struct map_desc mxc_io_desc[] __initdata = {
47 * - ATA 47 * - ATA
48 */ 48 */
49 { 49 {
50 .virtual = SAHB1_BASE_ADDR_VIRT, 50 .virtual = MX27_SAHB1_BASE_ADDR_VIRT,
51 .pfn = __phys_to_pfn(SAHB1_BASE_ADDR), 51 .pfn = __phys_to_pfn(MX27_SAHB1_BASE_ADDR),
52 .length = SAHB1_SIZE, 52 .length = MX27_SAHB1_SIZE,
53 .type = MT_DEVICE 53 .type = MT_DEVICE
54 }, 54 },
55 /* 55 /*
@@ -57,11 +57,11 @@ static struct map_desc mxc_io_desc[] __initdata = {
57 * - EMI 57 * - EMI
58 */ 58 */
59 { 59 {
60 .virtual = X_MEMC_BASE_ADDR_VIRT, 60 .virtual = MX27_X_MEMC_BASE_ADDR_VIRT,
61 .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), 61 .pfn = __phys_to_pfn(MX27_X_MEMC_BASE_ADDR),
62 .length = X_MEMC_SIZE, 62 .length = MX27_X_MEMC_SIZE,
63 .type = MT_DEVICE 63 .type = MT_DEVICE
64 } 64 },
65}; 65};
66 66
67/* 67/*
@@ -69,29 +69,15 @@ static struct map_desc mxc_io_desc[] __initdata = {
69 * system startup to create static physical to virtual 69 * system startup to create static physical to virtual
70 * memory map for the IO modules. 70 * memory map for the IO modules.
71 */ 71 */
72void __init mx21_map_io(void)
73{
74 mxc_set_cpu_type(MXC_CPU_MX21);
75 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR));
76
77 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
78}
79
80void __init mx27_map_io(void) 72void __init mx27_map_io(void)
81{ 73{
82 mxc_set_cpu_type(MXC_CPU_MX27); 74 mxc_set_cpu_type(MXC_CPU_MX27);
83 mxc_arch_reset_init(IO_ADDRESS(WDOG_BASE_ADDR)); 75 mxc_arch_reset_init(MX27_IO_ADDRESS(MX27_WDOG_BASE_ADDR));
84 76
85 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); 77 iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc));
86} 78}
87 79
88void __init mx27_init_irq(void) 80void __init mx27_init_irq(void)
89{ 81{
90 mxc_init_irq(IO_ADDRESS(AVIC_BASE_ADDR)); 82 mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
91} 83}
92
93void __init mx21_init_irq(void)
94{
95 mx27_init_irq();
96}
97
diff --git a/arch/arm/mach-mx2/pcm970-baseboard.c b/arch/arm/mach-mx2/pcm970-baseboard.c
index 3cb7f457e5d0..4aafd5b8b85b 100644
--- a/arch/arm/mach-mx2/pcm970-baseboard.c
+++ b/arch/arm/mach-mx2/pcm970-baseboard.c
@@ -24,7 +24,7 @@
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/common.h> 26#include <mach/common.h>
27#include <mach/iomux.h> 27#include <mach/iomux-mx27.h>
28#include <mach/imxfb.h> 28#include <mach/imxfb.h>
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/mmc.h> 30#include <mach/mmc.h>
@@ -190,8 +190,8 @@ static struct imx_fb_platform_data pcm038_fb_data = {
190 190
191static struct resource pcm970_sja1000_resources[] = { 191static struct resource pcm970_sja1000_resources[] = {
192 { 192 {
193 .start = CS4_BASE_ADDR, 193 .start = MX27_CS4_BASE_ADDR,
194 .end = CS4_BASE_ADDR + 0x100 - 1, 194 .end = MX27_CS4_BASE_ADDR + 0x100 - 1,
195 .flags = IORESOURCE_MEM, 195 .flags = IORESOURCE_MEM,
196 }, { 196 }, {
197 .start = IRQ_GPIOE(19), 197 .start = IRQ_GPIOE(19),
diff --git a/arch/arm/mach-mx2/serial.c b/arch/arm/mach-mx2/serial.c
index 40a485cdc10e..1c0c835b2252 100644
--- a/arch/arm/mach-mx2/serial.c
+++ b/arch/arm/mach-mx2/serial.c
@@ -26,12 +26,12 @@
26 26
27static struct resource uart0[] = { 27static struct resource uart0[] = {
28 { 28 {
29 .start = UART1_BASE_ADDR, 29 .start = MX2x_UART1_BASE_ADDR,
30 .end = UART1_BASE_ADDR + 0x0B5, 30 .end = MX2x_UART1_BASE_ADDR + 0x0B5,
31 .flags = IORESOURCE_MEM, 31 .flags = IORESOURCE_MEM,
32 }, { 32 }, {
33 .start = MXC_INT_UART1, 33 .start = MX2x_INT_UART1,
34 .end = MXC_INT_UART1, 34 .end = MX2x_INT_UART1,
35 .flags = IORESOURCE_IRQ, 35 .flags = IORESOURCE_IRQ,
36 }, 36 },
37}; 37};
@@ -45,12 +45,12 @@ struct platform_device mxc_uart_device0 = {
45 45
46static struct resource uart1[] = { 46static struct resource uart1[] = {
47 { 47 {
48 .start = UART2_BASE_ADDR, 48 .start = MX2x_UART2_BASE_ADDR,
49 .end = UART2_BASE_ADDR + 0x0B5, 49 .end = MX2x_UART2_BASE_ADDR + 0x0B5,
50 .flags = IORESOURCE_MEM, 50 .flags = IORESOURCE_MEM,
51 }, { 51 }, {
52 .start = MXC_INT_UART2, 52 .start = MX2x_INT_UART2,
53 .end = MXC_INT_UART2, 53 .end = MX2x_INT_UART2,
54 .flags = IORESOURCE_IRQ, 54 .flags = IORESOURCE_IRQ,
55 }, 55 },
56}; 56};
@@ -64,12 +64,12 @@ struct platform_device mxc_uart_device1 = {
64 64
65static struct resource uart2[] = { 65static struct resource uart2[] = {
66 { 66 {
67 .start = UART3_BASE_ADDR, 67 .start = MX2x_UART3_BASE_ADDR,
68 .end = UART3_BASE_ADDR + 0x0B5, 68 .end = MX2x_UART3_BASE_ADDR + 0x0B5,
69 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
70 }, { 70 }, {
71 .start = MXC_INT_UART3, 71 .start = MX2x_INT_UART3,
72 .end = MXC_INT_UART3, 72 .end = MX2x_INT_UART3,
73 .flags = IORESOURCE_IRQ, 73 .flags = IORESOURCE_IRQ,
74 }, 74 },
75}; 75};
@@ -83,12 +83,12 @@ struct platform_device mxc_uart_device2 = {
83 83
84static struct resource uart3[] = { 84static struct resource uart3[] = {
85 { 85 {
86 .start = UART4_BASE_ADDR, 86 .start = MX2x_UART4_BASE_ADDR,
87 .end = UART4_BASE_ADDR + 0x0B5, 87 .end = MX2x_UART4_BASE_ADDR + 0x0B5,
88 .flags = IORESOURCE_MEM, 88 .flags = IORESOURCE_MEM,
89 }, { 89 }, {
90 .start = MXC_INT_UART4, 90 .start = MX2x_INT_UART4,
91 .end = MXC_INT_UART4, 91 .end = MX2x_INT_UART4,
92 .flags = IORESOURCE_IRQ, 92 .flags = IORESOURCE_IRQ,
93 }, 93 },
94}; 94};
@@ -103,12 +103,12 @@ struct platform_device mxc_uart_device3 = {
103#ifdef CONFIG_MACH_MX27 103#ifdef CONFIG_MACH_MX27
104static struct resource uart4[] = { 104static struct resource uart4[] = {
105 { 105 {
106 .start = UART5_BASE_ADDR, 106 .start = MX27_UART5_BASE_ADDR,
107 .end = UART5_BASE_ADDR + 0x0B5, 107 .end = MX27_UART5_BASE_ADDR + 0x0B5,
108 .flags = IORESOURCE_MEM, 108 .flags = IORESOURCE_MEM,
109 }, { 109 }, {
110 .start = MXC_INT_UART5, 110 .start = MX27_INT_UART5,
111 .end = MXC_INT_UART5, 111 .end = MX27_INT_UART5,
112 .flags = IORESOURCE_IRQ, 112 .flags = IORESOURCE_IRQ,
113 }, 113 },
114}; 114};
@@ -122,12 +122,12 @@ struct platform_device mxc_uart_device4 = {
122 122
123static struct resource uart5[] = { 123static struct resource uart5[] = {
124 { 124 {
125 .start = UART6_BASE_ADDR, 125 .start = MX27_UART6_BASE_ADDR,
126 .end = UART6_BASE_ADDR + 0x0B5, 126 .end = MX27_UART6_BASE_ADDR + 0x0B5,
127 .flags = IORESOURCE_MEM, 127 .flags = IORESOURCE_MEM,
128 }, { 128 }, {
129 .start = MXC_INT_UART6, 129 .start = MX27_INT_UART6,
130 .end = MXC_INT_UART6, 130 .end = MX27_INT_UART6,
131 .flags = IORESOURCE_IRQ, 131 .flags = IORESOURCE_IRQ,
132 }, 132 },
133}; 133};
diff --git a/arch/arm/mach-mx25/Kconfig b/arch/arm/mach-mx25/Kconfig
index cc28f56eae80..54d217314ee9 100644
--- a/arch/arm/mach-mx25/Kconfig
+++ b/arch/arm/mach-mx25/Kconfig
@@ -3,7 +3,6 @@ if ARCH_MX25
3comment "MX25 platforms:" 3comment "MX25 platforms:"
4 4
5config MACH_MX25_3DS 5config MACH_MX25_3DS
6 select ARCH_MXC_IOMUX_V3
7 bool "Support MX25PDK (3DS) Platform" 6 bool "Support MX25PDK (3DS) Platform"
8 7
9endif 8endif
diff --git a/arch/arm/mach-mx25/Makefile b/arch/arm/mach-mx25/Makefile
index fe23836a9f3d..10cebc5ced8c 100644
--- a/arch/arm/mach-mx25/Makefile
+++ b/arch/arm/mach-mx25/Makefile
@@ -1,3 +1,3 @@
1obj-y := mm.o devices.o 1obj-y := mm.o devices.o
2obj-$(CONFIG_ARCH_MX25) += clock.o 2obj-$(CONFIG_ARCH_MX25) += clock.o
3obj-$(CONFIG_MACH_MX25_3DS) += mx25pdk.o 3obj-$(CONFIG_MACH_MX25_3DS) += mach-mx25pdk.o
diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c
index 37e1359ad0c0..155014993b13 100644
--- a/arch/arm/mach-mx25/clock.c
+++ b/arch/arm/mach-mx25/clock.c
@@ -124,6 +124,11 @@ static unsigned long get_rate_gpt(struct clk *clk)
124 return get_rate_per(5); 124 return get_rate_per(5);
125} 125}
126 126
127static unsigned long get_rate_lcdc(struct clk *clk)
128{
129 return get_rate_per(7);
130}
131
127static unsigned long get_rate_otg(struct clk *clk) 132static unsigned long get_rate_otg(struct clk *clk)
128{ 133{
129 return 48000000; /* FIXME */ 134 return 48000000; /* FIXME */
@@ -167,6 +172,8 @@ DEFINE_CLOCK(cspi1_clk, 0, CCM_CGCR1, 5, get_rate_ipg, NULL, NULL);
167DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL); 172DEFINE_CLOCK(cspi2_clk, 0, CCM_CGCR1, 6, get_rate_ipg, NULL, NULL);
168DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL); 173DEFINE_CLOCK(cspi3_clk, 0, CCM_CGCR1, 7, get_rate_ipg, NULL, NULL);
169DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL); 174DEFINE_CLOCK(fec_ahb_clk, 0, CCM_CGCR0, 23, NULL, NULL, NULL);
175DEFINE_CLOCK(lcdc_ahb_clk, 0, CCM_CGCR0, 24, NULL, NULL, NULL);
176DEFINE_CLOCK(lcdc_per_clk, 0, CCM_CGCR0, 7, NULL, NULL, &lcdc_ahb_clk);
170DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk); 177DEFINE_CLOCK(uart1_clk, 0, CCM_CGCR2, 14, get_rate_uart, NULL, &uart_per_clk);
171DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk); 178DEFINE_CLOCK(uart2_clk, 0, CCM_CGCR2, 15, get_rate_uart, NULL, &uart_per_clk);
172DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk); 179DEFINE_CLOCK(uart3_clk, 0, CCM_CGCR2, 16, get_rate_uart, NULL, &uart_per_clk);
@@ -182,6 +189,8 @@ DEFINE_CLOCK(kpp_clk, 0, CCM_CGCR1, 28, get_rate_ipg, NULL, NULL);
182DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL); 189DEFINE_CLOCK(tsc_clk, 0, CCM_CGCR2, 13, get_rate_ipg, NULL, NULL);
183DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL); 190DEFINE_CLOCK(i2c_clk, 0, CCM_CGCR0, 6, get_rate_i2c, NULL, NULL);
184DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk); 191DEFINE_CLOCK(fec_clk, 0, CCM_CGCR1, 15, get_rate_ipg, NULL, &fec_ahb_clk);
192DEFINE_CLOCK(dryice_clk, 0, CCM_CGCR1, 8, get_rate_ipg, NULL, NULL);
193DEFINE_CLOCK(lcdc_clk, 0, CCM_CGCR1, 29, get_rate_lcdc, NULL, &lcdc_per_clk);
185 194
186#define _REGISTER_CLOCK(d, n, c) \ 195#define _REGISTER_CLOCK(d, n, c) \
187 { \ 196 { \
@@ -214,6 +223,8 @@ static struct clk_lookup lookups[] = {
214 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk) 223 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk)
215 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk) 224 _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk)
216 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 225 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
226 _REGISTER_CLOCK("imxdi_rtc.0", NULL, dryice_clk)
227 _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
217}; 228};
218 229
219int __init mx25_clocks_init(void) 230int __init mx25_clocks_init(void)
@@ -228,6 +239,9 @@ int __init mx25_clocks_init(void)
228 __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1); 239 __raw_writel((0xf << 16) | (3 << 26), CRM_BASE + CCM_CGCR1);
229 __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2); 240 __raw_writel((1 << 5), CRM_BASE + CCM_CGCR2);
230 241
242 /* Clock source for lcdc is upll */
243 __raw_writel(__raw_readl(CRM_BASE+0x64) | (1 << 7), CRM_BASE + 0x64);
244
231 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54); 245 mxc_timer_init(&gpt_clk, MX25_IO_ADDRESS(MX25_GPT1_BASE_ADDR), 54);
232 246
233 return 0; 247 return 0;
diff --git a/arch/arm/mach-mx25/devices.c b/arch/arm/mach-mx25/devices.c
index 9fdeea1c083b..3f4b8a0b5fac 100644
--- a/arch/arm/mach-mx25/devices.c
+++ b/arch/arm/mach-mx25/devices.c
@@ -438,3 +438,65 @@ struct platform_device mx25_fec_device = {
438 .num_resources = ARRAY_SIZE(mx25_fec_resources), 438 .num_resources = ARRAY_SIZE(mx25_fec_resources),
439 .resource = mx25_fec_resources, 439 .resource = mx25_fec_resources,
440}; 440};
441
442static struct resource mxc_nand_resources[] = {
443 {
444 .start = MX25_NFC_BASE_ADDR,
445 .end = MX25_NFC_BASE_ADDR + 0x1fff,
446 .flags = IORESOURCE_MEM,
447 },
448 {
449 .start = MX25_INT_NANDFC,
450 .end = MX25_INT_NANDFC,
451 .flags = IORESOURCE_IRQ,
452 },
453};
454
455struct platform_device mxc_nand_device = {
456 .name = "mxc_nand",
457 .id = 0,
458 .num_resources = ARRAY_SIZE(mxc_nand_resources),
459 .resource = mxc_nand_resources,
460};
461
462static struct resource mx25_rtc_resources[] = {
463 {
464 .start = MX25_DRYICE_BASE_ADDR,
465 .end = MX25_DRYICE_BASE_ADDR + 0x40,
466 .flags = IORESOURCE_MEM,
467 },
468 {
469 .start = MX25_INT_DRYICE,
470 .flags = IORESOURCE_IRQ
471 },
472};
473
474struct platform_device mx25_rtc_device = {
475 .name = "imxdi_rtc",
476 .id = 0,
477 .num_resources = ARRAY_SIZE(mx25_rtc_resources),
478 .resource = mx25_rtc_resources,
479};
480
481static struct resource mx25_fb_resources[] = {
482 {
483 .start = MX25_LCDC_BASE_ADDR,
484 .end = MX25_LCDC_BASE_ADDR + 0xfff,
485 .flags = IORESOURCE_MEM,
486 },
487 {
488 .start = MX25_INT_LCDC,
489 .end = MX25_INT_LCDC,
490 .flags = IORESOURCE_IRQ,
491 },
492};
493
494struct platform_device mx25_fb_device = {
495 .name = "imx-fb",
496 .id = 0,
497 .resource = mx25_fb_resources,
498 .num_resources = ARRAY_SIZE(mx25_fb_resources),
499 .dev = {
500 .coherent_dma_mask = 0xFFFFFFFF,
501 },
502};
diff --git a/arch/arm/mach-mx25/devices.h b/arch/arm/mach-mx25/devices.h
index fe5420fcd11f..39560e13bc0d 100644
--- a/arch/arm/mach-mx25/devices.h
+++ b/arch/arm/mach-mx25/devices.h
@@ -18,3 +18,6 @@ extern struct platform_device mxc_i2c_device0;
18extern struct platform_device mxc_i2c_device1; 18extern struct platform_device mxc_i2c_device1;
19extern struct platform_device mxc_i2c_device2; 19extern struct platform_device mxc_i2c_device2;
20extern struct platform_device mx25_fec_device; 20extern struct platform_device mx25_fec_device;
21extern struct platform_device mxc_nand_device;
22extern struct platform_device mx25_rtc_device;
23extern struct platform_device mx25_fb_device;
diff --git a/arch/arm/mach-mx25/mx25pdk.c b/arch/arm/mach-mx25/mach-mx25pdk.c
index 6f06089246eb..83d74109e7d8 100644
--- a/arch/arm/mach-mx25/mx25pdk.c
+++ b/arch/arm/mach-mx25/mach-mx25pdk.c
@@ -35,8 +35,9 @@
35#include <mach/imx-uart.h> 35#include <mach/imx-uart.h>
36#include <mach/mx25.h> 36#include <mach/mx25.h>
37#include <mach/mxc_nand.h> 37#include <mach/mxc_nand.h>
38#include <mach/imxfb.h>
38#include "devices.h" 39#include "devices.h"
39#include <mach/iomux.h> 40#include <mach/iomux-mx25.h>
40 41
41static struct imxuart_platform_data uart_pdata = { 42static struct imxuart_platform_data uart_pdata = {
42 .flags = IMXUART_HAVE_RTSCTS, 43 .flags = IMXUART_HAVE_RTSCTS,
@@ -54,6 +55,31 @@ static struct pad_desc mx25pdk_pads[] = {
54 MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, 55 MX25_PAD_FEC_TX_CLK__FEC_TX_CLK,
55 MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */ 56 MX25_PAD_A17__GPIO_2_3, /* FEC_EN, GPIO 35 */
56 MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */ 57 MX25_PAD_D12__GPIO_4_8, /* FEC_RESET_B, GPIO 104 */
58
59 /* LCD */
60 MX25_PAD_LD0__LD0,
61 MX25_PAD_LD1__LD1,
62 MX25_PAD_LD2__LD2,
63 MX25_PAD_LD3__LD3,
64 MX25_PAD_LD4__LD4,
65 MX25_PAD_LD5__LD5,
66 MX25_PAD_LD6__LD6,
67 MX25_PAD_LD7__LD7,
68 MX25_PAD_LD8__LD8,
69 MX25_PAD_LD9__LD9,
70 MX25_PAD_LD10__LD10,
71 MX25_PAD_LD11__LD11,
72 MX25_PAD_LD12__LD12,
73 MX25_PAD_LD13__LD13,
74 MX25_PAD_LD14__LD14,
75 MX25_PAD_LD15__LD15,
76 MX25_PAD_GPIO_E__LD16,
77 MX25_PAD_GPIO_F__LD17,
78 MX25_PAD_HSYNC__HSYNC,
79 MX25_PAD_VSYNC__VSYNC,
80 MX25_PAD_LSCLK__LSCLK,
81 MX25_PAD_OE_ACD__OE_ACD,
82 MX25_PAD_CONTRAST__CONTRAST,
57}; 83};
58 84
59static struct fec_platform_data mx25_fec_pdata = { 85static struct fec_platform_data mx25_fec_pdata = {
@@ -77,6 +103,40 @@ static void __init mx25pdk_fec_reset(void)
77 gpio_set_value(FEC_RESET_B_GPIO, 1); 103 gpio_set_value(FEC_RESET_B_GPIO, 1);
78} 104}
79 105
106static struct mxc_nand_platform_data mx25pdk_nand_board_info = {
107 .width = 1,
108 .hw_ecc = 1,
109 .flash_bbt = 1,
110};
111
112static struct imx_fb_videomode mx25pdk_modes[] = {
113 {
114 .mode = {
115 .name = "CRT-VGA",
116 .refresh = 60,
117 .xres = 640,
118 .yres = 480,
119 .pixclock = 39683,
120 .left_margin = 45,
121 .right_margin = 114,
122 .upper_margin = 33,
123 .lower_margin = 11,
124 .hsync_len = 1,
125 .vsync_len = 1,
126 },
127 .bpp = 16,
128 .pcr = 0xFA208B80,
129 },
130};
131
132static struct imx_fb_platform_data mx25pdk_fb_pdata = {
133 .mode = mx25pdk_modes,
134 .num_modes = ARRAY_SIZE(mx25pdk_modes),
135 .pwmr = 0x00A903FF,
136 .lscr1 = 0x00120300,
137 .dmacr = 0x00020010,
138};
139
80static void __init mx25pdk_init(void) 140static void __init mx25pdk_init(void)
81{ 141{
82 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads, 142 mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
@@ -84,6 +144,9 @@ static void __init mx25pdk_init(void)
84 144
85 mxc_register_device(&mxc_uart_device0, &uart_pdata); 145 mxc_register_device(&mxc_uart_device0, &uart_pdata);
86 mxc_register_device(&mxc_usbh2, NULL); 146 mxc_register_device(&mxc_usbh2, NULL);
147 mxc_register_device(&mxc_nand_device, &mx25pdk_nand_board_info);
148 mxc_register_device(&mx25_rtc_device, NULL);
149 mxc_register_device(&mx25_fb_device, &mx25pdk_fb_pdata);
87 150
88 mx25pdk_fec_reset(); 151 mx25pdk_fec_reset();
89 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata); 152 mxc_register_device(&mx25_fec_device, &mx25_fec_pdata);
@@ -102,7 +165,7 @@ MACHINE_START(MX25_3DS, "Freescale MX25PDK (3DS)")
102 /* Maintainer: Freescale Semiconductor, Inc. */ 165 /* Maintainer: Freescale Semiconductor, Inc. */
103 .phys_io = MX25_AIPS1_BASE_ADDR, 166 .phys_io = MX25_AIPS1_BASE_ADDR,
104 .io_pg_offst = ((MX25_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 167 .io_pg_offst = ((MX25_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
105 .boot_params = PHYS_OFFSET + 0x100, 168 .boot_params = MX25_PHYS_OFFSET + 0x100,
106 .map_io = mx25_map_io, 169 .map_io = mx25_map_io,
107 .init_irq = mx25_init_irq, 170 .init_irq = mx25_init_irq,
108 .init_machine = mx25pdk_init, 171 .init_machine = mx25pdk_init,
diff --git a/arch/arm/mach-mx3/Kconfig b/arch/arm/mach-mx3/Kconfig
index 28294416b0af..3872af1cf2c3 100644
--- a/arch/arm/mach-mx3/Kconfig
+++ b/arch/arm/mach-mx3/Kconfig
@@ -34,6 +34,7 @@ config MACH_MX31ADS_WM1133_EV1
34config MACH_PCM037 34config MACH_PCM037
35 bool "Support Phytec pcm037 (i.MX31) platforms" 35 bool "Support Phytec pcm037 (i.MX31) platforms"
36 select ARCH_MX31 36 select ARCH_MX31
37 select MXC_ULPI if USB_ULPI
37 help 38 help
38 Include support for Phytec pcm037 platform. This includes 39 Include support for Phytec pcm037 platform. This includes
39 specific configurations for the board and its peripherals. 40 specific configurations for the board and its peripherals.
@@ -86,6 +87,7 @@ config MACH_QONG
86config MACH_PCM043 87config MACH_PCM043
87 bool "Support Phytec pcm043 (i.MX35) platforms" 88 bool "Support Phytec pcm043 (i.MX35) platforms"
88 select ARCH_MX35 89 select ARCH_MX35
90 select MXC_ULPI if USB_ULPI
89 help 91 help
90 Include support for Phytec pcm043 platform. This includes 92 Include support for Phytec pcm043 platform. This includes
91 specific configurations for the board and its peripherals. 93 specific configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx3/Makefile b/arch/arm/mach-mx3/Makefile
index 93c7b296be6a..5d650fda5d5d 100644
--- a/arch/arm/mach-mx3/Makefile
+++ b/arch/arm/mach-mx3/Makefile
@@ -5,18 +5,22 @@
5# Object file lists. 5# Object file lists.
6 6
7obj-y := mm.o devices.o cpu.o 7obj-y := mm.o devices.o cpu.o
8obj-$(CONFIG_ARCH_MX31) += clock.o iomux.o 8CFLAGS_mm.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS
9CFLAGS_devices.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS
10CFLAGS_cpu.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS
11obj-$(CONFIG_ARCH_MX31) += clock-imx31.o iomux-imx31.o
9obj-$(CONFIG_ARCH_MX35) += clock-imx35.o 12obj-$(CONFIG_ARCH_MX35) += clock-imx35.o
10obj-$(CONFIG_MACH_MX31ADS) += mx31ads.o 13obj-$(CONFIG_MACH_MX31ADS) += mach-mx31ads.o
11obj-$(CONFIG_MACH_MX31LILLY) += mx31lilly.o mx31lilly-db.o 14obj-$(CONFIG_MACH_MX31LILLY) += mach-mx31lilly.o mx31lilly-db.o
12obj-$(CONFIG_MACH_MX31LITE) += mx31lite.o mx31lite-db.o 15obj-$(CONFIG_MACH_MX31LITE) += mach-mx31lite.o mx31lite-db.o
13obj-$(CONFIG_MACH_PCM037) += pcm037.o 16obj-$(CONFIG_MACH_PCM037) += mach-pcm037.o
14obj-$(CONFIG_MACH_PCM037_EET) += pcm037_eet.o 17obj-$(CONFIG_MACH_PCM037_EET) += mach-pcm037_eet.o
15obj-$(CONFIG_MACH_MX31_3DS) += mx31pdk.o 18obj-$(CONFIG_MACH_MX31_3DS) += mach-mx31_3ds.o
16obj-$(CONFIG_MACH_MX31MOBOARD) += mx31moboard.o mx31moboard-devboard.o \ 19CFLAGS_mach-mx31_3ds.o = -DIMX_NEEDS_DEPRECATED_SYMBOLS
17 mx31moboard-marxbot.o 20obj-$(CONFIG_MACH_MX31MOBOARD) += mach-mx31moboard.o mx31moboard-devboard.o \
18obj-$(CONFIG_MACH_QONG) += qong.o 21 mx31moboard-marxbot.o mx31moboard-smartbot.o
19obj-$(CONFIG_MACH_PCM043) += pcm043.o 22obj-$(CONFIG_MACH_QONG) += mach-qong.o
20obj-$(CONFIG_MACH_ARMADILLO5X0) += armadillo5x0.o 23obj-$(CONFIG_MACH_PCM043) += mach-pcm043.o
21obj-$(CONFIG_MACH_MX35_3DS) += mx35pdk.o 24obj-$(CONFIG_MACH_ARMADILLO5X0) += mach-armadillo5x0.o
22obj-$(CONFIG_MACH_KZM_ARM11_01) += kzmarm11.o 25obj-$(CONFIG_MACH_MX35_3DS) += mach-mx35pdk.o
26obj-$(CONFIG_MACH_KZM_ARM11_01) += mach-kzm_arm11_01.o
diff --git a/arch/arm/mach-mx3/clock.c b/arch/arm/mach-mx3/clock-imx31.c
index b5c39a016db7..80dba9966b5e 100644
--- a/arch/arm/mach-mx3/clock.c
+++ b/arch/arm/mach-mx3/clock-imx31.c
@@ -616,14 +616,15 @@ int __init mx31_clocks_init(unsigned long fref)
616 616
617 mx31_read_cpu_rev(); 617 mx31_read_cpu_rev();
618 618
619 if (mx31_revision() >= CHIP_REV_2_0) { 619 if (mx31_revision() >= MX31_CHIP_REV_2_0) {
620 reg = __raw_readl(MXC_CCM_PMCR1); 620 reg = __raw_readl(MXC_CCM_PMCR1);
621 /* No PLL restart on DVFS switch; enable auto EMI handshake */ 621 /* No PLL restart on DVFS switch; enable auto EMI handshake */
622 reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN; 622 reg |= MXC_CCM_PMCR1_PLLRDIS | MXC_CCM_PMCR1_EMIRQ_EN;
623 __raw_writel(reg, MXC_CCM_PMCR1); 623 __raw_writel(reg, MXC_CCM_PMCR1);
624 } 624 }
625 625
626 mxc_timer_init(&ipg_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT); 626 mxc_timer_init(&ipg_clk, MX31_IO_ADDRESS(MX31_GPT1_BASE_ADDR),
627 MX31_INT_GPT);
627 628
628 return 0; 629 return 0;
629} 630}
diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c
index f3f41fa4f21b..9f3e943e2232 100644
--- a/arch/arm/mach-mx3/clock-imx35.c
+++ b/arch/arm/mach-mx3/clock-imx35.c
@@ -28,7 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/common.h> 29#include <mach/common.h>
30 30
31#define CCM_BASE IO_ADDRESS(CCM_BASE_ADDR) 31#define CCM_BASE MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR)
32 32
33#define CCM_CCMR 0x00 33#define CCM_CCMR 0x00
34#define CCM_PDR0 0x04 34#define CCM_PDR0 0x04
@@ -502,7 +502,8 @@ int __init mx35_clocks_init()
502 __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2); 502 __raw_writel((3 << 26) | ll, CCM_BASE + CCM_CGR2);
503 __raw_writel(0, CCM_BASE + CCM_CGR3); 503 __raw_writel(0, CCM_BASE + CCM_CGR3);
504 504
505 mxc_timer_init(&gpt_clk, IO_ADDRESS(GPT1_BASE_ADDR), MXC_INT_GPT); 505 mxc_timer_init(&gpt_clk,
506 MX35_IO_ADDRESS(MX35_GPT1_BASE_ADDR), MX35_INT_GPT);
506 507
507 return 0; 508 return 0;
508} 509}
diff --git a/arch/arm/mach-mx3/cpu.c b/arch/arm/mach-mx3/cpu.c
index db828809c675..861afe0fe3ad 100644
--- a/arch/arm/mach-mx3/cpu.c
+++ b/arch/arm/mach-mx3/cpu.c
@@ -41,7 +41,7 @@ void __init mx31_read_cpu_rev(void)
41 u32 i, srev; 41 u32 i, srev;
42 42
43 /* read SREV register from IIM module */ 43 /* read SREV register from IIM module */
44 srev = __raw_readl(IO_ADDRESS(IIM_BASE_ADDR) + MXC_IIMSREV); 44 srev = __raw_readl(IO_ADDRESS(IIM_BASE_ADDR + MXC_IIMSREV));
45 45
46 for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++) 46 for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
47 if (srev == mx31_cpu_type[i].srev) { 47 if (srev == mx31_cpu_type[i].srev) {
diff --git a/arch/arm/mach-mx3/crm_regs.h b/arch/arm/mach-mx3/crm_regs.h
index adfa3627ad84..37a8a07beda3 100644
--- a/arch/arm/mach-mx3/crm_regs.h
+++ b/arch/arm/mach-mx3/crm_regs.h
@@ -24,7 +24,7 @@
24#define CKIH_CLK_FREQ_27MHZ 27000000 24#define CKIH_CLK_FREQ_27MHZ 27000000
25#define CKIL_CLK_FREQ 32768 25#define CKIL_CLK_FREQ 32768
26 26
27#define MXC_CCM_BASE IO_ADDRESS(CCM_BASE_ADDR) 27#define MXC_CCM_BASE MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR)
28 28
29/* Register addresses */ 29/* Register addresses */
30#define MXC_CCM_CCMR (MXC_CCM_BASE + 0x00) 30#define MXC_CCM_CCMR (MXC_CCM_BASE + 0x00)
diff --git a/arch/arm/mach-mx3/iomux.c b/arch/arm/mach-mx3/iomux-imx31.c
index c66ccbcdc11b..a1d7fa5123dc 100644
--- a/arch/arm/mach-mx3/iomux.c
+++ b/arch/arm/mach-mx3/iomux-imx31.c
@@ -29,7 +29,7 @@
29/* 29/*
30 * IOMUX register (base) addresses 30 * IOMUX register (base) addresses
31 */ 31 */
32#define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) 32#define IOMUX_BASE MX31_IO_ADDRESS(MX31_IOMUXC_BASE_ADDR)
33#define IOMUXINT_OBS1 (IOMUX_BASE + 0x000) 33#define IOMUXINT_OBS1 (IOMUX_BASE + 0x000)
34#define IOMUXINT_OBS2 (IOMUX_BASE + 0x004) 34#define IOMUXINT_OBS2 (IOMUX_BASE + 0x004)
35#define IOMUXGPR (IOMUX_BASE + 0x008) 35#define IOMUXGPR (IOMUX_BASE + 0x008)
diff --git a/arch/arm/mach-mx3/armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c
index 54aab401dbdf..3d72b0b89705 100644
--- a/arch/arm/mach-mx3/armadillo5x0.c
+++ b/arch/arm/mach-mx3/mach-armadillo5x0.c
@@ -182,8 +182,8 @@ static struct physmap_flash_data armadillo5x0_nor_flash_pdata = {
182 182
183static struct resource armadillo5x0_nor_flash_resource = { 183static struct resource armadillo5x0_nor_flash_resource = {
184 .flags = IORESOURCE_MEM, 184 .flags = IORESOURCE_MEM,
185 .start = CS0_BASE_ADDR, 185 .start = MX31_CS0_BASE_ADDR,
186 .end = CS0_BASE_ADDR + SZ_64M - 1, 186 .end = MX31_CS0_BASE_ADDR + SZ_64M - 1,
187}; 187};
188 188
189static struct platform_device armadillo5x0_nor_flash = { 189static struct platform_device armadillo5x0_nor_flash = {
@@ -311,8 +311,8 @@ static struct imxmmc_platform_data sdhc_pdata = {
311 */ 311 */
312static struct resource armadillo5x0_smc911x_resources[] = { 312static struct resource armadillo5x0_smc911x_resources[] = {
313 { 313 {
314 .start = CS3_BASE_ADDR, 314 .start = MX31_CS3_BASE_ADDR,
315 .end = CS3_BASE_ADDR + SZ_32M - 1, 315 .end = MX31_CS3_BASE_ADDR + SZ_32M - 1,
316 .flags = IORESOURCE_MEM, 316 .flags = IORESOURCE_MEM,
317 }, { 317 }, {
318 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), 318 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0),
@@ -406,9 +406,9 @@ static struct sys_timer armadillo5x0_timer = {
406 406
407MACHINE_START(ARMADILLO5X0, "Armadillo-500") 407MACHINE_START(ARMADILLO5X0, "Armadillo-500")
408 /* Maintainer: Alberto Panizzo */ 408 /* Maintainer: Alberto Panizzo */
409 .phys_io = AIPS1_BASE_ADDR, 409 .phys_io = MX31_AIPS1_BASE_ADDR,
410 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 410 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
411 .boot_params = PHYS_OFFSET + 0x00000100, 411 .boot_params = MX3x_PHYS_OFFSET + 0x100,
412 .map_io = mx31_map_io, 412 .map_io = mx31_map_io,
413 .init_irq = mx31_init_irq, 413 .init_irq = mx31_init_irq,
414 .timer = &armadillo5x0_timer, 414 .timer = &armadillo5x0_timer,
diff --git a/arch/arm/mach-mx3/kzmarm11.c b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
index 6fa99ce3008a..f085d5d1a6de 100644
--- a/arch/arm/mach-mx3/kzmarm11.c
+++ b/arch/arm/mach-mx3/mach-kzm_arm11_01.c
@@ -46,13 +46,18 @@
46 46
47#include "devices.h" 47#include "devices.h"
48 48
49#define KZM_ARM11_IO_ADDRESS(x) ( \
50 IMX_IO_ADDRESS(x, MX31_CS4) ?: \
51 IMX_IO_ADDRESS(x, MX31_CS5) ?: \
52 MX31_IO_ADDRESS(x))
53
49#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 54#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
50/* 55/*
51 * KZM-ARM11-01 has an external UART on FPGA 56 * KZM-ARM11-01 has an external UART on FPGA
52 */ 57 */
53static struct plat_serial8250_port serial_platform_data[] = { 58static struct plat_serial8250_port serial_platform_data[] = {
54 { 59 {
55 .membase = IO_ADDRESS(KZM_ARM11_16550), 60 .membase = KZM_ARM11_IO_ADDRESS(KZM_ARM11_16550),
56 .mapbase = KZM_ARM11_16550, 61 .mapbase = KZM_ARM11_16550,
57 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), 62 .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1),
58 .irqflags = IRQ_TYPE_EDGE_RISING, 63 .irqflags = IRQ_TYPE_EDGE_RISING,
@@ -102,9 +107,9 @@ static int __init kzm_init_ext_uart(void)
102 /* 107 /*
103 * Unmask UART interrupt 108 * Unmask UART interrupt
104 */ 109 */
105 tmp = __raw_readb(IO_ADDRESS(KZM_ARM11_CTL1)); 110 tmp = __raw_readb(KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1));
106 tmp |= 0x2; 111 tmp |= 0x2;
107 __raw_writeb(tmp, IO_ADDRESS(KZM_ARM11_CTL1)); 112 __raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1));
108 113
109 return platform_device_register(&serial_device); 114 return platform_device_register(&serial_device);
110} 115}
@@ -128,8 +133,8 @@ static struct smsc911x_platform_config kzm_smsc9118_config = {
128 133
129static struct resource kzm_smsc9118_resources[] = { 134static struct resource kzm_smsc9118_resources[] = {
130 { 135 {
131 .start = CS5_BASE_ADDR, 136 .start = MX31_CS5_BASE_ADDR,
132 .end = CS5_BASE_ADDR + SZ_128K - 1, 137 .end = MX31_CS5_BASE_ADDR + SZ_128K - 1,
133 .flags = IORESOURCE_MEM, 138 .flags = IORESOURCE_MEM,
134 }, 139 },
135 { 140 {
@@ -222,15 +227,15 @@ static void __init kzm_board_init(void)
222 */ 227 */
223static struct map_desc kzm_io_desc[] __initdata = { 228static struct map_desc kzm_io_desc[] __initdata = {
224 { 229 {
225 .virtual = CS4_BASE_ADDR_VIRT, 230 .virtual = MX31_CS4_BASE_ADDR_VIRT,
226 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 231 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
227 .length = CS4_SIZE, 232 .length = MX31_CS4_SIZE,
228 .type = MT_DEVICE 233 .type = MT_DEVICE
229 }, 234 },
230 { 235 {
231 .virtual = CS5_BASE_ADDR_VIRT, 236 .virtual = MX31_CS5_BASE_ADDR_VIRT,
232 .pfn = __phys_to_pfn(CS5_BASE_ADDR), 237 .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR),
233 .length = CS5_SIZE, 238 .length = MX31_CS5_SIZE,
234 .type = MT_DEVICE 239 .type = MT_DEVICE
235 }, 240 },
236}; 241};
@@ -258,9 +263,9 @@ static struct sys_timer kzm_timer = {
258 * initialize __mach_desc_KZM_ARM11_01 data structure. 263 * initialize __mach_desc_KZM_ARM11_01 data structure.
259 */ 264 */
260MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01") 265MACHINE_START(KZM_ARM11_01, "Kyoto Microcomputer Co., Ltd. KZM-ARM11-01")
261 .phys_io = AIPS1_BASE_ADDR, 266 .phys_io = MX31_AIPS1_BASE_ADDR,
262 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 267 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
263 .boot_params = PHYS_OFFSET + 0x100, 268 .boot_params = MX3x_PHYS_OFFSET + 0x100,
264 .map_io = kzm_map_io, 269 .map_io = kzm_map_io,
265 .init_irq = mx31_init_irq, 270 .init_irq = mx31_init_irq,
266 .init_machine = kzm_board_init, 271 .init_machine = kzm_board_init,
diff --git a/arch/arm/mach-mx3/mx31pdk.c b/arch/arm/mach-mx3/mach-mx31_3ds.c
index 18715f1aa7eb..b88c18ad7698 100644
--- a/arch/arm/mach-mx3/mx31pdk.c
+++ b/arch/arm/mach-mx3/mach-mx31_3ds.c
@@ -211,9 +211,9 @@ static int __init mx31pdk_init_expio(void)
211 */ 211 */
212static struct map_desc mx31pdk_io_desc[] __initdata = { 212static struct map_desc mx31pdk_io_desc[] __initdata = {
213 { 213 {
214 .virtual = CS5_BASE_ADDR_VIRT, 214 .virtual = MX31_CS5_BASE_ADDR_VIRT,
215 .pfn = __phys_to_pfn(CS5_BASE_ADDR), 215 .pfn = __phys_to_pfn(MX31_CS5_BASE_ADDR),
216 .length = CS5_SIZE, 216 .length = MX31_CS5_SIZE,
217 .type = MT_DEVICE, 217 .type = MT_DEVICE,
218 }, 218 },
219}; 219};
@@ -256,9 +256,9 @@ static struct sys_timer mx31pdk_timer = {
256 */ 256 */
257MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)") 257MACHINE_START(MX31_3DS, "Freescale MX31PDK (3DS)")
258 /* Maintainer: Freescale Semiconductor, Inc. */ 258 /* Maintainer: Freescale Semiconductor, Inc. */
259 .phys_io = AIPS1_BASE_ADDR, 259 .phys_io = MX31_AIPS1_BASE_ADDR,
260 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 260 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
261 .boot_params = PHYS_OFFSET + 0x100, 261 .boot_params = MX3x_PHYS_OFFSET + 0x100,
262 .map_io = mx31pdk_map_io, 262 .map_io = mx31pdk_map_io,
263 .init_irq = mx31_init_irq, 263 .init_irq = mx31_init_irq,
264 .init_machine = mxc_board_init, 264 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/mx31ads.c b/arch/arm/mach-mx3/mach-mx31ads.c
index 938c549767dc..b3d1a1895c20 100644
--- a/arch/arm/mach-mx3/mx31ads.c
+++ b/arch/arm/mach-mx3/mach-mx31ads.c
@@ -60,7 +60,7 @@
60static struct plat_serial8250_port serial_platform_data[] = { 60static struct plat_serial8250_port serial_platform_data[] = {
61 { 61 {
62 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTA), 62 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTA),
63 .mapbase = (unsigned long)(CS4_BASE_ADDR + PBC_SC16C652_UARTA), 63 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTA),
64 .irq = EXPIO_INT_XUART_INTA, 64 .irq = EXPIO_INT_XUART_INTA,
65 .uartclk = 14745600, 65 .uartclk = 14745600,
66 .regshift = 0, 66 .regshift = 0,
@@ -68,7 +68,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ, 68 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ,
69 }, { 69 }, {
70 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTB), 70 .membase = (void *)(PBC_BASE_ADDRESS + PBC_SC16C652_UARTB),
71 .mapbase = (unsigned long)(CS4_BASE_ADDR + PBC_SC16C652_UARTB), 71 .mapbase = (unsigned long)(MX31_CS4_BASE_ADDR + PBC_SC16C652_UARTB),
72 .irq = EXPIO_INT_XUART_INTB, 72 .irq = EXPIO_INT_XUART_INTB,
73 .uartclk = 14745600, 73 .uartclk = 14745600,
74 .regshift = 0, 74 .regshift = 0,
@@ -309,12 +309,8 @@ static struct regulator_init_data ldo1_data = {
309}; 309};
310 310
311static struct regulator_consumer_supply ldo2_consumers[] = { 311static struct regulator_consumer_supply ldo2_consumers[] = {
312 { 312 { .supply = "AVDD", .dev_name = "1-001a" },
313 .supply = "AVDD", 313 { .supply = "HPVDD", .dev_name = "1-001a" },
314 },
315 {
316 .supply = "HPVDD",
317 },
318}; 314};
319 315
320/* CODEC and SIM */ 316/* CODEC and SIM */
@@ -385,8 +381,6 @@ static struct wm8350_audio_platform_data imx32ads_wm8350_setup = {
385 381
386static int mx31_wm8350_init(struct wm8350 *wm8350) 382static int mx31_wm8350_init(struct wm8350 *wm8350)
387{ 383{
388 int i;
389
390 wm8350_gpio_config(wm8350, 0, WM8350_GPIO_DIR_IN, 384 wm8350_gpio_config(wm8350, 0, WM8350_GPIO_DIR_IN,
391 WM8350_GPIO0_PWR_ON_IN, WM8350_GPIO_ACTIVE_LOW, 385 WM8350_GPIO0_PWR_ON_IN, WM8350_GPIO_ACTIVE_LOW,
392 WM8350_GPIO_PULL_UP, WM8350_GPIO_INVERT_OFF, 386 WM8350_GPIO_PULL_UP, WM8350_GPIO_INVERT_OFF,
@@ -422,10 +416,6 @@ static int mx31_wm8350_init(struct wm8350 *wm8350)
422 WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF, 416 WM8350_GPIO_PULL_NONE, WM8350_GPIO_INVERT_OFF,
423 WM8350_GPIO_DEBOUNCE_OFF); 417 WM8350_GPIO_DEBOUNCE_OFF);
424 418
425 /* Fix up for our own supplies. */
426 for (i = 0; i < ARRAY_SIZE(ldo2_consumers); i++)
427 ldo2_consumers[i].dev = wm8350->dev;
428
429 wm8350_register_regulator(wm8350, WM8350_DCDC_1, &sw1a_data); 419 wm8350_register_regulator(wm8350, WM8350_DCDC_1, &sw1a_data);
430 wm8350_register_regulator(wm8350, WM8350_DCDC_3, &viohi_data); 420 wm8350_register_regulator(wm8350, WM8350_DCDC_3, &viohi_data);
431 wm8350_register_regulator(wm8350, WM8350_DCDC_4, &violo_data); 421 wm8350_register_regulator(wm8350, WM8350_DCDC_4, &violo_data);
@@ -493,14 +483,27 @@ static void mxc_init_i2c(void)
493} 483}
494#endif 484#endif
495 485
486static unsigned int ssi_pins[] = {
487 MX31_PIN_SFS5__SFS5,
488 MX31_PIN_SCK5__SCK5,
489 MX31_PIN_SRXD5__SRXD5,
490 MX31_PIN_STXD5__STXD5,
491};
492
493static void mxc_init_audio(void)
494{
495 mxc_register_device(&imx_ssi_device0, NULL);
496 mxc_iomux_setup_multiple_pins(ssi_pins, ARRAY_SIZE(ssi_pins), "ssi");
497}
498
496/*! 499/*!
497 * This structure defines static mappings for the i.MX31ADS board. 500 * This structure defines static mappings for the i.MX31ADS board.
498 */ 501 */
499static struct map_desc mx31ads_io_desc[] __initdata = { 502static struct map_desc mx31ads_io_desc[] __initdata = {
500 { 503 {
501 .virtual = CS4_BASE_ADDR_VIRT, 504 .virtual = MX31_CS4_BASE_ADDR_VIRT,
502 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 505 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
503 .length = CS4_SIZE / 2, 506 .length = MX31_CS4_SIZE / 2,
504 .type = MT_DEVICE 507 .type = MT_DEVICE
505 }, 508 },
506}; 509};
@@ -528,6 +531,7 @@ static void __init mxc_board_init(void)
528 mxc_init_extuart(); 531 mxc_init_extuart();
529 mxc_init_imx_uart(); 532 mxc_init_imx_uart();
530 mxc_init_i2c(); 533 mxc_init_i2c();
534 mxc_init_audio();
531} 535}
532 536
533static void __init mx31ads_timer_init(void) 537static void __init mx31ads_timer_init(void)
@@ -545,9 +549,9 @@ static struct sys_timer mx31ads_timer = {
545 */ 549 */
546MACHINE_START(MX31ADS, "Freescale MX31ADS") 550MACHINE_START(MX31ADS, "Freescale MX31ADS")
547 /* Maintainer: Freescale Semiconductor, Inc. */ 551 /* Maintainer: Freescale Semiconductor, Inc. */
548 .phys_io = AIPS1_BASE_ADDR, 552 .phys_io = MX31_AIPS1_BASE_ADDR,
549 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 553 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
550 .boot_params = PHYS_OFFSET + 0x100, 554 .boot_params = MX3x_PHYS_OFFSET + 0x100,
551 .map_io = mx31ads_map_io, 555 .map_io = mx31ads_map_io,
552 .init_irq = mx31ads_init_irq, 556 .init_irq = mx31ads_init_irq,
553 .init_machine = mxc_board_init, 557 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c
index 9ce029f554b9..80847b04c063 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mach-mx31lilly.c
@@ -57,8 +57,8 @@
57 57
58static struct resource smsc91x_resources[] = { 58static struct resource smsc91x_resources[] = {
59 { 59 {
60 .start = CS4_BASE_ADDR, 60 .start = MX31_CS4_BASE_ADDR,
61 .end = CS4_BASE_ADDR + 0xffff, 61 .end = MX31_CS4_BASE_ADDR + 0xffff,
62 .flags = IORESOURCE_MEM, 62 .flags = IORESOURCE_MEM,
63 }, 63 },
64 { 64 {
@@ -195,9 +195,9 @@ static struct sys_timer mx31lilly_timer = {
195}; 195};
196 196
197MACHINE_START(LILLY1131, "INCO startec LILLY-1131") 197MACHINE_START(LILLY1131, "INCO startec LILLY-1131")
198 .phys_io = AIPS1_BASE_ADDR, 198 .phys_io = MX31_AIPS1_BASE_ADDR,
199 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 199 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
200 .boot_params = PHYS_OFFSET + 0x100, 200 .boot_params = MX3x_PHYS_OFFSET + 0x100,
201 .map_io = mx31_map_io, 201 .map_io = mx31_map_io,
202 .init_irq = mx31_init_irq, 202 .init_irq = mx31_init_irq,
203 .init_machine = mx31lilly_board_init, 203 .init_machine = mx31lilly_board_init,
diff --git a/arch/arm/mach-mx3/mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c
index 789b20d1730f..2b6d11400877 100644
--- a/arch/arm/mach-mx3/mx31lite.c
+++ b/arch/arm/mach-mx3/mach-mx31lite.c
@@ -82,8 +82,8 @@ static struct smsc911x_platform_config smsc911x_config = {
82 82
83static struct resource smsc911x_resources[] = { 83static struct resource smsc911x_resources[] = {
84 { 84 {
85 .start = CS4_BASE_ADDR, 85 .start = MX31_CS4_BASE_ADDR,
86 .end = CS4_BASE_ADDR + 0x100, 86 .end = MX31_CS4_BASE_ADDR + 0x100,
87 .flags = IORESOURCE_MEM, 87 .flags = IORESOURCE_MEM,
88 }, { 88 }, {
89 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6), 89 .start = IOMUX_TO_IRQ(MX31_PIN_SFS6),
@@ -214,9 +214,9 @@ static struct platform_device physmap_flash_device = {
214 */ 214 */
215static struct map_desc mx31lite_io_desc[] __initdata = { 215static struct map_desc mx31lite_io_desc[] __initdata = {
216 { 216 {
217 .virtual = CS4_BASE_ADDR_VIRT, 217 .virtual = MX31_CS4_BASE_ADDR_VIRT,
218 .pfn = __phys_to_pfn(CS4_BASE_ADDR), 218 .pfn = __phys_to_pfn(MX31_CS4_BASE_ADDR),
219 .length = CS4_SIZE, 219 .length = MX31_CS4_SIZE,
220 .type = MT_DEVICE 220 .type = MT_DEVICE
221 } 221 }
222}; 222};
@@ -287,9 +287,9 @@ struct sys_timer mx31lite_timer = {
287 287
288MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM") 288MACHINE_START(MX31LITE, "LogicPD i.MX31 SOM")
289 /* Maintainer: Freescale Semiconductor, Inc. */ 289 /* Maintainer: Freescale Semiconductor, Inc. */
290 .phys_io = AIPS1_BASE_ADDR, 290 .phys_io = MX31_AIPS1_BASE_ADDR,
291 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 291 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
292 .boot_params = PHYS_OFFSET + 0x100, 292 .boot_params = MX3x_PHYS_OFFSET + 0x100,
293 .map_io = mx31lite_map_io, 293 .map_io = mx31lite_map_io,
294 .init_irq = mx31_init_irq, 294 .init_irq = mx31_init_irq,
295 .init_machine = mxc_board_init, 295 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c
index cfd605d078ec..a7dc5191bf5e 100644
--- a/arch/arm/mach-mx3/mx31moboard.c
+++ b/arch/arm/mach-mx3/mach-mx31moboard.c
@@ -96,9 +96,6 @@ static unsigned int moboard_pins[] = {
96 /* LEDs */ 96 /* LEDs */
97 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1, 97 MX31_PIN_SVEN0__GPIO2_0, MX31_PIN_STX0__GPIO2_1,
98 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3, 98 MX31_PIN_SRX0__GPIO2_2, MX31_PIN_SIMPD0__GPIO2_3,
99 /* SEL */
100 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
101 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
102 /* SPI1 */ 99 /* SPI1 */
103 MX31_PIN_CSPI2_MOSI__MOSI, MX31_PIN_CSPI2_MISO__MISO, 100 MX31_PIN_CSPI2_MOSI__MOSI, MX31_PIN_CSPI2_MISO__MISO,
104 MX31_PIN_CSPI2_SCLK__SCLK, MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, 101 MX31_PIN_CSPI2_SCLK__SCLK, MX31_PIN_CSPI2_SPI_RDY__SPI_RDY,
@@ -352,9 +349,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
352 349
353static int moboard_usbh2_hw_init(struct platform_device *pdev) 350static int moboard_usbh2_hw_init(struct platform_device *pdev)
354{ 351{
355 int ret = gpio_request(USBH2_EN_B, "usbh2-en"); 352 int ret;
356 if (ret)
357 return ret;
358 353
359 mxc_iomux_set_gpr(MUX_PGP_UH2, true); 354 mxc_iomux_set_gpr(MUX_PGP_UH2, true);
360 355
@@ -371,6 +366,9 @@ static int moboard_usbh2_hw_init(struct platform_device *pdev)
371 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG); 366 mxc_iomux_set_pad(MX31_PIN_SRXD3, USB_PAD_CFG);
372 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG); 367 mxc_iomux_set_pad(MX31_PIN_STXD3, USB_PAD_CFG);
373 368
369 ret = gpio_request(USBH2_EN_B, "usbh2-en");
370 if (ret)
371 return ret;
374 gpio_direction_output(USBH2_EN_B, 0); 372 gpio_direction_output(USBH2_EN_B, 0);
375 373
376 return 0; 374 return 0;
@@ -431,34 +429,6 @@ static struct platform_device mx31moboard_leds_device = {
431 }, 429 },
432}; 430};
433 431
434#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
435#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
436#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
437#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
438
439static void mx31moboard_init_sel_gpios(void)
440{
441 if (!gpio_request(SEL0, "sel0")) {
442 gpio_direction_input(SEL0);
443 gpio_export(SEL0, true);
444 }
445
446 if (!gpio_request(SEL1, "sel1")) {
447 gpio_direction_input(SEL1);
448 gpio_export(SEL1, true);
449 }
450
451 if (!gpio_request(SEL2, "sel2")) {
452 gpio_direction_input(SEL2);
453 gpio_export(SEL2, true);
454 }
455
456 if (!gpio_request(SEL3, "sel3")) {
457 gpio_direction_input(SEL3);
458 gpio_export(SEL3, true);
459 }
460}
461
462static struct ipu_platform_data mx3_ipu_data = { 432static struct ipu_platform_data mx3_ipu_data = {
463 .irq_base = MXC_IPU_IRQ_START, 433 .irq_base = MXC_IPU_IRQ_START,
464}; 434};
@@ -518,8 +488,6 @@ static void __init mxc_board_init(void)
518 488
519 mxc_register_device(&mxc_uart_device4, &uart4_pdata); 489 mxc_register_device(&mxc_uart_device4, &uart4_pdata);
520 490
521 mx31moboard_init_sel_gpios();
522
523 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata); 491 mxc_register_device(&mxc_i2c_device0, &moboard_i2c0_pdata);
524 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata); 492 mxc_register_device(&mxc_i2c_device1, &moboard_i2c1_pdata);
525 493
@@ -552,6 +520,9 @@ static void __init mxc_board_init(void)
552 case MX31MARXBOT: 520 case MX31MARXBOT:
553 mx31moboard_marxbot_init(); 521 mx31moboard_marxbot_init();
554 break; 522 break;
523 case MX31SMARTBOT:
524 mx31moboard_smartbot_init();
525 break;
555 default: 526 default:
556 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n", 527 printk(KERN_ERR "Illegal mx31moboard_baseboard type %d\n",
557 mx31moboard_baseboard); 528 mx31moboard_baseboard);
@@ -569,9 +540,9 @@ struct sys_timer mx31moboard_timer = {
569 540
570MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard") 541MACHINE_START(MX31MOBOARD, "EPFL Mobots mx31moboard")
571 /* Maintainer: Valentin Longchamp, EPFL Mobots group */ 542 /* Maintainer: Valentin Longchamp, EPFL Mobots group */
572 .phys_io = AIPS1_BASE_ADDR, 543 .phys_io = MX31_AIPS1_BASE_ADDR,
573 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 544 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
574 .boot_params = PHYS_OFFSET + 0x100, 545 .boot_params = MX3x_PHYS_OFFSET + 0x100,
575 .map_io = mx31_map_io, 546 .map_io = mx31_map_io,
576 .init_irq = mx31_init_irq, 547 .init_irq = mx31_init_irq,
577 .init_machine = mxc_board_init, 548 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/mx35pdk.c b/arch/arm/mach-mx3/mach-mx35pdk.c
index 0bbc65ea23c8..bcac84d4dca4 100644
--- a/arch/arm/mach-mx3/mx35pdk.c
+++ b/arch/arm/mach-mx3/mach-mx35pdk.c
@@ -106,9 +106,9 @@ struct sys_timer mx35pdk_timer = {
106 106
107MACHINE_START(MX35_3DS, "Freescale MX35PDK") 107MACHINE_START(MX35_3DS, "Freescale MX35PDK")
108 /* Maintainer: Freescale Semiconductor, Inc */ 108 /* Maintainer: Freescale Semiconductor, Inc */
109 .phys_io = AIPS1_BASE_ADDR, 109 .phys_io = MX35_AIPS1_BASE_ADDR,
110 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 110 .io_pg_offst = ((MX35_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
111 .boot_params = PHYS_OFFSET + 0x100, 111 .boot_params = MX3x_PHYS_OFFSET + 0x100,
112 .map_io = mx35_map_io, 112 .map_io = mx35_map_io,
113 .init_irq = mx35_init_irq, 113 .init_irq = mx35_init_irq,
114 .init_machine = mxc_board_init, 114 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index 5be396917c99..11f531559169 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -33,6 +33,9 @@
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/fsl_devices.h> 34#include <linux/fsl_devices.h>
35#include <linux/can/platform/sja1000.h> 35#include <linux/can/platform/sja1000.h>
36#include <linux/usb/otg.h>
37#include <linux/usb/ulpi.h>
38#include <linux/fsl_devices.h>
36 39
37#include <media/soc_camera.h> 40#include <media/soc_camera.h>
38 41
@@ -51,6 +54,8 @@
51#include <mach/mx3_camera.h> 54#include <mach/mx3_camera.h>
52#include <mach/mx3fb.h> 55#include <mach/mx3fb.h>
53#include <mach/mxc_nand.h> 56#include <mach/mxc_nand.h>
57#include <mach/mxc_ehci.h>
58#include <mach/ulpi.h>
54 59
55#include "devices.h" 60#include "devices.h"
56#include "pcm037.h" 61#include "pcm037.h"
@@ -172,19 +177,7 @@ static unsigned int pcm037_pins[] = {
172 MX31_PIN_CSI_VSYNC__CSI_VSYNC, 177 MX31_PIN_CSI_VSYNC__CSI_VSYNC,
173 /* GPIO */ 178 /* GPIO */
174 IOMUX_MODE(MX31_PIN_ATA_DMACK, IOMUX_CONFIG_GPIO), 179 IOMUX_MODE(MX31_PIN_ATA_DMACK, IOMUX_CONFIG_GPIO),
175}; 180 /* OTG */
176
177static struct physmap_flash_data pcm037_flash_data = {
178 .width = 2,
179};
180
181static struct resource pcm037_flash_resource = {
182 .start = 0xa0000000,
183 .end = 0xa1ffffff,
184 .flags = IORESOURCE_MEM,
185};
186
187static int usbotg_pins[] = {
188 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, 181 MX31_PIN_USBOTG_DATA0__USBOTG_DATA0,
189 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, 182 MX31_PIN_USBOTG_DATA1__USBOTG_DATA1,
190 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, 183 MX31_PIN_USBOTG_DATA2__USBOTG_DATA2,
@@ -197,39 +190,29 @@ static int usbotg_pins[] = {
197 MX31_PIN_USBOTG_DIR__USBOTG_DIR, 190 MX31_PIN_USBOTG_DIR__USBOTG_DIR,
198 MX31_PIN_USBOTG_NXT__USBOTG_NXT, 191 MX31_PIN_USBOTG_NXT__USBOTG_NXT,
199 MX31_PIN_USBOTG_STP__USBOTG_STP, 192 MX31_PIN_USBOTG_STP__USBOTG_STP,
193 /* USB host 2 */
194 IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC),
195 IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC),
196 IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC),
197 IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC),
198 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC),
199 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC),
200 IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC),
201 IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC),
202 IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC),
203 IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC),
204 IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC),
205 IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC),
200}; 206};
201 207
202/* USB OTG HS port */ 208static struct physmap_flash_data pcm037_flash_data = {
203static int __init gpio_usbotg_hs_activate(void) 209 .width = 2,
204{ 210};
205 int ret = mxc_iomux_setup_multiple_pins(usbotg_pins,
206 ARRAY_SIZE(usbotg_pins), "usbotg");
207
208 if (ret < 0) {
209 printk(KERN_ERR "Cannot set up OTG pins\n");
210 return ret;
211 }
212
213 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
214 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
215 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
216 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
217 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
218 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
219 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
220 mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
221 mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
222 mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
223 mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
224 mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST);
225
226 return 0;
227}
228 211
229/* OTG config */ 212static struct resource pcm037_flash_resource = {
230static struct fsl_usb2_platform_data usb_pdata = { 213 .start = 0xa0000000,
231 .operating_mode = FSL_USB2_DR_DEVICE, 214 .end = 0xa1ffffff,
232 .phy_mode = FSL_USB2_PHY_ULPI, 215 .flags = IORESOURCE_MEM,
233}; 216};
234 217
235static struct platform_device pcm037_flash = { 218static struct platform_device pcm037_flash = {
@@ -248,8 +231,8 @@ static struct imxuart_platform_data uart_pdata = {
248 231
249static struct resource smsc911x_resources[] = { 232static struct resource smsc911x_resources[] = {
250 { 233 {
251 .start = CS1_BASE_ADDR + 0x300, 234 .start = MX31_CS1_BASE_ADDR + 0x300,
252 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, 235 .end = MX31_CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
253 .flags = IORESOURCE_MEM, 236 .flags = IORESOURCE_MEM,
254 }, { 237 }, {
255 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 238 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
@@ -281,8 +264,8 @@ static struct platdata_mtd_ram pcm038_sram_data = {
281}; 264};
282 265
283static struct resource pcm038_sram_resource = { 266static struct resource pcm038_sram_resource = {
284 .start = CS4_BASE_ADDR, 267 .start = MX31_CS4_BASE_ADDR,
285 .end = CS4_BASE_ADDR + 512 * 1024 - 1, 268 .end = MX31_CS4_BASE_ADDR + 512 * 1024 - 1,
286 .flags = IORESOURCE_MEM, 269 .flags = IORESOURCE_MEM,
287}; 270};
288 271
@@ -536,8 +519,8 @@ static struct mx3fb_platform_data mx3fb_pdata = {
536 519
537static struct resource pcm970_sja1000_resources[] = { 520static struct resource pcm970_sja1000_resources[] = {
538 { 521 {
539 .start = CS5_BASE_ADDR, 522 .start = MX31_CS5_BASE_ADDR,
540 .end = CS5_BASE_ADDR + 0x100 - 1, 523 .end = MX31_CS5_BASE_ADDR + 0x100 - 1,
541 .flags = IORESOURCE_MEM, 524 .flags = IORESOURCE_MEM,
542 }, { 525 }, {
543 .start = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)), 526 .start = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)),
@@ -561,16 +544,65 @@ static struct platform_device pcm970_sja1000 = {
561 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources), 544 .num_resources = ARRAY_SIZE(pcm970_sja1000_resources),
562}; 545};
563 546
547static struct mxc_usbh_platform_data otg_pdata = {
548 .portsc = MXC_EHCI_MODE_ULPI,
549 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
550};
551
552static struct mxc_usbh_platform_data usbh2_pdata = {
553 .portsc = MXC_EHCI_MODE_ULPI,
554 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
555};
556
557static struct fsl_usb2_platform_data otg_device_pdata = {
558 .operating_mode = FSL_USB2_DR_DEVICE,
559 .phy_mode = FSL_USB2_PHY_ULPI,
560};
561
562static int otg_mode_host;
563
564static int __init pcm037_otg_mode(char *options)
565{
566 if (!strcmp(options, "host"))
567 otg_mode_host = 1;
568 else if (!strcmp(options, "device"))
569 otg_mode_host = 0;
570 else
571 pr_info("otg_mode neither \"host\" nor \"device\". "
572 "Defaulting to device\n");
573 return 0;
574}
575__setup("otg_mode=", pcm037_otg_mode);
576
564/* 577/*
565 * Board specific initialization. 578 * Board specific initialization.
566 */ 579 */
567static void __init mxc_board_init(void) 580static void __init mxc_board_init(void)
568{ 581{
569 int ret; 582 int ret;
583 u32 tmp;
584
585 mxc_iomux_set_gpr(MUX_PGP_UH2, 1);
570 586
571 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), 587 mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
572 "pcm037"); 588 "pcm037");
573 589
590#define H2_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS \
591 | PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
592
593 mxc_iomux_set_pad(MX31_PIN_USBH2_CLK, H2_PAD_CFG);
594 mxc_iomux_set_pad(MX31_PIN_USBH2_DIR, H2_PAD_CFG);
595 mxc_iomux_set_pad(MX31_PIN_USBH2_NXT, H2_PAD_CFG);
596 mxc_iomux_set_pad(MX31_PIN_USBH2_STP, H2_PAD_CFG);
597 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA0, H2_PAD_CFG); /* USBH2_DATA0 */
598 mxc_iomux_set_pad(MX31_PIN_USBH2_DATA1, H2_PAD_CFG); /* USBH2_DATA1 */
599 mxc_iomux_set_pad(MX31_PIN_SRXD6, H2_PAD_CFG); /* USBH2_DATA2 */
600 mxc_iomux_set_pad(MX31_PIN_STXD6, H2_PAD_CFG); /* USBH2_DATA3 */
601 mxc_iomux_set_pad(MX31_PIN_SFS3, H2_PAD_CFG); /* USBH2_DATA4 */
602 mxc_iomux_set_pad(MX31_PIN_SCK3, H2_PAD_CFG); /* USBH2_DATA5 */
603 mxc_iomux_set_pad(MX31_PIN_SRXD3, H2_PAD_CFG); /* USBH2_DATA6 */
604 mxc_iomux_set_pad(MX31_PIN_STXD3, H2_PAD_CFG); /* USBH2_DATA7 */
605
574 if (pcm037_variant() == PCM037_EET) 606 if (pcm037_variant() == PCM037_EET)
575 mxc_iomux_setup_multiple_pins(pcm037_uart1_pins, 607 mxc_iomux_setup_multiple_pins(pcm037_uart1_pins,
576 ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1"); 608 ARRAY_SIZE(pcm037_uart1_pins), "pcm037_uart1");
@@ -608,8 +640,6 @@ static void __init mxc_board_init(void)
608 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); 640 mxc_register_device(&mxcsdhc_device0, &sdhc_pdata);
609 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 641 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
610 mxc_register_device(&mx3_fb, &mx3fb_pdata); 642 mxc_register_device(&mx3_fb, &mx3fb_pdata);
611 if (!gpio_usbotg_hs_activate())
612 mxc_register_device(&mxc_otg_udc_device, &usb_pdata);
613 643
614 /* CSI */ 644 /* CSI */
615 /* Camera power: default - off */ 645 /* Camera power: default - off */
@@ -623,6 +653,23 @@ static void __init mxc_board_init(void)
623 mxc_register_device(&mx3_camera, &camera_pdata); 653 mxc_register_device(&mx3_camera, &camera_pdata);
624 654
625 platform_device_register(&pcm970_sja1000); 655 platform_device_register(&pcm970_sja1000);
656
657#if defined(CONFIG_USB_ULPI)
658 if (otg_mode_host) {
659 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
660 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
661
662 mxc_register_device(&mxc_otg_host, &otg_pdata);
663 }
664
665 usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
666 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
667
668 mxc_register_device(&mxc_usbh2, &usbh2_pdata);
669#endif
670 if (!otg_mode_host)
671 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
672
626} 673}
627 674
628static void __init pcm037_timer_init(void) 675static void __init pcm037_timer_init(void)
@@ -636,9 +683,9 @@ struct sys_timer pcm037_timer = {
636 683
637MACHINE_START(PCM037, "Phytec Phycore pcm037") 684MACHINE_START(PCM037, "Phytec Phycore pcm037")
638 /* Maintainer: Pengutronix */ 685 /* Maintainer: Pengutronix */
639 .phys_io = AIPS1_BASE_ADDR, 686 .phys_io = MX31_AIPS1_BASE_ADDR,
640 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 687 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
641 .boot_params = PHYS_OFFSET + 0x100, 688 .boot_params = MX3x_PHYS_OFFSET + 0x100,
642 .map_io = mx31_map_io, 689 .map_io = mx31_map_io,
643 .init_irq = mx31_init_irq, 690 .init_irq = mx31_init_irq,
644 .init_machine = mxc_board_init, 691 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/pcm037_eet.c b/arch/arm/mach-mx3/mach-pcm037_eet.c
index 8d386000fc40..8d386000fc40 100644
--- a/arch/arm/mach-mx3/pcm037_eet.c
+++ b/arch/arm/mach-mx3/mach-pcm037_eet.c
diff --git a/arch/arm/mach-mx3/pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c
index e3aa829be586..1bf1ec2eef5e 100644
--- a/arch/arm/mach-mx3/pcm043.c
+++ b/arch/arm/mach-mx3/mach-pcm043.c
@@ -26,8 +26,12 @@
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/smc911x.h> 27#include <linux/smc911x.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h>
29#include <linux/i2c.h> 30#include <linux/i2c.h>
30#include <linux/i2c/at24.h> 31#include <linux/i2c/at24.h>
32#include <linux/usb/otg.h>
33#include <linux/usb/ulpi.h>
34#include <linux/fsl_devices.h>
31 35
32#include <asm/mach-types.h> 36#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
@@ -44,6 +48,10 @@
44#include <mach/ipu.h> 48#include <mach/ipu.h>
45#include <mach/mx3fb.h> 49#include <mach/mx3fb.h>
46#include <mach/mxc_nand.h> 50#include <mach/mxc_nand.h>
51#include <mach/mxc_ehci.h>
52#include <mach/ulpi.h>
53#include <mach/audmux.h>
54#include <mach/ssi.h>
47 55
48#include "devices.h" 56#include "devices.h"
49 57
@@ -205,6 +213,94 @@ static struct pad_desc pcm043_pads[] = {
205 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS, 213 MX35_PAD_D3_CLS__IPU_DISPB_D3_CLS,
206 /* gpio */ 214 /* gpio */
207 MX35_PAD_ATA_CS0__GPIO2_6, 215 MX35_PAD_ATA_CS0__GPIO2_6,
216 /* USB host */
217 MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR,
218 MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC,
219 /* SSI */
220 MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS,
221 MX35_PAD_STXD4__AUDMUX_AUD4_TXD,
222 MX35_PAD_SRXD4__AUDMUX_AUD4_RXD,
223 MX35_PAD_SCK4__AUDMUX_AUD4_TXC,
224};
225
226#define AC97_GPIO_TXFS (1 * 32 + 31)
227#define AC97_GPIO_TXD (1 * 32 + 28)
228#define AC97_GPIO_RESET (1 * 32 + 0)
229
230static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
231{
232 struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31;
233 struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS;
234 int ret;
235
236 ret = gpio_request(AC97_GPIO_TXFS, "SSI");
237 if (ret) {
238 printk("failed to get GPIO_TXFS: %d\n", ret);
239 return;
240 }
241
242 mxc_iomux_v3_setup_pad(&txfs_gpio);
243
244 /* warm reset */
245 gpio_direction_output(AC97_GPIO_TXFS, 1);
246 udelay(2);
247 gpio_set_value(AC97_GPIO_TXFS, 0);
248
249 gpio_free(AC97_GPIO_TXFS);
250 mxc_iomux_v3_setup_pad(&txfs);
251}
252
253static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
254{
255 struct pad_desc txfs_gpio = MX35_PAD_STXFS4__GPIO2_31;
256 struct pad_desc txfs = MX35_PAD_STXFS4__AUDMUX_AUD4_TXFS;
257 struct pad_desc txd_gpio = MX35_PAD_STXD4__GPIO2_28;
258 struct pad_desc txd = MX35_PAD_STXD4__AUDMUX_AUD4_TXD;
259 struct pad_desc reset_gpio = MX35_PAD_SD2_CMD__GPIO2_0;
260 int ret;
261
262 ret = gpio_request(AC97_GPIO_TXFS, "SSI");
263 if (ret)
264 goto err1;
265
266 ret = gpio_request(AC97_GPIO_TXD, "SSI");
267 if (ret)
268 goto err2;
269
270 ret = gpio_request(AC97_GPIO_RESET, "SSI");
271 if (ret)
272 goto err3;
273
274 mxc_iomux_v3_setup_pad(&txfs_gpio);
275 mxc_iomux_v3_setup_pad(&txd_gpio);
276 mxc_iomux_v3_setup_pad(&reset_gpio);
277
278 gpio_direction_output(AC97_GPIO_TXFS, 0);
279 gpio_direction_output(AC97_GPIO_TXD, 0);
280
281 /* cold reset */
282 gpio_direction_output(AC97_GPIO_RESET, 0);
283 udelay(10);
284 gpio_direction_output(AC97_GPIO_RESET, 1);
285
286 mxc_iomux_v3_setup_pad(&txd);
287 mxc_iomux_v3_setup_pad(&txfs);
288
289 gpio_free(AC97_GPIO_RESET);
290err3:
291 gpio_free(AC97_GPIO_TXD);
292err2:
293 gpio_free(AC97_GPIO_TXFS);
294err1:
295 if (ret)
296 printk("%s failed with %d\n", __func__, ret);
297 mdelay(1);
298}
299
300static struct imx_ssi_platform_data pcm043_ssi_pdata = {
301 .ac97_reset = pcm043_ac97_cold_reset,
302 .ac97_warm_reset = pcm043_ac97_warm_reset,
303 .flags = IMX_SSI_USE_AC97,
208}; 304};
209 305
210static struct mxc_nand_platform_data pcm037_nand_board_info = { 306static struct mxc_nand_platform_data pcm037_nand_board_info = {
@@ -212,6 +308,37 @@ static struct mxc_nand_platform_data pcm037_nand_board_info = {
212 .hw_ecc = 1, 308 .hw_ecc = 1,
213}; 309};
214 310
311static struct mxc_usbh_platform_data otg_pdata = {
312 .portsc = MXC_EHCI_MODE_UTMI,
313 .flags = MXC_EHCI_INTERFACE_DIFF_UNI,
314};
315
316static struct mxc_usbh_platform_data usbh1_pdata = {
317 .portsc = MXC_EHCI_MODE_SERIAL,
318 .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY |
319 MXC_EHCI_IPPUE_DOWN,
320};
321
322static struct fsl_usb2_platform_data otg_device_pdata = {
323 .operating_mode = FSL_USB2_DR_DEVICE,
324 .phy_mode = FSL_USB2_PHY_UTMI,
325};
326
327static int otg_mode_host;
328
329static int __init pcm043_otg_mode(char *options)
330{
331 if (!strcmp(options, "host"))
332 otg_mode_host = 1;
333 else if (!strcmp(options, "device"))
334 otg_mode_host = 0;
335 else
336 pr_info("otg_mode neither \"host\" nor \"device\". "
337 "Defaulting to device\n");
338 return 0;
339}
340__setup("otg_mode=", pcm043_otg_mode);
341
215/* 342/*
216 * Board specific initialization. 343 * Board specific initialization.
217 */ 344 */
@@ -219,10 +346,23 @@ static void __init mxc_board_init(void)
219{ 346{
220 mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads)); 347 mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
221 348
349 mxc_audmux_v2_configure_port(3,
350 MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
351 MXC_AUDMUX_V2_PTCR_TFSEL(0) |
352 MXC_AUDMUX_V2_PTCR_TFSDIR,
353 MXC_AUDMUX_V2_PDCR_RXDSEL(0));
354
355 mxc_audmux_v2_configure_port(0,
356 MXC_AUDMUX_V2_PTCR_SYN | /* 4wire mode */
357 MXC_AUDMUX_V2_PTCR_TCSEL(3) |
358 MXC_AUDMUX_V2_PTCR_TCLKDIR, /* clock is output */
359 MXC_AUDMUX_V2_PDCR_RXDSEL(3));
360
222 platform_add_devices(devices, ARRAY_SIZE(devices)); 361 platform_add_devices(devices, ARRAY_SIZE(devices));
223 362
224 mxc_register_device(&mxc_uart_device0, &uart_pdata); 363 mxc_register_device(&mxc_uart_device0, &uart_pdata);
225 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); 364 mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info);
365 mxc_register_device(&imx_ssi_device0, &pcm043_ssi_pdata);
226 366
227 mxc_register_device(&mxc_uart_device1, &uart_pdata); 367 mxc_register_device(&mxc_uart_device1, &uart_pdata);
228 368
@@ -235,6 +375,20 @@ static void __init mxc_board_init(void)
235 375
236 mxc_register_device(&mx3_ipu, &mx3_ipu_data); 376 mxc_register_device(&mx3_ipu, &mx3_ipu_data);
237 mxc_register_device(&mx3_fb, &mx3fb_pdata); 377 mxc_register_device(&mx3_fb, &mx3fb_pdata);
378
379#if defined(CONFIG_USB_ULPI)
380 if (otg_mode_host) {
381 otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops,
382 USB_OTG_DRV_VBUS | USB_OTG_DRV_VBUS_EXT);
383
384 mxc_register_device(&mxc_otg_host, &otg_pdata);
385 }
386
387 mxc_register_device(&mxc_usbh1, &usbh1_pdata);
388#endif
389 if (!otg_mode_host)
390 mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata);
391
238} 392}
239 393
240static void __init pcm043_timer_init(void) 394static void __init pcm043_timer_init(void)
@@ -248,9 +402,9 @@ struct sys_timer pcm043_timer = {
248 402
249MACHINE_START(PCM043, "Phytec Phycore pcm043") 403MACHINE_START(PCM043, "Phytec Phycore pcm043")
250 /* Maintainer: Pengutronix */ 404 /* Maintainer: Pengutronix */
251 .phys_io = AIPS1_BASE_ADDR, 405 .phys_io = MX35_AIPS1_BASE_ADDR,
252 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 406 .io_pg_offst = ((MX35_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
253 .boot_params = PHYS_OFFSET + 0x100, 407 .boot_params = MX3x_PHYS_OFFSET + 0x100,
254 .map_io = mx35_map_io, 408 .map_io = mx35_map_io,
255 .init_irq = mx35_init_irq, 409 .init_irq = mx35_init_irq,
256 .init_machine = mxc_board_init, 410 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/qong.c b/arch/arm/mach-mx3/mach-qong.c
index 044511f1b9a9..e5b5b8323a17 100644
--- a/arch/arm/mach-mx3/qong.c
+++ b/arch/arm/mach-mx3/mach-qong.c
@@ -43,7 +43,7 @@
43#define QONG_FPGA_VERSION(major, minor, rev) \ 43#define QONG_FPGA_VERSION(major, minor, rev) \
44 (((major & 0xF) << 12) | ((minor & 0xF) << 8) | (rev & 0xFF)) 44 (((major & 0xF) << 12) | ((minor & 0xF) << 8) | (rev & 0xFF))
45 45
46#define QONG_FPGA_BASEADDR CS1_BASE_ADDR 46#define QONG_FPGA_BASEADDR MX31_CS1_BASE_ADDR
47#define QONG_FPGA_PERIPH_SIZE (1 << 24) 47#define QONG_FPGA_PERIPH_SIZE (1 << 24)
48 48
49#define QONG_FPGA_CTRL_BASEADDR QONG_FPGA_BASEADDR 49#define QONG_FPGA_CTRL_BASEADDR QONG_FPGA_BASEADDR
@@ -115,8 +115,8 @@ static struct physmap_flash_data qong_flash_data = {
115}; 115};
116 116
117static struct resource qong_flash_resource = { 117static struct resource qong_flash_resource = {
118 .start = CS0_BASE_ADDR, 118 .start = MX31_CS0_BASE_ADDR,
119 .end = CS0_BASE_ADDR + QONG_NOR_SIZE - 1, 119 .end = MX31_CS0_BASE_ADDR + QONG_NOR_SIZE - 1,
120 .flags = IORESOURCE_MEM, 120 .flags = IORESOURCE_MEM,
121}; 121};
122 122
@@ -180,8 +180,8 @@ static struct platform_nand_data qong_nand_data = {
180}; 180};
181 181
182static struct resource qong_nand_resource = { 182static struct resource qong_nand_resource = {
183 .start = CS3_BASE_ADDR, 183 .start = MX31_CS3_BASE_ADDR,
184 .end = CS3_BASE_ADDR + SZ_32M - 1, 184 .end = MX31_CS3_BASE_ADDR + SZ_32M - 1,
185 .flags = IORESOURCE_MEM, 185 .flags = IORESOURCE_MEM,
186}; 186};
187 187
@@ -198,9 +198,7 @@ static struct platform_device qong_nand_device = {
198static void __init qong_init_nand_mtd(void) 198static void __init qong_init_nand_mtd(void)
199{ 199{
200 /* init CS */ 200 /* init CS */
201 __raw_writel(0x00004f00, CSCR_U(3)); 201 mx31_setup_weimcs(3, 0x00004f00, 0x20013b31, 0x00020800);
202 __raw_writel(0x20013b31, CSCR_L(3));
203 __raw_writel(0x00020800, CSCR_A(3));
204 mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true); 202 mxc_iomux_set_gpr(MUX_SDCTL_CSD1_SEL, true);
205 203
206 /* enable pin */ 204 /* enable pin */
@@ -275,9 +273,9 @@ static struct sys_timer qong_timer = {
275 273
276MACHINE_START(QONG, "Dave/DENX QongEVB-LITE") 274MACHINE_START(QONG, "Dave/DENX QongEVB-LITE")
277 /* Maintainer: DENX Software Engineering GmbH */ 275 /* Maintainer: DENX Software Engineering GmbH */
278 .phys_io = AIPS1_BASE_ADDR, 276 .phys_io = MX31_AIPS1_BASE_ADDR,
279 .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 277 .io_pg_offst = (MX31_AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc,
280 .boot_params = PHYS_OFFSET + 0x100, 278 .boot_params = MX3x_PHYS_OFFSET + 0x100,
281 .map_io = mx31_map_io, 279 .map_io = mx31_map_io,
282 .init_irq = mx31_init_irq, 280 .init_irq = mx31_init_irq,
283 .init_machine = mxc_board_init, 281 .init_machine = mxc_board_init,
diff --git a/arch/arm/mach-mx3/mx31lite-db.c b/arch/arm/mach-mx3/mx31lite-db.c
index 694611d6b057..ccd874225c3b 100644
--- a/arch/arm/mach-mx3/mx31lite-db.c
+++ b/arch/arm/mach-mx3/mx31lite-db.c
@@ -67,6 +67,13 @@ static unsigned int litekit_db_board_pins[] __initdata = {
67 MX31_PIN_CSPI1_SS0__SS0, 67 MX31_PIN_CSPI1_SS0__SS0,
68 MX31_PIN_CSPI1_SS1__SS1, 68 MX31_PIN_CSPI1_SS1__SS1,
69 MX31_PIN_CSPI1_SS2__SS2, 69 MX31_PIN_CSPI1_SS2__SS2,
70 /* SDHC1 */
71 MX31_PIN_SD1_DATA0__SD1_DATA0,
72 MX31_PIN_SD1_DATA1__SD1_DATA1,
73 MX31_PIN_SD1_DATA2__SD1_DATA2,
74 MX31_PIN_SD1_DATA3__SD1_DATA3,
75 MX31_PIN_SD1_CLK__SD1_CLK,
76 MX31_PIN_SD1_CMD__SD1_CMD,
70}; 77};
71 78
72/* UART */ 79/* UART */
@@ -79,11 +86,11 @@ static struct imxuart_platform_data uart_pdata __initdata = {
79static int gpio_det, gpio_wp; 86static int gpio_det, gpio_wp;
80 87
81#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 88#define MMC_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
82 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 89 PAD_CTL_ODE_CMOS)
83 90
84static int mxc_mmc1_get_ro(struct device *dev) 91static int mxc_mmc1_get_ro(struct device *dev)
85{ 92{
86 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_LCS0)); 93 return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_GPIO1_6));
87} 94}
88 95
89static int mxc_mmc1_init(struct device *dev, 96static int mxc_mmc1_init(struct device *dev,
@@ -94,12 +101,17 @@ static int mxc_mmc1_init(struct device *dev,
94 gpio_det = IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1); 101 gpio_det = IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1);
95 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_GPIO1_6); 102 gpio_wp = IOMUX_TO_GPIO(MX31_PIN_GPIO1_6);
96 103
97 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0, MMC_PAD_CFG); 104 mxc_iomux_set_pad(MX31_PIN_SD1_DATA0,
98 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1, MMC_PAD_CFG); 105 MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
99 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2, MMC_PAD_CFG); 106 mxc_iomux_set_pad(MX31_PIN_SD1_DATA1,
100 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3, MMC_PAD_CFG); 107 MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
108 mxc_iomux_set_pad(MX31_PIN_SD1_DATA2,
109 MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
110 mxc_iomux_set_pad(MX31_PIN_SD1_DATA3,
111 MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
112 mxc_iomux_set_pad(MX31_PIN_SD1_CMD,
113 MMC_PAD_CFG | PAD_CTL_PUE_PUD | PAD_CTL_100K_PU);
101 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG); 114 mxc_iomux_set_pad(MX31_PIN_SD1_CLK, MMC_PAD_CFG);
102 mxc_iomux_set_pad(MX31_PIN_SD1_CMD, MMC_PAD_CFG);
103 115
104 ret = gpio_request(gpio_det, "MMC detect"); 116 ret = gpio_request(gpio_det, "MMC detect");
105 if (ret) 117 if (ret)
@@ -113,7 +125,7 @@ static int mxc_mmc1_init(struct device *dev,
113 gpio_direction_input(gpio_wp); 125 gpio_direction_input(gpio_wp);
114 126
115 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq, 127 ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq,
116 IRQF_DISABLED | IRQF_TRIGGER_FALLING, 128 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
117 "MMC detect", data); 129 "MMC detect", data);
118 if (ret) 130 if (ret)
119 goto exit_free_wp; 131 goto exit_free_wp;
@@ -133,7 +145,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data)
133{ 145{
134 gpio_free(gpio_det); 146 gpio_free(gpio_det);
135 gpio_free(gpio_wp); 147 gpio_free(gpio_wp);
136 free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data); 148 free_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), data);
137} 149}
138 150
139static struct imxmmc_platform_data mmc_pdata = { 151static struct imxmmc_platform_data mmc_pdata = {
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c
index 438428eaf769..9fbad2eb3a49 100644
--- a/arch/arm/mach-mx3/mx31moboard-devboard.c
+++ b/arch/arm/mach-mx3/mx31moboard-devboard.c
@@ -49,6 +49,9 @@ static unsigned int devboard_pins[] = {
49 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB, 49 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
50 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND, 50 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
51 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12, 51 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
52 /* SEL */
53 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
54 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
52}; 55};
53 56
54static struct imxuart_platform_data uart_pdata = { 57static struct imxuart_platform_data uart_pdata = {
@@ -108,6 +111,33 @@ static struct imxmmc_platform_data sdhc2_pdata = {
108 .exit = devboard_sdhc2_exit, 111 .exit = devboard_sdhc2_exit,
109}; 112};
110 113
114#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
115#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
116#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
117#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
118
119static void devboard_init_sel_gpios(void)
120{
121 if (!gpio_request(SEL0, "sel0")) {
122 gpio_direction_input(SEL0);
123 gpio_export(SEL0, true);
124 }
125
126 if (!gpio_request(SEL1, "sel1")) {
127 gpio_direction_input(SEL1);
128 gpio_export(SEL1, true);
129 }
130
131 if (!gpio_request(SEL2, "sel2")) {
132 gpio_direction_input(SEL2);
133 gpio_export(SEL2, true);
134 }
135
136 if (!gpio_request(SEL3, "sel3")) {
137 gpio_direction_input(SEL3);
138 gpio_export(SEL3, true);
139 }
140}
111#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 141#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
112 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 142 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
113 143
@@ -196,5 +226,7 @@ void __init mx31moboard_devboard_init(void)
196 226
197 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 227 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
198 228
229 devboard_init_sel_gpios();
230
199 devboard_usbh1_init(); 231 devboard_usbh1_init();
200} 232}
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 1f44b9ccbb0f..3958515d75bf 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -66,6 +66,9 @@ static unsigned int marxbot_pins[] = {
66 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB, 66 MX31_PIN_CSPI1_SS2__USBH1_RCV, MX31_PIN_CSPI1_SCLK__USBH1_OEB,
67 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND, 67 MX31_PIN_CSPI1_SPI_RDY__USBH1_FS, MX31_PIN_SFS6__USBH1_SUSPEND,
68 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12, 68 MX31_PIN_NFRE_B__GPIO1_11, MX31_PIN_NFALE__GPIO1_12,
69 /* SEL */
70 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
71 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
69}; 72};
70 73
71#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR) 74#define SDHC2_CD IOMUX_TO_GPIO(MX31_PIN_ATA_DIOR)
@@ -127,12 +130,12 @@ static struct imxmmc_platform_data sdhc2_pdata = {
127static void dspics_resets_init(void) 130static void dspics_resets_init(void)
128{ 131{
129 if (!gpio_request(TRSLAT_RST_B, "translator-rst")) { 132 if (!gpio_request(TRSLAT_RST_B, "translator-rst")) {
130 gpio_direction_output(TRSLAT_RST_B, 1); 133 gpio_direction_output(TRSLAT_RST_B, 0);
131 gpio_export(TRSLAT_RST_B, false); 134 gpio_export(TRSLAT_RST_B, false);
132 } 135 }
133 136
134 if (!gpio_request(DSPICS_RST_B, "dspics-rst")) { 137 if (!gpio_request(DSPICS_RST_B, "dspics-rst")) {
135 gpio_direction_output(DSPICS_RST_B, 1); 138 gpio_direction_output(DSPICS_RST_B, 0);
136 gpio_export(DSPICS_RST_B, false); 139 gpio_export(DSPICS_RST_B, false);
137 } 140 }
138} 141}
@@ -200,7 +203,7 @@ static int __init marxbot_cam_init(void)
200 int ret = gpio_request(CAM_CHOICE, "cam-choice"); 203 int ret = gpio_request(CAM_CHOICE, "cam-choice");
201 if (ret) 204 if (ret)
202 return ret; 205 return ret;
203 gpio_direction_output(CAM_CHOICE, 1); 206 gpio_direction_output(CAM_CHOICE, 0);
204 207
205 ret = gpio_request(BASECAM_RST_B, "basecam-reset"); 208 ret = gpio_request(BASECAM_RST_B, "basecam-reset");
206 if (ret) 209 if (ret)
@@ -223,6 +226,34 @@ static int __init marxbot_cam_init(void)
223 return 0; 226 return 0;
224} 227}
225 228
229#define SEL0 IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
230#define SEL1 IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
231#define SEL2 IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
232#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
233
234static void marxbot_init_sel_gpios(void)
235{
236 if (!gpio_request(SEL0, "sel0")) {
237 gpio_direction_input(SEL0);
238 gpio_export(SEL0, true);
239 }
240
241 if (!gpio_request(SEL1, "sel1")) {
242 gpio_direction_input(SEL1);
243 gpio_export(SEL1, true);
244 }
245
246 if (!gpio_request(SEL2, "sel2")) {
247 gpio_direction_input(SEL2);
248 gpio_export(SEL2, true);
249 }
250
251 if (!gpio_request(SEL3, "sel3")) {
252 gpio_direction_input(SEL3);
253 gpio_export(SEL3, true);
254 }
255}
256
226#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ 257#define USB_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \
227 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) 258 PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU)
228 259
@@ -307,6 +338,8 @@ void __init mx31moboard_marxbot_init(void)
307 mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins), 338 mxc_iomux_setup_multiple_pins(marxbot_pins, ARRAY_SIZE(marxbot_pins),
308 "marxbot"); 339 "marxbot");
309 340
341 marxbot_init_sel_gpios();
342
310 dspics_resets_init(); 343 dspics_resets_init();
311 344
312 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata); 345 mxc_register_device(&mxcsdhc_device1, &sdhc2_pdata);
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
new file mode 100644
index 000000000000..52a69fc8b14f
--- /dev/null
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -0,0 +1,162 @@
1/*
2 * Copyright (C) 2009 Valentin Longchamp, EPFL Mobots group
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include <linux/delay.h>
20#include <linux/gpio.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/i2c.h>
24#include <linux/platform_device.h>
25#include <linux/types.h>
26
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/imx-uart.h>
30#include <mach/iomux-mx3.h>
31
32#include <media/soc_camera.h>
33
34#include "devices.h"
35
36static unsigned int smartbot_pins[] = {
37 /* UART1 */
38 MX31_PIN_CTS2__CTS2, MX31_PIN_RTS2__RTS2,
39 MX31_PIN_TXD2__TXD2, MX31_PIN_RXD2__RXD2,
40 /* CSI */
41 MX31_PIN_CSI_D4__CSI_D4, MX31_PIN_CSI_D5__CSI_D5,
42 MX31_PIN_CSI_D6__CSI_D6, MX31_PIN_CSI_D7__CSI_D7,
43 MX31_PIN_CSI_D8__CSI_D8, MX31_PIN_CSI_D9__CSI_D9,
44 MX31_PIN_CSI_D10__CSI_D10, MX31_PIN_CSI_D11__CSI_D11,
45 MX31_PIN_CSI_D12__CSI_D12, MX31_PIN_CSI_D13__CSI_D13,
46 MX31_PIN_CSI_D14__CSI_D14, MX31_PIN_CSI_D15__CSI_D15,
47 MX31_PIN_CSI_HSYNC__CSI_HSYNC, MX31_PIN_CSI_MCLK__CSI_MCLK,
48 MX31_PIN_CSI_PIXCLK__CSI_PIXCLK, MX31_PIN_CSI_VSYNC__CSI_VSYNC,
49 MX31_PIN_GPIO3_0__GPIO3_0, MX31_PIN_GPIO3_1__GPIO3_1,
50 /* ENABLES */
51 MX31_PIN_DTR_DCE1__GPIO2_8, MX31_PIN_DSR_DCE1__GPIO2_9,
52 MX31_PIN_RI_DCE1__GPIO2_10, MX31_PIN_DCD_DCE1__GPIO2_11,
53};
54
55static struct imxuart_platform_data uart_pdata = {
56 .flags = IMXUART_HAVE_RTSCTS,
57};
58
59#define CAM_POWER IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
60#define CAM_RST_B IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
61
62static int smartbot_cam_power(struct device *dev, int on)
63{
64 gpio_set_value(CAM_POWER, !on);
65 return 0;
66}
67
68static int smartbot_cam_reset(struct device *dev)
69{
70 gpio_set_value(CAM_RST_B, 0);
71 udelay(100);
72 gpio_set_value(CAM_RST_B, 1);
73 return 0;
74}
75
76static struct i2c_board_info smartbot_i2c_devices[] = {
77 {
78 I2C_BOARD_INFO("mt9t031", 0x5d),
79 },
80};
81
82static struct soc_camera_link base_iclink = {
83 .bus_id = 0, /* Must match with the camera ID */
84 .power = smartbot_cam_power,
85 .reset = smartbot_cam_reset,
86 .board_info = &smartbot_i2c_devices[0],
87 .i2c_adapter_id = 0,
88 .module_name = "mt9t031",
89};
90
91static struct platform_device smartbot_camera[] = {
92 {
93 .name = "soc-camera-pdrv",
94 .id = 0,
95 .dev = {
96 .platform_data = &base_iclink,
97 },
98 },
99};
100
101static struct platform_device *smartbot_cameras[] __initdata = {
102 &smartbot_camera[0],
103};
104
105static int __init smartbot_cam_init(void)
106{
107 int ret = gpio_request(CAM_RST_B, "cam-reset");
108 if (ret)
109 return ret;
110 gpio_direction_output(CAM_RST_B, 1);
111 ret = gpio_request(CAM_POWER, "cam-standby");
112 if (ret)
113 return ret;
114 gpio_direction_output(CAM_POWER, 0);
115
116 return 0;
117}
118
119#define POWER_EN IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)
120#define DSPIC_RST_B IOMUX_TO_GPIO(MX31_PIN_DSR_DCE1)
121#define TRSLAT_RST_B IOMUX_TO_GPIO(MX31_PIN_RI_DCE1)
122#define SEL3 IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)
123
124static void smartbot_resets_init(void)
125{
126 if (!gpio_request(POWER_EN, "power-enable")) {
127 gpio_direction_output(POWER_EN, 0);
128 gpio_export(POWER_EN, false);
129 }
130
131 if (!gpio_request(DSPIC_RST_B, "dspic-rst")) {
132 gpio_direction_output(DSPIC_RST_B, 0);
133 gpio_export(DSPIC_RST_B, false);
134 }
135
136 if (!gpio_request(TRSLAT_RST_B, "translator-rst")) {
137 gpio_direction_output(TRSLAT_RST_B, 0);
138 gpio_export(TRSLAT_RST_B, false);
139 }
140
141 if (!gpio_request(SEL3, "sel3")) {
142 gpio_direction_input(SEL3);
143 gpio_export(SEL3, true);
144 }
145}
146/*
147 * system init for baseboard usage. Will be called by mx31moboard init.
148 */
149void __init mx31moboard_smartbot_init(void)
150{
151 printk(KERN_INFO "Initializing mx31smartbot peripherals\n");
152
153 mxc_iomux_setup_multiple_pins(smartbot_pins, ARRAY_SIZE(smartbot_pins),
154 "smartbot");
155
156 mxc_register_device(&mxc_uart_device1, &uart_pdata);
157
158 smartbot_resets_init();
159
160 smartbot_cam_init();
161 platform_add_devices(smartbot_cameras, ARRAY_SIZE(smartbot_cameras));
162}
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
new file mode 100644
index 000000000000..1576d51e676c
--- /dev/null
+++ b/arch/arm/mach-mx5/Kconfig
@@ -0,0 +1,18 @@
1if ARCH_MX5
2
3config ARCH_MX51
4 bool
5 default y
6 select MXC_TZIC
7 select ARCH_MXC_IOMUX_V3
8
9comment "MX5 platforms:"
10
11config MACH_MX51_BABBAGE
12 bool "Support MX51 BABBAGE platforms"
13 help
14 Include support for MX51 Babbage platform, also known as MX51EVK in
15 u-boot. This includes specific configurations for the board and its
16 peripherals.
17
18endif
diff --git a/arch/arm/mach-mx5/Makefile b/arch/arm/mach-mx5/Makefile
new file mode 100644
index 000000000000..bf23f869ef51
--- /dev/null
+++ b/arch/arm/mach-mx5/Makefile
@@ -0,0 +1,9 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6obj-y := cpu.o mm.o clock-mx51.o devices.o
7
8obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
9
diff --git a/arch/arm/mach-mx5/Makefile.boot b/arch/arm/mach-mx5/Makefile.boot
new file mode 100644
index 000000000000..9939a19d99a1
--- /dev/null
+++ b/arch/arm/mach-mx5/Makefile.boot
@@ -0,0 +1,3 @@
1 zreladdr-y := 0x90008000
2params_phys-y := 0x90000100
3initrd_phys-y := 0x90800000
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
new file mode 100644
index 000000000000..ee67a71db80d
--- /dev/null
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -0,0 +1,98 @@
1/*
2 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/init.h>
14#include <linux/platform_device.h>
15
16#include <mach/common.h>
17#include <mach/hardware.h>
18#include <mach/imx-uart.h>
19#include <mach/iomux-mx51.h>
20
21#include <asm/irq.h>
22#include <asm/setup.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25#include <asm/mach/time.h>
26
27#include "devices.h"
28
29static struct platform_device *devices[] __initdata = {
30 &mxc_fec_device,
31};
32
33static struct pad_desc mx51babbage_pads[] = {
34 /* UART1 */
35 MX51_PAD_UART1_RXD__UART1_RXD,
36 MX51_PAD_UART1_TXD__UART1_TXD,
37 MX51_PAD_UART1_RTS__UART1_RTS,
38 MX51_PAD_UART1_CTS__UART1_CTS,
39
40 /* UART2 */
41 MX51_PAD_UART2_RXD__UART2_RXD,
42 MX51_PAD_UART2_TXD__UART2_TXD,
43
44 /* UART3 */
45 MX51_PAD_EIM_D25__UART3_RXD,
46 MX51_PAD_EIM_D26__UART3_TXD,
47 MX51_PAD_EIM_D27__UART3_RTS,
48 MX51_PAD_EIM_D24__UART3_CTS,
49};
50
51/* Serial ports */
52#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE)
53static struct imxuart_platform_data uart_pdata = {
54 .flags = IMXUART_HAVE_RTSCTS,
55};
56
57static inline void mxc_init_imx_uart(void)
58{
59 mxc_register_device(&mxc_uart_device0, &uart_pdata);
60 mxc_register_device(&mxc_uart_device1, &uart_pdata);
61 mxc_register_device(&mxc_uart_device2, &uart_pdata);
62}
63#else /* !SERIAL_IMX */
64static inline void mxc_init_imx_uart(void)
65{
66}
67#endif /* SERIAL_IMX */
68
69/*
70 * Board specific initialization.
71 */
72static void __init mxc_board_init(void)
73{
74 mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
75 ARRAY_SIZE(mx51babbage_pads));
76 mxc_init_imx_uart();
77 platform_add_devices(devices, ARRAY_SIZE(devices));
78}
79
80static void __init mx51_babbage_timer_init(void)
81{
82 mx51_clocks_init(32768, 24000000, 22579200, 0);
83}
84
85static struct sys_timer mxc_timer = {
86 .init = mx51_babbage_timer_init,
87};
88
89MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board")
90 /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */
91 .phys_io = MX51_AIPS1_BASE_ADDR,
92 .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
93 .boot_params = PHYS_OFFSET + 0x100,
94 .map_io = mx51_map_io,
95 .init_irq = mx51_init_irq,
96 .init_machine = mxc_board_init,
97 .timer = &mxc_timer,
98MACHINE_END
diff --git a/arch/arm/mach-mx5/clock-mx51.c b/arch/arm/mach-mx5/clock-mx51.c
new file mode 100644
index 000000000000..be90c03101cd
--- /dev/null
+++ b/arch/arm/mach-mx5/clock-mx51.c
@@ -0,0 +1,825 @@
1/*
2 * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/mm.h>
14#include <linux/delay.h>
15#include <linux/clk.h>
16#include <linux/io.h>
17
18#include <asm/clkdev.h>
19
20#include <mach/hardware.h>
21#include <mach/common.h>
22#include <mach/clock.h>
23
24#include "crm_regs.h"
25
26/* External clock values passed-in by the board code */
27static unsigned long external_high_reference, external_low_reference;
28static unsigned long oscillator_reference, ckih2_reference;
29
30static struct clk osc_clk;
31static struct clk pll1_main_clk;
32static struct clk pll1_sw_clk;
33static struct clk pll2_sw_clk;
34static struct clk pll3_sw_clk;
35static struct clk lp_apm_clk;
36static struct clk periph_apm_clk;
37static struct clk ahb_clk;
38static struct clk ipg_clk;
39
40#define MAX_DPLL_WAIT_TRIES 1000 /* 1000 * udelay(1) = 1ms */
41
42static int _clk_ccgr_enable(struct clk *clk)
43{
44 u32 reg;
45
46 reg = __raw_readl(clk->enable_reg);
47 reg |= MXC_CCM_CCGRx_MOD_ON << clk->enable_shift;
48 __raw_writel(reg, clk->enable_reg);
49
50 return 0;
51}
52
53static void _clk_ccgr_disable(struct clk *clk)
54{
55 u32 reg;
56 reg = __raw_readl(clk->enable_reg);
57 reg &= ~(MXC_CCM_CCGRx_MOD_OFF << clk->enable_shift);
58 __raw_writel(reg, clk->enable_reg);
59
60}
61
62static void _clk_ccgr_disable_inwait(struct clk *clk)
63{
64 u32 reg;
65
66 reg = __raw_readl(clk->enable_reg);
67 reg &= ~(MXC_CCM_CCGRx_CG_MASK << clk->enable_shift);
68 reg |= MXC_CCM_CCGRx_MOD_IDLE << clk->enable_shift;
69 __raw_writel(reg, clk->enable_reg);
70}
71
72/*
73 * For the 4-to-1 muxed input clock
74 */
75static inline u32 _get_mux(struct clk *parent, struct clk *m0,
76 struct clk *m1, struct clk *m2, struct clk *m3)
77{
78 if (parent == m0)
79 return 0;
80 else if (parent == m1)
81 return 1;
82 else if (parent == m2)
83 return 2;
84 else if (parent == m3)
85 return 3;
86 else
87 BUG();
88
89 return -EINVAL;
90}
91
92static inline void __iomem *_get_pll_base(struct clk *pll)
93{
94 if (pll == &pll1_main_clk)
95 return MX51_DPLL1_BASE;
96 else if (pll == &pll2_sw_clk)
97 return MX51_DPLL2_BASE;
98 else if (pll == &pll3_sw_clk)
99 return MX51_DPLL3_BASE;
100 else
101 BUG();
102
103 return NULL;
104}
105
106static unsigned long clk_pll_get_rate(struct clk *clk)
107{
108 long mfi, mfn, mfd, pdf, ref_clk, mfn_abs;
109 unsigned long dp_op, dp_mfd, dp_mfn, dp_ctl, pll_hfsm, dbl;
110 void __iomem *pllbase;
111 s64 temp;
112 unsigned long parent_rate;
113
114 parent_rate = clk_get_rate(clk->parent);
115
116 pllbase = _get_pll_base(clk);
117
118 dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
119 pll_hfsm = dp_ctl & MXC_PLL_DP_CTL_HFSM;
120 dbl = dp_ctl & MXC_PLL_DP_CTL_DPDCK0_2_EN;
121
122 if (pll_hfsm == 0) {
123 dp_op = __raw_readl(pllbase + MXC_PLL_DP_OP);
124 dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_MFD);
125 dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_MFN);
126 } else {
127 dp_op = __raw_readl(pllbase + MXC_PLL_DP_HFS_OP);
128 dp_mfd = __raw_readl(pllbase + MXC_PLL_DP_HFS_MFD);
129 dp_mfn = __raw_readl(pllbase + MXC_PLL_DP_HFS_MFN);
130 }
131 pdf = dp_op & MXC_PLL_DP_OP_PDF_MASK;
132 mfi = (dp_op & MXC_PLL_DP_OP_MFI_MASK) >> MXC_PLL_DP_OP_MFI_OFFSET;
133 mfi = (mfi <= 5) ? 5 : mfi;
134 mfd = dp_mfd & MXC_PLL_DP_MFD_MASK;
135 mfn = mfn_abs = dp_mfn & MXC_PLL_DP_MFN_MASK;
136 /* Sign extend to 32-bits */
137 if (mfn >= 0x04000000) {
138 mfn |= 0xFC000000;
139 mfn_abs = -mfn;
140 }
141
142 ref_clk = 2 * parent_rate;
143 if (dbl != 0)
144 ref_clk *= 2;
145
146 ref_clk /= (pdf + 1);
147 temp = (u64) ref_clk * mfn_abs;
148 do_div(temp, mfd + 1);
149 if (mfn < 0)
150 temp = -temp;
151 temp = (ref_clk * mfi) + temp;
152
153 return temp;
154}
155
156static int _clk_pll_set_rate(struct clk *clk, unsigned long rate)
157{
158 u32 reg;
159 void __iomem *pllbase;
160
161 long mfi, pdf, mfn, mfd = 999999;
162 s64 temp64;
163 unsigned long quad_parent_rate;
164 unsigned long pll_hfsm, dp_ctl;
165 unsigned long parent_rate;
166
167 parent_rate = clk_get_rate(clk->parent);
168
169 pllbase = _get_pll_base(clk);
170
171 quad_parent_rate = 4 * parent_rate;
172 pdf = mfi = -1;
173 while (++pdf < 16 && mfi < 5)
174 mfi = rate * (pdf+1) / quad_parent_rate;
175 if (mfi > 15)
176 return -EINVAL;
177 pdf--;
178
179 temp64 = rate * (pdf+1) - quad_parent_rate * mfi;
180 do_div(temp64, quad_parent_rate/1000000);
181 mfn = (long)temp64;
182
183 dp_ctl = __raw_readl(pllbase + MXC_PLL_DP_CTL);
184 /* use dpdck0_2 */
185 __raw_writel(dp_ctl | 0x1000L, pllbase + MXC_PLL_DP_CTL);
186 pll_hfsm = dp_ctl & MXC_PLL_DP_CTL_HFSM;
187 if (pll_hfsm == 0) {
188 reg = mfi << 4 | pdf;
189 __raw_writel(reg, pllbase + MXC_PLL_DP_OP);
190 __raw_writel(mfd, pllbase + MXC_PLL_DP_MFD);
191 __raw_writel(mfn, pllbase + MXC_PLL_DP_MFN);
192 } else {
193 reg = mfi << 4 | pdf;
194 __raw_writel(reg, pllbase + MXC_PLL_DP_HFS_OP);
195 __raw_writel(mfd, pllbase + MXC_PLL_DP_HFS_MFD);
196 __raw_writel(mfn, pllbase + MXC_PLL_DP_HFS_MFN);
197 }
198
199 return 0;
200}
201
202static int _clk_pll_enable(struct clk *clk)
203{
204 u32 reg;
205 void __iomem *pllbase;
206 int i = 0;
207
208 pllbase = _get_pll_base(clk);
209 reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) | MXC_PLL_DP_CTL_UPEN;
210 __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
211
212 /* Wait for lock */
213 do {
214 reg = __raw_readl(pllbase + MXC_PLL_DP_CTL);
215 if (reg & MXC_PLL_DP_CTL_LRF)
216 break;
217
218 udelay(1);
219 } while (++i < MAX_DPLL_WAIT_TRIES);
220
221 if (i == MAX_DPLL_WAIT_TRIES) {
222 pr_err("MX5: pll locking failed\n");
223 return -EINVAL;
224 }
225
226 return 0;
227}
228
229static void _clk_pll_disable(struct clk *clk)
230{
231 u32 reg;
232 void __iomem *pllbase;
233
234 pllbase = _get_pll_base(clk);
235 reg = __raw_readl(pllbase + MXC_PLL_DP_CTL) & ~MXC_PLL_DP_CTL_UPEN;
236 __raw_writel(reg, pllbase + MXC_PLL_DP_CTL);
237}
238
239static int _clk_pll1_sw_set_parent(struct clk *clk, struct clk *parent)
240{
241 u32 reg, step;
242
243 reg = __raw_readl(MXC_CCM_CCSR);
244
245 /* When switching from pll_main_clk to a bypass clock, first select a
246 * multiplexed clock in 'step_sel', then shift the glitchless mux
247 * 'pll1_sw_clk_sel'.
248 *
249 * When switching back, do it in reverse order
250 */
251 if (parent == &pll1_main_clk) {
252 /* Switch to pll1_main_clk */
253 reg &= ~MXC_CCM_CCSR_PLL1_SW_CLK_SEL;
254 __raw_writel(reg, MXC_CCM_CCSR);
255 /* step_clk mux switched to lp_apm, to save power. */
256 reg = __raw_readl(MXC_CCM_CCSR);
257 reg &= ~MXC_CCM_CCSR_STEP_SEL_MASK;
258 reg |= (MXC_CCM_CCSR_STEP_SEL_LP_APM <<
259 MXC_CCM_CCSR_STEP_SEL_OFFSET);
260 } else {
261 if (parent == &lp_apm_clk) {
262 step = MXC_CCM_CCSR_STEP_SEL_LP_APM;
263 } else if (parent == &pll2_sw_clk) {
264 step = MXC_CCM_CCSR_STEP_SEL_PLL2_DIVIDED;
265 } else if (parent == &pll3_sw_clk) {
266 step = MXC_CCM_CCSR_STEP_SEL_PLL3_DIVIDED;
267 } else
268 return -EINVAL;
269
270 reg &= ~MXC_CCM_CCSR_STEP_SEL_MASK;
271 reg |= (step << MXC_CCM_CCSR_STEP_SEL_OFFSET);
272
273 __raw_writel(reg, MXC_CCM_CCSR);
274 /* Switch to step_clk */
275 reg = __raw_readl(MXC_CCM_CCSR);
276 reg |= MXC_CCM_CCSR_PLL1_SW_CLK_SEL;
277 }
278 __raw_writel(reg, MXC_CCM_CCSR);
279 return 0;
280}
281
282static unsigned long clk_pll1_sw_get_rate(struct clk *clk)
283{
284 u32 reg, div;
285 unsigned long parent_rate;
286
287 parent_rate = clk_get_rate(clk->parent);
288
289 reg = __raw_readl(MXC_CCM_CCSR);
290
291 if (clk->parent == &pll2_sw_clk) {
292 div = ((reg & MXC_CCM_CCSR_PLL2_PODF_MASK) >>
293 MXC_CCM_CCSR_PLL2_PODF_OFFSET) + 1;
294 } else if (clk->parent == &pll3_sw_clk) {
295 div = ((reg & MXC_CCM_CCSR_PLL3_PODF_MASK) >>
296 MXC_CCM_CCSR_PLL3_PODF_OFFSET) + 1;
297 } else
298 div = 1;
299 return parent_rate / div;
300}
301
302static int _clk_pll2_sw_set_parent(struct clk *clk, struct clk *parent)
303{
304 u32 reg;
305
306 reg = __raw_readl(MXC_CCM_CCSR);
307
308 if (parent == &pll2_sw_clk)
309 reg &= ~MXC_CCM_CCSR_PLL2_SW_CLK_SEL;
310 else
311 reg |= MXC_CCM_CCSR_PLL2_SW_CLK_SEL;
312
313 __raw_writel(reg, MXC_CCM_CCSR);
314 return 0;
315}
316
317static int _clk_lp_apm_set_parent(struct clk *clk, struct clk *parent)
318{
319 u32 reg;
320
321 if (parent == &osc_clk)
322 reg = __raw_readl(MXC_CCM_CCSR) & ~MXC_CCM_CCSR_LP_APM_SEL;
323 else
324 return -EINVAL;
325
326 __raw_writel(reg, MXC_CCM_CCSR);
327
328 return 0;
329}
330
331static unsigned long clk_arm_get_rate(struct clk *clk)
332{
333 u32 cacrr, div;
334 unsigned long parent_rate;
335
336 parent_rate = clk_get_rate(clk->parent);
337 cacrr = __raw_readl(MXC_CCM_CACRR);
338 div = (cacrr & MXC_CCM_CACRR_ARM_PODF_MASK) + 1;
339
340 return parent_rate / div;
341}
342
343static int _clk_periph_apm_set_parent(struct clk *clk, struct clk *parent)
344{
345 u32 reg, mux;
346 int i = 0;
347
348 mux = _get_mux(parent, &pll1_sw_clk, &pll3_sw_clk, &lp_apm_clk, NULL);
349
350 reg = __raw_readl(MXC_CCM_CBCMR) & ~MXC_CCM_CBCMR_PERIPH_CLK_SEL_MASK;
351 reg |= mux << MXC_CCM_CBCMR_PERIPH_CLK_SEL_OFFSET;
352 __raw_writel(reg, MXC_CCM_CBCMR);
353
354 /* Wait for lock */
355 do {
356 reg = __raw_readl(MXC_CCM_CDHIPR);
357 if (!(reg & MXC_CCM_CDHIPR_PERIPH_CLK_SEL_BUSY))
358 break;
359
360 udelay(1);
361 } while (++i < MAX_DPLL_WAIT_TRIES);
362
363 if (i == MAX_DPLL_WAIT_TRIES) {
364 pr_err("MX5: Set parent for periph_apm clock failed\n");
365 return -EINVAL;
366 }
367
368 return 0;
369}
370
371static int _clk_main_bus_set_parent(struct clk *clk, struct clk *parent)
372{
373 u32 reg;
374
375 reg = __raw_readl(MXC_CCM_CBCDR);
376
377 if (parent == &pll2_sw_clk)
378 reg &= ~MXC_CCM_CBCDR_PERIPH_CLK_SEL;
379 else if (parent == &periph_apm_clk)
380 reg |= MXC_CCM_CBCDR_PERIPH_CLK_SEL;
381 else
382 return -EINVAL;
383
384 __raw_writel(reg, MXC_CCM_CBCDR);
385
386 return 0;
387}
388
389static struct clk main_bus_clk = {
390 .parent = &pll2_sw_clk,
391 .set_parent = _clk_main_bus_set_parent,
392};
393
394static unsigned long clk_ahb_get_rate(struct clk *clk)
395{
396 u32 reg, div;
397 unsigned long parent_rate;
398
399 parent_rate = clk_get_rate(clk->parent);
400
401 reg = __raw_readl(MXC_CCM_CBCDR);
402 div = ((reg & MXC_CCM_CBCDR_AHB_PODF_MASK) >>
403 MXC_CCM_CBCDR_AHB_PODF_OFFSET) + 1;
404 return parent_rate / div;
405}
406
407
408static int _clk_ahb_set_rate(struct clk *clk, unsigned long rate)
409{
410 u32 reg, div;
411 unsigned long parent_rate;
412 int i = 0;
413
414 parent_rate = clk_get_rate(clk->parent);
415
416 div = parent_rate / rate;
417 if (div > 8 || div < 1 || ((parent_rate / div) != rate))
418 return -EINVAL;
419
420 reg = __raw_readl(MXC_CCM_CBCDR);
421 reg &= ~MXC_CCM_CBCDR_AHB_PODF_MASK;
422 reg |= (div - 1) << MXC_CCM_CBCDR_AHB_PODF_OFFSET;
423 __raw_writel(reg, MXC_CCM_CBCDR);
424
425 /* Wait for lock */
426 do {
427 reg = __raw_readl(MXC_CCM_CDHIPR);
428 if (!(reg & MXC_CCM_CDHIPR_AHB_PODF_BUSY))
429 break;
430
431 udelay(1);
432 } while (++i < MAX_DPLL_WAIT_TRIES);
433
434 if (i == MAX_DPLL_WAIT_TRIES) {
435 pr_err("MX5: clk_ahb_set_rate failed\n");
436 return -EINVAL;
437 }
438
439 return 0;
440}
441
442static unsigned long _clk_ahb_round_rate(struct clk *clk,
443 unsigned long rate)
444{
445 u32 div;
446 unsigned long parent_rate;
447
448 parent_rate = clk_get_rate(clk->parent);
449
450 div = parent_rate / rate;
451 if (div > 8)
452 div = 8;
453 else if (div == 0)
454 div++;
455 return parent_rate / div;
456}
457
458
459static int _clk_max_enable(struct clk *clk)
460{
461 u32 reg;
462
463 _clk_ccgr_enable(clk);
464
465 /* Handshake with MAX when LPM is entered. */
466 reg = __raw_readl(MXC_CCM_CLPCR);
467 reg &= ~MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS;
468 __raw_writel(reg, MXC_CCM_CLPCR);
469
470 return 0;
471}
472
473static void _clk_max_disable(struct clk *clk)
474{
475 u32 reg;
476
477 _clk_ccgr_disable_inwait(clk);
478
479 /* No Handshake with MAX when LPM is entered as its disabled. */
480 reg = __raw_readl(MXC_CCM_CLPCR);
481 reg |= MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS;
482 __raw_writel(reg, MXC_CCM_CLPCR);
483}
484
485static unsigned long clk_ipg_get_rate(struct clk *clk)
486{
487 u32 reg, div;
488 unsigned long parent_rate;
489
490 parent_rate = clk_get_rate(clk->parent);
491
492 reg = __raw_readl(MXC_CCM_CBCDR);
493 div = ((reg & MXC_CCM_CBCDR_IPG_PODF_MASK) >>
494 MXC_CCM_CBCDR_IPG_PODF_OFFSET) + 1;
495
496 return parent_rate / div;
497}
498
499static unsigned long clk_ipg_per_get_rate(struct clk *clk)
500{
501 u32 reg, prediv1, prediv2, podf;
502 unsigned long parent_rate;
503
504 parent_rate = clk_get_rate(clk->parent);
505
506 if (clk->parent == &main_bus_clk || clk->parent == &lp_apm_clk) {
507 /* the main_bus_clk is the one before the DVFS engine */
508 reg = __raw_readl(MXC_CCM_CBCDR);
509 prediv1 = ((reg & MXC_CCM_CBCDR_PERCLK_PRED1_MASK) >>
510 MXC_CCM_CBCDR_PERCLK_PRED1_OFFSET) + 1;
511 prediv2 = ((reg & MXC_CCM_CBCDR_PERCLK_PRED2_MASK) >>
512 MXC_CCM_CBCDR_PERCLK_PRED2_OFFSET) + 1;
513 podf = ((reg & MXC_CCM_CBCDR_PERCLK_PODF_MASK) >>
514 MXC_CCM_CBCDR_PERCLK_PODF_OFFSET) + 1;
515 return parent_rate / (prediv1 * prediv2 * podf);
516 } else if (clk->parent == &ipg_clk)
517 return parent_rate;
518 else
519 BUG();
520}
521
522static int _clk_ipg_per_set_parent(struct clk *clk, struct clk *parent)
523{
524 u32 reg;
525
526 reg = __raw_readl(MXC_CCM_CBCMR);
527
528 reg &= ~MXC_CCM_CBCMR_PERCLK_LP_APM_CLK_SEL;
529 reg &= ~MXC_CCM_CBCMR_PERCLK_IPG_CLK_SEL;
530
531 if (parent == &ipg_clk)
532 reg |= MXC_CCM_CBCMR_PERCLK_IPG_CLK_SEL;
533 else if (parent == &lp_apm_clk)
534 reg |= MXC_CCM_CBCMR_PERCLK_LP_APM_CLK_SEL;
535 else if (parent != &main_bus_clk)
536 return -EINVAL;
537
538 __raw_writel(reg, MXC_CCM_CBCMR);
539
540 return 0;
541}
542
543static unsigned long clk_uart_get_rate(struct clk *clk)
544{
545 u32 reg, prediv, podf;
546 unsigned long parent_rate;
547
548 parent_rate = clk_get_rate(clk->parent);
549
550 reg = __raw_readl(MXC_CCM_CSCDR1);
551 prediv = ((reg & MXC_CCM_CSCDR1_UART_CLK_PRED_MASK) >>
552 MXC_CCM_CSCDR1_UART_CLK_PRED_OFFSET) + 1;
553 podf = ((reg & MXC_CCM_CSCDR1_UART_CLK_PODF_MASK) >>
554 MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET) + 1;
555
556 return parent_rate / (prediv * podf);
557}
558
559static int _clk_uart_set_parent(struct clk *clk, struct clk *parent)
560{
561 u32 reg, mux;
562
563 mux = _get_mux(parent, &pll1_sw_clk, &pll2_sw_clk, &pll3_sw_clk,
564 &lp_apm_clk);
565 reg = __raw_readl(MXC_CCM_CSCMR1) & ~MXC_CCM_CSCMR1_UART_CLK_SEL_MASK;
566 reg |= mux << MXC_CCM_CSCMR1_UART_CLK_SEL_OFFSET;
567 __raw_writel(reg, MXC_CCM_CSCMR1);
568
569 return 0;
570}
571
572static unsigned long get_high_reference_clock_rate(struct clk *clk)
573{
574 return external_high_reference;
575}
576
577static unsigned long get_low_reference_clock_rate(struct clk *clk)
578{
579 return external_low_reference;
580}
581
582static unsigned long get_oscillator_reference_clock_rate(struct clk *clk)
583{
584 return oscillator_reference;
585}
586
587static unsigned long get_ckih2_reference_clock_rate(struct clk *clk)
588{
589 return ckih2_reference;
590}
591
592/* External high frequency clock */
593static struct clk ckih_clk = {
594 .get_rate = get_high_reference_clock_rate,
595};
596
597static struct clk ckih2_clk = {
598 .get_rate = get_ckih2_reference_clock_rate,
599};
600
601static struct clk osc_clk = {
602 .get_rate = get_oscillator_reference_clock_rate,
603};
604
605/* External low frequency (32kHz) clock */
606static struct clk ckil_clk = {
607 .get_rate = get_low_reference_clock_rate,
608};
609
610static struct clk pll1_main_clk = {
611 .parent = &osc_clk,
612 .get_rate = clk_pll_get_rate,
613 .enable = _clk_pll_enable,
614 .disable = _clk_pll_disable,
615};
616
617/* Clock tree block diagram (WIP):
618 * CCM: Clock Controller Module
619 *
620 * PLL output -> |
621 * | CCM Switcher -> CCM_CLK_ROOT_GEN ->
622 * PLL bypass -> |
623 *
624 */
625
626/* PLL1 SW supplies to ARM core */
627static struct clk pll1_sw_clk = {
628 .parent = &pll1_main_clk,
629 .set_parent = _clk_pll1_sw_set_parent,
630 .get_rate = clk_pll1_sw_get_rate,
631};
632
633/* PLL2 SW supplies to AXI/AHB/IP buses */
634static struct clk pll2_sw_clk = {
635 .parent = &osc_clk,
636 .get_rate = clk_pll_get_rate,
637 .set_rate = _clk_pll_set_rate,
638 .set_parent = _clk_pll2_sw_set_parent,
639 .enable = _clk_pll_enable,
640 .disable = _clk_pll_disable,
641};
642
643/* PLL3 SW supplies to serial clocks like USB, SSI, etc. */
644static struct clk pll3_sw_clk = {
645 .parent = &osc_clk,
646 .set_rate = _clk_pll_set_rate,
647 .get_rate = clk_pll_get_rate,
648 .enable = _clk_pll_enable,
649 .disable = _clk_pll_disable,
650};
651
652/* Low-power Audio Playback Mode clock */
653static struct clk lp_apm_clk = {
654 .parent = &osc_clk,
655 .set_parent = _clk_lp_apm_set_parent,
656};
657
658static struct clk periph_apm_clk = {
659 .parent = &pll1_sw_clk,
660 .set_parent = _clk_periph_apm_set_parent,
661};
662
663static struct clk cpu_clk = {
664 .parent = &pll1_sw_clk,
665 .get_rate = clk_arm_get_rate,
666};
667
668static struct clk ahb_clk = {
669 .parent = &main_bus_clk,
670 .get_rate = clk_ahb_get_rate,
671 .set_rate = _clk_ahb_set_rate,
672 .round_rate = _clk_ahb_round_rate,
673};
674
675/* Main IP interface clock for access to registers */
676static struct clk ipg_clk = {
677 .parent = &ahb_clk,
678 .get_rate = clk_ipg_get_rate,
679};
680
681static struct clk ipg_perclk = {
682 .parent = &lp_apm_clk,
683 .get_rate = clk_ipg_per_get_rate,
684 .set_parent = _clk_ipg_per_set_parent,
685};
686
687static struct clk uart_root_clk = {
688 .parent = &pll2_sw_clk,
689 .get_rate = clk_uart_get_rate,
690 .set_parent = _clk_uart_set_parent,
691};
692
693static struct clk ahb_max_clk = {
694 .parent = &ahb_clk,
695 .enable_reg = MXC_CCM_CCGR0,
696 .enable_shift = MXC_CCM_CCGRx_CG14_OFFSET,
697 .enable = _clk_max_enable,
698 .disable = _clk_max_disable,
699};
700
701static struct clk aips_tz1_clk = {
702 .parent = &ahb_clk,
703 .secondary = &ahb_max_clk,
704 .enable_reg = MXC_CCM_CCGR0,
705 .enable_shift = MXC_CCM_CCGRx_CG12_OFFSET,
706 .enable = _clk_ccgr_enable,
707 .disable = _clk_ccgr_disable_inwait,
708};
709
710static struct clk aips_tz2_clk = {
711 .parent = &ahb_clk,
712 .secondary = &ahb_max_clk,
713 .enable_reg = MXC_CCM_CCGR0,
714 .enable_shift = MXC_CCM_CCGRx_CG13_OFFSET,
715 .enable = _clk_ccgr_enable,
716 .disable = _clk_ccgr_disable_inwait,
717};
718
719static struct clk gpt_32k_clk = {
720 .id = 0,
721 .parent = &ckil_clk,
722};
723
724#define DEFINE_CLOCK(name, i, er, es, gr, sr, p, s) \
725 static struct clk name = { \
726 .id = i, \
727 .enable_reg = er, \
728 .enable_shift = es, \
729 .get_rate = gr, \
730 .set_rate = sr, \
731 .enable = _clk_ccgr_enable, \
732 .disable = _clk_ccgr_disable, \
733 .parent = p, \
734 .secondary = s, \
735 }
736
737/* DEFINE_CLOCK(name, id, enable_reg, enable_shift,
738 get_rate, set_rate, parent, secondary); */
739
740/* Shared peripheral bus arbiter */
741DEFINE_CLOCK(spba_clk, 0, MXC_CCM_CCGR5, MXC_CCM_CCGRx_CG0_OFFSET,
742 NULL, NULL, &ipg_clk, NULL);
743
744/* UART */
745DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET,
746 NULL, NULL, &uart_root_clk, NULL);
747DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET,
748 NULL, NULL, &uart_root_clk, NULL);
749DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET,
750 NULL, NULL, &uart_root_clk, NULL);
751DEFINE_CLOCK(uart1_ipg_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG3_OFFSET,
752 NULL, NULL, &ipg_clk, &aips_tz1_clk);
753DEFINE_CLOCK(uart2_ipg_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG5_OFFSET,
754 NULL, NULL, &ipg_clk, &aips_tz1_clk);
755DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET,
756 NULL, NULL, &ipg_clk, &spba_clk);
757
758/* GPT */
759DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET,
760 NULL, NULL, &ipg_perclk, NULL);
761DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET,
762 NULL, NULL, &ipg_clk, NULL);
763
764/* FEC */
765DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET,
766 NULL, NULL, &ipg_clk, NULL);
767
768#define _REGISTER_CLOCK(d, n, c) \
769 { \
770 .dev_id = d, \
771 .con_id = n, \
772 .clk = &c, \
773 },
774
775static struct clk_lookup lookups[] = {
776 _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
777 _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
778 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
779 _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
780 _REGISTER_CLOCK("fec.0", NULL, fec_clk)
781};
782
783static void clk_tree_init(void)
784{
785 u32 reg;
786
787 ipg_perclk.set_parent(&ipg_perclk, &lp_apm_clk);
788
789 /*
790 * Initialise the IPG PER CLK dividers to 3. IPG_PER_CLK should be at
791 * 8MHz, its derived from lp_apm.
792 *
793 * FIXME: Verify if true for all boards
794 */
795 reg = __raw_readl(MXC_CCM_CBCDR);
796 reg &= ~MXC_CCM_CBCDR_PERCLK_PRED1_MASK;
797 reg &= ~MXC_CCM_CBCDR_PERCLK_PRED2_MASK;
798 reg &= ~MXC_CCM_CBCDR_PERCLK_PODF_MASK;
799 reg |= (2 << MXC_CCM_CBCDR_PERCLK_PRED1_OFFSET);
800 __raw_writel(reg, MXC_CCM_CBCDR);
801}
802
803int __init mx51_clocks_init(unsigned long ckil, unsigned long osc,
804 unsigned long ckih1, unsigned long ckih2)
805{
806 int i;
807
808 external_low_reference = ckil;
809 external_high_reference = ckih1;
810 ckih2_reference = ckih2;
811 oscillator_reference = osc;
812
813 for (i = 0; i < ARRAY_SIZE(lookups); i++)
814 clkdev_add(&lookups[i]);
815
816 clk_tree_init();
817
818 clk_enable(&cpu_clk);
819 clk_enable(&main_bus_clk);
820
821 /* System timer */
822 mxc_timer_init(&gpt_clk, MX51_IO_ADDRESS(MX51_GPT1_BASE_ADDR),
823 MX51_MXC_INT_GPT);
824 return 0;
825}
diff --git a/arch/arm/mach-mx5/cpu.c b/arch/arm/mach-mx5/cpu.c
new file mode 100644
index 000000000000..41c769f08c4d
--- /dev/null
+++ b/arch/arm/mach-mx5/cpu.c
@@ -0,0 +1,47 @@
1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 *
11 * This file contains the CPU initialization code.
12 */
13
14#include <linux/types.h>
15#include <linux/kernel.h>
16#include <linux/init.h>
17#include <mach/hardware.h>
18#include <asm/io.h>
19
20static int __init post_cpu_init(void)
21{
22 unsigned int reg;
23 void __iomem *base;
24
25 if (!cpu_is_mx51())
26 return 0;
27
28 base = MX51_IO_ADDRESS(MX51_AIPS1_BASE_ADDR);
29 __raw_writel(0x0, base + 0x40);
30 __raw_writel(0x0, base + 0x44);
31 __raw_writel(0x0, base + 0x48);
32 __raw_writel(0x0, base + 0x4C);
33 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
34 __raw_writel(reg, base + 0x50);
35
36 base = MX51_IO_ADDRESS(MX51_AIPS2_BASE_ADDR);
37 __raw_writel(0x0, base + 0x40);
38 __raw_writel(0x0, base + 0x44);
39 __raw_writel(0x0, base + 0x48);
40 __raw_writel(0x0, base + 0x4C);
41 reg = __raw_readl(base + 0x50) & 0x00FFFFFF;
42 __raw_writel(reg, base + 0x50);
43
44 return 0;
45}
46
47postcore_initcall(post_cpu_init);
diff --git a/arch/arm/mach-mx5/crm_regs.h b/arch/arm/mach-mx5/crm_regs.h
new file mode 100644
index 000000000000..c776b9af0624
--- /dev/null
+++ b/arch/arm/mach-mx5/crm_regs.h
@@ -0,0 +1,583 @@
1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11#ifndef __ARCH_ARM_MACH_MX51_CRM_REGS_H__
12#define __ARCH_ARM_MACH_MX51_CRM_REGS_H__
13
14#define MX51_CCM_BASE MX51_IO_ADDRESS(MX51_CCM_BASE_ADDR)
15#define MX51_DPLL1_BASE MX51_IO_ADDRESS(MX51_PLL1_BASE_ADDR)
16#define MX51_DPLL2_BASE MX51_IO_ADDRESS(MX51_PLL2_BASE_ADDR)
17#define MX51_DPLL3_BASE MX51_IO_ADDRESS(MX51_PLL3_BASE_ADDR)
18#define MX51_CORTEXA8_BASE MX51_IO_ADDRESS(MX51_ARM_BASE_ADDR)
19#define MX51_GPC_BASE MX51_IO_ADDRESS(MX51_GPC_BASE_ADDR)
20
21/* PLL Register Offsets */
22#define MXC_PLL_DP_CTL 0x00
23#define MXC_PLL_DP_CONFIG 0x04
24#define MXC_PLL_DP_OP 0x08
25#define MXC_PLL_DP_MFD 0x0C
26#define MXC_PLL_DP_MFN 0x10
27#define MXC_PLL_DP_MFNMINUS 0x14
28#define MXC_PLL_DP_MFNPLUS 0x18
29#define MXC_PLL_DP_HFS_OP 0x1C
30#define MXC_PLL_DP_HFS_MFD 0x20
31#define MXC_PLL_DP_HFS_MFN 0x24
32#define MXC_PLL_DP_MFN_TOGC 0x28
33#define MXC_PLL_DP_DESTAT 0x2c
34
35/* PLL Register Bit definitions */
36#define MXC_PLL_DP_CTL_MUL_CTRL 0x2000
37#define MXC_PLL_DP_CTL_DPDCK0_2_EN 0x1000
38#define MXC_PLL_DP_CTL_DPDCK0_2_OFFSET 12
39#define MXC_PLL_DP_CTL_ADE 0x800
40#define MXC_PLL_DP_CTL_REF_CLK_DIV 0x400
41#define MXC_PLL_DP_CTL_REF_CLK_SEL_MASK (3 << 8)
42#define MXC_PLL_DP_CTL_REF_CLK_SEL_OFFSET 8
43#define MXC_PLL_DP_CTL_HFSM 0x80
44#define MXC_PLL_DP_CTL_PRE 0x40
45#define MXC_PLL_DP_CTL_UPEN 0x20
46#define MXC_PLL_DP_CTL_RST 0x10
47#define MXC_PLL_DP_CTL_RCP 0x8
48#define MXC_PLL_DP_CTL_PLM 0x4
49#define MXC_PLL_DP_CTL_BRM0 0x2
50#define MXC_PLL_DP_CTL_LRF 0x1
51
52#define MXC_PLL_DP_CONFIG_BIST 0x8
53#define MXC_PLL_DP_CONFIG_SJC_CE 0x4
54#define MXC_PLL_DP_CONFIG_AREN 0x2
55#define MXC_PLL_DP_CONFIG_LDREQ 0x1
56
57#define MXC_PLL_DP_OP_MFI_OFFSET 4
58#define MXC_PLL_DP_OP_MFI_MASK (0xF << 4)
59#define MXC_PLL_DP_OP_PDF_OFFSET 0
60#define MXC_PLL_DP_OP_PDF_MASK 0xF
61
62#define MXC_PLL_DP_MFD_OFFSET 0
63#define MXC_PLL_DP_MFD_MASK 0x07FFFFFF
64
65#define MXC_PLL_DP_MFN_OFFSET 0x0
66#define MXC_PLL_DP_MFN_MASK 0x07FFFFFF
67
68#define MXC_PLL_DP_MFN_TOGC_TOG_DIS (1 << 17)
69#define MXC_PLL_DP_MFN_TOGC_TOG_EN (1 << 16)
70#define MXC_PLL_DP_MFN_TOGC_CNT_OFFSET 0x0
71#define MXC_PLL_DP_MFN_TOGC_CNT_MASK 0xFFFF
72
73#define MXC_PLL_DP_DESTAT_TOG_SEL (1 << 31)
74#define MXC_PLL_DP_DESTAT_MFN 0x07FFFFFF
75
76/* Register addresses of CCM*/
77#define MXC_CCM_CCR (MX51_CCM_BASE + 0x00)
78#define MXC_CCM_CCDR (MX51_CCM_BASE + 0x04)
79#define MXC_CCM_CSR (MX51_CCM_BASE + 0x08)
80#define MXC_CCM_CCSR (MX51_CCM_BASE + 0x0C)
81#define MXC_CCM_CACRR (MX51_CCM_BASE + 0x10)
82#define MXC_CCM_CBCDR (MX51_CCM_BASE + 0x14)
83#define MXC_CCM_CBCMR (MX51_CCM_BASE + 0x18)
84#define MXC_CCM_CSCMR1 (MX51_CCM_BASE + 0x1C)
85#define MXC_CCM_CSCMR2 (MX51_CCM_BASE + 0x20)
86#define MXC_CCM_CSCDR1 (MX51_CCM_BASE + 0x24)
87#define MXC_CCM_CS1CDR (MX51_CCM_BASE + 0x28)
88#define MXC_CCM_CS2CDR (MX51_CCM_BASE + 0x2C)
89#define MXC_CCM_CDCDR (MX51_CCM_BASE + 0x30)
90#define MXC_CCM_CHSCDR (MX51_CCM_BASE + 0x34)
91#define MXC_CCM_CSCDR2 (MX51_CCM_BASE + 0x38)
92#define MXC_CCM_CSCDR3 (MX51_CCM_BASE + 0x3C)
93#define MXC_CCM_CSCDR4 (MX51_CCM_BASE + 0x40)
94#define MXC_CCM_CWDR (MX51_CCM_BASE + 0x44)
95#define MXC_CCM_CDHIPR (MX51_CCM_BASE + 0x48)
96#define MXC_CCM_CDCR (MX51_CCM_BASE + 0x4C)
97#define MXC_CCM_CTOR (MX51_CCM_BASE + 0x50)
98#define MXC_CCM_CLPCR (MX51_CCM_BASE + 0x54)
99#define MXC_CCM_CISR (MX51_CCM_BASE + 0x58)
100#define MXC_CCM_CIMR (MX51_CCM_BASE + 0x5C)
101#define MXC_CCM_CCOSR (MX51_CCM_BASE + 0x60)
102#define MXC_CCM_CGPR (MX51_CCM_BASE + 0x64)
103#define MXC_CCM_CCGR0 (MX51_CCM_BASE + 0x68)
104#define MXC_CCM_CCGR1 (MX51_CCM_BASE + 0x6C)
105#define MXC_CCM_CCGR2 (MX51_CCM_BASE + 0x70)
106#define MXC_CCM_CCGR3 (MX51_CCM_BASE + 0x74)
107#define MXC_CCM_CCGR4 (MX51_CCM_BASE + 0x78)
108#define MXC_CCM_CCGR5 (MX51_CCM_BASE + 0x7C)
109#define MXC_CCM_CCGR6 (MX51_CCM_BASE + 0x80)
110#define MXC_CCM_CMEOR (MX51_CCM_BASE + 0x84)
111
112/* Define the bits in register CCR */
113#define MXC_CCM_CCR_COSC_EN (1 << 12)
114#define MXC_CCM_CCR_FPM_MULT_MASK (1 << 11)
115#define MXC_CCM_CCR_CAMP2_EN (1 << 10)
116#define MXC_CCM_CCR_CAMP1_EN (1 << 9)
117#define MXC_CCM_CCR_FPM_EN (1 << 8)
118#define MXC_CCM_CCR_OSCNT_OFFSET (0)
119#define MXC_CCM_CCR_OSCNT_MASK (0xFF)
120
121/* Define the bits in register CCDR */
122#define MXC_CCM_CCDR_HSC_HS_MASK (0x1 << 18)
123#define MXC_CCM_CCDR_IPU_HS_MASK (0x1 << 17)
124#define MXC_CCM_CCDR_EMI_HS_MASK (0x1 << 16)
125
126/* Define the bits in register CSR */
127#define MXC_CCM_CSR_COSR_READY (1 << 5)
128#define MXC_CCM_CSR_LVS_VALUE (1 << 4)
129#define MXC_CCM_CSR_CAMP2_READY (1 << 3)
130#define MXC_CCM_CSR_CAMP1_READY (1 << 2)
131#define MXC_CCM_CSR_FPM_READY (1 << 1)
132#define MXC_CCM_CSR_REF_EN_B (1 << 0)
133
134/* Define the bits in register CCSR */
135#define MXC_CCM_CCSR_LP_APM_SEL (0x1 << 9)
136#define MXC_CCM_CCSR_STEP_SEL_OFFSET (7)
137#define MXC_CCM_CCSR_STEP_SEL_MASK (0x3 << 7)
138#define MXC_CCM_CCSR_STEP_SEL_LP_APM 0
139#define MXC_CCM_CCSR_STEP_SEL_PLL1_BYPASS 1 /* Only when JTAG connected? */
140#define MXC_CCM_CCSR_STEP_SEL_PLL2_DIVIDED 2
141#define MXC_CCM_CCSR_STEP_SEL_PLL3_DIVIDED 3
142#define MXC_CCM_CCSR_PLL2_PODF_OFFSET (5)
143#define MXC_CCM_CCSR_PLL2_PODF_MASK (0x3 << 5)
144#define MXC_CCM_CCSR_PLL3_PODF_OFFSET (3)
145#define MXC_CCM_CCSR_PLL3_PODF_MASK (0x3 << 3)
146#define MXC_CCM_CCSR_PLL1_SW_CLK_SEL (1 << 2) /* 0: pll1_main_clk,
147 1: step_clk */
148#define MXC_CCM_CCSR_PLL2_SW_CLK_SEL (1 << 1)
149#define MXC_CCM_CCSR_PLL3_SW_CLK_SEL (1 << 0)
150
151/* Define the bits in register CACRR */
152#define MXC_CCM_CACRR_ARM_PODF_OFFSET (0)
153#define MXC_CCM_CACRR_ARM_PODF_MASK (0x7)
154
155/* Define the bits in register CBCDR */
156#define MXC_CCM_CBCDR_EMI_CLK_SEL (0x1 << 26)
157#define MXC_CCM_CBCDR_PERIPH_CLK_SEL (0x1 << 25)
158#define MXC_CCM_CBCDR_DDR_HF_SEL_OFFSET (30)
159#define MXC_CCM_CBCDR_DDR_HF_SEL (0x1 << 30)
160#define MXC_CCM_CBCDR_DDR_PODF_OFFSET (27)
161#define MXC_CCM_CBCDR_DDR_PODF_MASK (0x7 << 27)
162#define MXC_CCM_CBCDR_EMI_PODF_OFFSET (22)
163#define MXC_CCM_CBCDR_EMI_PODF_MASK (0x7 << 22)
164#define MXC_CCM_CBCDR_AXI_B_PODF_OFFSET (19)
165#define MXC_CCM_CBCDR_AXI_B_PODF_MASK (0x7 << 19)
166#define MXC_CCM_CBCDR_AXI_A_PODF_OFFSET (16)
167#define MXC_CCM_CBCDR_AXI_A_PODF_MASK (0x7 << 16)
168#define MXC_CCM_CBCDR_NFC_PODF_OFFSET (13)
169#define MXC_CCM_CBCDR_NFC_PODF_MASK (0x7 << 13)
170#define MXC_CCM_CBCDR_AHB_PODF_OFFSET (10)
171#define MXC_CCM_CBCDR_AHB_PODF_MASK (0x7 << 10)
172#define MXC_CCM_CBCDR_IPG_PODF_OFFSET (8)
173#define MXC_CCM_CBCDR_IPG_PODF_MASK (0x3 << 8)
174#define MXC_CCM_CBCDR_PERCLK_PRED1_OFFSET (6)
175#define MXC_CCM_CBCDR_PERCLK_PRED1_MASK (0x3 << 6)
176#define MXC_CCM_CBCDR_PERCLK_PRED2_OFFSET (3)
177#define MXC_CCM_CBCDR_PERCLK_PRED2_MASK (0x7 << 3)
178#define MXC_CCM_CBCDR_PERCLK_PODF_OFFSET (0)
179#define MXC_CCM_CBCDR_PERCLK_PODF_MASK (0x7)
180
181/* Define the bits in register CBCMR */
182#define MXC_CCM_CBCMR_VPU_AXI_CLK_SEL_OFFSET (14)
183#define MXC_CCM_CBCMR_VPU_AXI_CLK_SEL_MASK (0x3 << 14)
184#define MXC_CCM_CBCMR_PERIPH_CLK_SEL_OFFSET (12)
185#define MXC_CCM_CBCMR_PERIPH_CLK_SEL_MASK (0x3 << 12)
186#define MXC_CCM_CBCMR_DDR_CLK_SEL_OFFSET (10)
187#define MXC_CCM_CBCMR_DDR_CLK_SEL_MASK (0x3 << 10)
188#define MXC_CCM_CBCMR_ARM_AXI_CLK_SEL_OFFSET (8)
189#define MXC_CCM_CBCMR_ARM_AXI_CLK_SEL_MASK (0x3 << 8)
190#define MXC_CCM_CBCMR_IPU_HSP_CLK_SEL_OFFSET (6)
191#define MXC_CCM_CBCMR_IPU_HSP_CLK_SEL_MASK (0x3 << 6)
192#define MXC_CCM_CBCMR_GPU_CLK_SEL_OFFSET (4)
193#define MXC_CCM_CBCMR_GPU_CLK_SEL_MASK (0x3 << 4)
194#define MXC_CCM_CBCMR_GPU2D_CLK_SEL_OFFSET (14)
195#define MXC_CCM_CBCMR_GPU2D_CLK_SEL_MASK (0x3 << 14)
196#define MXC_CCM_CBCMR_PERCLK_LP_APM_CLK_SEL (0x1 << 1)
197#define MXC_CCM_CBCMR_PERCLK_IPG_CLK_SEL (0x1 << 0)
198
199/* Define the bits in register CSCMR1 */
200#define MXC_CCM_CSCMR1_SSI_EXT2_CLK_SEL_OFFSET (30)
201#define MXC_CCM_CSCMR1_SSI_EXT2_CLK_SEL_MASK (0x3 << 30)
202#define MXC_CCM_CSCMR1_SSI_EXT1_CLK_SEL_OFFSET (28)
203#define MXC_CCM_CSCMR1_SSI_EXT1_CLK_SEL_MASK (0x3 << 28)
204#define MXC_CCM_CSCMR1_USB_PHY_CLK_SEL_OFFSET (26)
205#define MXC_CCM_CSCMR1_USB_PHY_CLK_SEL (0x1 << 26)
206#define MXC_CCM_CSCMR1_UART_CLK_SEL_OFFSET (24)
207#define MXC_CCM_CSCMR1_UART_CLK_SEL_MASK (0x3 << 24)
208#define MXC_CCM_CSCMR1_USBOH3_CLK_SEL_OFFSET (22)
209#define MXC_CCM_CSCMR1_USBOH3_CLK_SEL_MASK (0x3 << 22)
210#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_OFFSET (20)
211#define MXC_CCM_CSCMR1_ESDHC1_MSHC1_CLK_SEL_MASK (0x3 << 20)
212#define MXC_CCM_CSCMR1_ESDHC3_CLK_SEL (0x1 << 19)
213#define MXC_CCM_CSCMR1_ESDHC4_CLK_SEL (0x1 << 18)
214#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_OFFSET (16)
215#define MXC_CCM_CSCMR1_ESDHC2_MSHC2_CLK_SEL_MASK (0x3 << 16)
216#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_OFFSET (14)
217#define MXC_CCM_CSCMR1_SSI1_CLK_SEL_MASK (0x3 << 14)
218#define MXC_CCM_CSCMR1_SSI2_CLK_SEL_OFFSET (12)
219#define MXC_CCM_CSCMR1_SSI2_CLK_SEL_MASK (0x3 << 12)
220#define MXC_CCM_CSCMR1_SSI3_CLK_SEL (0x1 << 11)
221#define MXC_CCM_CSCMR1_VPU_RCLK_SEL (0x1 << 10)
222#define MXC_CCM_CSCMR1_SSI_APM_CLK_SEL_OFFSET (8)
223#define MXC_CCM_CSCMR1_SSI_APM_CLK_SEL_MASK (0x3 << 8)
224#define MXC_CCM_CSCMR1_TVE_CLK_SEL (0x1 << 7)
225#define MXC_CCM_CSCMR1_TVE_EXT_CLK_SEL (0x1 << 6)
226#define MXC_CCM_CSCMR1_CSPI_CLK_SEL_OFFSET (4)
227#define MXC_CCM_CSCMR1_CSPI_CLK_SEL_MASK (0x3 << 4)
228#define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_OFFSET (2)
229#define MXC_CCM_CSCMR1_SPDIF_CLK_SEL_MASK (0x3 << 2)
230#define MXC_CCM_CSCMR1_SSI_EXT2_COM_CLK_SEL (0x1 << 1)
231#define MXC_CCM_CSCMR1_SSI_EXT1_COM_CLK_SEL (0x1)
232
233/* Define the bits in register CSCMR2 */
234#define MXC_CCM_CSCMR2_DI_CLK_SEL_OFFSET(n) (26+n*3)
235#define MXC_CCM_CSCMR2_DI_CLK_SEL_MASK(n) (0x7 << (26+n*3))
236#define MXC_CCM_CSCMR2_CSI_MCLK2_CLK_SEL_OFFSET (24)
237#define MXC_CCM_CSCMR2_CSI_MCLK2_CLK_SEL_MASK (0x3 << 24)
238#define MXC_CCM_CSCMR2_CSI_MCLK1_CLK_SEL_OFFSET (22)
239#define MXC_CCM_CSCMR2_CSI_MCLK1_CLK_SEL_MASK (0x3 << 22)
240#define MXC_CCM_CSCMR2_ESC_CLK_SEL_OFFSET (20)
241#define MXC_CCM_CSCMR2_ESC_CLK_SEL_MASK (0x3 << 20)
242#define MXC_CCM_CSCMR2_HSC2_CLK_SEL_OFFSET (18)
243#define MXC_CCM_CSCMR2_HSC2_CLK_SEL_MASK (0x3 << 18)
244#define MXC_CCM_CSCMR2_HSC1_CLK_SEL_OFFSET (16)
245#define MXC_CCM_CSCMR2_HSC1_CLK_SEL_MASK (0x3 << 16)
246#define MXC_CCM_CSCMR2_HSI2C_CLK_SEL_OFFSET (14)
247#define MXC_CCM_CSCMR2_HSI2C_CLK_SEL_MASK (0x3 << 14)
248#define MXC_CCM_CSCMR2_FIRI_CLK_SEL_OFFSET (12)
249#define MXC_CCM_CSCMR2_FIRI_CLK_SEL_MASK (0x3 << 12)
250#define MXC_CCM_CSCMR2_SIM_CLK_SEL_OFFSET (10)
251#define MXC_CCM_CSCMR2_SIM_CLK_SEL_MASK (0x3 << 10)
252#define MXC_CCM_CSCMR2_SLIMBUS_COM (0x1 << 9)
253#define MXC_CCM_CSCMR2_SLIMBUS_CLK_SEL_OFFSET (6)
254#define MXC_CCM_CSCMR2_SLIMBUS_CLK_SEL_MASK (0x7 << 6)
255#define MXC_CCM_CSCMR2_SPDIF1_COM (1 << 5)
256#define MXC_CCM_CSCMR2_SPDIF0_COM (1 << 4)
257#define MXC_CCM_CSCMR2_SPDIF1_CLK_SEL_OFFSET (2)
258#define MXC_CCM_CSCMR2_SPDIF1_CLK_SEL_MASK (0x3 << 2)
259#define MXC_CCM_CSCMR2_SPDIF0_CLK_SEL_OFFSET (0)
260#define MXC_CCM_CSCMR2_SPDIF0_CLK_SEL_MASK (0x3)
261
262/* Define the bits in register CSCDR1 */
263#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_OFFSET (22)
264#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PRED_MASK (0x7 << 22)
265#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_OFFSET (19)
266#define MXC_CCM_CSCDR1_ESDHC2_MSHC2_CLK_PODF_MASK (0x7 << 19)
267#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_OFFSET (16)
268#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PRED_MASK (0x7 << 16)
269#define MXC_CCM_CSCDR1_PGC_CLK_PODF_OFFSET (14)
270#define MXC_CCM_CSCDR1_PGC_CLK_PODF_MASK (0x3 << 14)
271#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PODF_OFFSET (11)
272#define MXC_CCM_CSCDR1_ESDHC1_MSHC1_CLK_PODF_MASK (0x7 << 11)
273#define MXC_CCM_CSCDR1_USBOH3_CLK_PRED_OFFSET (8)
274#define MXC_CCM_CSCDR1_USBOH3_CLK_PRED_MASK (0x7 << 8)
275#define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_OFFSET (6)
276#define MXC_CCM_CSCDR1_USBOH3_CLK_PODF_MASK (0x3 << 6)
277#define MXC_CCM_CSCDR1_UART_CLK_PRED_OFFSET (3)
278#define MXC_CCM_CSCDR1_UART_CLK_PRED_MASK (0x7 << 3)
279#define MXC_CCM_CSCDR1_UART_CLK_PODF_OFFSET (0)
280#define MXC_CCM_CSCDR1_UART_CLK_PODF_MASK (0x7)
281
282/* Define the bits in register CS1CDR and CS2CDR */
283#define MXC_CCM_CS1CDR_SSI_EXT1_CLK_PRED_OFFSET (22)
284#define MXC_CCM_CS1CDR_SSI_EXT1_CLK_PRED_MASK (0x7 << 22)
285#define MXC_CCM_CS1CDR_SSI_EXT1_CLK_PODF_OFFSET (16)
286#define MXC_CCM_CS1CDR_SSI_EXT1_CLK_PODF_MASK (0x3F << 16)
287#define MXC_CCM_CS1CDR_SSI1_CLK_PRED_OFFSET (6)
288#define MXC_CCM_CS1CDR_SSI1_CLK_PRED_MASK (0x7 << 6)
289#define MXC_CCM_CS1CDR_SSI1_CLK_PODF_OFFSET (0)
290#define MXC_CCM_CS1CDR_SSI1_CLK_PODF_MASK (0x3F)
291
292#define MXC_CCM_CS2CDR_SSI_EXT2_CLK_PRED_OFFSET (22)
293#define MXC_CCM_CS2CDR_SSI_EXT2_CLK_PRED_MASK (0x7 << 22)
294#define MXC_CCM_CS2CDR_SSI_EXT2_CLK_PODF_OFFSET (16)
295#define MXC_CCM_CS2CDR_SSI_EXT2_CLK_PODF_MASK (0x3F << 16)
296#define MXC_CCM_CS2CDR_SSI2_CLK_PRED_OFFSET (6)
297#define MXC_CCM_CS2CDR_SSI2_CLK_PRED_MASK (0x7 << 6)
298#define MXC_CCM_CS2CDR_SSI2_CLK_PODF_OFFSET (0)
299#define MXC_CCM_CS2CDR_SSI2_CLK_PODF_MASK (0x3F)
300
301/* Define the bits in register CDCDR */
302#define MXC_CCM_CDCDR_TVE_CLK_PRED_OFFSET (28)
303#define MXC_CCM_CDCDR_TVE_CLK_PRED_MASK (0x7 << 28)
304#define MXC_CCM_CDCDR_SPDIF0_CLK_PRED_OFFSET (25)
305#define MXC_CCM_CDCDR_SPDIF0_CLK_PRED_MASK (0x7 << 25)
306#define MXC_CCM_CDCDR_SPDIF0_CLK_PODF_OFFSET (19)
307#define MXC_CCM_CDCDR_SPDIF0_CLK_PODF_MASK (0x3F << 19)
308#define MXC_CCM_CDCDR_SPDIF1_CLK_PRED_OFFSET (16)
309#define MXC_CCM_CDCDR_SPDIF1_CLK_PRED_MASK (0x7 << 16)
310#define MXC_CCM_CDCDR_SPDIF1_CLK_PODF_OFFSET (9)
311#define MXC_CCM_CDCDR_SPDIF1_CLK_PODF_MASK (0x3F << 9)
312#define MXC_CCM_CDCDR_DI_CLK_PRED_OFFSET (6)
313#define MXC_CCM_CDCDR_DI_CLK_PRED_MASK (0x7 << 6)
314#define MXC_CCM_CDCDR_USB_PHY_PRED_OFFSET (3)
315#define MXC_CCM_CDCDR_USB_PHY_PRED_MASK (0x7 << 3)
316#define MXC_CCM_CDCDR_USB_PHY_PODF_OFFSET (0)
317#define MXC_CCM_CDCDR_USB_PHY_PODF_MASK (0x7)
318
319/* Define the bits in register CHSCCDR */
320#define MXC_CCM_CHSCCDR_ESC_CLK_PRED_OFFSET (12)
321#define MXC_CCM_CHSCCDR_ESC_CLK_PRED_MASK (0x7 << 12)
322#define MXC_CCM_CHSCCDR_ESC_CLK_PODF_OFFSET (6)
323#define MXC_CCM_CHSCCDR_ESC_CLK_PODF_MASK (0x3F << 6)
324#define MXC_CCM_CHSCCDR_HSC2_CLK_PODF_OFFSET (3)
325#define MXC_CCM_CHSCCDR_HSC2_CLK_PODF_MASK (0x7 << 3)
326#define MXC_CCM_CHSCCDR_HSC1_CLK_PODF_OFFSET (0)
327#define MXC_CCM_CHSCCDR_HSC1_CLK_PODF_MASK (0x7)
328
329/* Define the bits in register CSCDR2 */
330#define MXC_CCM_CSCDR2_CSPI_CLK_PRED_OFFSET (25)
331#define MXC_CCM_CSCDR2_CSPI_CLK_PRED_MASK (0x7 << 25)
332#define MXC_CCM_CSCDR2_CSPI_CLK_PODF_OFFSET (19)
333#define MXC_CCM_CSCDR2_CSPI_CLK_PODF_MASK (0x3F << 19)
334#define MXC_CCM_CSCDR2_SIM_CLK_PRED_OFFSET (16)
335#define MXC_CCM_CSCDR2_SIM_CLK_PRED_MASK (0x7 << 16)
336#define MXC_CCM_CSCDR2_SIM_CLK_PODF_OFFSET (9)
337#define MXC_CCM_CSCDR2_SIM_CLK_PODF_MASK (0x3F << 9)
338#define MXC_CCM_CSCDR2_SLIMBUS_CLK_PRED_OFFSET (6)
339#define MXC_CCM_CSCDR2_SLIMBUS_PRED_MASK (0x7 << 6)
340#define MXC_CCM_CSCDR2_SLIMBUS_PODF_OFFSET (0)
341#define MXC_CCM_CSCDR2_SLIMBUS_PODF_MASK (0x3F)
342
343/* Define the bits in register CSCDR3 */
344#define MXC_CCM_CSCDR3_HSI2C_CLK_PRED_OFFSET (16)
345#define MXC_CCM_CSCDR3_HSI2C_CLK_PRED_MASK (0x7 << 16)
346#define MXC_CCM_CSCDR3_HSI2C_CLK_PODF_OFFSET (9)
347#define MXC_CCM_CSCDR3_HSI2C_CLK_PODF_MASK (0x3F << 9)
348#define MXC_CCM_CSCDR3_FIRI_CLK_PRED_OFFSET (6)
349#define MXC_CCM_CSCDR3_FIRI_CLK_PRED_MASK (0x7 << 6)
350#define MXC_CCM_CSCDR3_FIRI_CLK_PODF_OFFSET (0)
351#define MXC_CCM_CSCDR3_FIRI_CLK_PODF_MASK (0x3F)
352
353/* Define the bits in register CSCDR4 */
354#define MXC_CCM_CSCDR4_CSI_MCLK2_CLK_PRED_OFFSET (16)
355#define MXC_CCM_CSCDR4_CSI_MCLK2_CLK_PRED_MASK (0x7 << 16)
356#define MXC_CCM_CSCDR4_CSI_MCLK2_CLK_PODF_OFFSET (9)
357#define MXC_CCM_CSCDR4_CSI_MCLK2_CLK_PODF_MASK (0x3F << 9)
358#define MXC_CCM_CSCDR4_CSI_MCLK1_CLK_PRED_OFFSET (6)
359#define MXC_CCM_CSCDR4_CSI_MCLK1_CLK_PRED_MASK (0x7 << 6)
360#define MXC_CCM_CSCDR4_CSI_MCLK1_CLK_PODF_OFFSET (0)
361#define MXC_CCM_CSCDR4_CSI_MCLK1_CLK_PODF_MASK (0x3F)
362
363/* Define the bits in register CDHIPR */
364#define MXC_CCM_CDHIPR_ARM_PODF_BUSY (1 << 16)
365#define MXC_CCM_CDHIPR_DDR_HF_CLK_SEL_BUSY (1 << 8)
366#define MXC_CCM_CDHIPR_DDR_PODF_BUSY (1 << 7)
367#define MXC_CCM_CDHIPR_EMI_CLK_SEL_BUSY (1 << 6)
368#define MXC_CCM_CDHIPR_PERIPH_CLK_SEL_BUSY (1 << 5)
369#define MXC_CCM_CDHIPR_NFC_IPG_INT_MEM_PODF_BUSY (1 << 4)
370#define MXC_CCM_CDHIPR_AHB_PODF_BUSY (1 << 3)
371#define MXC_CCM_CDHIPR_EMI_PODF_BUSY (1 << 2)
372#define MXC_CCM_CDHIPR_AXI_B_PODF_BUSY (1 << 1)
373#define MXC_CCM_CDHIPR_AXI_A_PODF_BUSY (1 << 0)
374
375/* Define the bits in register CDCR */
376#define MXC_CCM_CDCR_ARM_FREQ_SHIFT_DIVIDER (0x1 << 2)
377#define MXC_CCM_CDCR_PERIPH_CLK_DVFS_PODF_OFFSET (0)
378#define MXC_CCM_CDCR_PERIPH_CLK_DVFS_PODF_MASK (0x3)
379
380/* Define the bits in register CLPCR */
381#define MXC_CCM_CLPCR_BYPASS_HSC_LPM_HS (0x1 << 23)
382#define MXC_CCM_CLPCR_BYPASS_SCC_LPM_HS (0x1 << 22)
383#define MXC_CCM_CLPCR_BYPASS_MAX_LPM_HS (0x1 << 21)
384#define MXC_CCM_CLPCR_BYPASS_SDMA_LPM_HS (0x1 << 20)
385#define MXC_CCM_CLPCR_BYPASS_EMI_LPM_HS (0x1 << 19)
386#define MXC_CCM_CLPCR_BYPASS_IPU_LPM_HS (0x1 << 18)
387#define MXC_CCM_CLPCR_BYPASS_RTIC_LPM_HS (0x1 << 17)
388#define MXC_CCM_CLPCR_BYPASS_RNGC_LPM_HS (0x1 << 16)
389#define MXC_CCM_CLPCR_COSC_PWRDOWN (0x1 << 11)
390#define MXC_CCM_CLPCR_STBY_COUNT_OFFSET (9)
391#define MXC_CCM_CLPCR_STBY_COUNT_MASK (0x3 << 9)
392#define MXC_CCM_CLPCR_VSTBY (0x1 << 8)
393#define MXC_CCM_CLPCR_DIS_REF_OSC (0x1 << 7)
394#define MXC_CCM_CLPCR_SBYOS (0x1 << 6)
395#define MXC_CCM_CLPCR_ARM_CLK_DIS_ON_LPM (0x1 << 5)
396#define MXC_CCM_CLPCR_LPSR_CLK_SEL_OFFSET (3)
397#define MXC_CCM_CLPCR_LPSR_CLK_SEL_MASK (0x3 << 3)
398#define MXC_CCM_CLPCR_LPM_OFFSET (0)
399#define MXC_CCM_CLPCR_LPM_MASK (0x3)
400
401/* Define the bits in register CISR */
402#define MXC_CCM_CISR_ARM_PODF_LOADED (0x1 << 25)
403#define MXC_CCM_CISR_NFC_IPG_INT_MEM_PODF_LOADED (0x1 << 21)
404#define MXC_CCM_CISR_AHB_PODF_LOADED (0x1 << 20)
405#define MXC_CCM_CISR_EMI_PODF_LOADED (0x1 << 19)
406#define MXC_CCM_CISR_AXI_B_PODF_LOADED (0x1 << 18)
407#define MXC_CCM_CISR_AXI_A_PODF_LOADED (0x1 << 17)
408#define MXC_CCM_CISR_DIVIDER_LOADED (0x1 << 16)
409#define MXC_CCM_CISR_COSC_READY (0x1 << 6)
410#define MXC_CCM_CISR_CKIH2_READY (0x1 << 5)
411#define MXC_CCM_CISR_CKIH_READY (0x1 << 4)
412#define MXC_CCM_CISR_FPM_READY (0x1 << 3)
413#define MXC_CCM_CISR_LRF_PLL3 (0x1 << 2)
414#define MXC_CCM_CISR_LRF_PLL2 (0x1 << 1)
415#define MXC_CCM_CISR_LRF_PLL1 (0x1)
416
417/* Define the bits in register CIMR */
418#define MXC_CCM_CIMR_MASK_ARM_PODF_LOADED (0x1 << 25)
419#define MXC_CCM_CIMR_MASK_NFC_IPG_INT_MEM_PODF_LOADED (0x1 << 21)
420#define MXC_CCM_CIMR_MASK_EMI_PODF_LOADED (0x1 << 20)
421#define MXC_CCM_CIMR_MASK_AXI_C_PODF_LOADED (0x1 << 19)
422#define MXC_CCM_CIMR_MASK_AXI_B_PODF_LOADED (0x1 << 18)
423#define MXC_CCM_CIMR_MASK_AXI_A_PODF_LOADED (0x1 << 17)
424#define MXC_CCM_CIMR_MASK_DIVIDER_LOADED (0x1 << 16)
425#define MXC_CCM_CIMR_MASK_COSC_READY (0x1 << 5)
426#define MXC_CCM_CIMR_MASK_CKIH_READY (0x1 << 4)
427#define MXC_CCM_CIMR_MASK_FPM_READY (0x1 << 3)
428#define MXC_CCM_CIMR_MASK_LRF_PLL3 (0x1 << 2)
429#define MXC_CCM_CIMR_MASK_LRF_PLL2 (0x1 << 1)
430#define MXC_CCM_CIMR_MASK_LRF_PLL1 (0x1)
431
432/* Define the bits in register CCOSR */
433#define MXC_CCM_CCOSR_CKO2_EN_OFFSET (0x1 << 24)
434#define MXC_CCM_CCOSR_CKO2_DIV_OFFSET (21)
435#define MXC_CCM_CCOSR_CKO2_DIV_MASK (0x7 << 21)
436#define MXC_CCM_CCOSR_CKO2_SEL_OFFSET (16)
437#define MXC_CCM_CCOSR_CKO2_SEL_MASK (0x1F << 16)
438#define MXC_CCM_CCOSR_CKOL_EN (0x1 << 7)
439#define MXC_CCM_CCOSR_CKOL_DIV_OFFSET (4)
440#define MXC_CCM_CCOSR_CKOL_DIV_MASK (0x7 << 4)
441#define MXC_CCM_CCOSR_CKOL_SEL_OFFSET (0)
442#define MXC_CCM_CCOSR_CKOL_SEL_MASK (0xF)
443
444/* Define the bits in registers CGPR */
445#define MXC_CCM_CGPR_EFUSE_PROG_SUPPLY_GATE (0x1 << 4)
446#define MXC_CCM_CGPR_FPM_SEL (0x1 << 3)
447#define MXC_CCM_CGPR_VL_L2BIST_CLKDIV_OFFSET (0)
448#define MXC_CCM_CGPR_VL_L2BIST_CLKDIV_MASK (0x7)
449
450/* Define the bits in registers CCGRx */
451#define MXC_CCM_CCGRx_CG_MASK 0x3
452#define MXC_CCM_CCGRx_MOD_OFF 0x0
453#define MXC_CCM_CCGRx_MOD_ON 0x3
454#define MXC_CCM_CCGRx_MOD_IDLE 0x1
455
456#define MXC_CCM_CCGRx_CG15_MASK (0x3 << 30)
457#define MXC_CCM_CCGRx_CG14_MASK (0x3 << 28)
458#define MXC_CCM_CCGRx_CG13_MASK (0x3 << 26)
459#define MXC_CCM_CCGRx_CG12_MASK (0x3 << 24)
460#define MXC_CCM_CCGRx_CG11_MASK (0x3 << 22)
461#define MXC_CCM_CCGRx_CG10_MASK (0x3 << 20)
462#define MXC_CCM_CCGRx_CG9_MASK (0x3 << 18)
463#define MXC_CCM_CCGRx_CG8_MASK (0x3 << 16)
464#define MXC_CCM_CCGRx_CG5_MASK (0x3 << 10)
465#define MXC_CCM_CCGRx_CG4_MASK (0x3 << 8)
466#define MXC_CCM_CCGRx_CG3_MASK (0x3 << 6)
467#define MXC_CCM_CCGRx_CG2_MASK (0x3 << 4)
468#define MXC_CCM_CCGRx_CG1_MASK (0x3 << 2)
469#define MXC_CCM_CCGRx_CG0_MASK (0x3 << 0)
470
471#define MXC_CCM_CCGRx_CG15_OFFSET 30
472#define MXC_CCM_CCGRx_CG14_OFFSET 28
473#define MXC_CCM_CCGRx_CG13_OFFSET 26
474#define MXC_CCM_CCGRx_CG12_OFFSET 24
475#define MXC_CCM_CCGRx_CG11_OFFSET 22
476#define MXC_CCM_CCGRx_CG10_OFFSET 20
477#define MXC_CCM_CCGRx_CG9_OFFSET 18
478#define MXC_CCM_CCGRx_CG8_OFFSET 16
479#define MXC_CCM_CCGRx_CG7_OFFSET 14
480#define MXC_CCM_CCGRx_CG6_OFFSET 12
481#define MXC_CCM_CCGRx_CG5_OFFSET 10
482#define MXC_CCM_CCGRx_CG4_OFFSET 8
483#define MXC_CCM_CCGRx_CG3_OFFSET 6
484#define MXC_CCM_CCGRx_CG2_OFFSET 4
485#define MXC_CCM_CCGRx_CG1_OFFSET 2
486#define MXC_CCM_CCGRx_CG0_OFFSET 0
487
488#define MXC_DPTC_LP_BASE (MX51_GPC_BASE + 0x80)
489#define MXC_DPTC_GP_BASE (MX51_GPC_BASE + 0x100)
490#define MXC_DVFS_CORE_BASE (MX51_GPC_BASE + 0x180)
491#define MXC_DPTC_PER_BASE (MX51_GPC_BASE + 0x1C0)
492#define MXC_PGC_IPU_BASE (MX51_GPC_BASE + 0x220)
493#define MXC_PGC_VPU_BASE (MX51_GPC_BASE + 0x240)
494#define MXC_PGC_GPU_BASE (MX51_GPC_BASE + 0x260)
495#define MXC_SRPG_NEON_BASE (MX51_GPC_BASE + 0x280)
496#define MXC_SRPG_ARM_BASE (MX51_GPC_BASE + 0x2A0)
497#define MXC_SRPG_EMPGC0_BASE (MX51_GPC_BASE + 0x2C0)
498#define MXC_SRPG_EMPGC1_BASE (MX51_GPC_BASE + 0x2D0)
499#define MXC_SRPG_MEGAMIX_BASE (MX51_GPC_BASE + 0x2E0)
500#define MXC_SRPG_EMI_BASE (MX51_GPC_BASE + 0x300)
501
502/* CORTEXA8 platform */
503#define MXC_CORTEXA8_PLAT_PVID (MX51_CORTEXA8_BASE + 0x0)
504#define MXC_CORTEXA8_PLAT_GPC (MX51_CORTEXA8_BASE + 0x4)
505#define MXC_CORTEXA8_PLAT_PIC (MX51_CORTEXA8_BASE + 0x8)
506#define MXC_CORTEXA8_PLAT_LPC (MX51_CORTEXA8_BASE + 0xC)
507#define MXC_CORTEXA8_PLAT_NEON_LPC (MX51_CORTEXA8_BASE + 0x10)
508#define MXC_CORTEXA8_PLAT_ICGC (MX51_CORTEXA8_BASE + 0x14)
509#define MXC_CORTEXA8_PLAT_AMC (MX51_CORTEXA8_BASE + 0x18)
510#define MXC_CORTEXA8_PLAT_NMC (MX51_CORTEXA8_BASE + 0x20)
511#define MXC_CORTEXA8_PLAT_NMS (MX51_CORTEXA8_BASE + 0x24)
512
513/* DVFS CORE */
514#define MXC_DVFSTHRS (MXC_DVFS_CORE_BASE + 0x00)
515#define MXC_DVFSCOUN (MXC_DVFS_CORE_BASE + 0x04)
516#define MXC_DVFSSIG1 (MXC_DVFS_CORE_BASE + 0x08)
517#define MXC_DVFSSIG0 (MXC_DVFS_CORE_BASE + 0x0C)
518#define MXC_DVFSGPC0 (MXC_DVFS_CORE_BASE + 0x10)
519#define MXC_DVFSGPC1 (MXC_DVFS_CORE_BASE + 0x14)
520#define MXC_DVFSGPBT (MXC_DVFS_CORE_BASE + 0x18)
521#define MXC_DVFSEMAC (MXC_DVFS_CORE_BASE + 0x1C)
522#define MXC_DVFSCNTR (MXC_DVFS_CORE_BASE + 0x20)
523#define MXC_DVFSLTR0_0 (MXC_DVFS_CORE_BASE + 0x24)
524#define MXC_DVFSLTR0_1 (MXC_DVFS_CORE_BASE + 0x28)
525#define MXC_DVFSLTR1_0 (MXC_DVFS_CORE_BASE + 0x2C)
526#define MXC_DVFSLTR1_1 (MXC_DVFS_CORE_BASE + 0x30)
527#define MXC_DVFSPT0 (MXC_DVFS_CORE_BASE + 0x34)
528#define MXC_DVFSPT1 (MXC_DVFS_CORE_BASE + 0x38)
529#define MXC_DVFSPT2 (MXC_DVFS_CORE_BASE + 0x3C)
530#define MXC_DVFSPT3 (MXC_DVFS_CORE_BASE + 0x40)
531
532/* GPC */
533#define MXC_GPC_CNTR (MX51_GPC_BASE + 0x0)
534#define MXC_GPC_PGR (MX51_GPC_BASE + 0x4)
535#define MXC_GPC_VCR (MX51_GPC_BASE + 0x8)
536#define MXC_GPC_ALL_PU (MX51_GPC_BASE + 0xC)
537#define MXC_GPC_NEON (MX51_GPC_BASE + 0x10)
538#define MXC_GPC_PGR_ARMPG_OFFSET 8
539#define MXC_GPC_PGR_ARMPG_MASK (3 << 8)
540
541/* PGC */
542#define MXC_PGC_IPU_PGCR (MXC_PGC_IPU_BASE + 0x0)
543#define MXC_PGC_IPU_PGSR (MXC_PGC_IPU_BASE + 0xC)
544#define MXC_PGC_VPU_PGCR (MXC_PGC_VPU_BASE + 0x0)
545#define MXC_PGC_VPU_PGSR (MXC_PGC_VPU_BASE + 0xC)
546#define MXC_PGC_GPU_PGCR (MXC_PGC_GPU_BASE + 0x0)
547#define MXC_PGC_GPU_PGSR (MXC_PGC_GPU_BASE + 0xC)
548
549#define MXC_PGCR_PCR 1
550#define MXC_SRPGCR_PCR 1
551#define MXC_EMPGCR_PCR 1
552#define MXC_PGSR_PSR 1
553
554
555#define MXC_CORTEXA8_PLAT_LPC_DSM (1 << 0)
556#define MXC_CORTEXA8_PLAT_LPC_DBG_DSM (1 << 1)
557
558/* SRPG */
559#define MXC_SRPG_NEON_SRPGCR (MXC_SRPG_NEON_BASE + 0x0)
560#define MXC_SRPG_NEON_PUPSCR (MXC_SRPG_NEON_BASE + 0x4)
561#define MXC_SRPG_NEON_PDNSCR (MXC_SRPG_NEON_BASE + 0x8)
562
563#define MXC_SRPG_ARM_SRPGCR (MXC_SRPG_ARM_BASE + 0x0)
564#define MXC_SRPG_ARM_PUPSCR (MXC_SRPG_ARM_BASE + 0x4)
565#define MXC_SRPG_ARM_PDNSCR (MXC_SRPG_ARM_BASE + 0x8)
566
567#define MXC_SRPG_EMPGC0_SRPGCR (MXC_SRPG_EMPGC0_BASE + 0x0)
568#define MXC_SRPG_EMPGC0_PUPSCR (MXC_SRPG_EMPGC0_BASE + 0x4)
569#define MXC_SRPG_EMPGC0_PDNSCR (MXC_SRPG_EMPGC0_BASE + 0x8)
570
571#define MXC_SRPG_EMPGC1_SRPGCR (MXC_SRPG_EMPGC1_BASE + 0x0)
572#define MXC_SRPG_EMPGC1_PUPSCR (MXC_SRPG_EMPGC1_BASE + 0x4)
573#define MXC_SRPG_EMPGC1_PDNSCR (MXC_SRPG_EMPGC1_BASE + 0x8)
574
575#define MXC_SRPG_MEGAMIX_SRPGCR (MXC_SRPG_MEGAMIX_BASE + 0x0)
576#define MXC_SRPG_MEGAMIX_PUPSCR (MXC_SRPG_MEGAMIX_BASE + 0x4)
577#define MXC_SRPG_MEGAMIX_PDNSCR (MXC_SRPG_MEGAMIX_BASE + 0x8)
578
579#define MXC_SRPGC_EMI_SRPGCR (MXC_SRPGC_EMI_BASE + 0x0)
580#define MXC_SRPGC_EMI_PUPSCR (MXC_SRPGC_EMI_BASE + 0x4)
581#define MXC_SRPGC_EMI_PDNSCR (MXC_SRPGC_EMI_BASE + 0x8)
582
583#endif /* __ARCH_ARM_MACH_MX51_CRM_REGS_H__ */
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c
new file mode 100644
index 000000000000..d6fd3961ade9
--- /dev/null
+++ b/arch/arm/mach-mx5/devices.c
@@ -0,0 +1,96 @@
1/*
2 * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com>
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12#include <linux/platform_device.h>
13#include <mach/hardware.h>
14#include <mach/imx-uart.h>
15
16static struct resource uart0[] = {
17 {
18 .start = MX51_UART1_BASE_ADDR,
19 .end = MX51_UART1_BASE_ADDR + 0xfff,
20 .flags = IORESOURCE_MEM,
21 }, {
22 .start = MX51_MXC_INT_UART1,
23 .end = MX51_MXC_INT_UART1,
24 .flags = IORESOURCE_IRQ,
25 },
26};
27
28struct platform_device mxc_uart_device0 = {
29 .name = "imx-uart",
30 .id = 0,
31 .resource = uart0,
32 .num_resources = ARRAY_SIZE(uart0),
33};
34
35static struct resource uart1[] = {
36 {
37 .start = MX51_UART2_BASE_ADDR,
38 .end = MX51_UART2_BASE_ADDR + 0xfff,
39 .flags = IORESOURCE_MEM,
40 }, {
41 .start = MX51_MXC_INT_UART2,
42 .end = MX51_MXC_INT_UART2,
43 .flags = IORESOURCE_IRQ,
44 },
45};
46
47struct platform_device mxc_uart_device1 = {
48 .name = "imx-uart",
49 .id = 1,
50 .resource = uart1,
51 .num_resources = ARRAY_SIZE(uart1),
52};
53
54static struct resource uart2[] = {
55 {
56 .start = MX51_UART3_BASE_ADDR,
57 .end = MX51_UART3_BASE_ADDR + 0xfff,
58 .flags = IORESOURCE_MEM,
59 }, {
60 .start = MX51_MXC_INT_UART3,
61 .end = MX51_MXC_INT_UART3,
62 .flags = IORESOURCE_IRQ,
63 },
64};
65
66struct platform_device mxc_uart_device2 = {
67 .name = "imx-uart",
68 .id = 2,
69 .resource = uart2,
70 .num_resources = ARRAY_SIZE(uart2),
71};
72
73static struct resource mxc_fec_resources[] = {
74 {
75 .start = MX51_MXC_FEC_BASE_ADDR,
76 .end = MX51_MXC_FEC_BASE_ADDR + 0xfff,
77 .flags = IORESOURCE_MEM,
78 }, {
79 .start = MX51_MXC_INT_FEC,
80 .end = MX51_MXC_INT_FEC,
81 .flags = IORESOURCE_IRQ,
82 },
83};
84
85struct platform_device mxc_fec_device = {
86 .name = "fec",
87 .id = 0,
88 .num_resources = ARRAY_SIZE(mxc_fec_resources),
89 .resource = mxc_fec_resources,
90};
91
92/* Dummy definition to allow compiling in AVIC and TZIC simultaneously */
93int __init mxc_register_gpios(void)
94{
95 return 0;
96}
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h
new file mode 100644
index 000000000000..f339ab8c19be
--- /dev/null
+++ b/arch/arm/mach-mx5/devices.h
@@ -0,0 +1,4 @@
1extern struct platform_device mxc_uart_device0;
2extern struct platform_device mxc_uart_device1;
3extern struct platform_device mxc_uart_device2;
4extern struct platform_device mxc_fec_device;
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
new file mode 100644
index 000000000000..c21e18be7af8
--- /dev/null
+++ b/arch/arm/mach-mx5/mm.c
@@ -0,0 +1,89 @@
1/*
2 * Copyright 2008-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 *
11 * Create static mapping between physical to virtual memory.
12 */
13
14#include <linux/mm.h>
15#include <linux/init.h>
16
17#include <asm/mach/map.h>
18
19#include <mach/hardware.h>
20#include <mach/common.h>
21#include <mach/iomux-v3.h>
22
23/*
24 * Define the MX51 memory map.
25 */
26static struct map_desc mxc_io_desc[] __initdata = {
27 {
28 .virtual = MX51_IRAM_BASE_ADDR_VIRT,
29 .pfn = __phys_to_pfn(MX51_IRAM_BASE_ADDR),
30 .length = MX51_IRAM_SIZE,
31 .type = MT_DEVICE
32 }, {
33 .virtual = MX51_DEBUG_BASE_ADDR_VIRT,
34 .pfn = __phys_to_pfn(MX51_DEBUG_BASE_ADDR),
35 .length = MX51_DEBUG_SIZE,
36 .type = MT_DEVICE
37 }, {
38 .virtual = MX51_TZIC_BASE_ADDR_VIRT,
39 .pfn = __phys_to_pfn(MX51_TZIC_BASE_ADDR),
40 .length = MX51_TZIC_SIZE,
41 .type = MT_DEVICE
42 }, {
43 .virtual = MX51_AIPS1_BASE_ADDR_VIRT,
44 .pfn = __phys_to_pfn(MX51_AIPS1_BASE_ADDR),
45 .length = MX51_AIPS1_SIZE,
46 .type = MT_DEVICE
47 }, {
48 .virtual = MX51_SPBA0_BASE_ADDR_VIRT,
49 .pfn = __phys_to_pfn(MX51_SPBA0_BASE_ADDR),
50 .length = MX51_SPBA0_SIZE,
51 .type = MT_DEVICE
52 }, {
53 .virtual = MX51_AIPS2_BASE_ADDR_VIRT,
54 .pfn = __phys_to_pfn(MX51_AIPS2_BASE_ADDR),
55 .length = MX51_AIPS2_SIZE,
56 .type = MT_DEVICE
57 }, {
58 .virtual = MX51_NFC_AXI_BASE_ADDR_VIRT,
59 .pfn = __phys_to_pfn(MX51_NFC_AXI_BASE_ADDR),
60 .length = MX51_NFC_AXI_SIZE,
61 .type = MT_DEVICE
62 },
63};
64
65/*
66 * This function initializes the memory map. It is called during the
67 * system startup to create static physical to virtual memory mappings
68 * for the IO modules.
69 */
70void __init mx51_map_io(void)
71{
72 u32 tzic_addr;
73
74 if (mx51_revision() < MX51_CHIP_REV_2_0)
75 tzic_addr = 0x8FFFC000;
76 else
77 tzic_addr = 0xE0003000;
78 mxc_io_desc[2].pfn = __phys_to_pfn(tzic_addr);
79
80 mxc_set_cpu_type(MXC_CPU_MX51);
81 mxc_iomux_v3_init(MX51_IO_ADDRESS(MX51_IOMUXC_BASE_ADDR));
82 mxc_arch_reset_init(MX51_IO_ADDRESS(MX51_WDOG_BASE_ADDR));
83 iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc));
84}
85
86void __init mx51_init_irq(void)
87{
88 tzic_init_irq(MX51_IO_ADDRESS(MX51_TZIC_BASE_ADDR));
89}
diff --git a/arch/arm/mach-mxc91231/magx-zn5.c b/arch/arm/mach-mxc91231/magx-zn5.c
index 7dbe4ca12efd..69816ba82930 100644
--- a/arch/arm/mach-mxc91231/magx-zn5.c
+++ b/arch/arm/mach-mxc91231/magx-zn5.c
@@ -55,7 +55,7 @@ struct sys_timer zn5_timer = {
55MACHINE_START(MAGX_ZN5, "Motorola Zn5") 55MACHINE_START(MAGX_ZN5, "Motorola Zn5")
56 .phys_io = MXC91231_AIPS1_BASE_ADDR, 56 .phys_io = MXC91231_AIPS1_BASE_ADDR,
57 .io_pg_offst = ((MXC91231_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, 57 .io_pg_offst = ((MXC91231_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc,
58 .boot_params = PHYS_OFFSET + 0x100, 58 .boot_params = MXC91231_PHYS_OFFSET + 0x100,
59 .map_io = mxc91231_map_io, 59 .map_io = mxc91231_map_io,
60 .init_irq = mxc91231_init_irq, 60 .init_irq = mxc91231_init_irq,
61 .timer = &zn5_timer, 61 .timer = &zn5_timer,
diff --git a/arch/arm/mach-nomadik/board-nhk8815.c b/arch/arm/mach-nomadik/board-nhk8815.c
index 9438bf6613a3..ab3712c86d2b 100644
--- a/arch/arm/mach-nomadik/board-nhk8815.c
+++ b/arch/arm/mach-nomadik/board-nhk8815.c
@@ -38,7 +38,7 @@
38#define SRC_CR_INIT_MASK 0x00007fff 38#define SRC_CR_INIT_MASK 0x00007fff
39#define SRC_CR_INIT_VAL 0x2aaa8000 39#define SRC_CR_INIT_VAL 0x2aaa8000
40 40
41/* These adresses span 16MB, so use three individual pages */ 41/* These addresses span 16MB, so use three individual pages */
42static struct resource nhk8815_nand_resources[] = { 42static struct resource nhk8815_nand_resources[] = {
43 { 43 {
44 .name = "nand_addr", 44 .name = "nand_addr",
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 4386d2b4a785..4386d2b4a785 100755..100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c
index ca95d8d64136..ca95d8d64136 100755..100644
--- a/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ b/arch/arm/mach-omap2/board-zoom-peripherals.c
diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig
index c3d513cad5ac..905719a677ae 100644
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -57,6 +57,13 @@ config MACH_LINKSTATION_MINI
57 Say 'Y' here if you want your kernel to support the 57 Say 'Y' here if you want your kernel to support the
58 Buffalo Linkstation Mini platform. 58 Buffalo Linkstation Mini platform.
59 59
60config MACH_LINKSTATION_LS_HGL
61 bool "Buffalo Linkstation LS-HGL"
62 select I2C_BOARDINFO
63 help
64 Say 'Y' here if you want your kernel to support the
65 Buffalo Linkstation LS-HGL platform.
66
60config MACH_TS409 67config MACH_TS409
61 bool "QNAP TS-409" 68 bool "QNAP TS-409"
62 help 69 help
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 89772fcd65c7..eb6eabcb41e4 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -5,6 +5,7 @@ obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o
5obj-$(CONFIG_MACH_TERASTATION_PRO2) += terastation_pro2-setup.o 5obj-$(CONFIG_MACH_TERASTATION_PRO2) += terastation_pro2-setup.o
6obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o 6obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o
7obj-$(CONFIG_MACH_LINKSTATION_MINI) += lsmini-setup.o 7obj-$(CONFIG_MACH_LINKSTATION_MINI) += lsmini-setup.o
8obj-$(CONFIG_MACH_LINKSTATION_LS_HGL) += ls_hgl-setup.o
8obj-$(CONFIG_MACH_DNS323) += dns323-setup.o 9obj-$(CONFIG_MACH_DNS323) += dns323-setup.o
9obj-$(CONFIG_MACH_TS209) += ts209-setup.o tsx09-common.o 10obj-$(CONFIG_MACH_TS209) += ts209-setup.o tsx09-common.o
10obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o 11obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index f87fa1253803..8dc2c76d2260 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -488,7 +488,7 @@ static struct platform_device orion5x_xor0_channel = {
488 .dev = { 488 .dev = {
489 .dma_mask = &orion5x_xor_dmamask, 489 .dma_mask = &orion5x_xor_dmamask,
490 .coherent_dma_mask = DMA_BIT_MASK(64), 490 .coherent_dma_mask = DMA_BIT_MASK(64),
491 .platform_data = (void *)&orion5x_xor0_data, 491 .platform_data = &orion5x_xor0_data,
492 }, 492 },
493}; 493};
494 494
@@ -514,7 +514,7 @@ static struct platform_device orion5x_xor1_channel = {
514 .dev = { 514 .dev = {
515 .dma_mask = &orion5x_xor_dmamask, 515 .dma_mask = &orion5x_xor_dmamask,
516 .coherent_dma_mask = DMA_BIT_MASK(64), 516 .coherent_dma_mask = DMA_BIT_MASK(64),
517 .platform_data = (void *)&orion5x_xor1_data, 517 .platform_data = &orion5x_xor1_data,
518 }, 518 },
519}; 519};
520 520
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index 9d4bf763f25b..7130904ad999 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -149,10 +149,7 @@ static void __init d2net_sata_power_init(void)
149 149
150/* 150/*
151 * The blue front LED is wired to the CPLD and can blink in relation with the 151 * The blue front LED is wired to the CPLD and can blink in relation with the
152 * SATA activity. This feature is disabled to make this LED compatible with 152 * SATA activity.
153 * the leds-gpio driver: MPP14 and MPP15 are configured to act like output
154 * GPIO's and have to stay in an active state. This is needed to set the blue
155 * LED in a "fix on" state regardless of the SATA activity.
156 * 153 *
157 * The following array detail the different LED registers and the combination 154 * The following array detail the different LED registers and the combination
158 * of their possible values: 155 * of their possible values:
@@ -171,12 +168,11 @@ static void __init d2net_sata_power_init(void)
171#define D2NET_GPIO_RED_LED 6 168#define D2NET_GPIO_RED_LED 6
172#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16 169#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16
173#define D2NET_GPIO_BLUE_LED_OFF 23 170#define D2NET_GPIO_BLUE_LED_OFF 23
174#define D2NET_GPIO_SATA0_ACT 14
175#define D2NET_GPIO_SATA1_ACT 15
176 171
177static struct gpio_led d2net_leds[] = { 172static struct gpio_led d2net_leds[] = {
178 { 173 {
179 .name = "d2net:blue:power", 174 .name = "d2net:blue:sata",
175 .default_trigger = "default-on",
180 .gpio = D2NET_GPIO_BLUE_LED_OFF, 176 .gpio = D2NET_GPIO_BLUE_LED_OFF,
181 .active_low = 1, 177 .active_low = 1,
182 }, 178 },
@@ -201,25 +197,22 @@ static struct platform_device d2net_gpio_leds = {
201 197
202static void __init d2net_gpio_leds_init(void) 198static void __init d2net_gpio_leds_init(void)
203{ 199{
200 int err;
201
204 /* Configure GPIO over MPP max number. */ 202 /* Configure GPIO over MPP max number. */
205 orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1); 203 orion_gpio_set_valid(D2NET_GPIO_BLUE_LED_OFF, 1);
206 204
207 if (gpio_request(D2NET_GPIO_SATA0_ACT, "LED SATA0 activity") != 0) 205 /* Configure register blink_ctrl to allow SATA activity LED blinking. */
208 return; 206 err = gpio_request(D2NET_GPIO_BLUE_LED_BLINK_CTRL, "blue LED blink");
209 if (gpio_direction_output(D2NET_GPIO_SATA0_ACT, 1) != 0) 207 if (err == 0) {
210 goto err_free_1; 208 err = gpio_direction_output(D2NET_GPIO_BLUE_LED_BLINK_CTRL, 1);
211 if (gpio_request(D2NET_GPIO_SATA1_ACT, "LED SATA1 activity") != 0) 209 if (err)
212 goto err_free_1; 210 gpio_free(D2NET_GPIO_BLUE_LED_BLINK_CTRL);
213 if (gpio_direction_output(D2NET_GPIO_SATA1_ACT, 1) != 0) 211 }
214 goto err_free_2; 212 if (err)
215 platform_device_register(&d2net_gpio_leds); 213 pr_err("d2net: failed to configure blue LED blink GPIO\n");
216 return;
217 214
218err_free_2: 215 platform_device_register(&d2net_gpio_leds);
219 gpio_free(D2NET_GPIO_SATA1_ACT);
220err_free_1:
221 gpio_free(D2NET_GPIO_SATA0_ACT);
222 return;
223} 216}
224 217
225/**************************************************************************** 218/****************************************************************************
@@ -289,8 +282,8 @@ static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = {
289 { 11, MPP_UNUSED }, 282 { 11, MPP_UNUSED },
290 { 12, MPP_GPIO }, /* SATA 1 power */ 283 { 12, MPP_GPIO }, /* SATA 1 power */
291 { 13, MPP_UNUSED }, 284 { 13, MPP_UNUSED },
292 { 14, MPP_GPIO }, /* SATA 0 active */ 285 { 14, MPP_SATA_LED }, /* SATA 0 active */
293 { 15, MPP_GPIO }, /* SATA 1 active */ 286 { 15, MPP_SATA_LED }, /* SATA 1 active */
294 { 16, MPP_GPIO }, /* Blue front LED blink control */ 287 { 16, MPP_GPIO }, /* Blue front LED blink control */
295 { 17, MPP_UNUSED }, 288 { 17, MPP_UNUSED },
296 { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */ 289 { 18, MPP_GPIO }, /* Front button (0 = Released, 1 = Pushed ) */
@@ -301,6 +294,8 @@ static struct orion5x_mpp_mode d2net_mpp_modes[] __initdata = {
301 /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */ 294 /* 24: Inhibit board power off (0 = Disabled, 1 = Enabled) */
302}; 295};
303 296
297#define D2NET_GPIO_INHIBIT_POWER_OFF 24
298
304static void __init d2net_init(void) 299static void __init d2net_init(void)
305{ 300{
306 /* 301 /*
@@ -333,6 +328,8 @@ static void __init d2net_init(void)
333 328
334 i2c_register_board_info(0, d2net_i2c_devices, 329 i2c_register_board_info(0, d2net_i2c_devices,
335 ARRAY_SIZE(d2net_i2c_devices)); 330 ARRAY_SIZE(d2net_i2c_devices));
331
332 orion_gpio_set_valid(D2NET_GPIO_INHIBIT_POWER_OFF, 1);
336} 333}
337 334
338/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */ 335/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 8f159db4d08a..421b82f7c63d 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -34,7 +34,8 @@
34#define DNS323_GPIO_LED_RIGHT_AMBER 1 34#define DNS323_GPIO_LED_RIGHT_AMBER 1
35#define DNS323_GPIO_LED_LEFT_AMBER 2 35#define DNS323_GPIO_LED_LEFT_AMBER 2
36#define DNS323_GPIO_SYSTEM_UP 3 36#define DNS323_GPIO_SYSTEM_UP 3
37#define DNS323_GPIO_LED_POWER 5 37#define DNS323_GPIO_LED_POWER1 4
38#define DNS323_GPIO_LED_POWER2 5
38#define DNS323_GPIO_OVERTEMP 6 39#define DNS323_GPIO_OVERTEMP 6
39#define DNS323_GPIO_RTC 7 40#define DNS323_GPIO_RTC 7
40#define DNS323_GPIO_POWER_OFF 8 41#define DNS323_GPIO_POWER_OFF 8
@@ -237,11 +238,31 @@ error_fail:
237 * GPIO LEDs (simple - doesn't use hardware blinking support) 238 * GPIO LEDs (simple - doesn't use hardware blinking support)
238 */ 239 */
239 240
241#define ORION_BLINK_HALF_PERIOD 100 /* ms */
242
243static int dns323_gpio_blink_set(unsigned gpio,
244 unsigned long *delay_on, unsigned long *delay_off)
245{
246 static int value = 0;
247
248 if (!*delay_on && !*delay_off)
249 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
250
251 if (ORION_BLINK_HALF_PERIOD == *delay_on
252 && ORION_BLINK_HALF_PERIOD == *delay_off) {
253 value = !value;
254 orion_gpio_set_blink(gpio, value);
255 return 0;
256 }
257
258 return -EINVAL;
259}
260
240static struct gpio_led dns323_leds[] = { 261static struct gpio_led dns323_leds[] = {
241 { 262 {
242 .name = "power:blue", 263 .name = "power:blue",
243 .gpio = DNS323_GPIO_LED_POWER, 264 .gpio = DNS323_GPIO_LED_POWER2,
244 .default_state = LEDS_GPIO_DEFSTATE_ON, 265 .default_trigger = "timer",
245 }, { 266 }, {
246 .name = "right:amber", 267 .name = "right:amber",
247 .gpio = DNS323_GPIO_LED_RIGHT_AMBER, 268 .gpio = DNS323_GPIO_LED_RIGHT_AMBER,
@@ -256,6 +277,7 @@ static struct gpio_led dns323_leds[] = {
256static struct gpio_led_platform_data dns323_led_data = { 277static struct gpio_led_platform_data dns323_led_data = {
257 .num_leds = ARRAY_SIZE(dns323_leds), 278 .num_leds = ARRAY_SIZE(dns323_leds),
258 .leds = dns323_leds, 279 .leds = dns323_leds,
280 .gpio_blink_set = dns323_gpio_blink_set,
259}; 281};
260 282
261static struct platform_device dns323_gpio_leds = { 283static struct platform_device dns323_gpio_leds = {
@@ -412,6 +434,14 @@ static void __init dns323_init(void)
412 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE); 434 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE);
413 platform_device_register(&dns323_nor_flash); 435 platform_device_register(&dns323_nor_flash);
414 436
437 /* The 5181 power LED is active low and requires
438 * DNS323_GPIO_LED_POWER1 to also be low.
439 */
440 if (dns323_dev_id() == MV88F5181_DEV_ID) {
441 dns323_leds[0].active_low = 1;
442 gpio_direction_output(DNS323_GPIO_LED_POWER1, 0);
443 }
444
415 platform_device_register(&dns323_gpio_leds); 445 platform_device_register(&dns323_gpio_leds);
416 446
417 platform_device_register(&dns323_button_device); 447 platform_device_register(&dns323_button_device);
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
new file mode 100644
index 000000000000..8e569be6e2c7
--- /dev/null
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -0,0 +1,276 @@
1/*
2 * arch/arm/mach-orion5x/ls_hgl-setup.c
3 *
4 * Maintainer: Zhu Qingsen <zhuqs@cn.fujitsu.com>
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/mtd/physmap.h>
15#include <linux/mv643xx_eth.h>
16#include <linux/leds.h>
17#include <linux/gpio_keys.h>
18#include <linux/input.h>
19#include <linux/i2c.h>
20#include <linux/ata_platform.h>
21#include <linux/gpio.h>
22#include <asm/mach-types.h>
23#include <asm/mach/arch.h>
24#include <asm/system.h>
25#include <mach/orion5x.h>
26#include "common.h"
27#include "mpp.h"
28
29/*****************************************************************************
30 * Linkstation LS-HGL Info
31 ****************************************************************************/
32
33/*
34 * 256K NOR flash Device bus boot chip select
35 */
36
37#define LS_HGL_NOR_BOOT_BASE 0xf4000000
38#define LS_HGL_NOR_BOOT_SIZE SZ_256K
39
40/*****************************************************************************
41 * 256KB NOR Flash on BOOT Device
42 ****************************************************************************/
43
44static struct physmap_flash_data ls_hgl_nor_flash_data = {
45 .width = 1,
46};
47
48static struct resource ls_hgl_nor_flash_resource = {
49 .flags = IORESOURCE_MEM,
50 .start = LS_HGL_NOR_BOOT_BASE,
51 .end = LS_HGL_NOR_BOOT_BASE + LS_HGL_NOR_BOOT_SIZE - 1,
52};
53
54static struct platform_device ls_hgl_nor_flash = {
55 .name = "physmap-flash",
56 .id = 0,
57 .dev = {
58 .platform_data = &ls_hgl_nor_flash_data,
59 },
60 .num_resources = 1,
61 .resource = &ls_hgl_nor_flash_resource,
62};
63
64/*****************************************************************************
65 * Ethernet
66 ****************************************************************************/
67
68static struct mv643xx_eth_platform_data ls_hgl_eth_data = {
69 .phy_addr = 8,
70};
71
72/*****************************************************************************
73 * RTC 5C372a on I2C bus
74 ****************************************************************************/
75
76static struct i2c_board_info __initdata ls_hgl_i2c_rtc = {
77 I2C_BOARD_INFO("rs5c372a", 0x32),
78};
79
80/*****************************************************************************
81 * LEDs attached to GPIO
82 ****************************************************************************/
83
84#define LS_HGL_GPIO_LED_ALARM 2
85#define LS_HGL_GPIO_LED_INFO 3
86#define LS_HGL_GPIO_LED_FUNC 17
87#define LS_HGL_GPIO_LED_PWR 0
88
89
90static struct gpio_led ls_hgl_led_pins[] = {
91 {
92 .name = "alarm:red",
93 .gpio = LS_HGL_GPIO_LED_ALARM,
94 .active_low = 1,
95 }, {
96 .name = "info:amber",
97 .gpio = LS_HGL_GPIO_LED_INFO,
98 .active_low = 1,
99 }, {
100 .name = "func:blue:top",
101 .gpio = LS_HGL_GPIO_LED_FUNC,
102 .active_low = 1,
103 }, {
104 .name = "power:blue:bottom",
105 .gpio = LS_HGL_GPIO_LED_PWR,
106 },
107};
108
109static struct gpio_led_platform_data ls_hgl_led_data = {
110 .leds = ls_hgl_led_pins,
111 .num_leds = ARRAY_SIZE(ls_hgl_led_pins),
112};
113
114static struct platform_device ls_hgl_leds = {
115 .name = "leds-gpio",
116 .id = -1,
117 .dev = {
118 .platform_data = &ls_hgl_led_data,
119 },
120};
121
122/****************************************************************************
123 * GPIO Attached Keys
124 ****************************************************************************/
125#define LS_HGL_GPIO_KEY_FUNC 15
126#define LS_HGL_GPIO_KEY_POWER 8
127#define LS_HGL_GPIO_KEY_AUTOPOWER 10
128
129#define LS_HGL_SW_POWER 0x00
130#define LS_HGL_SW_AUTOPOWER 0x01
131
132static struct gpio_keys_button ls_hgl_buttons[] = {
133 {
134 .code = KEY_OPTION,
135 .gpio = LS_HGL_GPIO_KEY_FUNC,
136 .desc = "Function Button",
137 .active_low = 1,
138 }, {
139 .type = EV_SW,
140 .code = LS_HGL_SW_POWER,
141 .gpio = LS_HGL_GPIO_KEY_POWER,
142 .desc = "Power-on Switch",
143 .active_low = 1,
144 }, {
145 .type = EV_SW,
146 .code = LS_HGL_SW_AUTOPOWER,
147 .gpio = LS_HGL_GPIO_KEY_AUTOPOWER,
148 .desc = "Power-auto Switch",
149 .active_low = 1,
150 },
151};
152
153static struct gpio_keys_platform_data ls_hgl_button_data = {
154 .buttons = ls_hgl_buttons,
155 .nbuttons = ARRAY_SIZE(ls_hgl_buttons),
156};
157
158static struct platform_device ls_hgl_button_device = {
159 .name = "gpio-keys",
160 .id = -1,
161 .num_resources = 0,
162 .dev = {
163 .platform_data = &ls_hgl_button_data,
164 },
165};
166
167
168/*****************************************************************************
169 * SATA
170 ****************************************************************************/
171static struct mv_sata_platform_data ls_hgl_sata_data = {
172 .n_ports = 2,
173};
174
175
176/*****************************************************************************
177 * Linkstation LS-HGL specific power off method: reboot
178 ****************************************************************************/
179/*
180 * On the Linkstation LS-HGL, the shutdown process is following:
181 * - Userland monitors key events until the power switch goes to off position
182 * - The board reboots
183 * - U-boot starts and goes into an idle mode waiting for the user
184 * to move the switch to ON position
185 */
186
187static void ls_hgl_power_off(void)
188{
189 arm_machine_restart('h', NULL);
190}
191
192
193/*****************************************************************************
194 * General Setup
195 ****************************************************************************/
196
197#define LS_HGL_GPIO_USB_POWER 9
198#define LS_HGL_GPIO_AUTO_POWER 10
199#define LS_HGL_GPIO_POWER 8
200
201#define LS_HGL_GPIO_HDD_POWER 1
202
203static struct orion5x_mpp_mode ls_hgl_mpp_modes[] __initdata = {
204 { 0, MPP_GPIO }, /* LED_PWR */
205 { 1, MPP_GPIO }, /* HDD_PWR */
206 { 2, MPP_GPIO }, /* LED_ALARM */
207 { 3, MPP_GPIO }, /* LED_INFO */
208 { 4, MPP_UNUSED },
209 { 5, MPP_UNUSED },
210 { 6, MPP_GPIO }, /* FAN_LCK */
211 { 7, MPP_GPIO }, /* INIT */
212 { 8, MPP_GPIO }, /* POWER */
213 { 9, MPP_GPIO }, /* USB_PWR */
214 { 10, MPP_GPIO }, /* AUTO_POWER */
215 { 11, MPP_UNUSED }, /* LED_ETH (dummy) */
216 { 12, MPP_UNUSED },
217 { 13, MPP_UNUSED },
218 { 14, MPP_UNUSED },
219 { 15, MPP_GPIO }, /* FUNC */
220 { 16, MPP_UNUSED },
221 { 17, MPP_GPIO }, /* LED_FUNC */
222 { 18, MPP_UNUSED },
223 { 19, MPP_UNUSED },
224 { -1 },
225};
226
227static void __init ls_hgl_init(void)
228{
229 /*
230 * Setup basic Orion functions. Need to be called early.
231 */
232 orion5x_init();
233
234 orion5x_mpp_conf(ls_hgl_mpp_modes);
235
236 /*
237 * Configure peripherals.
238 */
239 orion5x_ehci0_init();
240 orion5x_ehci1_init();
241 orion5x_eth_init(&ls_hgl_eth_data);
242 orion5x_i2c_init();
243 orion5x_sata_init(&ls_hgl_sata_data);
244 orion5x_uart0_init();
245 orion5x_xor_init();
246
247 orion5x_setup_dev_boot_win(LS_HGL_NOR_BOOT_BASE,
248 LS_HGL_NOR_BOOT_SIZE);
249 platform_device_register(&ls_hgl_nor_flash);
250
251 platform_device_register(&ls_hgl_button_device);
252
253 platform_device_register(&ls_hgl_leds);
254
255 i2c_register_board_info(0, &ls_hgl_i2c_rtc, 1);
256
257 /* enable USB power */
258 gpio_set_value(LS_HGL_GPIO_USB_POWER, 1);
259
260 /* register power-off method */
261 pm_power_off = ls_hgl_power_off;
262
263 pr_info("%s: finished\n", __func__);
264}
265
266MACHINE_START(LINKSTATION_LS_HGL, "Buffalo Linkstation LS-HGL")
267 /* Maintainer: Zhu Qingsen <zhuqs@cn.fujistu.com> */
268 .phys_io = ORION5X_REGS_PHYS_BASE,
269 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
270 .boot_params = 0x00000100,
271 .init_machine = ls_hgl_init,
272 .map_io = orion5x_map_io,
273 .init_irq = orion5x_init_irq,
274 .timer = &orion5x_timer,
275 .fixup = tag_fixup_mem32,
276MACHINE_END
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index c9bf6b81a80d..c704f056de1e 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -11,7 +11,6 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/pci.h>
15#include <linux/mtd/physmap.h> 14#include <linux/mtd/physmap.h>
16#include <linux/mv643xx_eth.h> 15#include <linux/mv643xx_eth.h>
17#include <linux/leds.h> 16#include <linux/leds.h>
@@ -19,12 +18,13 @@
19#include <linux/input.h> 18#include <linux/input.h>
20#include <linux/i2c.h> 19#include <linux/i2c.h>
21#include <linux/ata_platform.h> 20#include <linux/ata_platform.h>
22#include <asm/mach-types.h>
23#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/system.h>
25#include <mach/orion5x.h>
25#include "common.h" 26#include "common.h"
26#include "mpp.h" 27#include "mpp.h"
27#include "include/mach/system.h"
28 28
29/***************************************************************************** 29/*****************************************************************************
30 * Linkstation Mini Info 30 * Linkstation Mini Info
@@ -186,7 +186,7 @@ static struct mv_sata_platform_data lsmini_sata_data = {
186 186
187static void lsmini_power_off(void) 187static void lsmini_power_off(void)
188{ 188{
189 arch_reset(0, NULL); 189 arm_machine_restart('h', NULL);
190} 190}
191 191
192 192
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index dee92182749b..38fbd0a0e402 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -115,6 +115,11 @@ config MACH_CM_X300
115 select CPU_PXA310 115 select CPU_PXA310
116 select HAVE_PWM 116 select HAVE_PWM
117 117
118config MACH_CAPC7117
119 bool "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM"
120 select CPU_PXA320
121 select PXA3xx
122
118config ARCH_GUMSTIX 123config ARCH_GUMSTIX
119 bool "Gumstix XScale 255 boards" 124 bool "Gumstix XScale 255 boards"
120 select PXA25x 125 select PXA25x
@@ -417,6 +422,24 @@ config MACH_TREO680
417 Say Y here if you intend to run this kernel on Palm Treo 680 422 Say Y here if you intend to run this kernel on Palm Treo 680
418 smartphone. 423 smartphone.
419 424
425config MACH_RAUMFELD_RC
426 bool "Raumfeld Controller"
427 select PXA3xx
428 select CPU_PXA300
429 select HAVE_PWM
430
431config MACH_RAUMFELD_CONNECTOR
432 bool "Raumfeld Connector"
433 select PXA3xx
434 select CPU_PXA300
435 select PXA_SSP
436
437config MACH_RAUMFELD_SPEAKER
438 bool "Raumfeld Speaker"
439 select PXA3xx
440 select CPU_PXA300
441 select PXA_SSP
442
420config PXA_SHARPSL 443config PXA_SHARPSL
421 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models" 444 bool "SHARP Zaurus SL-5600, SL-C7xx and SL-Cxx00 Models"
422 select SHARP_SCOOP 445 select SHARP_SCOOP
@@ -435,6 +458,7 @@ config SHARPSL_PM
435config CORGI_SSP_DEPRECATED 458config CORGI_SSP_DEPRECATED
436 bool 459 bool
437 select PXA_SSP 460 select PXA_SSP
461 select PXA_SSP_LEGACY
438 help 462 help
439 This option will include corgi_ssp.c and corgi_lcd.c 463 This option will include corgi_ssp.c and corgi_lcd.c
440 that corgi_ts.c and other legacy drivers (corgi_bl.c 464 that corgi_ts.c and other legacy drivers (corgi_bl.c
@@ -446,6 +470,7 @@ config MACH_POODLE
446 select PXA25x 470 select PXA25x
447 select SHARP_LOCOMO 471 select SHARP_LOCOMO
448 select PXA_SSP 472 select PXA_SSP
473 select PXA_HAVE_BOARD_IRQS
449 474
450config MACH_CORGI 475config MACH_CORGI
451 bool "Enable Sharp SL-C700 (Corgi) Support" 476 bool "Enable Sharp SL-C700 (Corgi) Support"
@@ -492,6 +517,11 @@ config MACH_TOSA
492 select PXA25x 517 select PXA25x
493 select PXA_HAVE_BOARD_IRQS 518 select PXA_HAVE_BOARD_IRQS
494 519
520config MACH_ICONTROL
521 bool "TMT iControl/SafeTCam based on the MXM-8x10 CoM"
522 select CPU_PXA320
523 select PXA3xx
524
495config ARCH_PXA_ESERIES 525config ARCH_PXA_ESERIES
496 bool "PXA based Toshiba e-series PDAs" 526 bool "PXA based Toshiba e-series PDAs"
497 select PXA25x 527 select PXA25x
@@ -629,6 +659,11 @@ config PXA_SSP
629 help 659 help
630 Enable support for PXA2xx SSP ports 660 Enable support for PXA2xx SSP ports
631 661
662config PXA_SSP_LEGACY
663 bool
664 help
665 Support of legacy SSP API
666
632config TOSA_BT 667config TOSA_BT
633 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000" 668 tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
634 depends on MACH_TOSA 669 depends on MACH_TOSA
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index f64afda7e6f6..86bc87b7f2dd 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -48,6 +48,7 @@ obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx-pci.o
48endif 48endif
49obj-$(CONFIG_MACH_EM_X270) += em-x270.o 49obj-$(CONFIG_MACH_EM_X270) += em-x270.o
50obj-$(CONFIG_MACH_CM_X300) += cm-x300.o 50obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
51obj-$(CONFIG_MACH_CAPC7117) += capc7117.o mxm8x10.o
51obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o 52obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
52obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o 53obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o
53obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o 54obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
@@ -82,6 +83,7 @@ obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
82obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o 83obj-$(CONFIG_CORGI_SSP_DEPRECATED) += corgi_ssp.o corgi_lcd.o
83obj-$(CONFIG_MACH_POODLE) += poodle.o 84obj-$(CONFIG_MACH_POODLE) += poodle.o
84obj-$(CONFIG_MACH_TOSA) += tosa.o 85obj-$(CONFIG_MACH_TOSA) += tosa.o
86obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o
85obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o 87obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o
86obj-$(CONFIG_MACH_E330) += e330.o 88obj-$(CONFIG_MACH_E330) += e330.o
87obj-$(CONFIG_MACH_E350) += e350.o 89obj-$(CONFIG_MACH_E350) += e350.o
@@ -89,6 +91,9 @@ obj-$(CONFIG_MACH_E740) += e740.o
89obj-$(CONFIG_MACH_E750) += e750.o 91obj-$(CONFIG_MACH_E750) += e750.o
90obj-$(CONFIG_MACH_E400) += e400.o 92obj-$(CONFIG_MACH_E400) += e400.o
91obj-$(CONFIG_MACH_E800) += e800.o 93obj-$(CONFIG_MACH_E800) += e800.o
94obj-$(CONFIG_MACH_RAUMFELD_RC) += raumfeld.o
95obj-$(CONFIG_MACH_RAUMFELD_CONNECTOR) += raumfeld.o
96obj-$(CONFIG_MACH_RAUMFELD_SPEAKER) += raumfeld.o
92 97
93# Support for blinky lights 98# Support for blinky lights
94led-y := leds.o 99led-y := leds.o
diff --git a/arch/arm/mach-pxa/am300epd.c b/arch/arm/mach-pxa/am300epd.c
index 4bd10a17332e..993d75e66390 100644
--- a/arch/arm/mach-pxa/am300epd.c
+++ b/arch/arm/mach-pxa/am300epd.c
@@ -288,7 +288,7 @@ int __init am300_init(void)
288} 288}
289 289
290module_param(panel_type, uint, 0); 290module_param(panel_type, uint, 0);
291MODULE_PARM_DESC(panel_type, "Select the panel type: 6, 8, 97"); 291MODULE_PARM_DESC(panel_type, "Select the panel type: 37, 6, 97");
292 292
293MODULE_DESCRIPTION("board driver for am300 epd kit"); 293MODULE_DESCRIPTION("board driver for am300 epd kit");
294MODULE_AUTHOR("Jaya Kumar"); 294MODULE_AUTHOR("Jaya Kumar");
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index b8cd07ca9380..f3b5ace815e5 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -132,6 +132,14 @@ static void __init balloon3_init_irq(void)
132 "enabled\n", __func__, BALLOON3_AUX_NIRQ); 132 "enabled\n", __func__, BALLOON3_AUX_NIRQ);
133} 133}
134 134
135static unsigned long balloon3_ac97_pin_config[] = {
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140 GPIO113_AC97_nRESET,
141};
142
135static void balloon3_backlight_power(int on) 143static void balloon3_backlight_power(int on)
136{ 144{
137 pr_debug("%s: power is %s\n", __func__, on ? "on" : "off"); 145 pr_debug("%s: power is %s\n", __func__, on ? "on" : "off");
@@ -140,26 +148,7 @@ static void balloon3_backlight_power(int on)
140 148
141static unsigned long balloon3_lcd_pin_config[] = { 149static unsigned long balloon3_lcd_pin_config[] = {
142 /* LCD - 16bpp Active TFT */ 150 /* LCD - 16bpp Active TFT */
143 GPIO58_LCD_LDD_0, 151 GPIOxx_LCD_TFT_16BPP,
144 GPIO59_LCD_LDD_1,
145 GPIO60_LCD_LDD_2,
146 GPIO61_LCD_LDD_3,
147 GPIO62_LCD_LDD_4,
148 GPIO63_LCD_LDD_5,
149 GPIO64_LCD_LDD_6,
150 GPIO65_LCD_LDD_7,
151 GPIO66_LCD_LDD_8,
152 GPIO67_LCD_LDD_9,
153 GPIO68_LCD_LDD_10,
154 GPIO69_LCD_LDD_11,
155 GPIO70_LCD_LDD_12,
156 GPIO71_LCD_LDD_13,
157 GPIO72_LCD_LDD_14,
158 GPIO73_LCD_LDD_15,
159 GPIO74_LCD_FCLK,
160 GPIO75_LCD_LCLK,
161 GPIO76_LCD_PCLK,
162 GPIO77_LCD_BIAS,
163 152
164 GPIO99_GPIO, /* Backlight */ 153 GPIO99_GPIO, /* Backlight */
165}; 154};
@@ -311,8 +300,10 @@ static void __init balloon3_init(void)
311 pxa_set_stuart_info(NULL); 300 pxa_set_stuart_info(NULL);
312 301
313 pxa_set_i2c_info(NULL); 302 pxa_set_i2c_info(NULL);
314 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) 303 if (balloon3_has(BALLOON3_FEATURE_AUDIO)) {
304 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config));
315 pxa_set_ac97_info(NULL); 305 pxa_set_ac97_info(NULL);
306 }
316 307
317 if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) { 308 if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) {
318 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config)); 309 pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config));
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c
new file mode 100644
index 000000000000..aae544631a8b
--- /dev/null
+++ b/arch/arm/mach-pxa/capc7117.c
@@ -0,0 +1,158 @@
1/*
2 * linux/arch/arm/mach-pxa/capc7117.c
3 *
4 * Support for the Embedian CAPC-7117 Evaluation Kit
5 * based on the Embedian MXM-8x10 Computer on Module
6 *
7 * Copyright (C) 2009 Embedian Inc.
8 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
9 *
10 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
11 * rewrite to align with latest kernel
12 *
13 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
14 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
15 * rework for upstream merge
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/irq.h>
23#include <linux/platform_device.h>
24#include <linux/ata_platform.h>
25#include <linux/serial_8250.h>
26#include <linux/gpio.h>
27
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30
31#include <mach/pxa320.h>
32#include <mach/mxm8x10.h>
33
34#include "generic.h"
35
36/* IDE (PATA) Support */
37static struct pata_platform_info pata_platform_data = {
38 .ioport_shift = 1
39};
40
41static struct resource capc7117_ide_resources[] = {
42 [0] = {
43 .start = 0x11000020,
44 .end = 0x1100003f,
45 .flags = IORESOURCE_MEM
46 },
47 [1] = {
48 .start = 0x1100001c,
49 .end = 0x1100001c,
50 .flags = IORESOURCE_MEM
51 },
52 [2] = {
53 .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
54 .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO76)),
55 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING
56 }
57};
58
59static struct platform_device capc7117_ide_device = {
60 .name = "pata_platform",
61 .num_resources = ARRAY_SIZE(capc7117_ide_resources),
62 .resource = capc7117_ide_resources,
63 .dev = {
64 .platform_data = &pata_platform_data,
65 .coherent_dma_mask = ~0 /* grumble */
66 }
67};
68
69static void __init capc7117_ide_init(void)
70{
71 platform_device_register(&capc7117_ide_device);
72}
73
74/* TI16C752 UART support */
75#define TI16C752_FLAGS (UPF_BOOT_AUTOCONF | \
76 UPF_IOREMAP | \
77 UPF_BUGGY_UART | \
78 UPF_SKIP_TEST)
79#define TI16C752_UARTCLK (22118400)
80static struct plat_serial8250_port ti16c752_platform_data[] = {
81 [0] = {
82 .mapbase = 0x14000000,
83 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO78)),
84 .irqflags = IRQF_TRIGGER_RISING,
85 .flags = TI16C752_FLAGS,
86 .iotype = UPIO_MEM,
87 .regshift = 1,
88 .uartclk = TI16C752_UARTCLK
89 },
90 [1] = {
91 .mapbase = 0x14000040,
92 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO79)),
93 .irqflags = IRQF_TRIGGER_RISING,
94 .flags = TI16C752_FLAGS,
95 .iotype = UPIO_MEM,
96 .regshift = 1,
97 .uartclk = TI16C752_UARTCLK
98 },
99 [2] = {
100 .mapbase = 0x14000080,
101 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO80)),
102 .irqflags = IRQF_TRIGGER_RISING,
103 .flags = TI16C752_FLAGS,
104 .iotype = UPIO_MEM,
105 .regshift = 1,
106 .uartclk = TI16C752_UARTCLK
107 },
108 [3] = {
109 .mapbase = 0x140000c0,
110 .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO81)),
111 .irqflags = IRQF_TRIGGER_RISING,
112 .flags = TI16C752_FLAGS,
113 .iotype = UPIO_MEM,
114 .regshift = 1,
115 .uartclk = TI16C752_UARTCLK
116 },
117 [4] = {
118 /* end of array */
119 }
120};
121
122static struct platform_device ti16c752_device = {
123 .name = "serial8250",
124 .id = PLAT8250_DEV_PLATFORM,
125 .dev = {
126 .platform_data = ti16c752_platform_data
127 }
128};
129
130static void __init capc7117_uarts_init(void)
131{
132 platform_device_register(&ti16c752_device);
133}
134
135static void __init capc7117_init(void)
136{
137 /* Init CoM */
138 mxm_8x10_barebones_init();
139
140 /* Init evaluation board peripherals */
141 mxm_8x10_ac97_init();
142 mxm_8x10_usb_host_init();
143 mxm_8x10_mmc_init();
144
145 capc7117_uarts_init();
146 capc7117_ide_init();
147}
148
149MACHINE_START(CAPC7117,
150 "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM")
151 .phys_io = 0x40000000,
152 .boot_params = 0xa0000100,
153 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
154 .map_io = pxa_map_io,
155 .init_irq = pxa3xx_init_irq,
156 .timer = &pxa_timer,
157 .init_machine = capc7117_init
158MACHINE_END
diff --git a/arch/arm/mach-pxa/cm-x255.c b/arch/arm/mach-pxa/cm-x255.c
index 253fd76142d6..f1a7703d771b 100644
--- a/arch/arm/mach-pxa/cm-x255.c
+++ b/arch/arm/mach-pxa/cm-x255.c
@@ -50,26 +50,7 @@ static unsigned long cmx255_pin_config[] = {
50 GPIO47_STUART_TXD, 50 GPIO47_STUART_TXD,
51 51
52 /* LCD */ 52 /* LCD */
53 GPIO58_LCD_LDD_0, 53 GPIOxx_LCD_TFT_16BPP,
54 GPIO59_LCD_LDD_1,
55 GPIO60_LCD_LDD_2,
56 GPIO61_LCD_LDD_3,
57 GPIO62_LCD_LDD_4,
58 GPIO63_LCD_LDD_5,
59 GPIO64_LCD_LDD_6,
60 GPIO65_LCD_LDD_7,
61 GPIO66_LCD_LDD_8,
62 GPIO67_LCD_LDD_9,
63 GPIO68_LCD_LDD_10,
64 GPIO69_LCD_LDD_11,
65 GPIO70_LCD_LDD_12,
66 GPIO71_LCD_LDD_13,
67 GPIO72_LCD_LDD_14,
68 GPIO73_LCD_LDD_15,
69 GPIO74_LCD_FCLK,
70 GPIO75_LCD_LCLK,
71 GPIO76_LCD_PCLK,
72 GPIO77_LCD_BIAS,
73 54
74 /* SSP1 */ 55 /* SSP1 */
75 GPIO23_SSP1_SCLK, 56 GPIO23_SSP1_SCLK,
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index eea78b6c2bc5..a9926bb75922 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -71,26 +71,7 @@ static unsigned long cmx270_pin_config[] = {
71 GPIO111_MMC_DAT_3, 71 GPIO111_MMC_DAT_3,
72 72
73 /* LCD */ 73 /* LCD */
74 GPIO58_LCD_LDD_0, 74 GPIOxx_LCD_TFT_16BPP,
75 GPIO59_LCD_LDD_1,
76 GPIO60_LCD_LDD_2,
77 GPIO61_LCD_LDD_3,
78 GPIO62_LCD_LDD_4,
79 GPIO63_LCD_LDD_5,
80 GPIO64_LCD_LDD_6,
81 GPIO65_LCD_LDD_7,
82 GPIO66_LCD_LDD_8,
83 GPIO67_LCD_LDD_9,
84 GPIO68_LCD_LDD_10,
85 GPIO69_LCD_LDD_11,
86 GPIO70_LCD_LDD_12,
87 GPIO71_LCD_LDD_13,
88 GPIO72_LCD_LDD_14,
89 GPIO73_LCD_LDD_15,
90 GPIO74_LCD_FCLK,
91 GPIO75_LCD_LCLK,
92 GPIO76_LCD_PCLK,
93 GPIO77_LCD_BIAS,
94 75
95 /* I2C */ 76 /* I2C */
96 GPIO117_I2C_SCL, 77 GPIO117_I2C_SCL,
@@ -195,33 +176,57 @@ static struct resource cmx270_2700G_resource[] = {
195 }, 176 },
196}; 177};
197 178
198static unsigned long save_lcd_regs[10]; 179static unsigned long cmx270_marathon_on[] = {
180 GPIO58_GPIO,
181 GPIO59_GPIO,
182 GPIO60_GPIO,
183 GPIO61_GPIO,
184 GPIO62_GPIO,
185 GPIO63_GPIO,
186 GPIO64_GPIO,
187 GPIO65_GPIO,
188 GPIO66_GPIO,
189 GPIO67_GPIO,
190 GPIO68_GPIO,
191 GPIO69_GPIO,
192 GPIO70_GPIO,
193 GPIO71_GPIO,
194 GPIO72_GPIO,
195 GPIO73_GPIO,
196 GPIO74_GPIO,
197 GPIO75_GPIO,
198 GPIO76_GPIO,
199 GPIO77_GPIO,
200};
201
202static unsigned long cmx270_marathon_off[] = {
203 GPIOxx_LCD_TFT_16BPP,
204};
199 205
200static int cmx270_marathon_probe(struct fb_info *fb) 206static int cmx270_marathon_probe(struct fb_info *fb)
201{ 207{
202 /* save PXA-270 pin settings before enabling 2700G */ 208 int gpio, err;
203 save_lcd_regs[0] = GPDR1; 209
204 save_lcd_regs[1] = GPDR2; 210 for (gpio = 58; gpio <= 77; gpio++) {
205 save_lcd_regs[2] = GAFR1_U; 211 err = gpio_request(gpio, "LCD");
206 save_lcd_regs[3] = GAFR2_L; 212 if (err)
207 save_lcd_regs[4] = GAFR2_U; 213 return err;
208 214 gpio_direction_input(gpio);
209 /* Disable PXA-270 on-chip controller driving pins */ 215 }
210 GPDR1 &= ~(0xfc000000); 216
211 GPDR2 &= ~(0x00c03fff); 217 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_on));
212 GAFR1_U &= ~(0xfff00000);
213 GAFR2_L &= ~(0x0fffffff);
214 GAFR2_U &= ~(0x0000f000);
215 return 0; 218 return 0;
216} 219}
217 220
218static int cmx270_marathon_remove(struct fb_info *fb) 221static int cmx270_marathon_remove(struct fb_info *fb)
219{ 222{
220 GPDR1 = save_lcd_regs[0]; 223 int gpio;
221 GPDR2 = save_lcd_regs[1]; 224
222 GAFR1_U = save_lcd_regs[2]; 225 pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_marathon_off));
223 GAFR2_L = save_lcd_regs[3]; 226
224 GAFR2_U = save_lcd_regs[4]; 227 for (gpio = 58; gpio <= 77; gpio++)
228 gpio_free(gpio);
229
225 return 0; 230 return 0;
226} 231}
227 232
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 7873fa3d8fa4..161fc2d61207 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -59,7 +59,7 @@ void __init cmx2xx_pci_adjust_zones(int node, unsigned long *zone_size,
59static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 59static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
60{ 60{
61 /* clear our parent irq */ 61 /* clear our parent irq */
62 GEDR(cmx2xx_it8152_irq_gpio) = GPIO_bit(cmx2xx_it8152_irq_gpio); 62 desc->chip->ack(irq);
63 63
64 it8152_irq_demux(irq, desc); 64 it8152_irq_demux(irq, desc);
65} 65}
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index 94b23a9e3877..d578021d1a10 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -134,6 +134,12 @@ static unsigned long e740_pin_config[] __initdata = {
134 /* IrDA */ 134 /* IrDA */
135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 135 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
136 136
137 /* AC97 */
138 GPIO28_AC97_BITCLK,
139 GPIO29_AC97_SDATA_IN_0,
140 GPIO30_AC97_SDATA_OUT,
141 GPIO31_AC97_SYNC,
142
137 /* Audio power control */ 143 /* Audio power control */
138 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */ 144 GPIO16_GPIO, /* AC97 codec AVDD2 supply (analogue power) */
139 GPIO40_GPIO, /* Mic amp power */ 145 GPIO40_GPIO, /* Mic amp power */
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 5eccbce73a33..af83caa52dd4 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -132,6 +132,12 @@ static unsigned long e750_pin_config[] __initdata = {
132 /* IrDA */ 132 /* IrDA */
133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH, 133 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
134 134
135 /* AC97 */
136 GPIO28_AC97_BITCLK,
137 GPIO29_AC97_SDATA_IN_0,
138 GPIO30_AC97_SDATA_OUT,
139 GPIO31_AC97_SYNC,
140
135 /* Audio power control */ 141 /* Audio power control */
136 GPIO4_GPIO, /* Headphone amp power */ 142 GPIO4_GPIO, /* Headphone amp power */
137 GPIO7_GPIO, /* Speaker amp power */ 143 GPIO7_GPIO, /* Speaker amp power */
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index aad129bed199..8ea97bf53fe1 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -35,6 +35,14 @@
35 35
36/* ------------------------ e800 LCD definitions ------------------------- */ 36/* ------------------------ e800 LCD definitions ------------------------- */
37 37
38static unsigned long e800_pin_config[] __initdata = {
39 /* AC97 */
40 GPIO28_AC97_BITCLK,
41 GPIO29_AC97_SDATA_IN_0,
42 GPIO30_AC97_SDATA_OUT,
43 GPIO31_AC97_SYNC,
44};
45
38static struct w100_gen_regs e800_lcd_regs = { 46static struct w100_gen_regs e800_lcd_regs = {
39 .lcd_format = 0x00008003, 47 .lcd_format = 0x00008003,
40 .lcdd_cntl1 = 0x02a00000, 48 .lcdd_cntl1 = 0x02a00000,
@@ -195,6 +203,7 @@ static struct platform_device *devices[] __initdata = {
195 203
196static void __init e800_init(void) 204static void __init e800_init(void)
197{ 205{
206 pxa2xx_mfp_config(ARRAY_AND_SIZE(e800_pin_config));
198 pxa_set_ffuart_info(NULL); 207 pxa_set_ffuart_info(NULL);
199 pxa_set_btuart_info(NULL); 208 pxa_set_btuart_info(NULL);
200 pxa_set_stuart_info(NULL); 209 pxa_set_stuart_info(NULL);
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index c8a01bc85fde..aab04f33e49b 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -109,26 +109,7 @@ static unsigned long common_pin_config[] = {
109 GPIO111_MMC_DAT_3, 109 GPIO111_MMC_DAT_3,
110 110
111 /* LCD */ 111 /* LCD */
112 GPIO58_LCD_LDD_0, 112 GPIOxx_LCD_TFT_16BPP,
113 GPIO59_LCD_LDD_1,
114 GPIO60_LCD_LDD_2,
115 GPIO61_LCD_LDD_3,
116 GPIO62_LCD_LDD_4,
117 GPIO63_LCD_LDD_5,
118 GPIO64_LCD_LDD_6,
119 GPIO65_LCD_LDD_7,
120 GPIO66_LCD_LDD_8,
121 GPIO67_LCD_LDD_9,
122 GPIO68_LCD_LDD_10,
123 GPIO69_LCD_LDD_11,
124 GPIO70_LCD_LDD_12,
125 GPIO71_LCD_LDD_13,
126 GPIO72_LCD_LDD_14,
127 GPIO73_LCD_LDD_15,
128 GPIO74_LCD_FCLK,
129 GPIO75_LCD_LCLK,
130 GPIO76_LCD_PCLK,
131 GPIO77_LCD_BIAS,
132 113
133 /* QCI */ 114 /* QCI */
134 GPIO84_CIF_FV, 115 GPIO84_CIF_FV,
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
new file mode 100644
index 000000000000..771137fc1a82
--- /dev/null
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -0,0 +1,202 @@
1/*
2 * linux/arch/arm/mach-pxa/icontrol.c
3 *
4 * Support for the iControl and SafeTcam platforms from TMT Services
5 * using the Embedian MXM-8x10 Computer on Module
6 *
7 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
8 *
9 * 2010-01-21 Hennie van der Merve <hvdmerwe@tmtservies.co.za>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/irq.h>
17#include <linux/platform_device.h>
18#include <linux/gpio.h>
19
20#include <asm/mach-types.h>
21#include <asm/mach/arch.h>
22
23#include <mach/pxa320.h>
24#include <mach/mxm8x10.h>
25
26#include <linux/spi/spi.h>
27#include <mach/pxa2xx_spi.h>
28#include <linux/can/platform/mcp251x.h>
29
30#include "generic.h"
31
32#define ICONTROL_MCP251x_nCS1 (15)
33#define ICONTROL_MCP251x_nCS2 (16)
34#define ICONTROL_MCP251x_nCS3 (17)
35#define ICONTROL_MCP251x_nCS4 (24)
36
37#define ICONTROL_MCP251x_nIRQ1 (74)
38#define ICONTROL_MCP251x_nIRQ2 (75)
39#define ICONTROL_MCP251x_nIRQ3 (76)
40#define ICONTROL_MCP251x_nIRQ4 (77)
41
42static struct pxa2xx_spi_chip mcp251x_chip_info1 = {
43 .tx_threshold = 8,
44 .rx_threshold = 128,
45 .dma_burst_size = 8,
46 .timeout = 235,
47 .gpio_cs = ICONTROL_MCP251x_nCS1
48};
49
50static struct pxa2xx_spi_chip mcp251x_chip_info2 = {
51 .tx_threshold = 8,
52 .rx_threshold = 128,
53 .dma_burst_size = 8,
54 .timeout = 235,
55 .gpio_cs = ICONTROL_MCP251x_nCS2
56};
57
58static struct pxa2xx_spi_chip mcp251x_chip_info3 = {
59 .tx_threshold = 8,
60 .rx_threshold = 128,
61 .dma_burst_size = 8,
62 .timeout = 235,
63 .gpio_cs = ICONTROL_MCP251x_nCS3
64};
65
66static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
67 .tx_threshold = 8,
68 .rx_threshold = 128,
69 .dma_burst_size = 8,
70 .timeout = 235,
71 .gpio_cs = ICONTROL_MCP251x_nCS4
72};
73
74static struct mcp251x_platform_data mcp251x_info = {
75 .oscillator_frequency = 16E6,
76 .model = CAN_MCP251X_MCP2515,
77 .board_specific_setup = NULL,
78 .power_enable = NULL,
79 .transceiver_enable = NULL
80};
81
82static struct spi_board_info mcp251x_board_info[] = {
83 {
84 .modalias = "mcp251x",
85 .max_speed_hz = 6500000,
86 .bus_num = 3,
87 .chip_select = 0,
88 .platform_data = &mcp251x_info,
89 .controller_data = &mcp251x_chip_info1,
90 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ1)
91 },
92 {
93 .modalias = "mcp251x",
94 .max_speed_hz = 6500000,
95 .bus_num = 3,
96 .chip_select = 1,
97 .platform_data = &mcp251x_info,
98 .controller_data = &mcp251x_chip_info2,
99 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ2)
100 },
101 {
102 .modalias = "mcp251x",
103 .max_speed_hz = 6500000,
104 .bus_num = 4,
105 .chip_select = 0,
106 .platform_data = &mcp251x_info,
107 .controller_data = &mcp251x_chip_info3,
108 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ3)
109 },
110 {
111 .modalias = "mcp251x",
112 .max_speed_hz = 6500000,
113 .bus_num = 4,
114 .chip_select = 1,
115 .platform_data = &mcp251x_info,
116 .controller_data = &mcp251x_chip_info4,
117 .irq = gpio_to_irq(ICONTROL_MCP251x_nIRQ4)
118 }
119};
120
121static struct pxa2xx_spi_master pxa_ssp3_spi_master_info = {
122 .clock_enable = CKEN_SSP3,
123 .num_chipselect = 2,
124 .enable_dma = 1
125};
126
127static struct pxa2xx_spi_master pxa_ssp4_spi_master_info = {
128 .clock_enable = CKEN_SSP4,
129 .num_chipselect = 2,
130 .enable_dma = 1
131};
132
133struct platform_device pxa_spi_ssp3 = {
134 .name = "pxa2xx-spi",
135 .id = 3,
136 .dev = {
137 .platform_data = &pxa_ssp3_spi_master_info,
138 }
139};
140
141struct platform_device pxa_spi_ssp4 = {
142 .name = "pxa2xx-spi",
143 .id = 4,
144 .dev = {
145 .platform_data = &pxa_ssp4_spi_master_info,
146 }
147};
148
149static struct platform_device *icontrol_spi_devices[] __initdata = {
150 &pxa_spi_ssp3,
151 &pxa_spi_ssp4,
152};
153
154static mfp_cfg_t mfp_can_cfg[] __initdata = {
155 /* CAN CS lines */
156 GPIO15_GPIO,
157 GPIO16_GPIO,
158 GPIO17_GPIO,
159 GPIO24_GPIO,
160
161 /* SPI (SSP3) lines */
162 GPIO89_SSP3_SCLK,
163 GPIO91_SSP3_TXD,
164 GPIO92_SSP3_RXD,
165
166 /* SPI (SSP4) lines */
167 GPIO93_SSP4_SCLK,
168 GPIO95_SSP4_TXD,
169 GPIO96_SSP4_RXD,
170
171 /* CAN nIRQ lines */
172 GPIO74_GPIO | MFP_LPM_EDGE_RISE,
173 GPIO75_GPIO | MFP_LPM_EDGE_RISE,
174 GPIO76_GPIO | MFP_LPM_EDGE_RISE,
175 GPIO77_GPIO | MFP_LPM_EDGE_RISE
176};
177
178static void __init icontrol_can_init(void)
179{
180 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_can_cfg));
181 platform_add_devices(ARRAY_AND_SIZE(icontrol_spi_devices));
182 spi_register_board_info(ARRAY_AND_SIZE(mcp251x_board_info));
183}
184
185static void __init icontrol_init(void)
186{
187 mxm_8x10_barebones_init();
188 mxm_8x10_usb_host_init();
189 mxm_8x10_mmc_init();
190
191 icontrol_can_init();
192}
193
194MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
195 .phys_io = 0x40000000,
196 .boot_params = 0xa0000100,
197 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
198 .map_io = pxa_map_io,
199 .init_irq = pxa3xx_init_irq,
200 .timer = &pxa_timer,
201 .init_machine = icontrol_init
202MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 5c9e11d74f49..bc78c4dc0c66 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -47,25 +47,7 @@
47 47
48static unsigned long idp_pin_config[] __initdata = { 48static unsigned long idp_pin_config[] __initdata = {
49 /* LCD */ 49 /* LCD */
50 GPIO58_LCD_LDD_0, 50 GPIOxx_LCD_DSTN_16BPP,
51 GPIO59_LCD_LDD_1,
52 GPIO60_LCD_LDD_2,
53 GPIO61_LCD_LDD_3,
54 GPIO62_LCD_LDD_4,
55 GPIO63_LCD_LDD_5,
56 GPIO64_LCD_LDD_6,
57 GPIO65_LCD_LDD_7,
58 GPIO66_LCD_LDD_8,
59 GPIO67_LCD_LDD_9,
60 GPIO68_LCD_LDD_10,
61 GPIO69_LCD_LDD_11,
62 GPIO70_LCD_LDD_12,
63 GPIO71_LCD_LDD_13,
64 GPIO72_LCD_LDD_14,
65 GPIO73_LCD_LDD_15,
66 GPIO74_LCD_FCLK,
67 GPIO75_LCD_LCLK,
68 GPIO76_LCD_PCLK,
69 51
70 /* BTUART */ 52 /* BTUART */
71 GPIO42_BTUART_RXD, 53 GPIO42_BTUART_RXD,
diff --git a/arch/arm/mach-pxa/imote2.c b/arch/arm/mach-pxa/imote2.c
index 5b0862df61ab..b2f878bd460b 100644
--- a/arch/arm/mach-pxa/imote2.c
+++ b/arch/arm/mach-pxa/imote2.c
@@ -64,7 +64,6 @@ static unsigned long imote2_pin_config[] __initdata = {
64 GPIO116_GPIO, /* CC_CCA */ 64 GPIO116_GPIO, /* CC_CCA */
65 GPIO0_GPIO, /* CC_FIFOP */ 65 GPIO0_GPIO, /* CC_FIFOP */
66 GPIO16_GPIO, /* CCSFD */ 66 GPIO16_GPIO, /* CCSFD */
67 GPIO39_GPIO, /* CSn */
68 GPIO115_GPIO, /* Power enable */ 67 GPIO115_GPIO, /* Power enable */
69 68
70 /* I2C */ 69 /* I2C */
@@ -72,7 +71,7 @@ static unsigned long imote2_pin_config[] __initdata = {
72 GPIO118_I2C_SDA, 71 GPIO118_I2C_SDA,
73 72
74 /* SSP 3 - 802.15.4 radio */ 73 /* SSP 3 - 802.15.4 radio */
75 GPIO39_GPIO, /* Chip Select */ 74 GPIO39_GPIO, /* Chip Select */
76 GPIO34_SSP3_SCLK, 75 GPIO34_SSP3_SCLK,
77 GPIO35_SSP3_TXD, 76 GPIO35_SSP3_TXD,
78 GPIO41_SSP3_RXD, 77 GPIO41_SSP3_RXD,
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index bfec09b1814b..1a741065045f 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -129,6 +129,16 @@ enum balloon3_features {
129#define CPLD_AROUTING_LOONR2INT_BIT 6 129#define CPLD_AROUTING_LOONR2INT_BIT 6
130#define CPLD_AROUTING_LOONR2EXT_BIT 7 130#define CPLD_AROUTING_LOONR2EXT_BIT 7
131 131
132/* Balloon3 Interrupts */
133#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
134
135#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
136#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
137
138#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
139#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
140#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
141
132extern int balloon3_has(enum balloon3_features feature); 142extern int balloon3_has(enum balloon3_features feature);
133 143
134#endif 144#endif
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h
index e741bf1bfb2d..7515757d6911 100644
--- a/arch/arm/mach-pxa/include/mach/hardware.h
+++ b/arch/arm/mach-pxa/include/mach/hardware.h
@@ -314,7 +314,6 @@ extern unsigned long get_clock_tick_rate(void);
314#define PCIBIOS_MIN_IO 0 314#define PCIBIOS_MIN_IO 0
315#define PCIBIOS_MIN_MEM 0 315#define PCIBIOS_MIN_MEM 0
316#define pcibios_assign_all_busses() 1 316#define pcibios_assign_all_busses() 1
317#define HAVE_ARCH_PCI_SET_DMA_MASK 1
318#endif 317#endif
319 318
320 319
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h
index 3677a9af9c87..ffc8314520f2 100644
--- a/arch/arm/mach-pxa/include/mach/irqs.h
+++ b/arch/arm/mach-pxa/include/mach/irqs.h
@@ -135,82 +135,6 @@
135#define IRQ_BOARD_END (IRQ_BOARD_START + 16) 135#define IRQ_BOARD_END (IRQ_BOARD_START + 16)
136#endif 136#endif
137 137
138#define IRQ_SA1111_START (IRQ_BOARD_END)
139#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
140#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
141#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
142#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
143#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
144#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
145#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
146#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
147#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
148#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
149#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
150#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
151#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
152#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
153#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
154#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
155#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
156#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
157#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
158#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
159#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
160#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
161#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
162#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
163#define SSPXMTINT (IRQ_BOARD_END + 24)
164#define SSPRCVINT (IRQ_BOARD_END + 25)
165#define SSPROR (IRQ_BOARD_END + 26)
166#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
167#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
168#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
169#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
170#define AUDTFSR (IRQ_BOARD_END + 36)
171#define AUDRFSR (IRQ_BOARD_END + 37)
172#define AUDTUR (IRQ_BOARD_END + 38)
173#define AUDROR (IRQ_BOARD_END + 39)
174#define AUDDTS (IRQ_BOARD_END + 40)
175#define AUDRDD (IRQ_BOARD_END + 41)
176#define AUDSTO (IRQ_BOARD_END + 42)
177#define IRQ_USBPWR (IRQ_BOARD_END + 43)
178#define IRQ_HCIM (IRQ_BOARD_END + 44)
179#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
180#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
181#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
182#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
183#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
184#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
185#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
186#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
187#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
188#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
189
190#define IRQ_LOCOMO_START (IRQ_BOARD_END)
191#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
192#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
193#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
194#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
195#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
196#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
197#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
198#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
199#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
200#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
201#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
202#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
203#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
204#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
205#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
206#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
207#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
208#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
209#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
210#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
211#define IRQ_LOCOMO_SPI_OVRN (IRQ_BOARD_END + 20)
212#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
213
214/* 138/*
215 * Figure out the MAX IRQ number. 139 * Figure out the MAX IRQ number.
216 * 140 *
@@ -219,89 +143,16 @@
219 * Otherwise, we have the standard IRQs only. 143 * Otherwise, we have the standard IRQs only.
220 */ 144 */
221#ifdef CONFIG_SA1111 145#ifdef CONFIG_SA1111
222#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) 146#define NR_IRQS (IRQ_BOARD_END + 55)
223#elif defined(CONFIG_SHARP_LOCOMO)
224#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1)
225#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS) 147#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
226#define NR_IRQS (IRQ_BOARD_END) 148#define NR_IRQS (IRQ_BOARD_END)
227#else 149#else
228#define NR_IRQS (IRQ_BOARD_START) 150#define NR_IRQS (IRQ_BOARD_START)
229#endif 151#endif
230 152
231/*
232 * Board specific IRQs. Define them here.
233 * Do not surround them with ifdefs.
234 */
235#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
236#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
237#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
238#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
239#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
240#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
241#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
242#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
243#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
244
245#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
246#define LPD270_USBC_IRQ LPD270_IRQ(2)
247#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
248#define LPD270_AC97_IRQ LPD270_IRQ(4)
249
250#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
251#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
252#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
253#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
254#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
255#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
256#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
257#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
258#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
259#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
260#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
261#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
262#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
263#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
264#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
265
266/* Balloon3 Interrupts */
267#define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
268
269#define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
270#define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
271
272#define BALLOON3_AUX_NIRQ IRQ_GPIO(BALLOON3_GPIO_AUX_NIRQ)
273#define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
274#define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD)
275
276/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
277#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
278#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
279#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
280#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
281
282/* phyCORE-PXA270 (PCM027) Interrupts */
283#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
284#define PCM027_BTDET_IRQ PCM027_IRQ(0)
285#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
286#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
287#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
288
289/* ITE8152 irqs */
290/* add IT8152 IRQs beyond BOARD_END */ 153/* add IT8152 IRQs beyond BOARD_END */
291#ifdef CONFIG_PCI_HOST_ITE8152 154#ifdef CONFIG_PCI_HOST_ITE8152
292#define IT8152_IRQ(x) (IRQ_BOARD_END + (x)) 155#define IT8152_LAST_IRQ (IRQ_BOARD_END + 40)
293
294/* IRQ-sources in 3 groups - local devices, LPC (serial), and external PCI */
295#define IT8152_LD_IRQ_COUNT 9
296#define IT8152_LP_IRQ_COUNT 16
297#define IT8152_PD_IRQ_COUNT 15
298
299/* Priorities: */
300#define IT8152_PD_IRQ(i) IT8152_IRQ(i)
301#define IT8152_LP_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT)
302#define IT8152_LD_IRQ(i) (IT8152_IRQ(i) + IT8152_PD_IRQ_COUNT + IT8152_LP_IRQ_COUNT)
303
304#define IT8152_LAST_IRQ IT8152_LD_IRQ(IT8152_LD_IRQ_COUNT - 1)
305 156
306#if NR_IRQS < (IT8152_LAST_IRQ+1) 157#if NR_IRQS < (IT8152_LAST_IRQ+1)
307#undef NR_IRQS 158#undef NR_IRQS
diff --git a/arch/arm/mach-pxa/include/mach/lpd270.h b/arch/arm/mach-pxa/include/mach/lpd270.h
index f89fb715266b..0e6440c81683 100644
--- a/arch/arm/mach-pxa/include/mach/lpd270.h
+++ b/arch/arm/mach-pxa/include/mach/lpd270.h
@@ -34,5 +34,9 @@
34#define LPD270_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */ 34#define LPD270_INT_ETHERNET (1 << 3) /* Ethernet controller IRQ */
35#define LPD270_INT_USBC (1 << 2) /* USB client cable detection IRQ */ 35#define LPD270_INT_USBC (1 << 2) /* USB client cable detection IRQ */
36 36
37#define LPD270_IRQ(x) (IRQ_BOARD_START + (x))
38#define LPD270_USBC_IRQ LPD270_IRQ(2)
39#define LPD270_ETHERNET_IRQ LPD270_IRQ(3)
40#define LPD270_AC97_IRQ LPD270_IRQ(4)
37 41
38#endif 42#endif
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h
index 751b74811d0f..a0d4247f08fc 100644
--- a/arch/arm/mach-pxa/include/mach/lubbock.h
+++ b/arch/arm/mach-pxa/include/mach/lubbock.h
@@ -34,6 +34,17 @@
34#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0) 34#define LUB_IRQ_SET_CLR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x0d0)
35#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100) 35#define LUB_GP __LUB_REG(LUBBOCK_FPGA_PHYS + 0x100)
36 36
37/* Board specific IRQs */
38#define LUBBOCK_IRQ(x) (IRQ_BOARD_START + (x))
39#define LUBBOCK_SD_IRQ LUBBOCK_IRQ(0)
40#define LUBBOCK_SA1111_IRQ LUBBOCK_IRQ(1)
41#define LUBBOCK_USB_IRQ LUBBOCK_IRQ(2) /* usb connect */
42#define LUBBOCK_ETH_IRQ LUBBOCK_IRQ(3)
43#define LUBBOCK_UCB1400_IRQ LUBBOCK_IRQ(4)
44#define LUBBOCK_BB_IRQ LUBBOCK_IRQ(5)
45#define LUBBOCK_USB_DISC_IRQ LUBBOCK_IRQ(6) /* usb disconnect */
46#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
47
37#ifndef __ASSEMBLY__ 48#ifndef __ASSEMBLY__
38extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set); 49extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
39#endif 50#endif
diff --git a/arch/arm/mach-pxa/include/mach/mainstone.h b/arch/arm/mach-pxa/include/mach/mainstone.h
index 3461c4302ff4..86e623abd64d 100644
--- a/arch/arm/mach-pxa/include/mach/mainstone.h
+++ b/arch/arm/mach-pxa/include/mach/mainstone.h
@@ -117,4 +117,21 @@
117#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */ 117#define MST_PCMCIA_PWR_VCC_33 0x8 /* voltage VCC = 3.3V */
118#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */ 118#define MST_PCMCIA_PWR_VCC_50 0x4 /* voltage VCC = 5.0V */
119 119
120/* board specific IRQs */
121#define MAINSTONE_IRQ(x) (IRQ_BOARD_START + (x))
122#define MAINSTONE_MMC_IRQ MAINSTONE_IRQ(0)
123#define MAINSTONE_USIM_IRQ MAINSTONE_IRQ(1)
124#define MAINSTONE_USBC_IRQ MAINSTONE_IRQ(2)
125#define MAINSTONE_ETHERNET_IRQ MAINSTONE_IRQ(3)
126#define MAINSTONE_AC97_IRQ MAINSTONE_IRQ(4)
127#define MAINSTONE_PEN_IRQ MAINSTONE_IRQ(5)
128#define MAINSTONE_MSINS_IRQ MAINSTONE_IRQ(6)
129#define MAINSTONE_EXBRD_IRQ MAINSTONE_IRQ(7)
130#define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9)
131#define MAINSTONE_S0_STSCHG_IRQ MAINSTONE_IRQ(10)
132#define MAINSTONE_S0_IRQ MAINSTONE_IRQ(11)
133#define MAINSTONE_S1_CD_IRQ MAINSTONE_IRQ(13)
134#define MAINSTONE_S1_STSCHG_IRQ MAINSTONE_IRQ(14)
135#define MAINSTONE_S1_IRQ MAINSTONE_IRQ(15)
136
120#endif 137#endif
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
index 9c787855cf24..cafadc33dfd8 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa25x.h
@@ -190,4 +190,36 @@
190#define GPIO89_AC97_nRESET MFP_CFG_OUT(GPIO89, AF0, DRIVE_HIGH) 190#define GPIO89_AC97_nRESET MFP_CFG_OUT(GPIO89, AF0, DRIVE_HIGH)
191#endif /* CONFIG_CPU_PXA26x */ 191#endif /* CONFIG_CPU_PXA26x */
192 192
193/* commonly used pin configurations */
194#define GPIOxx_LCD_16BPP \
195 GPIO58_LCD_LDD_0, \
196 GPIO59_LCD_LDD_1, \
197 GPIO60_LCD_LDD_2, \
198 GPIO61_LCD_LDD_3, \
199 GPIO62_LCD_LDD_4, \
200 GPIO63_LCD_LDD_5, \
201 GPIO64_LCD_LDD_6, \
202 GPIO65_LCD_LDD_7, \
203 GPIO66_LCD_LDD_8, \
204 GPIO67_LCD_LDD_9, \
205 GPIO68_LCD_LDD_10, \
206 GPIO69_LCD_LDD_11, \
207 GPIO70_LCD_LDD_12, \
208 GPIO71_LCD_LDD_13, \
209 GPIO72_LCD_LDD_14, \
210 GPIO73_LCD_LDD_15
211
212#define GPIOxx_LCD_DSTN_16BPP \
213 GPIOxx_LCD_16BPP, \
214 GPIO74_LCD_FCLK, \
215 GPIO75_LCD_LCLK, \
216 GPIO76_LCD_PCLK
217
218#define GPIOxx_LCD_TFT_16BPP \
219 GPIOxx_LCD_16BPP, \
220 GPIO74_LCD_FCLK, \
221 GPIO75_LCD_LCLK, \
222 GPIO76_LCD_PCLK, \
223 GPIO77_LCD_BIAS
224
193#endif /* __ASM_ARCH_MFP_PXA25X_H */ 225#endif /* __ASM_ARCH_MFP_PXA25X_H */
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index 6543c05f47ed..ec0f0b0b6744 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -434,5 +434,32 @@
434#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2) 434#define GPIO112_nMSINS MFP_CFG_IN(GPIO112, AF2)
435#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW) 435#define GPIO32_MSSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
436 436
437/* commonly used pin configurations */
438#define GPIOxx_LCD_16BPP \
439 GPIO58_LCD_LDD_0, \
440 GPIO59_LCD_LDD_1, \
441 GPIO60_LCD_LDD_2, \
442 GPIO61_LCD_LDD_3, \
443 GPIO62_LCD_LDD_4, \
444 GPIO63_LCD_LDD_5, \
445 GPIO64_LCD_LDD_6, \
446 GPIO65_LCD_LDD_7, \
447 GPIO66_LCD_LDD_8, \
448 GPIO67_LCD_LDD_9, \
449 GPIO68_LCD_LDD_10, \
450 GPIO69_LCD_LDD_11, \
451 GPIO70_LCD_LDD_12, \
452 GPIO71_LCD_LDD_13, \
453 GPIO72_LCD_LDD_14, \
454 GPIO73_LCD_LDD_15
455
456#define GPIOxx_LCD_TFT_16BPP \
457 GPIOxx_LCD_16BPP, \
458 GPIO74_LCD_FCLK, \
459 GPIO75_LCD_LCLK, \
460 GPIO76_LCD_PCLK, \
461 GPIO77_LCD_BIAS
462
463
437extern int keypad_set_wake(unsigned int on); 464extern int keypad_set_wake(unsigned int on);
438#endif /* __ASM_ARCH_MFP_PXA27X_H */ 465#endif /* __ASM_ARCH_MFP_PXA27X_H */
diff --git a/arch/arm/mach-pxa/include/mach/mxm8x10.h b/arch/arm/mach-pxa/include/mach/mxm8x10.h
new file mode 100644
index 000000000000..ffa15665a418
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/mxm8x10.h
@@ -0,0 +1,21 @@
1#ifndef __MACH_MXM_8X10_H
2#define __MACH_MXM_8X10_H
3
4#define MXM_8X10_ETH_PHYS 0x13000000
5
6#if defined(CONFIG_MMC)
7
8#define MXM_8X10_SD_nCD (72)
9#define MXM_8X10_SD_WP (84)
10
11extern void mxm_8x10_mmc_init(void);
12#else
13static inline void mxm_8x10_mmc_init(void) {}
14#endif
15
16extern void mxm_8x10_usb_host_init(void);
17extern void mxm_8x10_ac97_init(void);
18
19extern void mxm_8x10_barebones_init(void);
20
21#endif /* __MACH_MXM_8X10_H */
diff --git a/arch/arm/mach-pxa/include/mach/pcm027.h b/arch/arm/mach-pxa/include/mach/pcm027.h
index 4dcd2e8baa61..04083263167e 100644
--- a/arch/arm/mach-pxa/include/mach/pcm027.h
+++ b/arch/arm/mach-pxa/include/mach/pcm027.h
@@ -23,6 +23,13 @@
23 * Definitions of CPU card resources only 23 * Definitions of CPU card resources only
24 */ 24 */
25 25
26/* phyCORE-PXA270 (PCM027) Interrupts */
27#define PCM027_IRQ(x) (IRQ_BOARD_START + (x))
28#define PCM027_BTDET_IRQ PCM027_IRQ(0)
29#define PCM027_FF_RI_IRQ PCM027_IRQ(1)
30#define PCM027_MMCDET_IRQ PCM027_IRQ(2)
31#define PCM027_PM_5V_IRQ PCM027_IRQ(3)
32
26/* I2C RTC */ 33/* I2C RTC */
27#define PCM027_RTC_IRQ_GPIO 0 34#define PCM027_RTC_IRQ_GPIO 0
28#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO) 35#define PCM027_RTC_IRQ IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
diff --git a/arch/arm/mach-pxa/include/mach/ssp.h b/arch/arm/mach-pxa/include/mach/ssp.h
index cb5cb766f0f1..be1be5b6db51 100644
--- a/arch/arm/mach-pxa/include/mach/ssp.h
+++ b/arch/arm/mach-pxa/include/mach/ssp.h
@@ -46,6 +46,7 @@ struct ssp_device {
46 int drcmr_tx; 46 int drcmr_tx;
47}; 47};
48 48
49#ifdef CONFIG_PXA_SSP_LEGACY
49/* 50/*
50 * SSP initialisation flags 51 * SSP initialisation flags
51 */ 52 */
@@ -78,6 +79,7 @@ void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp);
78int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); 79int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags);
79int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); 80int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed);
80void ssp_exit(struct ssp_dev *dev); 81void ssp_exit(struct ssp_dev *dev);
82#endif /* CONFIG_PXA_SSP_LEGACY */
81 83
82/** 84/**
83 * ssp_write_reg - Write to a SSP register 85 * ssp_write_reg - Write to a SSP register
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 237734b5b1be..5ef91d9d17e4 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -10,20 +10,41 @@
10 */ 10 */
11 11
12#include <linux/serial_reg.h> 12#include <linux/serial_reg.h>
13#include <mach/regs-uart.h>
14#include <asm/mach-types.h> 13#include <asm/mach-types.h>
15 14
16#define __REG(x) ((volatile unsigned long *)x) 15#define FFUART_BASE (0x40100000)
16#define BTUART_BASE (0x40200000)
17#define STUART_BASE (0x40700000)
17 18
18static volatile unsigned long *UART = FFUART; 19static unsigned long uart_base = FFUART_BASE;
20static unsigned int uart_shift = 2;
21static unsigned int uart_is_pxa = 1;
22
23static inline unsigned char uart_read(int offset)
24{
25 return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
26}
27
28static inline void uart_write(unsigned char val, int offset)
29{
30 *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
31}
32
33static inline int uart_is_enabled(void)
34{
35 /* assume enabled by default for non-PXA uarts */
36 return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
37}
19 38
20static inline void putc(char c) 39static inline void putc(char c)
21{ 40{
22 if (!(UART[UART_IER] & IER_UUE)) 41 if (!uart_is_enabled())
23 return; 42 return;
24 while (!(UART[UART_LSR] & LSR_TDRQ)) 43
44 while (!(uart_read(UART_LSR) & UART_LSR_THRE))
25 barrier(); 45 barrier();
26 UART[UART_TX] = c; 46
47 uart_write(c, UART_TX);
27} 48}
28 49
29/* 50/*
@@ -38,7 +59,13 @@ static inline void arch_decomp_setup(void)
38 if (machine_is_littleton() || machine_is_intelmote2() 59 if (machine_is_littleton() || machine_is_intelmote2()
39 || machine_is_csb726() || machine_is_stargate2() 60 || machine_is_csb726() || machine_is_stargate2()
40 || machine_is_cm_x300() || machine_is_balloon3()) 61 || machine_is_cm_x300() || machine_is_balloon3())
41 UART = STUART; 62 uart_base = STUART_BASE;
63
64 if (machine_is_arcom_zeus()) {
65 uart_base = 0x10000000; /* nCS4 */
66 uart_shift = 1;
67 uart_is_pxa = 0;
68 }
42} 69}
43 70
44/* 71/*
diff --git a/arch/arm/mach-pxa/include/mach/zeus.h b/arch/arm/mach-pxa/include/mach/zeus.h
index c387046d2f28..6e119976003e 100644
--- a/arch/arm/mach-pxa/include/mach/zeus.h
+++ b/arch/arm/mach-pxa/include/mach/zeus.h
@@ -58,6 +58,8 @@
58#define ZEUS_EXT1_GPIO(x) (ZEUS_EXT1_GPIO_BASE + (x)) 58#define ZEUS_EXT1_GPIO(x) (ZEUS_EXT1_GPIO_BASE + (x))
59#define ZEUS_USER_GPIO(x) (ZEUS_USER_GPIO_BASE + (x)) 59#define ZEUS_USER_GPIO(x) (ZEUS_USER_GPIO_BASE + (x))
60 60
61#define ZEUS_CAN_SHDN_GPIO ZEUS_EXT1_GPIO(2)
62
61/* 63/*
62 * CPLD registers: 64 * CPLD registers:
63 * Only 4 registers, but spreaded over a 32MB address space. 65 * Only 4 registers, but spreaded over a 32MB address space.
@@ -68,7 +70,6 @@
68#define ZEUS_CPLD_VERSION (ZEUS_CPLD + 0x0000) 70#define ZEUS_CPLD_VERSION (ZEUS_CPLD + 0x0000)
69#define ZEUS_CPLD_ISA_IRQ (ZEUS_CPLD + 0x1000) 71#define ZEUS_CPLD_ISA_IRQ (ZEUS_CPLD + 0x1000)
70#define ZEUS_CPLD_CONTROL (ZEUS_CPLD + 0x2000) 72#define ZEUS_CPLD_CONTROL (ZEUS_CPLD + 0x2000)
71#define ZEUS_CPLD_EXTWDOG (ZEUS_CPLD + 0x3000)
72 73
73/* CPLD register bits */ 74/* CPLD register bits */
74#define ZEUS_CPLD_CONTROL_CF_RST 0x01 75#define ZEUS_CPLD_CONTROL_CF_RST 0x01
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 1373c22dbb83..d279507fc748 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -83,6 +83,10 @@ static unsigned long lpd270_pin_config[] __initdata = {
83 GPIO89_USBH1_PEN, 83 GPIO89_USBH1_PEN,
84 84
85 /* AC97 */ 85 /* AC97 */
86 GPIO28_AC97_BITCLK,
87 GPIO29_AC97_SDATA_IN_0,
88 GPIO30_AC97_SDATA_OUT,
89 GPIO31_AC97_SYNC,
86 GPIO45_AC97_SYSCLK, 90 GPIO45_AC97_SYSCLK,
87 91
88 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH, 92 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
@@ -121,7 +125,7 @@ static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc)
121 125
122 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; 126 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled;
123 do { 127 do {
124 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */ 128 desc->chip->ack(irq); /* clear useless edge notification */
125 if (likely(pending)) { 129 if (likely(pending)) {
126 irq = LPD270_IRQ(0) + __ffs(pending); 130 irq = LPD270_IRQ(0) + __ffs(pending);
127 generic_handle_irq(irq); 131 generic_handle_irq(irq);
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 98ee7e590299..63d65a2a0387 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -66,26 +66,14 @@ static unsigned long lubbock_pin_config[] __initdata = {
66 GPIO25_SSP1_TXD, 66 GPIO25_SSP1_TXD,
67 GPIO26_SSP1_RXD, 67 GPIO26_SSP1_RXD,
68 68
69 /* AC97 */
70 GPIO28_AC97_BITCLK,
71 GPIO29_AC97_SDATA_IN_0,
72 GPIO30_AC97_SDATA_OUT,
73 GPIO31_AC97_SYNC,
74
69 /* LCD - 16bpp DSTN */ 75 /* LCD - 16bpp DSTN */
70 GPIO58_LCD_LDD_0, 76 GPIOxx_LCD_DSTN_16BPP,
71 GPIO59_LCD_LDD_1,
72 GPIO60_LCD_LDD_2,
73 GPIO61_LCD_LDD_3,
74 GPIO62_LCD_LDD_4,
75 GPIO63_LCD_LDD_5,
76 GPIO64_LCD_LDD_6,
77 GPIO65_LCD_LDD_7,
78 GPIO66_LCD_LDD_8,
79 GPIO67_LCD_LDD_9,
80 GPIO68_LCD_LDD_10,
81 GPIO69_LCD_LDD_11,
82 GPIO70_LCD_LDD_12,
83 GPIO71_LCD_LDD_13,
84 GPIO72_LCD_LDD_14,
85 GPIO73_LCD_LDD_15,
86 GPIO74_LCD_FCLK,
87 GPIO75_LCD_LCLK,
88 GPIO76_LCD_PCLK,
89 77
90 /* BTUART */ 78 /* BTUART */
91 GPIO42_BTUART_RXD, 79 GPIO42_BTUART_RXD,
@@ -158,7 +146,7 @@ static void lubbock_irq_handler(unsigned int irq, struct irq_desc *desc)
158{ 146{
159 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 147 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
160 do { 148 do {
161 GEDR(0) = GPIO_bit(0); /* clear our parent irq */ 149 desc->chip->ack(irq); /* clear our parent irq */
162 if (likely(pending)) { 150 if (likely(pending)) {
163 irq = LUBBOCK_IRQ(0) + __ffs(pending); 151 irq = LUBBOCK_IRQ(0) + __ffs(pending);
164 generic_handle_irq(irq); 152 generic_handle_irq(irq);
@@ -240,11 +228,18 @@ static struct resource sa1111_resources[] = {
240 }, 228 },
241}; 229};
242 230
231static struct sa1111_platform_data sa1111_info = {
232 .irq_base = IRQ_BOARD_END,
233};
234
243static struct platform_device sa1111_device = { 235static struct platform_device sa1111_device = {
244 .name = "sa1111", 236 .name = "sa1111",
245 .id = -1, 237 .id = -1,
246 .num_resources = ARRAY_SIZE(sa1111_resources), 238 .num_resources = ARRAY_SIZE(sa1111_resources),
247 .resource = sa1111_resources, 239 .resource = sa1111_resources,
240 .dev = {
241 .platform_data = &sa1111_info,
242 },
248}; 243};
249 244
250/* ADS7846 is connected through SSP ... and if your board has J5 populated, 245/* ADS7846 is connected through SSP ... and if your board has J5 populated,
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 189f330719a2..e81dd0c8e40d 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -88,26 +88,7 @@ static unsigned long magician_pin_config[] __initdata = {
88 GPIO112_MMC_CMD, 88 GPIO112_MMC_CMD,
89 89
90 /* LCD */ 90 /* LCD */
91 GPIO58_LCD_LDD_0, 91 GPIOxx_LCD_TFT_16BPP,
92 GPIO59_LCD_LDD_1,
93 GPIO60_LCD_LDD_2,
94 GPIO61_LCD_LDD_3,
95 GPIO62_LCD_LDD_4,
96 GPIO63_LCD_LDD_5,
97 GPIO64_LCD_LDD_6,
98 GPIO65_LCD_LDD_7,
99 GPIO66_LCD_LDD_8,
100 GPIO67_LCD_LDD_9,
101 GPIO68_LCD_LDD_10,
102 GPIO69_LCD_LDD_11,
103 GPIO70_LCD_LDD_12,
104 GPIO71_LCD_LDD_13,
105 GPIO72_LCD_LDD_14,
106 GPIO73_LCD_LDD_15,
107 GPIO74_LCD_FCLK,
108 GPIO75_LCD_LCLK,
109 GPIO76_LCD_PCLK,
110 GPIO77_LCD_BIAS,
111 92
112 /* QCI */ 93 /* QCI */
113 GPIO12_CIF_DD_7, 94 GPIO12_CIF_DD_7,
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 851ee0fc32e2..5543c64da9ef 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -60,26 +60,7 @@ static unsigned long mainstone_pin_config[] = {
60 GPIO15_nCS_1, 60 GPIO15_nCS_1,
61 61
62 /* LCD - 16bpp Active TFT */ 62 /* LCD - 16bpp Active TFT */
63 GPIO58_LCD_LDD_0, 63 GPIOxx_LCD_TFT_16BPP,
64 GPIO59_LCD_LDD_1,
65 GPIO60_LCD_LDD_2,
66 GPIO61_LCD_LDD_3,
67 GPIO62_LCD_LDD_4,
68 GPIO63_LCD_LDD_5,
69 GPIO64_LCD_LDD_6,
70 GPIO65_LCD_LDD_7,
71 GPIO66_LCD_LDD_8,
72 GPIO67_LCD_LDD_9,
73 GPIO68_LCD_LDD_10,
74 GPIO69_LCD_LDD_11,
75 GPIO70_LCD_LDD_12,
76 GPIO71_LCD_LDD_13,
77 GPIO72_LCD_LDD_14,
78 GPIO73_LCD_LDD_15,
79 GPIO74_LCD_FCLK,
80 GPIO75_LCD_LCLK,
81 GPIO76_LCD_PCLK,
82 GPIO77_LCD_BIAS,
83 GPIO16_PWM0_OUT, /* Backlight */ 64 GPIO16_PWM0_OUT, /* Backlight */
84 65
85 /* MMC */ 66 /* MMC */
@@ -107,6 +88,10 @@ static unsigned long mainstone_pin_config[] = {
107 GPIO57_nIOIS16, 88 GPIO57_nIOIS16,
108 89
109 /* AC97 */ 90 /* AC97 */
91 GPIO28_AC97_BITCLK,
92 GPIO29_AC97_SDATA_IN_0,
93 GPIO30_AC97_SDATA_OUT,
94 GPIO31_AC97_SYNC,
110 GPIO45_AC97_SYSCLK, 95 GPIO45_AC97_SYSCLK,
111 96
112 /* Keypad */ 97 /* Keypad */
@@ -162,7 +147,7 @@ static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc)
162{ 147{
163 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; 148 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled;
164 do { 149 do {
165 GEDR(0) = GPIO_bit(0); /* clear useless edge notification */ 150 desc->chip->ack(irq); /* clear useless edge notification */
166 if (likely(pending)) { 151 if (likely(pending)) {
167 irq = MAINSTONE_IRQ(0) + __ffs(pending); 152 irq = MAINSTONE_IRQ(0) + __ffs(pending);
168 generic_handle_irq(irq); 153 generic_handle_irq(irq);
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 2466a44d8fda..843fcca76e26 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -86,25 +86,7 @@ static unsigned long mioa701_pin_config[] = {
86 MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW), 86 MIO_CFG_OUT(GPIO22_USB_ENABLE, AF0, DRIVE_LOW),
87 87
88 /* LCD */ 88 /* LCD */
89 GPIO58_LCD_LDD_0, 89 GPIOxx_LCD_TFT_16BPP,
90 GPIO59_LCD_LDD_1,
91 GPIO60_LCD_LDD_2,
92 GPIO61_LCD_LDD_3,
93 GPIO62_LCD_LDD_4,
94 GPIO63_LCD_LDD_5,
95 GPIO64_LCD_LDD_6,
96 GPIO65_LCD_LDD_7,
97 GPIO66_LCD_LDD_8,
98 GPIO67_LCD_LDD_9,
99 GPIO68_LCD_LDD_10,
100 GPIO69_LCD_LDD_11,
101 GPIO70_LCD_LDD_12,
102 GPIO71_LCD_LDD_13,
103 GPIO72_LCD_LDD_14,
104 GPIO73_LCD_LDD_15,
105 GPIO74_LCD_FCLK,
106 GPIO75_LCD_LCLK,
107 GPIO76_LCD_PCLK,
108 90
109 /* QCI */ 91 /* QCI */
110 GPIO12_CIF_DD_7, 92 GPIO12_CIF_DD_7,
@@ -155,6 +137,10 @@ static unsigned long mioa701_pin_config[] = {
155 GPIO41_FFUART_RTS, 137 GPIO41_FFUART_RTS,
156 138
157 /* Sound */ 139 /* Sound */
140 GPIO28_AC97_BITCLK,
141 GPIO29_AC97_SDATA_IN_0,
142 GPIO30_AC97_SDATA_OUT,
143 GPIO31_AC97_SYNC,
158 GPIO89_AC97_SYSCLK, 144 GPIO89_AC97_SYSCLK,
159 MIO_CFG_IN(GPIO12_HPJACK_INSERT, AF0), 145 MIO_CFG_IN(GPIO12_HPJACK_INSERT, AF0),
160 146
diff --git a/arch/arm/mach-pxa/mxm8x10.c b/arch/arm/mach-pxa/mxm8x10.c
new file mode 100644
index 000000000000..8c9c6f0d56bb
--- /dev/null
+++ b/arch/arm/mach-pxa/mxm8x10.c
@@ -0,0 +1,474 @@
1/*
2 * linux/arch/arm/mach-pxa/mxm8x10.c
3 *
4 * Support for the Embedian MXM-8x10 Computer on Module
5 *
6 * Copyright (C) 2006 Marvell International Ltd.
7 * Copyright (C) 2009 Embedian Inc.
8 * Copyright (C) 2009 TMT Services & Supplies (Pty) Ltd.
9 *
10 * 2007-09-04: eric miao <eric.y.miao@gmail.com>
11 * rewrite to align with latest kernel
12 *
13 * 2010-01-09: Edwin Peer <epeer@tmtservices.co.za>
14 * Hennie van der Merwe <hvdmerwe@tmtservices.co.za>
15 * rework for upstream merge
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License version 2 as
19 * published by the Free Software Foundation.
20 */
21
22#include <linux/serial_8250.h>
23#include <linux/dm9000.h>
24#include <linux/gpio.h>
25
26#include <plat/i2c.h>
27#include <plat/pxa3xx_nand.h>
28
29#include <mach/pxafb.h>
30#include <mach/mmc.h>
31#include <mach/ohci.h>
32#include <mach/pxa320.h>
33
34#include <mach/mxm8x10.h>
35
36#include "devices.h"
37#include "generic.h"
38
39/* GPIO pin definition
40
41External device stuff - Leave unconfigured for now...
42---------------------
43GPIO0 - DREQ (External DMA Request)
44GPIO3 - nGCS2 (External Chip Select) Where is nGCS0; nGCS1; nGCS4; nGCS5 ?
45GPIO4 - nGCS3
46GPIO15 - EXT_GPIO1
47GPIO16 - EXT_GPIO2
48GPIO17 - EXT_GPIO3
49GPIO24 - EXT_GPIO4
50GPIO25 - EXT_GPIO5
51GPIO26 - EXT_GPIO6
52GPIO27 - EXT_GPIO7
53GPIO28 - EXT_GPIO8
54GPIO29 - EXT_GPIO9
55GPIO30 - EXT_GPIO10
56GPIO31 - EXT_GPIO11
57GPIO57 - EXT_GPIO12
58GPIO74 - EXT_IRQ1
59GPIO75 - EXT_IRQ2
60GPIO76 - EXT_IRQ3
61GPIO77 - EXT_IRQ4
62GPIO78 - EXT_IRQ5
63GPIO79 - EXT_IRQ6
64GPIO80 - EXT_IRQ7
65GPIO81 - EXT_IRQ8
66GPIO87 - VCCIO_PWREN (External Device PWREN)
67
68Dallas 1-Wire - Leave unconfigured for now...
69-------------
70GPIO0_2 - DS - 1Wire
71
72Ethernet
73--------
74GPIO1 - DM9000 PWR
75GPIO9 - DM9K_nIRQ
76GPIO36 - DM9K_RESET
77
78Keypad - Leave unconfigured by for now...
79------
80GPIO1_2 - KP_DKIN0
81GPIO5_2 - KP_MKOUT7
82GPIO82 - KP_DKIN1
83GPIO85 - KP_DKIN2
84GPIO86 - KP_DKIN3
85GPIO113 - KP_MKIN0
86GPIO114 - KP_MKIN1
87GPIO115 - KP_MKIN2
88GPIO116 - KP_MKIN3
89GPIO117 - KP_MKIN4
90GPIO118 - KP_MKIN5
91GPIO119 - KP_MKIN6
92GPIO120 - KP_MKIN7
93GPIO121 - KP_MKOUT0
94GPIO122 - KP_MKOUT1
95GPIO122 - KP_MKOUT2
96GPIO123 - KP_MKOUT3
97GPIO124 - KP_MKOUT4
98GPIO125 - KP_MKOUT5
99GPIO127 - KP_MKOUT6
100
101Data Bus - Leave unconfigured for now...
102--------
103GPIO2 - nWait (Data Bus)
104
105USB Device
106----------
107GPIO4_2 - USBD_PULLUP
108GPIO10 - UTM_CLK (USB Device UTM Clk)
109GPIO49 - USB 2.0 Device UTM_DATA0
110GPIO50 - USB 2.0 Device UTM_DATA1
111GPIO51 - USB 2.0 Device UTM_DATA2
112GPIO52 - USB 2.0 Device UTM_DATA3
113GPIO53 - USB 2.0 Device UTM_DATA4
114GPIO54 - USB 2.0 Device UTM_DATA5
115GPIO55 - USB 2.0 Device UTM_DATA6
116GPIO56 - USB 2.0 Device UTM_DATA7
117GPIO58 - UTM_RXVALID (USB 2.0 Device)
118GPIO59 - UTM_RXACTIVE (USB 2.0 Device)
119GPIO60 - UTM_RXERROR
120GPIO61 - UTM_OPMODE0
121GPIO62 - UTM_OPMODE1
122GPIO71 - USBD_INT (USB Device?)
123GPIO73 - UTM_TXREADY (USB 2.0 Device)
124GPIO83 - UTM_TXVALID (USB 2.0 Device)
125GPIO98 - UTM_RESET (USB 2.0 device)
126GPIO99 - UTM_XCVR_SELECT
127GPIO100 - UTM_TERM_SELECT
128GPIO101 - UTM_SUSPENDM_X
129GPIO102 - UTM_LINESTATE0
130GPIO103 - UTM_LINESTATE1
131
132Card-Bus Interface - Leave unconfigured for now...
133------------------
134GPIO5 - nPIOR (I/O space output enable)
135GPIO6 - nPIOW (I/O space write enable)
136GPIO7 - nIOS16 (Input from I/O space telling size of data bus)
137GPIO8 - nPWAIT (Input for inserting wait states)
138
139LCD
140---
141GPIO6_2 - LDD0
142GPIO7_2 - LDD1
143GPIO8_2 - LDD2
144GPIO9_2 - LDD3
145GPIO11_2 - LDD5
146GPIO12_2 - LDD6
147GPIO13_2 - LDD7
148GPIO14_2 - VSYNC
149GPIO15_2 - HSYNC
150GPIO16_2 - VCLK
151GPIO17_2 - HCLK
152GPIO18_2 - VDEN
153GPIO63 - LDD8 (CPU LCD)
154GPIO64 - LDD9 (CPU LCD)
155GPIO65 - LDD10 (CPU LCD)
156GPIO66 - LDD11 (CPU LCD)
157GPIO67 - LDD12 (CPU LCD)
158GPIO68 - LDD13 (CPU LCD)
159GPIO69 - LDD14 (CPU LCD)
160GPIO70 - LDD15 (CPU LCD)
161GPIO88 - VCCLCD_PWREN (LCD Panel PWREN)
162GPIO97 - BACKLIGHT_EN
163GPIO104 - LCD_PWREN
164
165PWM - Leave unconfigured for now...
166---
167GPIO11 - PWM0
168GPIO12 - PWM1
169GPIO13 - PWM2
170GPIO14 - PWM3
171
172SD-CARD
173-------
174GPIO18 - SDDATA0
175GPIO19 - SDDATA1
176GPIO20 - SDDATA2
177GPIO21 - SDDATA3
178GPIO22 - SDCLK
179GPIO23 - SDCMD
180GPIO72 - SD_WP
181GPIO84 - SD_nIRQ_CD (SD-Card)
182
183I2C
184---
185GPIO32 - I2CSCL
186GPIO33 - I2CSDA
187
188AC97
189----
190GPIO35 - AC97_SDATA_IN
191GPIO37 - AC97_SDATA_OUT
192GPIO38 - AC97_SYNC
193GPIO39 - AC97_BITCLK
194GPIO40 - AC97_nRESET
195
196UART1
197-----
198GPIO41 - UART_RXD1
199GPIO42 - UART_TXD1
200GPIO43 - UART_CTS1
201GPIO44 - UART_DCD1
202GPIO45 - UART_DSR1
203GPIO46 - UART_nRI1
204GPIO47 - UART_DTR1
205GPIO48 - UART_RTS1
206
207UART2
208-----
209GPIO109 - RTS2
210GPIO110 - RXD2
211GPIO111 - TXD2
212GPIO112 - nCTS2
213
214UART3
215-----
216GPIO105 - nCTS3
217GPIO106 - nRTS3
218GPIO107 - TXD3
219GPIO108 - RXD3
220
221SSP3 - Leave unconfigured for now...
222----
223GPIO89 - SSP3_CLK
224GPIO90 - SSP3_SFRM
225GPIO91 - SSP3_TXD
226GPIO92 - SSP3_RXD
227
228SSP4
229GPIO93 - SSP4_CLK
230GPIO94 - SSP4_SFRM
231GPIO95 - SSP4_TXD
232GPIO96 - SSP4_RXD
233*/
234
235static mfp_cfg_t mfp_cfg[] __initdata = {
236 /* USB */
237 GPIO10_UTM_CLK,
238 GPIO49_U2D_PHYDATA_0,
239 GPIO50_U2D_PHYDATA_1,
240 GPIO51_U2D_PHYDATA_2,
241 GPIO52_U2D_PHYDATA_3,
242 GPIO53_U2D_PHYDATA_4,
243 GPIO54_U2D_PHYDATA_5,
244 GPIO55_U2D_PHYDATA_6,
245 GPIO56_U2D_PHYDATA_7,
246 GPIO58_UTM_RXVALID,
247 GPIO59_UTM_RXACTIVE,
248 GPIO60_U2D_RXERROR,
249 GPIO61_U2D_OPMODE0,
250 GPIO62_U2D_OPMODE1,
251 GPIO71_GPIO, /* USBD_INT */
252 GPIO73_UTM_TXREADY,
253 GPIO83_U2D_TXVALID,
254 GPIO98_U2D_RESET,
255 GPIO99_U2D_XCVR_SEL,
256 GPIO100_U2D_TERM_SEL,
257 GPIO101_U2D_SUSPEND,
258 GPIO102_UTM_LINESTATE_0,
259 GPIO103_UTM_LINESTATE_1,
260 GPIO4_2_GPIO | MFP_PULL_HIGH, /* UTM_PULLUP */
261
262 /* DM9000 */
263 GPIO1_GPIO,
264 GPIO9_GPIO,
265 GPIO36_GPIO,
266
267 /* AC97 */
268 GPIO35_AC97_SDATA_IN_0,
269 GPIO37_AC97_SDATA_OUT,
270 GPIO38_AC97_SYNC,
271 GPIO39_AC97_BITCLK,
272 GPIO40_AC97_nACRESET,
273
274 /* UARTS */
275 GPIO41_UART1_RXD,
276 GPIO42_UART1_TXD,
277 GPIO43_UART1_CTS,
278 GPIO44_UART1_DCD,
279 GPIO45_UART1_DSR,
280 GPIO46_UART1_RI,
281 GPIO47_UART1_DTR,
282 GPIO48_UART1_RTS,
283
284 GPIO109_UART2_RTS,
285 GPIO110_UART2_RXD,
286 GPIO111_UART2_TXD,
287 GPIO112_UART2_CTS,
288
289 GPIO105_UART3_CTS,
290 GPIO106_UART3_RTS,
291 GPIO107_UART3_TXD,
292 GPIO108_UART3_RXD,
293
294 GPIO78_GPIO,
295 GPIO79_GPIO,
296 GPIO80_GPIO,
297 GPIO81_GPIO,
298
299 /* I2C */
300 GPIO32_I2C_SCL,
301 GPIO33_I2C_SDA,
302
303 /* MMC */
304 GPIO18_MMC1_DAT0,
305 GPIO19_MMC1_DAT1,
306 GPIO20_MMC1_DAT2,
307 GPIO21_MMC1_DAT3,
308 GPIO22_MMC1_CLK,
309 GPIO23_MMC1_CMD,
310 GPIO72_GPIO | MFP_PULL_HIGH, /* Card Detect */
311 GPIO84_GPIO | MFP_PULL_LOW, /* Write Protect */
312
313 /* IRQ */
314 GPIO74_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ1 */
315 GPIO75_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ2 */
316 GPIO76_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ3 */
317 GPIO77_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ4 */
318 GPIO78_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ5 */
319 GPIO79_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ6 */
320 GPIO80_GPIO | MFP_LPM_EDGE_RISE, /* EXT_IRQ7 */
321 GPIO81_GPIO | MFP_LPM_EDGE_RISE /* EXT_IRQ8 */
322};
323
324/* MMC/MCI Support */
325#if defined(CONFIG_MMC)
326static struct pxamci_platform_data mxm_8x10_mci_platform_data = {
327 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
328 .detect_delay = 1,
329 .gpio_card_detect = MXM_8X10_SD_nCD,
330 .gpio_card_ro = MXM_8X10_SD_WP,
331 .gpio_power = -1
332};
333
334void __init mxm_8x10_mmc_init(void)
335{
336 pxa_set_mci_info(&mxm_8x10_mci_platform_data);
337}
338#endif
339
340/* USB Open Host Controler Interface */
341static struct pxaohci_platform_data mxm_8x10_ohci_platform_data = {
342 .port_mode = PMM_NPS_MODE,
343 .flags = ENABLE_PORT_ALL
344};
345
346void __init mxm_8x10_usb_host_init(void)
347{
348 pxa_set_ohci_info(&mxm_8x10_ohci_platform_data);
349}
350
351/* AC97 Sound Support */
352static struct platform_device mxm_8x10_ac97_device = {
353 .name = "pxa2xx-ac97"
354};
355
356void __init mxm_8x10_ac97_init(void)
357{
358 platform_device_register(&mxm_8x10_ac97_device);
359}
360
361/* NAND flash Support */
362#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
363#define NAND_BLOCK_SIZE SZ_128K
364#define NB(x) (NAND_BLOCK_SIZE * (x))
365static struct mtd_partition mxm_8x10_nand_partitions[] = {
366 [0] = {
367 .name = "boot",
368 .size = NB(0x002),
369 .offset = NB(0x000),
370 .mask_flags = MTD_WRITEABLE
371 },
372 [1] = {
373 .name = "kernel",
374 .size = NB(0x010),
375 .offset = NB(0x002),
376 .mask_flags = MTD_WRITEABLE
377 },
378 [2] = {
379 .name = "root",
380 .size = NB(0x36c),
381 .offset = NB(0x012)
382 },
383 [3] = {
384 .name = "bbt",
385 .size = NB(0x082),
386 .offset = NB(0x37e),
387 .mask_flags = MTD_WRITEABLE
388 }
389};
390
391static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = {
392 .enable_arbiter = 1,
393 .keep_config = 1,
394 .parts = mxm_8x10_nand_partitions,
395 .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions)
396};
397
398static void __init mxm_8x10_nand_init(void)
399{
400 pxa3xx_set_nand_info(&mxm_8x10_nand_info);
401}
402#else
403static inline void mxm_8x10_nand_init(void) {}
404#endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */
405
406/* Ethernet support: Davicom DM9000 */
407static struct resource dm9k_resources[] = {
408 [0] = {
409 .start = MXM_8X10_ETH_PHYS + 0x300,
410 .end = MXM_8X10_ETH_PHYS + 0x300,
411 .flags = IORESOURCE_MEM
412 },
413 [1] = {
414 .start = MXM_8X10_ETH_PHYS + 0x308,
415 .end = MXM_8X10_ETH_PHYS + 0x308,
416 .flags = IORESOURCE_MEM
417 },
418 [2] = {
419 .start = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
420 .end = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO9)),
421 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE
422 }
423};
424
425static struct dm9000_plat_data dm9k_plat_data = {
426 .flags = DM9000_PLATF_16BITONLY
427};
428
429static struct platform_device dm9k_device = {
430 .name = "dm9000",
431 .id = 0,
432 .num_resources = ARRAY_SIZE(dm9k_resources),
433 .resource = dm9k_resources,
434 .dev = {
435 .platform_data = &dm9k_plat_data
436 }
437};
438
439static void __init mxm_8x10_ethernet_init(void)
440{
441 platform_device_register(&dm9k_device);
442}
443
444/* PXA UARTs */
445static void __init mxm_8x10_uarts_init(void)
446{
447 pxa_set_ffuart_info(NULL);
448 pxa_set_btuart_info(NULL);
449 pxa_set_stuart_info(NULL);
450}
451
452/* I2C and Real Time Clock */
453static struct i2c_board_info __initdata mxm_8x10_i2c_devices[] = {
454 {
455 I2C_BOARD_INFO("ds1337", 0x68)
456 }
457};
458
459static void __init mxm_8x10_i2c_init(void)
460{
461 i2c_register_board_info(0, mxm_8x10_i2c_devices,
462 ARRAY_SIZE(mxm_8x10_i2c_devices));
463 pxa_set_i2c_info(NULL);
464}
465
466void __init mxm_8x10_barebones_init(void)
467{
468 pxa3xx_mfp_config(ARRAY_AND_SIZE(mfp_cfg));
469
470 mxm_8x10_uarts_init();
471 mxm_8x10_nand_init();
472 mxm_8x10_i2c_init();
473 mxm_8x10_ethernet_init();
474}
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index e100af78b166..f70c75b38769 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -83,26 +83,7 @@ static unsigned long palmld_pin_config[] __initdata = {
83 GPIO105_KP_MKOUT_2, 83 GPIO105_KP_MKOUT_2,
84 84
85 /* LCD */ 85 /* LCD */
86 GPIO58_LCD_LDD_0, 86 GPIOxx_LCD_TFT_16BPP,
87 GPIO59_LCD_LDD_1,
88 GPIO60_LCD_LDD_2,
89 GPIO61_LCD_LDD_3,
90 GPIO62_LCD_LDD_4,
91 GPIO63_LCD_LDD_5,
92 GPIO64_LCD_LDD_6,
93 GPIO65_LCD_LDD_7,
94 GPIO66_LCD_LDD_8,
95 GPIO67_LCD_LDD_9,
96 GPIO68_LCD_LDD_10,
97 GPIO69_LCD_LDD_11,
98 GPIO70_LCD_LDD_12,
99 GPIO71_LCD_LDD_13,
100 GPIO72_LCD_LDD_14,
101 GPIO73_LCD_LDD_15,
102 GPIO74_LCD_FCLK,
103 GPIO75_LCD_LCLK,
104 GPIO76_LCD_PCLK,
105 GPIO77_LCD_BIAS,
106 87
107 /* PWM */ 88 /* PWM */
108 GPIO16_PWM0_OUT, 89 GPIO16_PWM0_OUT,
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c
index 8fe3ec27568f..d902a813aae3 100644
--- a/arch/arm/mach-pxa/palmt5.c
+++ b/arch/arm/mach-pxa/palmt5.c
@@ -87,26 +87,7 @@ static unsigned long palmt5_pin_config[] __initdata = {
87 GPIO105_KP_MKOUT_2, 87 GPIO105_KP_MKOUT_2,
88 88
89 /* LCD */ 89 /* LCD */
90 GPIO58_LCD_LDD_0, 90 GPIOxx_LCD_TFT_16BPP,
91 GPIO59_LCD_LDD_1,
92 GPIO60_LCD_LDD_2,
93 GPIO61_LCD_LDD_3,
94 GPIO62_LCD_LDD_4,
95 GPIO63_LCD_LDD_5,
96 GPIO64_LCD_LDD_6,
97 GPIO65_LCD_LDD_7,
98 GPIO66_LCD_LDD_8,
99 GPIO67_LCD_LDD_9,
100 GPIO68_LCD_LDD_10,
101 GPIO69_LCD_LDD_11,
102 GPIO70_LCD_LDD_12,
103 GPIO71_LCD_LDD_13,
104 GPIO72_LCD_LDD_14,
105 GPIO73_LCD_LDD_15,
106 GPIO74_LCD_FCLK,
107 GPIO75_LCD_LCLK,
108 GPIO76_LCD_PCLK,
109 GPIO77_LCD_BIAS,
110 91
111 /* PWM */ 92 /* PWM */
112 GPIO16_PWM0_OUT, 93 GPIO16_PWM0_OUT,
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index b992f07ece21..717d7a638675 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -84,26 +84,7 @@ static unsigned long palmtc_pin_config[] __initdata = {
84 GPIO36_GPIO, /* pullup */ 84 GPIO36_GPIO, /* pullup */
85 85
86 /* LCD */ 86 /* LCD */
87 GPIO58_LCD_LDD_0, 87 GPIOxx_LCD_TFT_16BPP,
88 GPIO59_LCD_LDD_1,
89 GPIO60_LCD_LDD_2,
90 GPIO61_LCD_LDD_3,
91 GPIO62_LCD_LDD_4,
92 GPIO63_LCD_LDD_5,
93 GPIO64_LCD_LDD_6,
94 GPIO65_LCD_LDD_7,
95 GPIO66_LCD_LDD_8,
96 GPIO67_LCD_LDD_9,
97 GPIO68_LCD_LDD_10,
98 GPIO69_LCD_LDD_11,
99 GPIO70_LCD_LDD_12,
100 GPIO71_LCD_LDD_13,
101 GPIO72_LCD_LDD_14,
102 GPIO73_LCD_LDD_15,
103 GPIO74_LCD_FCLK,
104 GPIO75_LCD_LCLK,
105 GPIO76_LCD_PCLK,
106 GPIO77_LCD_BIAS,
107 88
108 /* MATRIX KEYPAD */ 89 /* MATRIX KEYPAD */
109 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* in 0 */ 90 GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH, /* in 0 */
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c
index dc728d6ab94e..3d284ff1a64e 100644
--- a/arch/arm/mach-pxa/palmte2.c
+++ b/arch/arm/mach-pxa/palmte2.c
@@ -73,26 +73,7 @@ static unsigned long palmte2_pin_config[] __initdata = {
73 GPIO47_FICP_TXD, 73 GPIO47_FICP_TXD,
74 74
75 /* LCD */ 75 /* LCD */
76 GPIO58_LCD_LDD_0, 76 GPIOxx_LCD_TFT_16BPP,
77 GPIO59_LCD_LDD_1,
78 GPIO60_LCD_LDD_2,
79 GPIO61_LCD_LDD_3,
80 GPIO62_LCD_LDD_4,
81 GPIO63_LCD_LDD_5,
82 GPIO64_LCD_LDD_6,
83 GPIO65_LCD_LDD_7,
84 GPIO66_LCD_LDD_8,
85 GPIO67_LCD_LDD_9,
86 GPIO68_LCD_LDD_10,
87 GPIO69_LCD_LDD_11,
88 GPIO70_LCD_LDD_12,
89 GPIO71_LCD_LDD_13,
90 GPIO72_LCD_LDD_14,
91 GPIO73_LCD_LDD_15,
92 GPIO74_LCD_FCLK,
93 GPIO75_LCD_LCLK,
94 GPIO76_LCD_PCLK,
95 GPIO77_LCD_BIAS,
96 77
97 /* GPIO KEYS */ 78 /* GPIO KEYS */
98 GPIO5_GPIO, /* notes */ 79 GPIO5_GPIO, /* notes */
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index b433bb496711..d8b4469607a1 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -99,25 +99,7 @@ static unsigned long treo_pin_config[] __initdata = {
99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */ 99 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH, /* Hotsync button */
100 100
101 /* LCD */ 101 /* LCD */
102 GPIO58_LCD_LDD_0, 102 GPIOxx_LCD_TFT_16BPP,
103 GPIO59_LCD_LDD_1,
104 GPIO60_LCD_LDD_2,
105 GPIO61_LCD_LDD_3,
106 GPIO62_LCD_LDD_4,
107 GPIO63_LCD_LDD_5,
108 GPIO64_LCD_LDD_6,
109 GPIO65_LCD_LDD_7,
110 GPIO66_LCD_LDD_8,
111 GPIO67_LCD_LDD_9,
112 GPIO68_LCD_LDD_10,
113 GPIO69_LCD_LDD_11,
114 GPIO70_LCD_LDD_12,
115 GPIO71_LCD_LDD_13,
116 GPIO72_LCD_LDD_14,
117 GPIO73_LCD_LDD_15,
118 GPIO74_LCD_FCLK,
119 GPIO75_LCD_LCLK,
120 GPIO76_LCD_PCLK,
121 103
122 /* Quick Capture Interface */ 104 /* Quick Capture Interface */
123 GPIO84_CIF_FV, 105 GPIO84_CIF_FV,
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c
index b37a025c0b7b..007b58c11f8d 100644
--- a/arch/arm/mach-pxa/palmtx.c
+++ b/arch/arm/mach-pxa/palmtx.c
@@ -110,26 +110,7 @@ static unsigned long palmtx_pin_config[] __initdata = {
110 GPIO105_KP_MKOUT_2, 110 GPIO105_KP_MKOUT_2,
111 111
112 /* LCD */ 112 /* LCD */
113 GPIO58_LCD_LDD_0, 113 GPIOxx_LCD_TFT_16BPP,
114 GPIO59_LCD_LDD_1,
115 GPIO60_LCD_LDD_2,
116 GPIO61_LCD_LDD_3,
117 GPIO62_LCD_LDD_4,
118 GPIO63_LCD_LDD_5,
119 GPIO64_LCD_LDD_6,
120 GPIO65_LCD_LDD_7,
121 GPIO66_LCD_LDD_8,
122 GPIO67_LCD_LDD_9,
123 GPIO68_LCD_LDD_10,
124 GPIO69_LCD_LDD_11,
125 GPIO70_LCD_LDD_12,
126 GPIO71_LCD_LDD_13,
127 GPIO72_LCD_LDD_14,
128 GPIO73_LCD_LDD_15,
129 GPIO74_LCD_FCLK,
130 GPIO75_LCD_LCLK,
131 GPIO76_LCD_PCLK,
132 GPIO77_LCD_BIAS,
133 114
134 /* FFUART */ 115 /* FFUART */
135 GPIO34_FFUART_RXD, 116 GPIO34_FFUART_RXD,
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 1c5d68a94511..3a7925ca3944 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -95,26 +95,8 @@ static unsigned long palmz72_pin_config[] __initdata = {
95 GPIO105_KP_MKOUT_2, 95 GPIO105_KP_MKOUT_2,
96 96
97 /* LCD */ 97 /* LCD */
98 GPIO58_LCD_LDD_0, 98 GPIOxx_LCD_TFT_16BPP,
99 GPIO59_LCD_LDD_1, 99
100 GPIO60_LCD_LDD_2,
101 GPIO61_LCD_LDD_3,
102 GPIO62_LCD_LDD_4,
103 GPIO63_LCD_LDD_5,
104 GPIO64_LCD_LDD_6,
105 GPIO65_LCD_LDD_7,
106 GPIO66_LCD_LDD_8,
107 GPIO67_LCD_LDD_9,
108 GPIO68_LCD_LDD_10,
109 GPIO69_LCD_LDD_11,
110 GPIO70_LCD_LDD_12,
111 GPIO71_LCD_LDD_13,
112 GPIO72_LCD_LDD_14,
113 GPIO73_LCD_LDD_15,
114 GPIO74_LCD_FCLK,
115 GPIO75_LCD_LCLK,
116 GPIO76_LCD_PCLK,
117 GPIO77_LCD_BIAS,
118 GPIO20_GPIO, /* bl power */ 100 GPIO20_GPIO, /* bl power */
119 GPIO21_GPIO, /* LCD border switch */ 101 GPIO21_GPIO, /* LCD border switch */
120 GPIO22_GPIO, /* LCD border color */ 102 GPIO22_GPIO, /* LCD border color */
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index d5255ae74fe3..9d0ecea1760c 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -58,6 +58,12 @@ static unsigned long pcm990_pin_config[] __initdata = {
58 /* I2C */ 58 /* I2C */
59 GPIO117_I2C_SCL, 59 GPIO117_I2C_SCL,
60 GPIO118_I2C_SDA, 60 GPIO118_I2C_SDA,
61
62 /* AC97 */
63 GPIO28_AC97_BITCLK,
64 GPIO29_AC97_SDATA_IN_0,
65 GPIO30_AC97_SDATA_OUT,
66 GPIO31_AC97_SYNC,
61}; 67};
62 68
63/* 69/*
@@ -259,8 +265,7 @@ static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
259 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 265 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled;
260 266
261 do { 267 do {
262 GEDR(PCM990_CTRL_INT_IRQ_GPIO) = 268 desc->chip->ack(irq); /* clear our parent IRQ */
263 GPIO_bit(PCM990_CTRL_INT_IRQ_GPIO);
264 if (likely(pending)) { 269 if (likely(pending)) {
265 irq = PCM027_IRQ(0) + __ffs(pending); 270 irq = PCM027_IRQ(0) + __ffs(pending);
266 generic_handle_irq(irq); 271 generic_handle_irq(irq);
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index c2b938a4d5c9..d58a52415d75 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -91,26 +91,7 @@ static unsigned long poodle_pin_config[] __initdata = {
91 GPIO35_FFUART_CTS, 91 GPIO35_FFUART_CTS,
92 92
93 /* LCD */ 93 /* LCD */
94 GPIO58_LCD_LDD_0, 94 GPIOxx_LCD_TFT_16BPP,
95 GPIO59_LCD_LDD_1,
96 GPIO60_LCD_LDD_2,
97 GPIO61_LCD_LDD_3,
98 GPIO62_LCD_LDD_4,
99 GPIO63_LCD_LDD_5,
100 GPIO64_LCD_LDD_6,
101 GPIO65_LCD_LDD_7,
102 GPIO66_LCD_LDD_8,
103 GPIO67_LCD_LDD_9,
104 GPIO68_LCD_LDD_10,
105 GPIO69_LCD_LDD_11,
106 GPIO70_LCD_LDD_12,
107 GPIO71_LCD_LDD_13,
108 GPIO72_LCD_LDD_14,
109 GPIO73_LCD_LDD_15,
110 GPIO74_LCD_FCLK,
111 GPIO75_LCD_LCLK,
112 GPIO76_LCD_PCLK,
113 GPIO77_LCD_BIAS,
114 95
115 /* PC Card */ 96 /* PC Card */
116 GPIO48_nPOE, 97 GPIO48_nPOE,
@@ -193,11 +174,18 @@ static struct resource locomo_resources[] = {
193 }, 174 },
194}; 175};
195 176
177static struct locomo_platform_data locomo_info = {
178 .irq_base = IRQ_BOARD_START,
179};
180
196struct platform_device poodle_locomo_device = { 181struct platform_device poodle_locomo_device = {
197 .name = "locomo", 182 .name = "locomo",
198 .id = 0, 183 .id = 0,
199 .num_resources = ARRAY_SIZE(locomo_resources), 184 .num_resources = ARRAY_SIZE(locomo_resources),
200 .resource = locomo_resources, 185 .resource = locomo_resources,
186 .dev = {
187 .platform_data = &locomo_info,
188 },
201}; 189};
202 190
203EXPORT_SYMBOL(poodle_locomo_device); 191EXPORT_SYMBOL(poodle_locomo_device);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index d783123e2d48..0af36177ff08 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -40,6 +40,25 @@ void pxa27x_clear_otgph(void)
40} 40}
41EXPORT_SYMBOL(pxa27x_clear_otgph); 41EXPORT_SYMBOL(pxa27x_clear_otgph);
42 42
43static unsigned long ac97_reset_config[] = {
44 GPIO95_AC97_nRESET,
45 GPIO95_GPIO,
46 GPIO113_AC97_nRESET,
47 GPIO113_GPIO,
48};
49
50void pxa27x_assert_ac97reset(int reset_gpio, int on)
51{
52 if (reset_gpio == 113)
53 pxa2xx_mfp_config(on ? &ac97_reset_config[0] :
54 &ac97_reset_config[1], 1);
55
56 if (reset_gpio == 95)
57 pxa2xx_mfp_config(on ? &ac97_reset_config[2] :
58 &ac97_reset_config[3], 1);
59}
60EXPORT_SYMBOL_GPL(pxa27x_assert_ac97reset);
61
43/* Crystal clock: 13MHz */ 62/* Crystal clock: 13MHz */
44#define BASE_CLK 13000000 63#define BASE_CLK 13000000
45 64
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
new file mode 100644
index 000000000000..3184bdc14526
--- /dev/null
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -0,0 +1,1108 @@
1/*
2 * arch/arm/mach-pxa/raumfeld.c
3 *
4 * Support for the following Raumfeld devices:
5 *
6 * * Controller
7 * * Connector
8 * * Speaker S/M
9 *
10 * See http://www.raumfeld.com for details.
11 *
12 * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/sysdev.h>
22#include <linux/platform_device.h>
23#include <linux/interrupt.h>
24#include <linux/gpio.h>
25#include <linux/smsc911x.h>
26#include <linux/input.h>
27#include <linux/rotary_encoder.h>
28#include <linux/gpio_keys.h>
29#include <linux/input/eeti_ts.h>
30#include <linux/leds.h>
31#include <linux/w1-gpio.h>
32#include <linux/sched.h>
33#include <linux/pwm_backlight.h>
34#include <linux/i2c.h>
35#include <linux/spi/spi.h>
36#include <linux/spi/spi_gpio.h>
37#include <linux/lis3lv02d.h>
38#include <linux/pda_power.h>
39#include <linux/power_supply.h>
40#include <linux/pda_power.h>
41#include <linux/power_supply.h>
42#include <linux/regulator/max8660.h>
43#include <linux/regulator/machine.h>
44#include <linux/regulator/fixed.h>
45#include <linux/regulator/consumer.h>
46#include <linux/delay.h>
47
48#include <asm/mach-types.h>
49#include <asm/mach/arch.h>
50
51#include <mach/hardware.h>
52#include <mach/pxa3xx-regs.h>
53#include <mach/mfp-pxa3xx.h>
54#include <mach/mfp-pxa300.h>
55#include <mach/ohci.h>
56#include <mach/pxafb.h>
57#include <mach/mmc.h>
58#include <plat/i2c.h>
59#include <plat/pxa3xx_nand.h>
60
61#include "generic.h"
62#include "devices.h"
63#include "clock.h"
64
65/* common GPIO definitions */
66
67/* inputs */
68#define GPIO_ON_OFF (14)
69#define GPIO_VOLENC_A (19)
70#define GPIO_VOLENC_B (20)
71#define GPIO_CHARGE_DONE (23)
72#define GPIO_CHARGE_IND (27)
73#define GPIO_TOUCH_IRQ (32)
74#define GPIO_ETH_IRQ (40)
75#define GPIO_SPI_MISO (98)
76#define GPIO_ACCEL_IRQ (104)
77#define GPIO_RESCUE_BOOT (115)
78#define GPIO_DOCK_DETECT (116)
79#define GPIO_KEY1 (117)
80#define GPIO_KEY2 (118)
81#define GPIO_KEY3 (119)
82#define GPIO_CHARGE_USB_OK (112)
83#define GPIO_CHARGE_DC_OK (101)
84#define GPIO_CHARGE_USB_SUSP (102)
85
86/* outputs */
87#define GPIO_SHUTDOWN_SUPPLY (16)
88#define GPIO_SHUTDOWN_BATT (18)
89#define GPIO_CHRG_PEN2 (31)
90#define GPIO_TFT_VA_EN (33)
91#define GPIO_SPDIF_CS (34)
92#define GPIO_LED2 (35)
93#define GPIO_LED1 (36)
94#define GPIO_SPDIF_RESET (38)
95#define GPIO_SPI_CLK (95)
96#define GPIO_MCLK_DAC_CS (96)
97#define GPIO_SPI_MOSI (97)
98#define GPIO_W1_PULLUP_ENABLE (105)
99#define GPIO_DISPLAY_ENABLE (106)
100#define GPIO_MCLK_RESET (111)
101#define GPIO_W2W_RESET (113)
102#define GPIO_W2W_PDN (114)
103#define GPIO_CODEC_RESET (120)
104#define GPIO_AUDIO_VA_ENABLE (124)
105#define GPIO_ACCEL_CS (125)
106#define GPIO_ONE_WIRE (126)
107
108/*
109 * GPIO configurations
110 */
111static mfp_cfg_t raumfeld_controller_pin_config[] __initdata = {
112 /* UART1 */
113 GPIO77_UART1_RXD,
114 GPIO78_UART1_TXD,
115 GPIO79_UART1_CTS,
116 GPIO81_UART1_DSR,
117 GPIO83_UART1_DTR,
118 GPIO84_UART1_RTS,
119
120 /* UART3 */
121 GPIO110_UART3_RXD,
122
123 /* USB Host */
124 GPIO0_2_USBH_PEN,
125 GPIO1_2_USBH_PWR,
126
127 /* I2C */
128 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
129 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
130
131 /* SPI */
132 GPIO34_GPIO, /* SPDIF_CS */
133 GPIO96_GPIO, /* MCLK_CS */
134 GPIO125_GPIO, /* ACCEL_CS */
135
136 /* MMC */
137 GPIO3_MMC1_DAT0,
138 GPIO4_MMC1_DAT1,
139 GPIO5_MMC1_DAT2,
140 GPIO6_MMC1_DAT3,
141 GPIO7_MMC1_CLK,
142 GPIO8_MMC1_CMD,
143
144 /* One-wire */
145 GPIO126_GPIO | MFP_LPM_FLOAT,
146 GPIO105_GPIO | MFP_PULL_LOW | MFP_LPM_PULL_LOW,
147
148 /* CHRG_USB_OK */
149 GPIO101_GPIO | MFP_PULL_HIGH,
150 /* CHRG_USB_OK */
151 GPIO112_GPIO | MFP_PULL_HIGH,
152 /* CHRG_USB_SUSP */
153 GPIO102_GPIO,
154 /* DISPLAY_ENABLE */
155 GPIO106_GPIO,
156 /* DOCK_DETECT */
157 GPIO116_GPIO | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
158
159 /* LCD */
160 GPIO54_LCD_LDD_0,
161 GPIO55_LCD_LDD_1,
162 GPIO56_LCD_LDD_2,
163 GPIO57_LCD_LDD_3,
164 GPIO58_LCD_LDD_4,
165 GPIO59_LCD_LDD_5,
166 GPIO60_LCD_LDD_6,
167 GPIO61_LCD_LDD_7,
168 GPIO62_LCD_LDD_8,
169 GPIO63_LCD_LDD_9,
170 GPIO64_LCD_LDD_10,
171 GPIO65_LCD_LDD_11,
172 GPIO66_LCD_LDD_12,
173 GPIO67_LCD_LDD_13,
174 GPIO68_LCD_LDD_14,
175 GPIO69_LCD_LDD_15,
176 GPIO70_LCD_LDD_16,
177 GPIO71_LCD_LDD_17,
178 GPIO72_LCD_FCLK,
179 GPIO73_LCD_LCLK,
180 GPIO74_LCD_PCLK,
181 GPIO75_LCD_BIAS,
182};
183
184static mfp_cfg_t raumfeld_connector_pin_config[] __initdata = {
185 /* UART1 */
186 GPIO77_UART1_RXD,
187 GPIO78_UART1_TXD,
188 GPIO79_UART1_CTS,
189 GPIO81_UART1_DSR,
190 GPIO83_UART1_DTR,
191 GPIO84_UART1_RTS,
192
193 /* UART3 */
194 GPIO110_UART3_RXD,
195
196 /* USB Host */
197 GPIO0_2_USBH_PEN,
198 GPIO1_2_USBH_PWR,
199
200 /* I2C */
201 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
202 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
203
204 /* SPI */
205 GPIO34_GPIO, /* SPDIF_CS */
206 GPIO96_GPIO, /* MCLK_CS */
207 GPIO125_GPIO, /* ACCEL_CS */
208
209 /* MMC */
210 GPIO3_MMC1_DAT0,
211 GPIO4_MMC1_DAT1,
212 GPIO5_MMC1_DAT2,
213 GPIO6_MMC1_DAT3,
214 GPIO7_MMC1_CLK,
215 GPIO8_MMC1_CMD,
216
217 /* Ethernet */
218 GPIO1_nCS2, /* CS */
219 GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
220
221 /* SSP for I2S */
222 GPIO85_SSP1_SCLK,
223 GPIO89_SSP1_EXTCLK,
224 GPIO86_SSP1_FRM,
225 GPIO87_SSP1_TXD,
226 GPIO88_SSP1_RXD,
227 GPIO90_SSP1_SYSCLK,
228
229 /* SSP2 for S/PDIF */
230 GPIO25_SSP2_SCLK,
231 GPIO26_SSP2_FRM,
232 GPIO27_SSP2_TXD,
233 GPIO29_SSP2_EXTCLK,
234
235 /* LEDs */
236 GPIO35_GPIO | MFP_LPM_PULL_LOW,
237 GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
238};
239
240static mfp_cfg_t raumfeld_speaker_pin_config[] __initdata = {
241 /* UART1 */
242 GPIO77_UART1_RXD,
243 GPIO78_UART1_TXD,
244 GPIO79_UART1_CTS,
245 GPIO81_UART1_DSR,
246 GPIO83_UART1_DTR,
247 GPIO84_UART1_RTS,
248
249 /* UART3 */
250 GPIO110_UART3_RXD,
251
252 /* USB Host */
253 GPIO0_2_USBH_PEN,
254 GPIO1_2_USBH_PWR,
255
256 /* I2C */
257 GPIO21_I2C_SCL | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
258 GPIO22_I2C_SDA | MFP_LPM_FLOAT | MFP_PULL_FLOAT,
259
260 /* SPI */
261 GPIO34_GPIO, /* SPDIF_CS */
262 GPIO96_GPIO, /* MCLK_CS */
263 GPIO125_GPIO, /* ACCEL_CS */
264
265 /* MMC */
266 GPIO3_MMC1_DAT0,
267 GPIO4_MMC1_DAT1,
268 GPIO5_MMC1_DAT2,
269 GPIO6_MMC1_DAT3,
270 GPIO7_MMC1_CLK,
271 GPIO8_MMC1_CMD,
272
273 /* Ethernet */
274 GPIO1_nCS2, /* CS */
275 GPIO40_GPIO | MFP_PULL_HIGH, /* IRQ */
276
277 /* SSP for I2S */
278 GPIO85_SSP1_SCLK,
279 GPIO89_SSP1_EXTCLK,
280 GPIO86_SSP1_FRM,
281 GPIO87_SSP1_TXD,
282 GPIO88_SSP1_RXD,
283 GPIO90_SSP1_SYSCLK,
284
285 /* LEDs */
286 GPIO35_GPIO | MFP_LPM_PULL_LOW,
287 GPIO36_GPIO | MFP_LPM_DRIVE_HIGH,
288};
289
290/*
291 * SMSC LAN9220 Ethernet
292 */
293
294static struct resource smc91x_resources[] = {
295 {
296 .start = PXA3xx_CS2_PHYS,
297 .end = PXA3xx_CS2_PHYS + 0xfffff,
298 .flags = IORESOURCE_MEM,
299 },
300 {
301 .start = gpio_to_irq(GPIO_ETH_IRQ),
302 .end = gpio_to_irq(GPIO_ETH_IRQ),
303 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
304 }
305};
306
307static struct smsc911x_platform_config raumfeld_smsc911x_config = {
308 .phy_interface = PHY_INTERFACE_MODE_MII,
309 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
310 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
311 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
312};
313
314static struct platform_device smc91x_device = {
315 .name = "smsc911x",
316 .id = -1,
317 .num_resources = ARRAY_SIZE(smc91x_resources),
318 .resource = smc91x_resources,
319 .dev = {
320 .platform_data = &raumfeld_smsc911x_config,
321 }
322};
323
324/**
325 * NAND
326 */
327
328static struct mtd_partition raumfeld_nand_partitions[] = {
329 {
330 .name = "Bootloader",
331 .offset = 0,
332 .size = 0xa0000,
333 .mask_flags = MTD_WRITEABLE, /* force read-only */
334 },
335 {
336 .name = "BootloaderEnvironment",
337 .offset = 0xa0000,
338 .size = 0x20000,
339 },
340 {
341 .name = "BootloaderSplashScreen",
342 .offset = 0xc0000,
343 .size = 0x60000,
344 },
345 {
346 .name = "UBI",
347 .offset = 0x120000,
348 .size = MTDPART_SIZ_FULL,
349 },
350};
351
352static struct pxa3xx_nand_platform_data raumfeld_nand_info = {
353 .enable_arbiter = 1,
354 .keep_config = 1,
355 .parts = raumfeld_nand_partitions,
356 .nr_parts = ARRAY_SIZE(raumfeld_nand_partitions),
357};
358
359/**
360 * USB (OHCI) support
361 */
362
363static struct pxaohci_platform_data raumfeld_ohci_info = {
364 .port_mode = PMM_GLOBAL_MODE,
365 .flags = ENABLE_PORT1,
366};
367
368/**
369 * Rotary encoder input device
370 */
371
372static struct rotary_encoder_platform_data raumfeld_rotary_encoder_info = {
373 .steps = 24,
374 .axis = REL_X,
375 .relative_axis = 1,
376 .gpio_a = GPIO_VOLENC_A,
377 .gpio_b = GPIO_VOLENC_B,
378 .inverted_a = 1,
379 .inverted_b = 0,
380};
381
382static struct platform_device rotary_encoder_device = {
383 .name = "rotary-encoder",
384 .id = 0,
385 .dev = {
386 .platform_data = &raumfeld_rotary_encoder_info,
387 }
388};
389
390/**
391 * GPIO buttons
392 */
393
394static struct gpio_keys_button gpio_keys_button[] = {
395 {
396 .code = KEY_F1,
397 .type = EV_KEY,
398 .gpio = GPIO_KEY1,
399 .active_low = 1,
400 .wakeup = 0,
401 .debounce_interval = 5, /* ms */
402 .desc = "Button 1",
403 },
404 {
405 .code = KEY_F2,
406 .type = EV_KEY,
407 .gpio = GPIO_KEY2,
408 .active_low = 1,
409 .wakeup = 0,
410 .debounce_interval = 5, /* ms */
411 .desc = "Button 2",
412 },
413 {
414 .code = KEY_F3,
415 .type = EV_KEY,
416 .gpio = GPIO_KEY3,
417 .active_low = 1,
418 .wakeup = 0,
419 .debounce_interval = 5, /* ms */
420 .desc = "Button 3",
421 },
422 {
423 .code = KEY_F4,
424 .type = EV_KEY,
425 .gpio = GPIO_RESCUE_BOOT,
426 .active_low = 0,
427 .wakeup = 0,
428 .debounce_interval = 5, /* ms */
429 .desc = "rescue boot button",
430 },
431 {
432 .code = KEY_F5,
433 .type = EV_KEY,
434 .gpio = GPIO_DOCK_DETECT,
435 .active_low = 1,
436 .wakeup = 0,
437 .debounce_interval = 5, /* ms */
438 .desc = "dock detect",
439 },
440 {
441 .code = KEY_F6,
442 .type = EV_KEY,
443 .gpio = GPIO_ON_OFF,
444 .active_low = 0,
445 .wakeup = 0,
446 .debounce_interval = 5, /* ms */
447 .desc = "on/off button",
448 },
449};
450
451static struct gpio_keys_platform_data gpio_keys_platform_data = {
452 .buttons = gpio_keys_button,
453 .nbuttons = ARRAY_SIZE(gpio_keys_button),
454 .rep = 0,
455};
456
457static struct platform_device raumfeld_gpio_keys_device = {
458 .name = "gpio-keys",
459 .id = -1,
460 .dev = {
461 .platform_data = &gpio_keys_platform_data,
462 }
463};
464
465/**
466 * GPIO LEDs
467 */
468
469static struct gpio_led raumfeld_leds[] = {
470 {
471 .name = "raumfeld:1",
472 .gpio = GPIO_LED1,
473 .active_low = 1,
474 .default_state = LEDS_GPIO_DEFSTATE_ON,
475 },
476 {
477 .name = "raumfeld:2",
478 .gpio = GPIO_LED2,
479 .active_low = 0,
480 .default_state = LEDS_GPIO_DEFSTATE_OFF,
481 }
482};
483
484static struct gpio_led_platform_data raumfeld_led_platform_data = {
485 .leds = raumfeld_leds,
486 .num_leds = ARRAY_SIZE(raumfeld_leds),
487};
488
489static struct platform_device raumfeld_led_device = {
490 .name = "leds-gpio",
491 .id = -1,
492 .dev = {
493 .platform_data = &raumfeld_led_platform_data,
494 },
495};
496
497/**
498 * One-wire (W1 bus) support
499 */
500
501static void w1_enable_external_pullup(int enable)
502{
503 gpio_set_value(GPIO_W1_PULLUP_ENABLE, enable);
504 msleep(100);
505}
506
507static struct w1_gpio_platform_data w1_gpio_platform_data = {
508 .pin = GPIO_ONE_WIRE,
509 .is_open_drain = 0,
510 .enable_external_pullup = w1_enable_external_pullup,
511};
512
513struct platform_device raumfeld_w1_gpio_device = {
514 .name = "w1-gpio",
515 .dev = {
516 .platform_data = &w1_gpio_platform_data
517 }
518};
519
520static void __init raumfeld_w1_init(void)
521{
522 int ret = gpio_request(GPIO_W1_PULLUP_ENABLE,
523 "W1 external pullup enable");
524
525 if (ret < 0)
526 pr_warning("Unable to request GPIO_W1_PULLUP_ENABLE\n");
527 else
528 gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);
529
530 platform_device_register(&raumfeld_w1_gpio_device);
531}
532
533/**
534 * Framebuffer device
535 */
536
537/* PWM controlled backlight */
538static struct platform_pwm_backlight_data raumfeld_pwm_backlight_data = {
539 .pwm_id = 0,
540 .max_brightness = 100,
541 .dft_brightness = 100,
542 /* 10000 ns = 10 ms ^= 100 kHz */
543 .pwm_period_ns = 10000,
544};
545
546static struct platform_device raumfeld_pwm_backlight_device = {
547 .name = "pwm-backlight",
548 .dev = {
549 .parent = &pxa27x_device_pwm0.dev,
550 .platform_data = &raumfeld_pwm_backlight_data,
551 }
552};
553
554/* LT3593 controlled backlight */
555static struct gpio_led raumfeld_lt3593_led = {
556 .name = "backlight",
557 .gpio = mfp_to_gpio(MFP_PIN_GPIO17),
558 .default_state = LEDS_GPIO_DEFSTATE_ON,
559};
560
561static struct gpio_led_platform_data raumfeld_lt3593_platform_data = {
562 .leds = &raumfeld_lt3593_led,
563 .num_leds = 1,
564};
565
566static struct platform_device raumfeld_lt3593_device = {
567 .name = "leds-lt3593",
568 .id = -1,
569 .dev = {
570 .platform_data = &raumfeld_lt3593_platform_data,
571 },
572};
573
574static struct pxafb_mode_info sharp_lq043t3dx02_mode = {
575 .pixclock = 111000,
576 .xres = 480,
577 .yres = 272,
578 .bpp = 16,
579 .hsync_len = 4,
580 .left_margin = 2,
581 .right_margin = 1,
582 .vsync_len = 1,
583 .upper_margin = 3,
584 .lower_margin = 1,
585 .sync = 0,
586};
587
588static struct pxafb_mach_info raumfeld_sharp_lcd_info = {
589 .modes = &sharp_lq043t3dx02_mode,
590 .num_modes = 1,
591 .video_mem_size = 0x400000,
592 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
593};
594
595static void __init raumfeld_lcd_init(void)
596{
597 int ret;
598
599 set_pxa_fb_info(&raumfeld_sharp_lcd_info);
600
601 /* Earlier devices had the backlight regulator controlled
602 * via PWM, later versions use another controller for that */
603 if ((system_rev & 0xff) < 2) {
604 mfp_cfg_t raumfeld_pwm_pin_config = GPIO17_PWM0_OUT;
605 pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
606 platform_device_register(&raumfeld_pwm_backlight_device);
607 } else
608 platform_device_register(&raumfeld_lt3593_device);
609
610 ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
611 if (ret < 0)
612 pr_warning("Unable to request GPIO_TFT_VA_EN\n");
613 else
614 gpio_direction_output(GPIO_TFT_VA_EN, 1);
615
616 ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
617 if (ret < 0)
618 pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
619 else
620 gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
621}
622
623/**
624 * SPI devices
625 */
626
627struct spi_gpio_platform_data raumfeld_spi_platform_data = {
628 .sck = GPIO_SPI_CLK,
629 .mosi = GPIO_SPI_MOSI,
630 .miso = GPIO_SPI_MISO,
631 .num_chipselect = 3,
632};
633
634static struct platform_device raumfeld_spi_device = {
635 .name = "spi_gpio",
636 .id = 0,
637 .dev = {
638 .platform_data = &raumfeld_spi_platform_data,
639 }
640};
641
642static struct lis3lv02d_platform_data lis3_pdata = {
643 .click_flags = LIS3_CLICK_SINGLE_X |
644 LIS3_CLICK_SINGLE_Y |
645 LIS3_CLICK_SINGLE_Z,
646 .irq_cfg = LIS3_IRQ1_CLICK | LIS3_IRQ2_CLICK,
647 .wakeup_flags = LIS3_WAKEUP_X_LO | LIS3_WAKEUP_X_HI |
648 LIS3_WAKEUP_Y_LO | LIS3_WAKEUP_Y_HI |
649 LIS3_WAKEUP_Z_LO | LIS3_WAKEUP_Z_HI,
650 .wakeup_thresh = 10,
651 .click_thresh_x = 10,
652 .click_thresh_y = 10,
653 .click_thresh_z = 10,
654};
655
656#define SPI_AK4104 \
657{ \
658 .modalias = "ak4104", \
659 .max_speed_hz = 10000, \
660 .bus_num = 0, \
661 .chip_select = 0, \
662 .controller_data = (void *) GPIO_SPDIF_CS, \
663}
664
665#define SPI_LIS3 \
666{ \
667 .modalias = "lis3lv02d_spi", \
668 .max_speed_hz = 1000000, \
669 .bus_num = 0, \
670 .chip_select = 1, \
671 .controller_data = (void *) GPIO_ACCEL_CS, \
672 .platform_data = &lis3_pdata, \
673 .irq = gpio_to_irq(GPIO_ACCEL_IRQ), \
674}
675
676#define SPI_DAC7512 \
677{ \
678 .modalias = "dac7512", \
679 .max_speed_hz = 1000000, \
680 .bus_num = 0, \
681 .chip_select = 2, \
682 .controller_data = (void *) GPIO_MCLK_DAC_CS, \
683}
684
685static struct spi_board_info connector_spi_devices[] __initdata = {
686 SPI_AK4104,
687 SPI_DAC7512,
688};
689
690static struct spi_board_info speaker_spi_devices[] __initdata = {
691 SPI_DAC7512,
692};
693
694static struct spi_board_info controller_spi_devices[] __initdata = {
695 SPI_LIS3,
696};
697
698/**
699 * MMC for Marvell Libertas 8688 via SDIO
700 */
701
702static int raumfeld_mci_init(struct device *dev, irq_handler_t isr, void *data)
703{
704 gpio_set_value(GPIO_W2W_RESET, 1);
705 gpio_set_value(GPIO_W2W_PDN, 1);
706
707 return 0;
708}
709
710static void raumfeld_mci_exit(struct device *dev, void *data)
711{
712 gpio_set_value(GPIO_W2W_RESET, 0);
713 gpio_set_value(GPIO_W2W_PDN, 0);
714}
715
716static struct pxamci_platform_data raumfeld_mci_platform_data = {
717 .init = raumfeld_mci_init,
718 .exit = raumfeld_mci_exit,
719 .detect_delay = 20,
720 .gpio_card_detect = -1,
721 .gpio_card_ro = -1,
722 .gpio_power = -1,
723};
724
725/*
726 * External power / charge logic
727 */
728
729static int power_supply_init(struct device *dev)
730{
731 return 0;
732}
733
734static void power_supply_exit(struct device *dev)
735{
736}
737
738static int raumfeld_is_ac_online(void)
739{
740 return !gpio_get_value(GPIO_CHARGE_DC_OK);
741}
742
743static int raumfeld_is_usb_online(void)
744{
745 return 0;
746}
747
748static char *raumfeld_power_supplicants[] = { "ds2760-battery.0" };
749
750static struct pda_power_pdata power_supply_info = {
751 .init = power_supply_init,
752 .is_ac_online = raumfeld_is_ac_online,
753 .is_usb_online = raumfeld_is_usb_online,
754 .exit = power_supply_exit,
755 .supplied_to = raumfeld_power_supplicants,
756 .num_supplicants = ARRAY_SIZE(raumfeld_power_supplicants)
757};
758
759static struct resource power_supply_resources[] = {
760 {
761 .name = "ac",
762 .flags = IORESOURCE_IRQ |
763 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE,
764 .start = GPIO_CHARGE_DC_OK,
765 .end = GPIO_CHARGE_DC_OK,
766 },
767};
768
769static irqreturn_t charge_done_irq(int irq, void *dev_id)
770{
771 struct power_supply *psy;
772
773 psy = power_supply_get_by_name("ds2760-battery.0");
774
775 if (psy)
776 power_supply_set_battery_charged(psy);
777
778 return IRQ_HANDLED;
779}
780
781static struct platform_device raumfeld_power_supply = {
782 .name = "pda-power",
783 .id = -1,
784 .dev = {
785 .platform_data = &power_supply_info,
786 },
787 .resource = power_supply_resources,
788 .num_resources = ARRAY_SIZE(power_supply_resources),
789};
790
791static void __init raumfeld_power_init(void)
792{
793 int ret;
794
795 /* Set PEN2 high to enable maximum charge current */
796 ret = gpio_request(GPIO_CHRG_PEN2, "CHRG_PEN2");
797 if (ret < 0)
798 pr_warning("Unable to request GPIO_CHRG_PEN2\n");
799 else
800 gpio_direction_output(GPIO_CHRG_PEN2, 1);
801
802 ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
803 if (ret < 0)
804 pr_warning("Unable to request GPIO_CHARGE_DC_OK\n");
805
806 ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
807 if (ret < 0)
808 pr_warning("Unable to request GPIO_CHARGE_USB_SUSP\n");
809 else
810 gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
811
812 power_supply_resources[0].start = gpio_to_irq(GPIO_CHARGE_DC_OK);
813 power_supply_resources[0].end = gpio_to_irq(GPIO_CHARGE_DC_OK);
814
815 ret = request_irq(gpio_to_irq(GPIO_CHARGE_DONE),
816 &charge_done_irq, IORESOURCE_IRQ_LOWEDGE,
817 "charge_done", NULL);
818
819 if (ret < 0)
820 printk(KERN_ERR "%s: unable to register irq %d\n", __func__,
821 GPIO_CHARGE_DONE);
822 else
823 platform_device_register(&raumfeld_power_supply);
824}
825
826/* Fixed regulator for AUDIO_VA, 0-0048 maps to the cs4270 codec device */
827
828static struct regulator_consumer_supply audio_va_consumer_supply =
829 REGULATOR_SUPPLY("va", "0-0048");
830
831struct regulator_init_data audio_va_initdata = {
832 .consumer_supplies = &audio_va_consumer_supply,
833 .num_consumer_supplies = 1,
834 .constraints = {
835 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
836 },
837};
838
839static struct fixed_voltage_config audio_va_config = {
840 .supply_name = "audio_va",
841 .microvolts = 5000000,
842 .gpio = GPIO_AUDIO_VA_ENABLE,
843 .enable_high = 1,
844 .enabled_at_boot = 0,
845 .init_data = &audio_va_initdata,
846};
847
848static struct platform_device audio_va_device = {
849 .name = "reg-fixed-voltage",
850 .id = 0,
851 .dev = {
852 .platform_data = &audio_va_config,
853 },
854};
855
856/* Dummy supplies for Codec's VD/VLC */
857
858static struct regulator_consumer_supply audio_dummy_supplies[] = {
859 REGULATOR_SUPPLY("vd", "0-0048"),
860 REGULATOR_SUPPLY("vlc", "0-0048"),
861};
862
863struct regulator_init_data audio_dummy_initdata = {
864 .consumer_supplies = audio_dummy_supplies,
865 .num_consumer_supplies = ARRAY_SIZE(audio_dummy_supplies),
866 .constraints = {
867 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
868 },
869};
870
871static struct fixed_voltage_config audio_dummy_config = {
872 .supply_name = "audio_vd",
873 .microvolts = 3300000,
874 .gpio = -1,
875 .init_data = &audio_dummy_initdata,
876};
877
878static struct platform_device audio_supply_dummy_device = {
879 .name = "reg-fixed-voltage",
880 .id = 1,
881 .dev = {
882 .platform_data = &audio_dummy_config,
883 },
884};
885
886static struct platform_device *audio_regulator_devices[] = {
887 &audio_va_device,
888 &audio_supply_dummy_device,
889};
890
891/**
892 * Regulator support via MAX8660
893 */
894
895static struct regulator_consumer_supply vcc_mmc_supply =
896 REGULATOR_SUPPLY("vmmc", "pxa2xx-mci.0");
897
898static struct regulator_init_data vcc_mmc_init_data = {
899 .constraints = {
900 .min_uV = 3300000,
901 .max_uV = 3300000,
902 .valid_modes_mask = REGULATOR_MODE_NORMAL,
903 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
904 REGULATOR_CHANGE_VOLTAGE |
905 REGULATOR_CHANGE_MODE,
906 },
907 .consumer_supplies = &vcc_mmc_supply,
908 .num_consumer_supplies = 1,
909};
910
911struct max8660_subdev_data max8660_v6_subdev_data = {
912 .id = MAX8660_V6,
913 .name = "vmmc",
914 .platform_data = &vcc_mmc_init_data,
915};
916
917static struct max8660_platform_data max8660_pdata = {
918 .subdevs = &max8660_v6_subdev_data,
919 .num_subdevs = 1,
920};
921
922/**
923 * I2C devices
924 */
925
926static struct i2c_board_info raumfeld_pwri2c_board_info = {
927 .type = "max8660",
928 .addr = 0x34,
929 .platform_data = &max8660_pdata,
930};
931
932static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
933 .type = "cs4270",
934 .addr = 0x48,
935};
936
937static struct eeti_ts_platform_data eeti_ts_pdata = {
938 .irq_active_high = 1,
939};
940
941static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
942 .type = "eeti_ts",
943 .addr = 0x0a,
944 .irq = gpio_to_irq(GPIO_TOUCH_IRQ),
945 .platform_data = &eeti_ts_pdata,
946};
947
948static struct platform_device *raumfeld_common_devices[] = {
949 &raumfeld_gpio_keys_device,
950 &raumfeld_led_device,
951 &raumfeld_spi_device,
952};
953
954static void __init raumfeld_audio_init(void)
955{
956 int ret;
957
958 ret = gpio_request(GPIO_CODEC_RESET, "cs4270 reset");
959 if (ret < 0)
960 pr_warning("unable to request GPIO_CODEC_RESET\n");
961 else
962 gpio_direction_output(GPIO_CODEC_RESET, 1);
963
964 ret = gpio_request(GPIO_SPDIF_RESET, "ak4104 s/pdif reset");
965 if (ret < 0)
966 pr_warning("unable to request GPIO_SPDIF_RESET\n");
967 else
968 gpio_direction_output(GPIO_SPDIF_RESET, 1);
969
970 ret = gpio_request(GPIO_MCLK_RESET, "MCLK reset");
971 if (ret < 0)
972 pr_warning("unable to request GPIO_MCLK_RESET\n");
973 else
974 gpio_direction_output(GPIO_MCLK_RESET, 1);
975
976 platform_add_devices(ARRAY_AND_SIZE(audio_regulator_devices));
977}
978
979static void __init raumfeld_common_init(void)
980{
981 int ret;
982
983 /* The on/off button polarity has changed after revision 1 */
984 if ((system_rev & 0xff) > 1) {
985 int i;
986
987 for (i = 0; i < ARRAY_SIZE(gpio_keys_button); i++)
988 if (!strcmp(gpio_keys_button[i].desc, "on/off button"))
989 gpio_keys_button[i].active_low = 1;
990 }
991
992 enable_irq_wake(IRQ_WAKEUP0);
993
994 pxa3xx_set_nand_info(&raumfeld_nand_info);
995 pxa3xx_set_i2c_power_info(NULL);
996 pxa_set_ohci_info(&raumfeld_ohci_info);
997 pxa_set_mci_info(&raumfeld_mci_platform_data);
998 pxa_set_i2c_info(NULL);
999 pxa_set_ffuart_info(NULL);
1000
1001 ret = gpio_request(GPIO_W2W_RESET, "Wi2Wi reset");
1002 if (ret < 0)
1003 pr_warning("Unable to request GPIO_W2W_RESET\n");
1004 else
1005 gpio_direction_output(GPIO_W2W_RESET, 0);
1006
1007 ret = gpio_request(GPIO_W2W_PDN, "Wi2Wi powerup");
1008 if (ret < 0)
1009 pr_warning("Unable to request GPIO_W2W_PDN\n");
1010 else
1011 gpio_direction_output(GPIO_W2W_PDN, 0);
1012
1013 /* this can be used to switch off the device */
1014 ret = gpio_request(GPIO_SHUTDOWN_SUPPLY,
1015 "supply shutdown");
1016 if (ret < 0)
1017 pr_warning("Unable to request GPIO_SHUTDOWN_SUPPLY\n");
1018 else
1019 gpio_direction_output(GPIO_SHUTDOWN_SUPPLY, 0);
1020
1021 platform_add_devices(ARRAY_AND_SIZE(raumfeld_common_devices));
1022 i2c_register_board_info(1, &raumfeld_pwri2c_board_info, 1);
1023}
1024
1025static void __init raumfeld_controller_init(void)
1026{
1027 int ret;
1028
1029 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_controller_pin_config));
1030 platform_device_register(&rotary_encoder_device);
1031 spi_register_board_info(ARRAY_AND_SIZE(controller_spi_devices));
1032 i2c_register_board_info(0, &raumfeld_controller_i2c_board_info, 1);
1033
1034 ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
1035 if (ret < 0)
1036 pr_warning("Unable to request GPIO_SHUTDOWN_BATT\n");
1037 else
1038 gpio_direction_output(GPIO_SHUTDOWN_BATT, 0);
1039
1040 raumfeld_common_init();
1041 raumfeld_power_init();
1042 raumfeld_lcd_init();
1043 raumfeld_w1_init();
1044}
1045
1046static void __init raumfeld_connector_init(void)
1047{
1048 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_connector_pin_config));
1049 spi_register_board_info(ARRAY_AND_SIZE(connector_spi_devices));
1050 i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
1051
1052 platform_device_register(&smc91x_device);
1053
1054 raumfeld_audio_init();
1055 raumfeld_common_init();
1056}
1057
1058static void __init raumfeld_speaker_init(void)
1059{
1060 pxa3xx_mfp_config(ARRAY_AND_SIZE(raumfeld_speaker_pin_config));
1061 spi_register_board_info(ARRAY_AND_SIZE(speaker_spi_devices));
1062 i2c_register_board_info(0, &raumfeld_connector_i2c_board_info, 1);
1063
1064 platform_device_register(&smc91x_device);
1065 platform_device_register(&rotary_encoder_device);
1066
1067 raumfeld_audio_init();
1068 raumfeld_common_init();
1069}
1070
1071/* physical memory regions */
1072#define RAUMFELD_SDRAM_BASE 0xa0000000 /* SDRAM region */
1073
1074#ifdef CONFIG_MACH_RAUMFELD_RC
1075MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
1076 .phys_io = 0x40000000,
1077 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1078 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1079 .init_machine = raumfeld_controller_init,
1080 .map_io = pxa_map_io,
1081 .init_irq = pxa3xx_init_irq,
1082 .timer = &pxa_timer,
1083MACHINE_END
1084#endif
1085
1086#ifdef CONFIG_MACH_RAUMFELD_CONNECTOR
1087MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
1088 .phys_io = 0x40000000,
1089 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1090 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1091 .init_machine = raumfeld_connector_init,
1092 .map_io = pxa_map_io,
1093 .init_irq = pxa3xx_init_irq,
1094 .timer = &pxa_timer,
1095MACHINE_END
1096#endif
1097
1098#ifdef CONFIG_MACH_RAUMFELD_SPEAKER
1099MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
1100 .phys_io = 0x40000000,
1101 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
1102 .boot_params = RAUMFELD_SDRAM_BASE + 0x100,
1103 .init_machine = raumfeld_speaker_init,
1104 .map_io = pxa_map_io,
1105 .init_irq = pxa3xx_init_irq,
1106 .timer = &pxa_timer,
1107MACHINE_END
1108#endif
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 28352c0b8c34..19b5109d9808 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -56,25 +56,7 @@ static unsigned long spitz_pin_config[] __initdata = {
56 GPIO80_nCS_4, /* SCOOP #1 */ 56 GPIO80_nCS_4, /* SCOOP #1 */
57 57
58 /* LCD - 16bpp Active TFT */ 58 /* LCD - 16bpp Active TFT */
59 GPIO58_LCD_LDD_0, 59 GPIOxx_LCD_TFT_16BPP,
60 GPIO59_LCD_LDD_1,
61 GPIO60_LCD_LDD_2,
62 GPIO61_LCD_LDD_3,
63 GPIO62_LCD_LDD_4,
64 GPIO63_LCD_LDD_5,
65 GPIO64_LCD_LDD_6,
66 GPIO65_LCD_LDD_7,
67 GPIO66_LCD_LDD_8,
68 GPIO67_LCD_LDD_9,
69 GPIO68_LCD_LDD_10,
70 GPIO69_LCD_LDD_11,
71 GPIO70_LCD_LDD_12,
72 GPIO71_LCD_LDD_13,
73 GPIO72_LCD_LDD_14,
74 GPIO73_LCD_LDD_15,
75 GPIO74_LCD_FCLK,
76 GPIO75_LCD_LCLK,
77 GPIO76_LCD_PCLK,
78 60
79 /* PC Card */ 61 /* PC Card */
80 GPIO48_nPOE, 62 GPIO48_nPOE,
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
index 9ebe658590fa..a81d6dbf662d 100644
--- a/arch/arm/mach-pxa/ssp.c
+++ b/arch/arm/mach-pxa/ssp.c
@@ -35,6 +35,8 @@
35#include <mach/ssp.h> 35#include <mach/ssp.h>
36#include <mach/regs-ssp.h> 36#include <mach/regs-ssp.h>
37 37
38#ifdef CONFIG_PXA_SSP_LEGACY
39
38#define TIMEOUT 100000 40#define TIMEOUT 100000
39 41
40static irqreturn_t ssp_interrupt(int irq, void *dev_id) 42static irqreturn_t ssp_interrupt(int irq, void *dev_id)
@@ -303,6 +305,7 @@ void ssp_exit(struct ssp_dev *dev)
303 clk_disable(ssp->clk); 305 clk_disable(ssp->clk);
304 ssp_free(ssp); 306 ssp_free(ssp);
305} 307}
308#endif /* CONFIG_PXA_SSP_LEGACY */
306 309
307static DEFINE_MUTEX(ssp_lock); 310static DEFINE_MUTEX(ssp_lock);
308static LIST_HEAD(ssp_list); 311static LIST_HEAD(ssp_list);
@@ -488,6 +491,7 @@ static void __exit pxa_ssp_exit(void)
488arch_initcall(pxa_ssp_init); 491arch_initcall(pxa_ssp_init);
489module_exit(pxa_ssp_exit); 492module_exit(pxa_ssp_exit);
490 493
494#ifdef CONFIG_PXA_SSP_LEGACY
491EXPORT_SYMBOL(ssp_write_word); 495EXPORT_SYMBOL(ssp_write_word);
492EXPORT_SYMBOL(ssp_read_word); 496EXPORT_SYMBOL(ssp_read_word);
493EXPORT_SYMBOL(ssp_flush); 497EXPORT_SYMBOL(ssp_flush);
@@ -498,6 +502,7 @@ EXPORT_SYMBOL(ssp_restore_state);
498EXPORT_SYMBOL(ssp_init); 502EXPORT_SYMBOL(ssp_init);
499EXPORT_SYMBOL(ssp_exit); 503EXPORT_SYMBOL(ssp_exit);
500EXPORT_SYMBOL(ssp_config); 504EXPORT_SYMBOL(ssp_config);
505#endif
501 506
502MODULE_DESCRIPTION("PXA SSP driver"); 507MODULE_DESCRIPTION("PXA SSP driver");
503MODULE_AUTHOR("Liam Girdwood"); 508MODULE_AUTHOR("Liam Girdwood");
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 750c448db672..293e40aeaf29 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -76,14 +76,12 @@ pxa_ost0_interrupt(int irq, void *dev_id)
76static int 76static int
77pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev) 77pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
78{ 78{
79 unsigned long flags, next, oscr; 79 unsigned long next, oscr;
80 80
81 raw_local_irq_save(flags);
82 OIER |= OIER_E0; 81 OIER |= OIER_E0;
83 next = OSCR + delta; 82 next = OSCR + delta;
84 OSMR0 = next; 83 OSMR0 = next;
85 oscr = OSCR; 84 oscr = OSCR;
86 raw_local_irq_restore(flags);
87 85
88 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; 86 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
89} 87}
@@ -91,23 +89,17 @@ pxa_osmr0_set_next_event(unsigned long delta, struct clock_event_device *dev)
91static void 89static void
92pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev) 90pxa_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *dev)
93{ 91{
94 unsigned long irqflags;
95
96 switch (mode) { 92 switch (mode) {
97 case CLOCK_EVT_MODE_ONESHOT: 93 case CLOCK_EVT_MODE_ONESHOT:
98 raw_local_irq_save(irqflags);
99 OIER &= ~OIER_E0; 94 OIER &= ~OIER_E0;
100 OSSR = OSSR_M0; 95 OSSR = OSSR_M0;
101 raw_local_irq_restore(irqflags);
102 break; 96 break;
103 97
104 case CLOCK_EVT_MODE_UNUSED: 98 case CLOCK_EVT_MODE_UNUSED:
105 case CLOCK_EVT_MODE_SHUTDOWN: 99 case CLOCK_EVT_MODE_SHUTDOWN:
106 /* initializing, released, or preparing for suspend */ 100 /* initializing, released, or preparing for suspend */
107 raw_local_irq_save(irqflags);
108 OIER &= ~OIER_E0; 101 OIER &= ~OIER_E0;
109 OSSR = OSSR_M0; 102 OSSR = OSSR_M0;
110 raw_local_irq_restore(irqflags);
111 break; 103 break;
112 104
113 case CLOCK_EVT_MODE_RESUME: 105 case CLOCK_EVT_MODE_RESUME:
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index c854c168a451..ad552791c4ce 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -32,6 +32,7 @@
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/pda_power.h> 33#include <linux/pda_power.h>
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
35#include <linux/input/matrix_keypad.h>
35 36
36#include <asm/setup.h> 37#include <asm/setup.h>
37#include <asm/mach-types.h> 38#include <asm/mach-types.h>
@@ -131,24 +132,24 @@ static unsigned long tosa_pin_config[] = {
131 GPIO45_BTUART_RTS, 132 GPIO45_BTUART_RTS,
132 133
133 /* Keybd */ 134 /* Keybd */
134 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, 135 GPIO58_GPIO | MFP_LPM_DRIVE_LOW, /* Column 0 */
135 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, 136 GPIO59_GPIO | MFP_LPM_DRIVE_LOW, /* Column 1 */
136 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, 137 GPIO60_GPIO | MFP_LPM_DRIVE_LOW, /* Column 2 */
137 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, 138 GPIO61_GPIO | MFP_LPM_DRIVE_LOW, /* Column 3 */
138 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, 139 GPIO62_GPIO | MFP_LPM_DRIVE_LOW, /* Column 4 */
139 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, 140 GPIO63_GPIO | MFP_LPM_DRIVE_LOW, /* Column 5 */
140 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, 141 GPIO64_GPIO | MFP_LPM_DRIVE_LOW, /* Column 6 */
141 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, 142 GPIO65_GPIO | MFP_LPM_DRIVE_LOW, /* Column 7 */
142 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, 143 GPIO66_GPIO | MFP_LPM_DRIVE_LOW, /* Column 8 */
143 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, 144 GPIO67_GPIO | MFP_LPM_DRIVE_LOW, /* Column 9 */
144 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, 145 GPIO68_GPIO | MFP_LPM_DRIVE_LOW, /* Column 10 */
145 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, 146 GPIO69_GPIO | MFP_LPM_DRIVE_LOW, /* Row 0 */
146 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, 147 GPIO70_GPIO | MFP_LPM_DRIVE_LOW, /* Row 1 */
147 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, 148 GPIO71_GPIO | MFP_LPM_DRIVE_LOW, /* Row 2 */
148 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, 149 GPIO72_GPIO | MFP_LPM_DRIVE_LOW, /* Row 3 */
149 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, 150 GPIO73_GPIO | MFP_LPM_DRIVE_LOW, /* Row 4 */
150 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, 151 GPIO74_GPIO | MFP_LPM_DRIVE_LOW, /* Row 5 */
151 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, 152 GPIO75_GPIO | MFP_LPM_DRIVE_LOW, /* Row 6 */
152 153
153 /* SPI */ 154 /* SPI */
154 GPIO81_SSP2_CLK_OUT, 155 GPIO81_SSP2_CLK_OUT,
@@ -411,9 +412,87 @@ static struct platform_device tosa_power_device = {
411/* 412/*
412 * Tosa Keyboard 413 * Tosa Keyboard
413 */ 414 */
415static const uint32_t tosakbd_keymap[] = {
416 KEY(0, 2, KEY_W),
417 KEY(0, 6, KEY_K),
418 KEY(0, 7, KEY_BACKSPACE),
419 KEY(0, 8, KEY_P),
420 KEY(1, 1, KEY_Q),
421 KEY(1, 2, KEY_E),
422 KEY(1, 3, KEY_T),
423 KEY(1, 4, KEY_Y),
424 KEY(1, 6, KEY_O),
425 KEY(1, 7, KEY_I),
426 KEY(1, 8, KEY_COMMA),
427 KEY(2, 1, KEY_A),
428 KEY(2, 2, KEY_D),
429 KEY(2, 3, KEY_G),
430 KEY(2, 4, KEY_U),
431 KEY(2, 6, KEY_L),
432 KEY(2, 7, KEY_ENTER),
433 KEY(2, 8, KEY_DOT),
434 KEY(3, 1, KEY_Z),
435 KEY(3, 2, KEY_C),
436 KEY(3, 3, KEY_V),
437 KEY(3, 4, KEY_J),
438 KEY(3, 5, TOSA_KEY_ADDRESSBOOK),
439 KEY(3, 6, TOSA_KEY_CANCEL),
440 KEY(3, 7, TOSA_KEY_CENTER),
441 KEY(3, 8, TOSA_KEY_OK),
442 KEY(3, 9, KEY_LEFTSHIFT),
443 KEY(4, 1, KEY_S),
444 KEY(4, 2, KEY_R),
445 KEY(4, 3, KEY_B),
446 KEY(4, 4, KEY_N),
447 KEY(4, 5, TOSA_KEY_CALENDAR),
448 KEY(4, 6, TOSA_KEY_HOMEPAGE),
449 KEY(4, 7, KEY_LEFTCTRL),
450 KEY(4, 8, TOSA_KEY_LIGHT),
451 KEY(4, 10, KEY_RIGHTSHIFT),
452 KEY(5, 1, KEY_TAB),
453 KEY(5, 2, KEY_SLASH),
454 KEY(5, 3, KEY_H),
455 KEY(5, 4, KEY_M),
456 KEY(5, 5, TOSA_KEY_MENU),
457 KEY(5, 7, KEY_UP),
458 KEY(5, 11, TOSA_KEY_FN),
459 KEY(6, 1, KEY_X),
460 KEY(6, 2, KEY_F),
461 KEY(6, 3, KEY_SPACE),
462 KEY(6, 4, KEY_APOSTROPHE),
463 KEY(6, 5, TOSA_KEY_MAIL),
464 KEY(6, 6, KEY_LEFT),
465 KEY(6, 7, KEY_DOWN),
466 KEY(6, 8, KEY_RIGHT),
467};
468
469static struct matrix_keymap_data tosakbd_keymap_data = {
470 .keymap = tosakbd_keymap,
471 .keymap_size = ARRAY_SIZE(tosakbd_keymap),
472};
473
474static const int tosakbd_col_gpios[] =
475 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
476static const int tosakbd_row_gpios[] =
477 { 69, 70, 71, 72, 73, 74, 75 };
478
479static struct matrix_keypad_platform_data tosakbd_pdata = {
480 .keymap_data = &tosakbd_keymap_data,
481 .row_gpios = tosakbd_row_gpios,
482 .col_gpios = tosakbd_col_gpios,
483 .num_row_gpios = ARRAY_SIZE(tosakbd_row_gpios),
484 .num_col_gpios = ARRAY_SIZE(tosakbd_col_gpios),
485 .col_scan_delay_us = 10,
486 .debounce_ms = 10,
487 .wakeup = 1,
488};
489
414static struct platform_device tosakbd_device = { 490static struct platform_device tosakbd_device = {
415 .name = "tosa-keyboard", 491 .name = "matrix-keypad",
416 .id = -1, 492 .id = -1,
493 .dev = {
494 .platform_data = &tosakbd_pdata,
495 },
417}; 496};
418 497
419static struct gpio_keys_button tosa_gpio_keys[] = { 498static struct gpio_keys_button tosa_gpio_keys[] = {
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index 0aa858ebc573..797f2544d0ce 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -72,27 +72,14 @@ static unsigned long trizeps4_pin_config[] __initdata = {
72 GPIO79_nCS_3, /* Logic CS */ 72 GPIO79_nCS_3, /* Logic CS */
73 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */ 73 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, /* Logic irq */
74 74
75 /* AC97 */
76 GPIO28_AC97_BITCLK,
77 GPIO29_AC97_SDATA_IN_0,
78 GPIO30_AC97_SDATA_OUT,
79 GPIO31_AC97_SYNC,
80
75 /* LCD - 16bpp Active TFT */ 81 /* LCD - 16bpp Active TFT */
76 GPIO58_LCD_LDD_0, 82 GPIOxx_LCD_TFT_16BPP,
77 GPIO59_LCD_LDD_1,
78 GPIO60_LCD_LDD_2,
79 GPIO61_LCD_LDD_3,
80 GPIO62_LCD_LDD_4,
81 GPIO63_LCD_LDD_5,
82 GPIO64_LCD_LDD_6,
83 GPIO65_LCD_LDD_7,
84 GPIO66_LCD_LDD_8,
85 GPIO67_LCD_LDD_9,
86 GPIO68_LCD_LDD_10,
87 GPIO69_LCD_LDD_11,
88 GPIO70_LCD_LDD_12,
89 GPIO71_LCD_LDD_13,
90 GPIO72_LCD_LDD_14,
91 GPIO73_LCD_LDD_15,
92 GPIO74_LCD_FCLK,
93 GPIO75_LCD_LCLK,
94 GPIO76_LCD_PCLK,
95 GPIO77_LCD_BIAS,
96 83
97 /* UART */ 84 /* UART */
98 GPIO9_FFUART_CTS, 85 GPIO9_FFUART_CTS,
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index 89f258c9e126..1dd13346f977 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -281,7 +281,7 @@ static void viper_irq_handler(unsigned int irq, struct irq_desc *desc)
281 do { 281 do {
282 /* we're in a chained irq handler, 282 /* we're in a chained irq handler,
283 * so ack the interrupt by hand */ 283 * so ack the interrupt by hand */
284 GEDR(VIPER_CPLD_GPIO) = GPIO_bit(VIPER_CPLD_GPIO); 284 desc->chip->ack(irq);
285 285
286 if (likely(pending)) { 286 if (likely(pending)) {
287 irq = viper_bit_to_irq(__ffs(pending)); 287 irq = viper_bit_to_irq(__ffs(pending));
@@ -711,6 +711,12 @@ static mfp_cfg_t viper_pin_config[] __initdata = {
711 GPIO80_nCS_4, 711 GPIO80_nCS_4,
712 GPIO33_nCS_5, 712 GPIO33_nCS_5,
713 713
714 /* AC97 */
715 GPIO28_AC97_BITCLK,
716 GPIO29_AC97_SDATA_IN_0,
717 GPIO30_AC97_SDATA_OUT,
718 GPIO31_AC97_SYNC,
719
714 /* FP Backlight */ 720 /* FP Backlight */
715 GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */ 721 GPIO9_GPIO, /* VIPER_BCKLIGHT_EN_GPIO */
716 GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */ 722 GPIO10_GPIO, /* VIPER_LCD_EN_GPIO */
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 75f2a37f945d..39896d883584 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -26,6 +26,7 @@
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h> 27#include <linux/i2c/pca953x.h>
28#include <linux/apm-emulation.h> 28#include <linux/apm-emulation.h>
29#include <linux/can/platform/mcp251x.h>
29 30
30#include <asm/mach-types.h> 31#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
@@ -387,11 +388,47 @@ static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = {
387 .enable_dma = 1, 388 .enable_dma = 1,
388}; 389};
389 390
390static struct platform_device pxa2xx_spi_ssp3_device = { 391/* CAN bus on SPI */
391 .name = "pxa2xx-spi", 392static int zeus_mcp2515_setup(struct spi_device *sdev)
392 .id = 3, 393{
393 .dev = { 394 int err;
394 .platform_data = &pxa2xx_spi_ssp3_master_info, 395
396 err = gpio_request(ZEUS_CAN_SHDN_GPIO, "CAN shutdown");
397 if (err)
398 return err;
399
400 err = gpio_direction_output(ZEUS_CAN_SHDN_GPIO, 1);
401 if (err) {
402 gpio_free(ZEUS_CAN_SHDN_GPIO);
403 return err;
404 }
405
406 return 0;
407}
408
409static int zeus_mcp2515_transceiver_enable(int enable)
410{
411 gpio_set_value(ZEUS_CAN_SHDN_GPIO, !enable);
412 return 0;
413}
414
415static struct mcp251x_platform_data zeus_mcp2515_pdata = {
416 .oscillator_frequency = 16*1000*1000,
417 .model = CAN_MCP251X_MCP2515,
418 .board_specific_setup = zeus_mcp2515_setup,
419 .transceiver_enable = zeus_mcp2515_transceiver_enable,
420 .power_enable = zeus_mcp2515_transceiver_enable,
421};
422
423static struct spi_board_info zeus_spi_board_info[] = {
424 [0] = {
425 .modalias = "mcp251x",
426 .platform_data = &zeus_mcp2515_pdata,
427 .irq = gpio_to_irq(ZEUS_CAN_GPIO),
428 .max_speed_hz = 1*1000*1000,
429 .bus_num = 3,
430 .mode = SPI_MODE_0,
431 .chip_select = 0,
395 }, 432 },
396}; 433};
397 434
@@ -457,15 +494,28 @@ static struct platform_device zeus_pcmcia_device = {
457 }, 494 },
458}; 495};
459 496
497static struct resource zeus_max6369_resource = {
498 .start = ZEUS_CPLD_EXTWDOG_PHYS,
499 .end = ZEUS_CPLD_EXTWDOG_PHYS,
500 .flags = IORESOURCE_MEM,
501};
502
503struct platform_device zeus_max6369_device = {
504 .name = "max6369_wdt",
505 .id = -1,
506 .resource = &zeus_max6369_resource,
507 .num_resources = 1,
508};
509
460static struct platform_device *zeus_devices[] __initdata = { 510static struct platform_device *zeus_devices[] __initdata = {
461 &zeus_serial_device, 511 &zeus_serial_device,
462 &zeus_mtd_devices[0], 512 &zeus_mtd_devices[0],
463 &zeus_dm9k0_device, 513 &zeus_dm9k0_device,
464 &zeus_dm9k1_device, 514 &zeus_dm9k1_device,
465 &zeus_sram_device, 515 &zeus_sram_device,
466 &pxa2xx_spi_ssp3_device,
467 &zeus_leds_device, 516 &zeus_leds_device,
468 &zeus_pcmcia_device, 517 &zeus_pcmcia_device,
518 &zeus_max6369_device,
469}; 519};
470 520
471/* AC'97 */ 521/* AC'97 */
@@ -509,7 +559,9 @@ static void zeus_ohci_exit(struct device *dev)
509 559
510static struct pxaohci_platform_data zeus_ohci_platform_data = { 560static struct pxaohci_platform_data zeus_ohci_platform_data = {
511 .port_mode = PMM_NPS_MODE, 561 .port_mode = PMM_NPS_MODE,
512 .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW, 562 /* Clear Power Control Polarity Low and set Power Sense
563 * Polarity Low. Supply power to USB ports. */
564 .flags = ENABLE_PORT_ALL | POWER_SENSE_LOW,
513 .init = zeus_ohci_init, 565 .init = zeus_ohci_init,
514 .exit = zeus_ohci_exit, 566 .exit = zeus_ohci_exit,
515}; 567};
@@ -621,11 +673,15 @@ static struct pxa2xx_udc_mach_info zeus_udc_info = {
621 .udc_command = zeus_udc_command, 673 .udc_command = zeus_udc_command,
622}; 674};
623 675
676#ifdef CONFIG_PM
624static void zeus_power_off(void) 677static void zeus_power_off(void)
625{ 678{
626 local_irq_disable(); 679 local_irq_disable();
627 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); 680 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP);
628} 681}
682#else
683#define zeus_power_off NULL
684#endif
629 685
630#ifdef CONFIG_APM_EMULATION 686#ifdef CONFIG_APM_EMULATION
631static void zeus_get_power_status(struct apm_power_info *info) 687static void zeus_get_power_status(struct apm_power_info *info)
@@ -706,6 +762,12 @@ static struct i2c_board_info __initdata zeus_i2c_devices[] = {
706}; 762};
707 763
708static mfp_cfg_t zeus_pin_config[] __initdata = { 764static mfp_cfg_t zeus_pin_config[] __initdata = {
765 /* AC97 */
766 GPIO28_AC97_BITCLK,
767 GPIO29_AC97_SDATA_IN_0,
768 GPIO30_AC97_SDATA_OUT,
769 GPIO31_AC97_SYNC,
770
709 GPIO15_nCS_1, 771 GPIO15_nCS_1,
710 GPIO78_nCS_2, 772 GPIO78_nCS_2,
711 GPIO80_nCS_4, 773 GPIO80_nCS_4,
@@ -731,6 +793,11 @@ static mfp_cfg_t zeus_pin_config[] __initdata = {
731 GPIO104_CIF_DD_2, 793 GPIO104_CIF_DD_2,
732 GPIO105_CIF_DD_1, 794 GPIO105_CIF_DD_1,
733 795
796 GPIO81_SSP3_TXD,
797 GPIO82_SSP3_RXD,
798 GPIO83_SSP3_SFRM,
799 GPIO84_SSP3_SCLK,
800
734 GPIO48_nPOE, 801 GPIO48_nPOE,
735 GPIO49_nPWE, 802 GPIO49_nPWE,
736 GPIO50_nPIOR, 803 GPIO50_nPIOR,
@@ -785,6 +852,8 @@ static void __init zeus_init(void)
785 pxa_set_ac97_info(&zeus_ac97_info); 852 pxa_set_ac97_info(&zeus_ac97_info);
786 pxa_set_i2c_info(NULL); 853 pxa_set_i2c_info(NULL);
787 i2c_register_board_info(0, ARRAY_AND_SIZE(zeus_i2c_devices)); 854 i2c_register_board_info(0, ARRAY_AND_SIZE(zeus_i2c_devices));
855 pxa2xx_set_spi_info(3, &pxa2xx_spi_ssp3_master_info);
856 spi_register_board_info(zeus_spi_board_info, ARRAY_SIZE(zeus_spi_board_info));
788} 857}
789 858
790static struct map_desc zeus_io_desc[] __initdata = { 859static struct map_desc zeus_io_desc[] __initdata = {
@@ -807,12 +876,6 @@ static struct map_desc zeus_io_desc[] __initdata = {
807 .type = MT_DEVICE, 876 .type = MT_DEVICE,
808 }, 877 },
809 { 878 {
810 .virtual = ZEUS_CPLD_EXTWDOG,
811 .pfn = __phys_to_pfn(ZEUS_CPLD_EXTWDOG_PHYS),
812 .length = 0x1000,
813 .type = MT_DEVICE,
814 },
815 {
816 .virtual = ZEUS_PC104IO, 879 .virtual = ZEUS_PC104IO,
817 .pfn = __phys_to_pfn(ZEUS_PC104IO_PHYS), 880 .pfn = __phys_to_pfn(ZEUS_PC104IO_PHYS),
818 .length = 0x00800000, 881 .length = 0x00800000,
@@ -837,7 +900,7 @@ static void __init zeus_map_io(void)
837 PCFR = PCFR_OPDE | PCFR_DC_EN | PCFR_FS | PCFR_FP; 900 PCFR = PCFR_OPDE | PCFR_DC_EN | PCFR_FS | PCFR_FP;
838} 901}
839 902
840MACHINE_START(ARCOM_ZEUS, "Arcom ZEUS") 903MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
841 /* Maintainer: Marc Zyngier <maz@misterjones.org> */ 904 /* Maintainer: Marc Zyngier <maz@misterjones.org> */
842 .phys_io = 0x40000000, 905 .phys_io = 0x40000000,
843 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc), 906 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc),
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index 63b753f56c64..0d8e043804c2 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -21,7 +21,7 @@
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/cpu.h> 23#include <plat/cpu.h>
24#include <plat/dma-plat.h> 24#include <plat/dma-s3c24xx.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
27#include <mach/regs-gpio.h> 27#include <mach/regs-gpio.h>
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-core.h b/arch/arm/mach-s3c2410/include/mach/gpio-track.h
index f8b879a7973c..acb259103808 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio-track.h
@@ -15,7 +15,6 @@
15#ifndef __ASM_ARCH_GPIO_CORE_H 15#ifndef __ASM_ARCH_GPIO_CORE_H
16#define __ASM_ARCH_GPIO_CORE_H __FILE__ 16#define __ASM_ARCH_GPIO_CORE_H __FILE__
17 17
18#include <plat/gpio-core.h>
19#include <mach/regs-gpio.h> 18#include <mach/regs-gpio.h>
20 19
21extern struct s3c_gpio_chip s3c24xx_gpios[]; 20extern struct s3c_gpio_chip s3c24xx_gpios[];
diff --git a/arch/arm/plat-s3c24xx/include/plat/pm-core.h b/arch/arm/mach-s3c2410/include/mach/pm-core.h
index fb45dd9adca5..70a83b209e25 100644
--- a/arch/arm/plat-s3c24xx/include/plat/pm-core.h
+++ b/arch/arm/mach-s3c2410/include/mach/pm-core.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/include/plat/pll.h 1/* linux/arch/arm/mach-s3c2410/include/pm-core.h
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
index ebc85c6dadbf..fd672f330bf2 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
@@ -406,31 +406,31 @@
406#define S3C2443_GPE5_SD1_CLK (0x02 << 10) 406#define S3C2443_GPE5_SD1_CLK (0x02 << 10)
407#define S3C2400_GPE5_EINT5 (0x02 << 10) 407#define S3C2400_GPE5_EINT5 (0x02 << 10)
408#define S3C2400_GPE5_TCLK1 (0x03 << 10) 408#define S3C2400_GPE5_TCLK1 (0x03 << 10)
409#define S3C2443_GPE5_AC_BITCLK (0x03 << 10)
409 410
410#define S3C2410_GPE6_SDCMD (0x02 << 12) 411#define S3C2410_GPE6_SDCMD (0x02 << 12)
411#define S3C2443_GPE6_SD1_CMD (0x02 << 12) 412#define S3C2443_GPE6_SD1_CMD (0x02 << 12)
412#define S3C2443_GPE6_AC_BITCLK (0x03 << 12) 413#define S3C2443_GPE6_AC_SDI (0x03 << 12)
413#define S3C2400_GPE6_EINT6 (0x02 << 12) 414#define S3C2400_GPE6_EINT6 (0x02 << 12)
414 415
415#define S3C2410_GPE7_SDDAT0 (0x02 << 14) 416#define S3C2410_GPE7_SDDAT0 (0x02 << 14)
416#define S3C2443_GPE5_SD1_DAT0 (0x02 << 14) 417#define S3C2443_GPE5_SD1_DAT0 (0x02 << 14)
417#define S3C2443_GPE7_AC_SDI (0x03 << 14) 418#define S3C2443_GPE7_AC_SDO (0x03 << 14)
418#define S3C2400_GPE7_EINT7 (0x02 << 14) 419#define S3C2400_GPE7_EINT7 (0x02 << 14)
419 420
420#define S3C2410_GPE8_SDDAT1 (0x02 << 16) 421#define S3C2410_GPE8_SDDAT1 (0x02 << 16)
421#define S3C2443_GPE8_SD1_DAT1 (0x02 << 16) 422#define S3C2443_GPE8_SD1_DAT1 (0x02 << 16)
422#define S3C2443_GPE8_AC_SDO (0x03 << 16) 423#define S3C2443_GPE8_AC_SYNC (0x03 << 16)
423#define S3C2400_GPE8_nXDACK0 (0x02 << 16) 424#define S3C2400_GPE8_nXDACK0 (0x02 << 16)
424 425
425#define S3C2410_GPE9_SDDAT2 (0x02 << 18) 426#define S3C2410_GPE9_SDDAT2 (0x02 << 18)
426#define S3C2443_GPE9_SD1_DAT2 (0x02 << 18) 427#define S3C2443_GPE9_SD1_DAT2 (0x02 << 18)
427#define S3C2443_GPE9_AC_SYNC (0x03 << 18) 428#define S3C2443_GPE9_AC_nRESET (0x03 << 18)
428#define S3C2400_GPE9_nXDACK1 (0x02 << 18) 429#define S3C2400_GPE9_nXDACK1 (0x02 << 18)
429#define S3C2400_GPE9_nXBACK (0x03 << 18) 430#define S3C2400_GPE9_nXBACK (0x03 << 18)
430 431
431#define S3C2410_GPE10_SDDAT3 (0x02 << 20) 432#define S3C2410_GPE10_SDDAT3 (0x02 << 20)
432#define S3C2443_GPE10_SD1_DAT3 (0x02 << 20) 433#define S3C2443_GPE10_SD1_DAT3 (0x02 << 20)
433#define S3C2443_GPE10_AC_nRESET (0x03 << 20)
434#define S3C2400_GPE10_nXDREQ0 (0x02 << 20) 434#define S3C2400_GPE10_nXDREQ0 (0x02 << 20)
435 435
436#define S3C2410_GPE11_SPIMISO0 (0x02 << 22) 436#define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
index 6026d091a2fe..d87ebe0cb625 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
@@ -42,23 +42,14 @@
42 42
43#define S3C2443_PLLCON_OFF (1<<24) 43#define S3C2443_PLLCON_OFF (1<<24)
44 44
45#define S3C2443_CLKSRC_I2S_EXT (1<<14)
46#define S3C2443_CLKSRC_I2S_EPLLDIV (0<<14)
47#define S3C2443_CLKSRC_I2S_EPLLREF (2<<14)
48#define S3C2443_CLKSRC_I2S_EPLLREF3 (3<<14)
49#define S3C2443_CLKSRC_I2S_MASK (3<<14)
50
51#define S3C2443_CLKSRC_EPLLREF_XTAL (2<<7) 45#define S3C2443_CLKSRC_EPLLREF_XTAL (2<<7)
52#define S3C2443_CLKSRC_EPLLREF_EXTCLK (3<<7) 46#define S3C2443_CLKSRC_EPLLREF_EXTCLK (3<<7)
53#define S3C2443_CLKSRC_EPLLREF_MPLLREF (0<<7) 47#define S3C2443_CLKSRC_EPLLREF_MPLLREF (0<<7)
54#define S3C2443_CLKSRC_EPLLREF_MPLLREF2 (1<<7) 48#define S3C2443_CLKSRC_EPLLREF_MPLLREF2 (1<<7)
55#define S3C2443_CLKSRC_EPLLREF_MASK (3<<7) 49#define S3C2443_CLKSRC_EPLLREF_MASK (3<<7)
56 50
57#define S3C2443_CLKSRC_ESYSCLK_EPLL (1<<6)
58#define S3C2443_CLKSRC_MSYSCLK_MPLL (1<<4)
59#define S3C2443_CLKSRC_EXTCLK_DIV (1<<3) 51#define S3C2443_CLKSRC_EXTCLK_DIV (1<<3)
60 52
61#define S3C2443_CLKDIV0_DVS (1<<13)
62#define S3C2443_CLKDIV0_HALF_HCLK (1<<3) 53#define S3C2443_CLKDIV0_HALF_HCLK (1<<3)
63#define S3C2443_CLKDIV0_HALF_PCLK (1<<2) 54#define S3C2443_CLKDIV0_HALF_PCLK (1<<2)
64 55
@@ -81,28 +72,7 @@
81#define S3C2443_CLKDIV0_ARMDIV_12 (13<<9) 72#define S3C2443_CLKDIV0_ARMDIV_12 (13<<9)
82#define S3C2443_CLKDIV0_ARMDIV_16 (15<<9) 73#define S3C2443_CLKDIV0_ARMDIV_16 (15<<9)
83 74
84/* S3C2443_CLKDIV1 */ 75/* S3C2443_CLKDIV1 removed, only used in clock.c code */
85
86#define S3C2443_CLKDIV1_CAMDIV_MASK (15<<26)
87#define S3C2443_CLKDIV1_CAMDIV_SHIFT (26)
88
89#define S3C2443_CLKDIV1_HSSPIDIV_MASK (3<<24)
90#define S3C2443_CLKDIV1_HSSPIDIV_SHIFT (24)
91
92#define S3C2443_CLKDIV1_DISPDIV_MASK (0xff<<16)
93#define S3C2443_CLKDIV1_DISPDIV_SHIFT (16)
94
95#define S3C2443_CLKDIV1_I2SDIV_MASK (15<<12)
96#define S3C2443_CLKDIV1_I2SDIV_SHIFT (12)
97
98#define S3C2443_CLKDIV1_UARTDIV_MASK (15<<8)
99#define S3C2443_CLKDIV1_UARTDIV_SHIFT (8)
100
101#define S3C2443_CLKDIV1_HSMMCDIV_MASK (3<<6)
102#define S3C2443_CLKDIV1_HSMMCDIV_SHIFT (6)
103
104#define S3C2443_CLKDIV1_USBHOSTDIV_MASK (3<<4)
105#define S3C2443_CLKDIV1_USBHOSTDIV_SHIFT (4)
106 76
107#define S3C2443_CLKCON_NAND 77#define S3C2443_CLKCON_NAND
108 78
diff --git a/arch/arm/mach-s3c2410/include/mach/spi-gpio.h b/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
index 980a099e209c..dcef2287cb38 100644
--- a/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/spi-gpio.h
@@ -3,7 +3,7 @@
3 * Copyright (c) 2006 Simtec Electronics 3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - SPI Controller platfrom_device info 6 * S3C2410 - SPI Controller platform_device info
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/mach/timex.h b/arch/arm/mach-s3c2410/include/mach/timex.h
index 2a425ed0a7e0..fe9ca1ffd51b 100644
--- a/arch/arm/plat-s3c/include/mach/timex.h
+++ b/arch/arm/mach-s3c2410/include/mach/timex.h
@@ -19,8 +19,6 @@
19 * for the time conversion functions to/from jiffies is acceptable. 19 * for the time conversion functions to/from jiffies is acceptable.
20*/ 20*/
21 21
22
23#define CLOCK_TICK_RATE 12000000 22#define CLOCK_TICK_RATE 12000000
24 23
25
26#endif /* __ASM_ARCH_TIMEX_H */ 24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/plat-s3c/include/mach/vmalloc.h b/arch/arm/mach-s3c2410/include/mach/vmalloc.h
index 299d95f365c9..315b0078a34d 100644
--- a/arch/arm/plat-s3c/include/mach/vmalloc.h
+++ b/arch/arm/mach-s3c2410/include/mach/vmalloc.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/mach/vmalloc.h 1/* arch/arm/mach-s3c2410/include/mach/vmalloc.h
2 * 2 *
3 * from arch/arm/mach-iop3xx/include/mach/vmalloc.h 3 * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
4 * 4 *
@@ -15,6 +15,6 @@
15#ifndef __ASM_ARCH_VMALLOC_H 15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H 16#define __ASM_ARCH_VMALLOC_H
17 17
18#define VMALLOC_END (0xe0000000UL) 18#define VMALLOC_END (0xE0000000)
19 19
20#endif /* __ASM_ARCH_VMALLOC_H */ 20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 06a84adfb13f..7047317ed7f4 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -153,7 +153,7 @@ static struct platform_device *amlm5900_devices[] __initdata = {
153 &s3c_device_adc, 153 &s3c_device_adc,
154 &s3c_device_wdt, 154 &s3c_device_wdt,
155 &s3c_device_i2c0, 155 &s3c_device_i2c0,
156 &s3c_device_usb, 156 &s3c_device_ohci,
157 &s3c_device_rtc, 157 &s3c_device_rtc,
158 &s3c_device_usbgadget, 158 &s3c_device_usbgadget,
159 &s3c_device_sdi, 159 &s3c_device_sdi,
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 97162fdd0590..02b1b6220cba 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -584,7 +584,7 @@ static struct s3c_hwmon_pdata bast_hwmon_info = {
584// cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0 584// cat /sys/devices/platform/s3c24xx-adc/s3c-hwmon/in_0
585 585
586static struct platform_device *bast_devices[] __initdata = { 586static struct platform_device *bast_devices[] __initdata = {
587 &s3c_device_usb, 587 &s3c_device_ohci,
588 &s3c_device_lcd, 588 &s3c_device_lcd,
589 &s3c_device_wdt, 589 &s3c_device_wdt,
590 &s3c_device_i2c0, 590 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 1e34abe1a19e..fbedd0760941 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -196,7 +196,7 @@ static struct platform_device h1940_device_bluetooth = {
196 .id = -1, 196 .id = -1,
197}; 197};
198 198
199static struct s3c24xx_mci_pdata h1940_mmc_cfg = { 199static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
200 .gpio_detect = S3C2410_GPF(5), 200 .gpio_detect = S3C2410_GPF(5),
201 .gpio_wprotect = S3C2410_GPH(8), 201 .gpio_wprotect = S3C2410_GPH(8),
202 .set_power = NULL, 202 .set_power = NULL,
@@ -272,7 +272,7 @@ static struct platform_device h1940_lcd_powerdev = {
272 272
273static struct platform_device *h1940_devices[] __initdata = { 273static struct platform_device *h1940_devices[] __initdata = {
274 &s3c_device_ts, 274 &s3c_device_ts,
275 &s3c_device_usb, 275 &s3c_device_ohci,
276 &s3c_device_lcd, 276 &s3c_device_lcd,
277 &s3c_device_wdt, 277 &s3c_device_wdt,
278 &s3c_device_i2c0, 278 &s3c_device_i2c0,
@@ -311,12 +311,11 @@ static void __init h1940_init(void)
311 u32 tmp; 311 u32 tmp;
312 312
313 s3c24xx_fb_set_platdata(&h1940_fb_info); 313 s3c24xx_fb_set_platdata(&h1940_fb_info);
314 s3c24xx_mci_set_platdata(&h1940_mmc_cfg);
314 s3c24xx_udc_set_platdata(&h1940_udc_cfg); 315 s3c24xx_udc_set_platdata(&h1940_udc_cfg);
315 s3c24xx_ts_set_platdata(&h1940_ts_cfg); 316 s3c24xx_ts_set_platdata(&h1940_ts_cfg);
316 s3c_i2c0_set_platdata(NULL); 317 s3c_i2c0_set_platdata(NULL);
317 318
318 s3c_device_sdi.dev.platform_data = &h1940_mmc_cfg;
319
320 /* Turn off suspend on both USB ports, and switch the 319 /* Turn off suspend on both USB ports, and switch the
321 * selectable USB port to USB device mode. */ 320 * selectable USB port to USB device mode. */
322 321
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 0405712c2263..684710f88142 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -322,7 +322,7 @@ static struct platform_device *n30_devices[] __initdata = {
322 &s3c_device_wdt, 322 &s3c_device_wdt,
323 &s3c_device_i2c0, 323 &s3c_device_i2c0,
324 &s3c_device_iis, 324 &s3c_device_iis,
325 &s3c_device_usb, 325 &s3c_device_ohci,
326 &s3c_device_usbgadget, 326 &s3c_device_usbgadget,
327 &n30_button_device, 327 &n30_button_device,
328 &n30_blue_led, 328 &n30_blue_led,
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index f6c7261a4a12..d8c7f2efc1a7 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -92,7 +92,7 @@ static struct platform_device otom_device_nor = {
92/* Standard OTOM devices */ 92/* Standard OTOM devices */
93 93
94static struct platform_device *otom11_devices[] __initdata = { 94static struct platform_device *otom11_devices[] __initdata = {
95 &s3c_device_usb, 95 &s3c_device_ohci,
96 &s3c_device_lcd, 96 &s3c_device_lcd,
97 &s3c_device_wdt, 97 &s3c_device_wdt,
98 &s3c_device_i2c0, 98 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index ab092bcda393..92a4ec375d82 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -246,7 +246,7 @@ static struct platform_device qt2410_spi = {
246/* Board devices */ 246/* Board devices */
247 247
248static struct platform_device *qt2410_devices[] __initdata = { 248static struct platform_device *qt2410_devices[] __initdata = {
249 &s3c_device_usb, 249 &s3c_device_ohci,
250 &s3c_device_lcd, 250 &s3c_device_lcd,
251 &s3c_device_wdt, 251 &s3c_device_wdt,
252 &s3c_device_i2c0, 252 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index c49126ccb1d5..452223042201 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -87,7 +87,7 @@ static struct s3c2410_uartcfg smdk2410_uartcfgs[] __initdata = {
87}; 87};
88 88
89static struct platform_device *smdk2410_devices[] __initdata = { 89static struct platform_device *smdk2410_devices[] __initdata = {
90 &s3c_device_usb, 90 &s3c_device_ohci,
91 &s3c_device_lcd, 91 &s3c_device_lcd,
92 &s3c_device_wdt, 92 &s3c_device_wdt,
93 &s3c_device_i2c0, 93 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
index 8fdb0430bd48..929164a8e9b1 100644
--- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
@@ -129,7 +129,7 @@ static struct platform_device *tct_hammer_devices[] __initdata = {
129 &s3c_device_adc, 129 &s3c_device_adc,
130 &s3c_device_wdt, 130 &s3c_device_wdt,
131 &s3c_device_i2c0, 131 &s3c_device_i2c0,
132 &s3c_device_usb, 132 &s3c_device_ohci,
133 &s3c_device_rtc, 133 &s3c_device_rtc,
134 &s3c_device_usbgadget, 134 &s3c_device_usbgadget,
135 &s3c_device_sdi, 135 &s3c_device_sdi,
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 0d61fb577170..9051f0d31123 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -334,7 +334,7 @@ static struct i2c_board_info vr1000_i2c_devs[] __initdata = {
334/* devices for this board */ 334/* devices for this board */
335 335
336static struct platform_device *vr1000_devices[] __initdata = { 336static struct platform_device *vr1000_devices[] __initdata = {
337 &s3c_device_usb, 337 &s3c_device_ohci,
338 &s3c_device_lcd, 338 &s3c_device_lcd,
339 &s3c_device_wdt, 339 &s3c_device_wdt,
340 &s3c_device_i2c0, 340 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 6b9d0d83a6f9..29bd3d987bec 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -91,7 +91,7 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
91 } 91 }
92} 92}
93 93
94static struct s3c2410_hcd_info usb_simtec_info = { 94static struct s3c2410_hcd_info usb_simtec_info __initdata = {
95 .port[0] = { 95 .port[0] = {
96 .flags = S3C_HCDFLG_USED 96 .flags = S3C_HCDFLG_USED
97 }, 97 },
@@ -127,6 +127,6 @@ int usb_simtec_init(void)
127 gpio_direction_output(S3C2410_GPB(4), 1); 127 gpio_direction_output(S3C2410_GPB(4), 1);
128 gpio_direction_input(S3C2410_GPG(10)); 128 gpio_direction_input(S3C2410_GPG(10));
129 129
130 s3c_device_usb.dev.platform_data = &usb_simtec_info; 130 s3c_ohci_set_platdata(&usb_simtec_info);
131 return 0; 131 return 0;
132} 132}
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
index a037df5e1c2d..0c0505b025cb 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c2412/clock.c
@@ -124,7 +124,9 @@ static struct clk clk_usysclk = {
124 .name = "usysclk", 124 .name = "usysclk",
125 .id = -1, 125 .id = -1,
126 .parent = &clk_xtal, 126 .parent = &clk_xtal,
127 .set_parent = s3c2412_setparent_usysclk, 127 .ops = &(struct clk_ops) {
128 .set_parent = s3c2412_setparent_usysclk,
129 },
128}; 130};
129 131
130static struct clk clk_mrefclk = { 132static struct clk clk_mrefclk = {
@@ -199,10 +201,12 @@ static int s3c2412_setrate_usbsrc(struct clk *clk, unsigned long rate)
199static struct clk clk_usbsrc = { 201static struct clk clk_usbsrc = {
200 .name = "usbsrc", 202 .name = "usbsrc",
201 .id = -1, 203 .id = -1,
202 .get_rate = s3c2412_getrate_usbsrc, 204 .ops = &(struct clk_ops) {
203 .set_rate = s3c2412_setrate_usbsrc, 205 .get_rate = s3c2412_getrate_usbsrc,
204 .round_rate = s3c2412_roundrate_usbsrc, 206 .set_rate = s3c2412_setrate_usbsrc,
205 .set_parent = s3c2412_setparent_usbsrc, 207 .round_rate = s3c2412_roundrate_usbsrc,
208 .set_parent = s3c2412_setparent_usbsrc,
209 },
206}; 210};
207 211
208static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent) 212static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent)
@@ -225,7 +229,9 @@ static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent)
225static struct clk clk_msysclk = { 229static struct clk clk_msysclk = {
226 .name = "msysclk", 230 .name = "msysclk",
227 .id = -1, 231 .id = -1,
228 .set_parent = s3c2412_setparent_msysclk, 232 .ops = &(struct clk_ops) {
233 .set_parent = s3c2412_setparent_msysclk,
234 },
229}; 235};
230 236
231static int s3c2412_setparent_armclk(struct clk *clk, struct clk *parent) 237static int s3c2412_setparent_armclk(struct clk *clk, struct clk *parent)
@@ -264,7 +270,9 @@ static struct clk clk_armclk = {
264 .name = "armclk", 270 .name = "armclk",
265 .id = -1, 271 .id = -1,
266 .parent = &clk_msysclk, 272 .parent = &clk_msysclk,
267 .set_parent = s3c2412_setparent_armclk, 273 .ops = &(struct clk_ops) {
274 .set_parent = s3c2412_setparent_armclk,
275 },
268}; 276};
269 277
270/* these next clocks have an divider immediately after them, 278/* these next clocks have an divider immediately after them,
@@ -337,10 +345,12 @@ static int s3c2412_setrate_uart(struct clk *clk, unsigned long rate)
337static struct clk clk_uart = { 345static struct clk clk_uart = {
338 .name = "uartclk", 346 .name = "uartclk",
339 .id = -1, 347 .id = -1,
340 .get_rate = s3c2412_getrate_uart, 348 .ops = &(struct clk_ops) {
341 .set_rate = s3c2412_setrate_uart, 349 .get_rate = s3c2412_getrate_uart,
342 .set_parent = s3c2412_setparent_uart, 350 .set_rate = s3c2412_setrate_uart,
343 .round_rate = s3c2412_roundrate_clksrc, 351 .set_parent = s3c2412_setparent_uart,
352 .round_rate = s3c2412_roundrate_clksrc,
353 },
344}; 354};
345 355
346static int s3c2412_setparent_i2s(struct clk *clk, struct clk *parent) 356static int s3c2412_setparent_i2s(struct clk *clk, struct clk *parent)
@@ -388,10 +398,12 @@ static int s3c2412_setrate_i2s(struct clk *clk, unsigned long rate)
388static struct clk clk_i2s = { 398static struct clk clk_i2s = {
389 .name = "i2sclk", 399 .name = "i2sclk",
390 .id = -1, 400 .id = -1,
391 .get_rate = s3c2412_getrate_i2s, 401 .ops = &(struct clk_ops) {
392 .set_rate = s3c2412_setrate_i2s, 402 .get_rate = s3c2412_getrate_i2s,
393 .set_parent = s3c2412_setparent_i2s, 403 .set_rate = s3c2412_setrate_i2s,
394 .round_rate = s3c2412_roundrate_clksrc, 404 .set_parent = s3c2412_setparent_i2s,
405 .round_rate = s3c2412_roundrate_clksrc,
406 },
395}; 407};
396 408
397static int s3c2412_setparent_cam(struct clk *clk, struct clk *parent) 409static int s3c2412_setparent_cam(struct clk *clk, struct clk *parent)
@@ -438,10 +450,12 @@ static int s3c2412_setrate_cam(struct clk *clk, unsigned long rate)
438static struct clk clk_cam = { 450static struct clk clk_cam = {
439 .name = "camif-upll", /* same as 2440 name */ 451 .name = "camif-upll", /* same as 2440 name */
440 .id = -1, 452 .id = -1,
441 .get_rate = s3c2412_getrate_cam, 453 .ops = &(struct clk_ops) {
442 .set_rate = s3c2412_setrate_cam, 454 .get_rate = s3c2412_getrate_cam,
443 .set_parent = s3c2412_setparent_cam, 455 .set_rate = s3c2412_setrate_cam,
444 .round_rate = s3c2412_roundrate_clksrc, 456 .set_parent = s3c2412_setparent_cam,
457 .round_rate = s3c2412_roundrate_clksrc,
458 },
445}; 459};
446 460
447/* standard clock definitions */ 461/* standard clock definitions */
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index f8d16fc10bc6..e880524904eb 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -20,7 +20,7 @@
20 20
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/dma-plat.h> 23#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index c9fa3fca486c..14f4798291aa 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -468,7 +468,7 @@ static struct i2c_board_info jive_i2c_devs[] __initdata = {
468/* The platform devices being used. */ 468/* The platform devices being used. */
469 469
470static struct platform_device *jive_devices[] __initdata = { 470static struct platform_device *jive_devices[] __initdata = {
471 &s3c_device_usb, 471 &s3c_device_ohci,
472 &s3c_device_rtc, 472 &s3c_device_rtc,
473 &s3c_device_wdt, 473 &s3c_device_wdt,
474 &s3c_device_i2c0, 474 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index 9a5e43419722..0392065af1af 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -104,8 +104,7 @@ static struct s3c2410_udc_mach_info smdk2413_udc_cfg __initdata = {
104 104
105 105
106static struct platform_device *smdk2413_devices[] __initdata = { 106static struct platform_device *smdk2413_devices[] __initdata = {
107 &s3c_device_usb, 107 &s3c_device_ohci,
108 //&s3c_device_lcd,
109 &s3c_device_wdt, 108 &s3c_device_wdt,
110 &s3c_device_i2c0, 109 &s3c_device_i2c0,
111 &s3c_device_iis, 110 &s3c_device_iis,
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index a6ba591b26bb..3ca9265b6997 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -121,7 +121,7 @@ static struct s3c2410_platform_nand __initdata vstms_nand_info = {
121}; 121};
122 122
123static struct platform_device *vstms_devices[] __initdata = { 123static struct platform_device *vstms_devices[] __initdata = {
124 &s3c_device_usb, 124 &s3c_device_ohci,
125 &s3c_device_wdt, 125 &s3c_device_wdt,
126 &s3c_device_i2c0, 126 &s3c_device_i2c0,
127 &s3c_device_iis, 127 &s3c_device_iis,
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 80879358eb2f..7f465265cf04 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -15,14 +15,67 @@ config CPU_S3C2440
15 help 15 help
16 Support for S3C2440 Samsung Mobile CPU based systems. 16 Support for S3C2440 Samsung Mobile CPU based systems.
17 17
18config CPU_S3C2442
19 bool
20 depends on ARCH_S3C2410
21 select CPU_ARM920T
22 select S3C2410_CLOCK
23 select S3C2410_GPIO
24 select S3C2410_PM if PM
25 select CPU_S3C244X
26 select CPU_LLSERIAL_S3C2440
27 help
28 Support for S3C2442 Samsung Mobile CPU based systems.
29
30config CPU_S3C244X
31 bool
32 depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442)
33 help
34 Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
35
36
37
38config S3C2440_CPUFREQ
39 bool "S3C2440/S3C2442 CPU Frequency scaling support"
40 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
41 select S3C2410_CPUFREQ_UTILS
42 default y
43 help
44 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
45
46config S3C2440_XTAL_12000000
47 bool
48 help
49 Indicate that the build needs to support 12MHz system
50 crystal.
51
52config S3C2440_XTAL_16934400
53 bool
54 help
55 Indicate that the build needs to support 16.9344MHz system
56 crystal.
57
58config S3C2440_PLL_12000000
59 bool
60 depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
61 default y if CPU_FREQ_S3C24XX_PLL
62 help
63 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals.
64
65config S3C2440_PLL_16934400
66 bool
67 depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
68 default y if CPU_FREQ_S3C24XX_PLL
69 help
70 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
71
18config S3C2440_DMA 72config S3C2440_DMA
19 bool 73 bool
20 depends on ARCH_S3C2410 && CPU_S3C24405B 74 depends on ARCH_S3C2410 && CPU_S3C24405B
21 help 75 help
22 Support for S3C2440 specific DMA code5A 76 Support for S3C2440 specific DMA code5A
23 77
24 78menu "S3C2440 and S3C2442 Machines"
25menu "S3C2440 Machines"
26 79
27config MACH_ANUBIS 80config MACH_ANUBIS
28 bool "Simtec Electronics ANUBIS" 81 bool "Simtec Electronics ANUBIS"
@@ -37,6 +90,18 @@ config MACH_ANUBIS
37 Say Y here if you are using the Simtec Electronics ANUBIS 90 Say Y here if you are using the Simtec Electronics ANUBIS
38 development system 91 development system
39 92
93config MACH_NEO1973_GTA02
94 bool "Openmoko GTA02 / Freerunner phone"
95 select CPU_S3C2442
96 select MFD_PCF50633
97 select PCF50633_GPIO
98 select I2C
99 select POWER_SUPPLY
100 select MACH_NEO1973
101 select S3C2410_PWM
102 help
103 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
104
40config MACH_OSIRIS 105config MACH_OSIRIS
41 bool "Simtec IM2440D20 (OSIRIS) module" 106 bool "Simtec IM2440D20 (OSIRIS) module"
42 select CPU_S3C2440 107 select CPU_S3C2440
@@ -94,11 +159,14 @@ config MACH_NEXCODER_2440
94 159
95config SMDK2440_CPU2440 160config SMDK2440_CPU2440
96 bool "SMDK2440 with S3C2440 CPU module" 161 bool "SMDK2440 with S3C2440 CPU module"
97 depends on ARCH_S3C2440
98 default y if ARCH_S3C2440 162 default y if ARCH_S3C2440
99 select S3C2440_XTAL_16934400 163 select S3C2440_XTAL_16934400
100 select CPU_S3C2440 164 select CPU_S3C2440
101 165
166config SMDK2440_CPU2442
167 bool "SMDM2440 with S3C2442 CPU module"
168 select CPU_S3C2442
169
102config MACH_AT2440EVB 170config MACH_AT2440EVB
103 bool "Avantech AT2440EVB development board" 171 bool "Avantech AT2440EVB development board"
104 select CPU_S3C2440 172 select CPU_S3C2440
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
index 5f3224531885..c85ba32d8956 100644
--- a/arch/arm/mach-s3c2440/Makefile
+++ b/arch/arm/mach-s3c2440/Makefile
@@ -10,10 +10,20 @@ obj-n :=
10obj- := 10obj- :=
11 11
12obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o 12obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o
13obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
14
13obj-$(CONFIG_CPU_S3C2440) += irq.o 15obj-$(CONFIG_CPU_S3C2440) += irq.o
14obj-$(CONFIG_CPU_S3C2440) += clock.o 16obj-$(CONFIG_CPU_S3C2440) += clock.o
15obj-$(CONFIG_S3C2440_DMA) += dma.o 17obj-$(CONFIG_S3C2440_DMA) += dma.o
16 18
19obj-$(CONFIG_CPU_S3C244X) += s3c244x.o
20obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o
21obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o
22obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
23
24obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o
25obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o
26
17# Machine support 27# Machine support
18 28
19obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o 29obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o
@@ -23,6 +33,7 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
23obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o 33obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
24obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o 34obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
25obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o 35obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
36obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
26 37
27# extra machine support 38# extra machine support
28 39
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c
index d1c29b2537cd..3dc2426e2345 100644
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c2440/clock.c
@@ -98,8 +98,10 @@ static struct clk s3c2440_clk_cam = {
98static struct clk s3c2440_clk_cam_upll = { 98static struct clk s3c2440_clk_cam_upll = {
99 .name = "camif-upll", 99 .name = "camif-upll",
100 .id = -1, 100 .id = -1,
101 .set_rate = s3c2440_camif_upll_setrate, 101 .ops = &(struct clk_ops) {
102 .round_rate = s3c2440_camif_upll_round, 102 .set_rate = s3c2440_camif_upll_setrate,
103 .round_rate = s3c2440_camif_upll_round,
104 },
103}; 105};
104 106
105static struct clk s3c2440_clk_ac97 = { 107static struct clk s3c2440_clk_ac97 = {
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index e08e081430f0..3b0529f54e9c 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -20,7 +20,7 @@
20#include <mach/map.h> 20#include <mach/map.h>
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/dma-plat.h> 23#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
diff --git a/arch/arm/mach-s3c2440/dsc.c b/arch/arm/mach-s3c2440/dsc.c
index 554044272771..9ea66e31f626 100644
--- a/arch/arm/mach-s3c2440/dsc.c
+++ b/arch/arm/mach-s3c2440/dsc.c
@@ -28,7 +28,7 @@
28#include <mach/regs-dsc.h> 28#include <mach/regs-dsc.h>
29 29
30#include <plat/cpu.h> 30#include <plat/cpu.h>
31#include <plat/s3c2440.h> 31#include <plat/s3c244x.h>
32 32
33int s3c2440_set_dsc(unsigned int pin, unsigned int value) 33int s3c2440_set_dsc(unsigned int pin, unsigned int value)
34{ 34{
diff --git a/arch/arm/mach-s3c2442/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h
index 953331d8d56a..953331d8d56a 100644
--- a/arch/arm/mach-s3c2442/include/mach/gta02.h
+++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 62a4c3eba97f..b73f78a9da5c 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -409,7 +409,7 @@ static struct platform_device anubis_device_sm501 = {
409/* Standard Anubis devices */ 409/* Standard Anubis devices */
410 410
411static struct platform_device *anubis_devices[] __initdata = { 411static struct platform_device *anubis_devices[] __initdata = {
412 &s3c_device_usb, 412 &s3c_device_ohci,
413 &s3c_device_wdt, 413 &s3c_device_wdt,
414 &s3c_device_adc, 414 &s3c_device_adc,
415 &s3c_device_i2c0, 415 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index aa69290e04c6..84725791e6bf 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -165,7 +165,7 @@ static struct platform_device at2440evb_device_eth = {
165 }, 165 },
166}; 166};
167 167
168static struct s3c24xx_mci_pdata at2440evb_mci_pdata = { 168static struct s3c24xx_mci_pdata at2440evb_mci_pdata __initdata = {
169 .gpio_detect = S3C2410_GPG(10), 169 .gpio_detect = S3C2410_GPG(10),
170}; 170};
171 171
@@ -203,7 +203,7 @@ static struct s3c2410fb_mach_info at2440evb_fb_info __initdata = {
203}; 203};
204 204
205static struct platform_device *at2440evb_devices[] __initdata = { 205static struct platform_device *at2440evb_devices[] __initdata = {
206 &s3c_device_usb, 206 &s3c_device_ohci,
207 &s3c_device_wdt, 207 &s3c_device_wdt,
208 &s3c_device_adc, 208 &s3c_device_adc,
209 &s3c_device_i2c0, 209 &s3c_device_i2c0,
@@ -216,8 +216,6 @@ static struct platform_device *at2440evb_devices[] __initdata = {
216 216
217static void __init at2440evb_map_io(void) 217static void __init at2440evb_map_io(void)
218{ 218{
219 s3c_device_sdi.dev.platform_data = &at2440evb_mci_pdata;
220
221 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc)); 219 s3c24xx_init_io(at2440evb_iodesc, ARRAY_SIZE(at2440evb_iodesc));
222 s3c24xx_init_clocks(16934400); 220 s3c24xx_init_clocks(16934400);
223 s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs)); 221 s3c24xx_init_uarts(at2440evb_uartcfgs, ARRAY_SIZE(at2440evb_uartcfgs));
@@ -226,6 +224,7 @@ static void __init at2440evb_map_io(void)
226static void __init at2440evb_init(void) 224static void __init at2440evb_init(void)
227{ 225{
228 s3c24xx_fb_set_platdata(&at2440evb_fb_info); 226 s3c24xx_fb_set_platdata(&at2440evb_fb_info);
227 s3c24xx_mci_set_platdata(&at2440evb_mci_pdata);
229 s3c_nand_set_platdata(&at2440evb_nand_info); 228 s3c_nand_set_platdata(&at2440evb_nand_info);
230 s3c_i2c0_set_platdata(NULL); 229 s3c_i2c0_set_platdata(NULL);
231 230
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 0b4a3a03071f..45799c608d8f 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -544,7 +544,7 @@ static struct platform_device gta02_bl_dev = {
544 544
545 545
546/* USB */ 546/* USB */
547static struct s3c2410_hcd_info gta02_usb_info = { 547static struct s3c2410_hcd_info gta02_usb_info __initdata = {
548 .port[0] = { 548 .port[0] = {
549 .flags = S3C_HCDFLG_USED, 549 .flags = S3C_HCDFLG_USED,
550 }, 550 },
@@ -565,7 +565,7 @@ static void __init gta02_map_io(void)
565/* These are the guys that don't need to be children of PMU. */ 565/* These are the guys that don't need to be children of PMU. */
566 566
567static struct platform_device *gta02_devices[] __initdata = { 567static struct platform_device *gta02_devices[] __initdata = {
568 &s3c_device_usb, 568 &s3c_device_ohci,
569 &s3c_device_wdt, 569 &s3c_device_wdt,
570 &s3c_device_sdi, 570 &s3c_device_sdi,
571 &s3c_device_usbgadget, 571 &s3c_device_usbgadget,
@@ -623,9 +623,8 @@ static void __init gta02_machine_init(void)
623 INIT_DELAYED_WORK(&gta02_charger_work, gta02_charger_worker); 623 INIT_DELAYED_WORK(&gta02_charger_work, gta02_charger_worker);
624#endif 624#endif
625 625
626 s3c_device_usb.dev.platform_data = &gta02_usb_info;
627
628 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 626 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
627 s3c_ohci_set_platdata(&gta02_usb_info);
629 s3c_nand_set_platdata(&gta02_nand_info); 628 s3c_nand_set_platdata(&gta02_nand_info);
630 s3c_i2c0_set_platdata(NULL); 629 s3c_i2c0_set_platdata(NULL);
631 630
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c2440/mach-mini2440.c
index 2068e9096a43..571b17683d96 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c2440/mach-mini2440.c
@@ -506,9 +506,8 @@ static struct i2c_board_info mini2440_i2c_devs[] __initdata = {
506}; 506};
507 507
508static struct platform_device *mini2440_devices[] __initdata = { 508static struct platform_device *mini2440_devices[] __initdata = {
509 &s3c_device_usb, 509 &s3c_device_ohci,
510 &s3c_device_wdt, 510 &s3c_device_wdt,
511/* &s3c_device_adc,*/ /* ADC doesn't like living with touchscreen ! */
512 &s3c_device_i2c0, 511 &s3c_device_i2c0,
513 &s3c_device_rtc, 512 &s3c_device_rtc,
514 &s3c_device_usbgadget, 513 &s3c_device_usbgadget,
@@ -522,8 +521,6 @@ static struct platform_device *mini2440_devices[] __initdata = {
522 &s3c_device_sdi, 521 &s3c_device_sdi,
523 &s3c_device_iis, 522 &s3c_device_iis,
524 &mini2440_audio, 523 &mini2440_audio,
525/* &s3c_device_timer[0],*/ /* buzzer pwm, no API for it */
526 /* remaining devices are optional */
527}; 524};
528 525
529static void __init mini2440_map_io(void) 526static void __init mini2440_map_io(void)
@@ -531,8 +528,6 @@ static void __init mini2440_map_io(void)
531 s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc)); 528 s3c24xx_init_io(mini2440_iodesc, ARRAY_SIZE(mini2440_iodesc));
532 s3c24xx_init_clocks(12000000); 529 s3c24xx_init_clocks(12000000);
533 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs)); 530 s3c24xx_init_uarts(mini2440_uartcfgs, ARRAY_SIZE(mini2440_uartcfgs));
534
535 s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
536} 531}
537 532
538/* 533/*
@@ -678,6 +673,7 @@ static void __init mini2440_init(void)
678 } 673 }
679 674
680 s3c24xx_udc_set_platdata(&mini2440_udc_cfg); 675 s3c24xx_udc_set_platdata(&mini2440_udc_cfg);
676 s3c24xx_mci_set_platdata(&mini2440_mmc_cfg);
681 s3c_nand_set_platdata(&mini2440_nand_info); 677 s3c_nand_set_platdata(&mini2440_nand_info);
682 s3c_i2c0_set_platdata(NULL); 678 s3c_i2c0_set_platdata(NULL);
683 679
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index d43edede590e..342041593f22 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -41,7 +41,7 @@
41#include <plat/iic.h> 41#include <plat/iic.h>
42 42
43#include <plat/s3c2410.h> 43#include <plat/s3c2410.h>
44#include <plat/s3c2440.h> 44#include <plat/s3c244x.h>
45#include <plat/clock.h> 45#include <plat/clock.h>
46#include <plat/devs.h> 46#include <plat/devs.h>
47#include <plat/cpu.h> 47#include <plat/cpu.h>
@@ -106,7 +106,7 @@ static struct platform_device nexcoder_device_nor = {
106/* Standard Nexcoder devices */ 106/* Standard Nexcoder devices */
107 107
108static struct platform_device *nexcoder_devices[] __initdata = { 108static struct platform_device *nexcoder_devices[] __initdata = {
109 &s3c_device_usb, 109 &s3c_device_ohci,
110 &s3c_device_lcd, 110 &s3c_device_lcd,
111 &s3c_device_wdt, 111 &s3c_device_wdt,
112 &s3c_device_i2c0, 112 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index a952a13afb1f..1e836e506f8b 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -176,7 +176,7 @@ static struct s3c2410_platform_nand __initdata rx3715_nand_info = {
176}; 176};
177 177
178static struct platform_device *rx3715_devices[] __initdata = { 178static struct platform_device *rx3715_devices[] __initdata = {
179 &s3c_device_usb, 179 &s3c_device_ohci,
180 &s3c_device_lcd, 180 &s3c_device_lcd,
181 &s3c_device_wdt, 181 &s3c_device_wdt,
182 &s3c_device_i2c0, 182 &s3c_device_i2c0,
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index ec13e748ccc5..3ac3d636d615 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -40,7 +40,7 @@
40#include <plat/iic.h> 40#include <plat/iic.h>
41 41
42#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
43#include <plat/s3c2440.h> 43#include <plat/s3c244x.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/cpu.h> 46#include <plat/cpu.h>
@@ -150,7 +150,7 @@ static struct s3c2410fb_mach_info smdk2440_fb_info __initdata = {
150}; 150};
151 151
152static struct platform_device *smdk2440_devices[] __initdata = { 152static struct platform_device *smdk2440_devices[] __initdata = {
153 &s3c_device_usb, 153 &s3c_device_ohci,
154 &s3c_device_lcd, 154 &s3c_device_lcd,
155 &s3c_device_wdt, 155 &s3c_device_wdt,
156 &s3c_device_i2c0, 156 &s3c_device_i2c0,
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
index 49f65032f2c0..f105d5e8c477 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-12000000.c 1/* arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
2 * 2 *
3 * Copyright (c) 2006-2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
index 7679af13a94d..c8a8f90ef382 100644
--- a/arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c24xx/s3c2440-pll-16934400.c 1/* arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
2 * 2 *
3 * Copyright (c) 2006-2008 Simtec Electronics 3 * Copyright (c) 2006-2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
index ac1f7ea5f405..2b68f7ea45ae 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c2440/s3c2440.c
@@ -29,9 +29,9 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <asm/irq.h> 30#include <asm/irq.h>
31 31
32#include <plat/s3c2440.h>
33#include <plat/devs.h> 32#include <plat/devs.h>
34#include <plat/cpu.h> 33#include <plat/cpu.h>
34#include <plat/s3c244x.h>
35 35
36static struct sys_device s3c2440_sysdev = { 36static struct sys_device s3c2440_sysdev = {
37 .cls = &s3c2440_sysclass, 37 .cls = &s3c2440_sysclass,
diff --git a/arch/arm/mach-s3c2442/clock.c b/arch/arm/mach-s3c2440/s3c2442.c
index ea1aa1f5157a..188ad1e57dc0 100644
--- a/arch/arm/mach-s3c2442/clock.c
+++ b/arch/arm/mach-s3c2440/s3c2442.c
@@ -1,10 +1,10 @@
1/* linux/arch/arm/mach-s3c2442/clock.c 1/* linux/arch/arm/mach-s3c2442/s3c2442.c
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
7 * S3C2442 Clock support 7 * S3C2442 core and lock support
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -109,8 +109,10 @@ static struct clk s3c2442_clk_cam = {
109static struct clk s3c2442_clk_cam_upll = { 109static struct clk s3c2442_clk_cam_upll = {
110 .name = "camif-upll", 110 .name = "camif-upll",
111 .id = -1, 111 .id = -1,
112 .set_rate = s3c2442_camif_upll_setrate, 112 .ops = &(struct clk_ops) {
113 .round_rate = s3c2442_camif_upll_round, 113 .set_rate = s3c2442_camif_upll_setrate,
114 .round_rate = s3c2442_camif_upll_round,
115 },
114}; 116};
115 117
116static int s3c2442_clk_add(struct sys_device *sysdev) 118static int s3c2442_clk_add(struct sys_device *sysdev)
@@ -149,3 +151,15 @@ static __init int s3c2442_clk_init(void)
149} 151}
150 152
151arch_initcall(s3c2442_clk_init); 153arch_initcall(s3c2442_clk_init);
154
155
156static struct sys_device s3c2442_sysdev = {
157 .cls = &s3c2442_sysclass,
158};
159
160int __init s3c2442_init(void)
161{
162 printk("S3C2442: Initialising architecture\n");
163
164 return sysdev_register(&s3c2442_sysdev);
165}
diff --git a/arch/arm/plat-s3c24xx/s3c244x-clock.c b/arch/arm/mach-s3c2440/s3c244x-clock.c
index 79371091aa38..f8d96130d1d1 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-clock.c
+++ b/arch/arm/mach-s3c2440/s3c244x-clock.c
@@ -68,7 +68,9 @@ static int s3c2440_setparent_armclk(struct clk *clk, struct clk *parent)
68static struct clk clk_arm = { 68static struct clk clk_arm = {
69 .name = "armclk", 69 .name = "armclk",
70 .id = -1, 70 .id = -1,
71 .set_parent = s3c2440_setparent_armclk, 71 .ops = &(struct clk_ops) {
72 .set_parent = s3c2440_setparent_armclk,
73 },
72}; 74};
73 75
74static int s3c244x_clk_add(struct sys_device *sysdev) 76static int s3c244x_clk_add(struct sys_device *sysdev)
diff --git a/arch/arm/plat-s3c24xx/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c
index a75c0c2431ea..a75c0c2431ea 100644
--- a/arch/arm/plat-s3c24xx/s3c244x-irq.c
+++ b/arch/arm/mach-s3c2440/s3c244x-irq.c
diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 12623a474b54..5e4a97e76533 100644
--- a/arch/arm/plat-s3c24xx/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -38,8 +38,7 @@
38#include <mach/regs-dsc.h> 38#include <mach/regs-dsc.h>
39 39
40#include <plat/s3c2410.h> 40#include <plat/s3c2410.h>
41#include <plat/s3c2440.h> 41#include <plat/s3c244x.h>
42#include "s3c244x.h"
43#include <plat/clock.h> 42#include <plat/clock.h>
44#include <plat/devs.h> 43#include <plat/devs.h>
45#include <plat/cpu.h> 44#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c2442/Kconfig b/arch/arm/mach-s3c2442/Kconfig
deleted file mode 100644
index 8d3811852fc7..000000000000
--- a/arch/arm/mach-s3c2442/Kconfig
+++ /dev/null
@@ -1,37 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5config CPU_S3C2442
6 bool
7 depends on ARCH_S3C2410
8 select CPU_ARM920T
9 select S3C2410_CLOCK
10 select S3C2410_GPIO
11 select S3C2410_PM if PM
12 select CPU_S3C244X
13 select CPU_LLSERIAL_S3C2440
14 help
15 Support for S3C2442 Samsung Mobile CPU based systems.
16
17
18menu "S3C2442 Machines"
19
20config SMDK2440_CPU2442
21 bool "SMDM2440 with S3C2442 CPU module"
22 depends on ARCH_S3C2440
23 select CPU_S3C2442
24
25config MACH_NEO1973_GTA02
26 bool "Openmoko GTA02 / Freerunner phone"
27 select CPU_S3C2442
28 select MFD_PCF50633
29 select PCF50633_GPIO
30 select I2C
31 select POWER_SUPPLY
32 select MACH_NEO1973
33 select S3C2410_PWM
34 help
35 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
36
37endmenu
diff --git a/arch/arm/mach-s3c2442/Makefile b/arch/arm/mach-s3c2442/Makefile
deleted file mode 100644
index 2a19113a5769..000000000000
--- a/arch/arm/mach-s3c2442/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
1# arch/arm/mach-s3c2442/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
13obj-$(CONFIG_CPU_S3C2442) += clock.o
14
15obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
16
17# Machine support
18
diff --git a/arch/arm/mach-s3c2442/s3c2442.c b/arch/arm/mach-s3c2442/s3c2442.c
deleted file mode 100644
index 4663bdc7fff6..000000000000
--- a/arch/arm/mach-s3c2442/s3c2442.c
+++ /dev/null
@@ -1,34 +0,0 @@
1/* linux/arch/arm/mach-s3c2442/s3c2442.c
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Samsung S3C2442 Mobile CPU support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/timer.h>
18#include <linux/init.h>
19#include <linux/serial_core.h>
20#include <linux/sysdev.h>
21
22#include <plat/s3c2442.h>
23#include <plat/cpu.h>
24
25static struct sys_device s3c2442_sysdev = {
26 .cls = &s3c2442_sysclass,
27};
28
29int __init s3c2442_init(void)
30{
31 printk("S3C2442: Initialising architecture\n");
32
33 return sysdev_register(&s3c2442_sysdev);
34}
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
index 4314c4424909..698140af247c 100644
--- a/arch/arm/mach-s3c2443/Kconfig
+++ b/arch/arm/mach-s3c2443/Kconfig
@@ -7,6 +7,7 @@ config CPU_S3C2443
7 depends on ARCH_S3C2410 7 depends on ARCH_S3C2410
8 select S3C2443_DMA if S3C2410_DMA 8 select S3C2443_DMA if S3C2410_DMA
9 select CPU_LLSERIAL_S3C2440 9 select CPU_LLSERIAL_S3C2440
10 select SAMSUNG_CLKSRC
10 help 11 help
11 Support for the S3C2443 SoC from the S3C24XX line 12 Support for the S3C2443 SoC from the S3C24XX line
12 13
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 2785d69c95b0..62cd4eaee01b 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2443/clock.c 1/* linux/arch/arm/mach-s3c2443/clock.c
2 * 2 *
3 * Copyright (c) 2007 Simtec Electronics 3 * Copyright (c) 2007, 2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2443 Clock control support 6 * S3C2443 Clock control support
@@ -42,6 +42,7 @@
42 42
43#include <plat/s3c2443.h> 43#include <plat/s3c2443.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/clock-clksrc.h>
45#include <plat/cpu.h> 46#include <plat/cpu.h>
46 47
47/* We currently have to assume that the system is running 48/* We currently have to assume that the system is running
@@ -53,141 +54,69 @@
53 * set the correct muxing at initialisation 54 * set the correct muxing at initialisation
54*/ 55*/
55 56
56static int s3c2443_clkcon_enable_h(struct clk *clk, int enable) 57static int s3c2443_gate(void __iomem *reg, struct clk *clk, int enable)
57{
58 unsigned int clocks = clk->ctrlbit;
59 unsigned long clkcon;
60
61 clkcon = __raw_readl(S3C2443_HCLKCON);
62
63 if (enable)
64 clkcon |= clocks;
65 else
66 clkcon &= ~clocks;
67
68 __raw_writel(clkcon, S3C2443_HCLKCON);
69
70 return 0;
71}
72
73static int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
74{ 58{
75 unsigned int clocks = clk->ctrlbit; 59 u32 ctrlbit = clk->ctrlbit;
76 unsigned long clkcon; 60 u32 con = __raw_readl(reg);
77
78 clkcon = __raw_readl(S3C2443_PCLKCON);
79 61
80 if (enable) 62 if (enable)
81 clkcon |= clocks; 63 con |= ctrlbit;
82 else 64 else
83 clkcon &= ~clocks; 65 con &= ~ctrlbit;
84
85 __raw_writel(clkcon, S3C2443_PCLKCON);
86 66
67 __raw_writel(con, reg);
87 return 0; 68 return 0;
88} 69}
89 70
90static int s3c2443_clkcon_enable_s(struct clk *clk, int enable) 71static int s3c2443_clkcon_enable_h(struct clk *clk, int enable)
91{
92 unsigned int clocks = clk->ctrlbit;
93 unsigned long clkcon;
94
95 clkcon = __raw_readl(S3C2443_SCLKCON);
96
97 if (enable)
98 clkcon |= clocks;
99 else
100 clkcon &= ~clocks;
101
102 __raw_writel(clkcon, S3C2443_SCLKCON);
103
104 return 0;
105}
106
107static unsigned long s3c2443_roundrate_clksrc(struct clk *clk,
108 unsigned long rate,
109 unsigned int max)
110{
111 unsigned long parent_rate = clk_get_rate(clk->parent);
112 int div;
113
114 if (rate > parent_rate)
115 return parent_rate;
116
117 /* note, we remove the +/- 1 calculations as they cancel out */
118
119 div = (rate / parent_rate);
120
121 if (div < 1)
122 div = 1;
123 else if (div > max)
124 div = max;
125
126 return parent_rate / div;
127}
128
129static unsigned long s3c2443_roundrate_clksrc4(struct clk *clk,
130 unsigned long rate)
131{ 72{
132 return s3c2443_roundrate_clksrc(clk, rate, 4); 73 return s3c2443_gate(S3C2443_HCLKCON, clk, enable);
133} 74}
134 75
135static unsigned long s3c2443_roundrate_clksrc16(struct clk *clk, 76static int s3c2443_clkcon_enable_p(struct clk *clk, int enable)
136 unsigned long rate)
137{ 77{
138 return s3c2443_roundrate_clksrc(clk, rate, 16); 78 return s3c2443_gate(S3C2443_PCLKCON, clk, enable);
139} 79}
140 80
141static unsigned long s3c2443_roundrate_clksrc256(struct clk *clk, 81static int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
142 unsigned long rate)
143{ 82{
144 return s3c2443_roundrate_clksrc(clk, rate, 256); 83 return s3c2443_gate(S3C2443_SCLKCON, clk, enable);
145} 84}
146 85
147/* clock selections */ 86/* clock selections */
148 87
88/* mpllref is a direct descendant of clk_xtal by default, but it is not
89 * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as
90 * such directly equating the two source clocks is impossible.
91 */
149static struct clk clk_mpllref = { 92static struct clk clk_mpllref = {
150 .name = "mpllref", 93 .name = "mpllref",
151 .parent = &clk_xtal, 94 .parent = &clk_xtal,
152 .id = -1, 95 .id = -1,
153}; 96};
154 97
155#if 0
156static struct clk clk_mpll = {
157 .name = "mpll",
158 .parent = &clk_mpllref,
159 .id = -1,
160};
161#endif
162
163static struct clk clk_i2s_ext = { 98static struct clk clk_i2s_ext = {
164 .name = "i2s-ext", 99 .name = "i2s-ext",
165 .id = -1, 100 .id = -1,
166}; 101};
167 102
168static int s3c2443_setparent_epllref(struct clk *clk, struct clk *parent) 103static struct clk *clk_epllref_sources[] = {
169{ 104 [0] = &clk_mpllref,
170 unsigned long clksrc = __raw_readl(S3C2443_CLKSRC); 105 [1] = &clk_mpllref,
171 106 [2] = &clk_xtal,
172 clksrc &= ~S3C2443_CLKSRC_EPLLREF_MASK; 107 [3] = &clk_ext,
173 108};
174 if (parent == &clk_xtal)
175 clksrc |= S3C2443_CLKSRC_EPLLREF_XTAL;
176 else if (parent == &clk_ext)
177 clksrc |= S3C2443_CLKSRC_EPLLREF_EXTCLK;
178 else if (parent != &clk_mpllref)
179 return -EINVAL;
180
181 __raw_writel(clksrc, S3C2443_CLKSRC);
182 clk->parent = parent;
183
184 return 0;
185}
186 109
187static struct clk clk_epllref = { 110static struct clksrc_clk clk_epllref = {
188 .name = "epllref", 111 .clk = {
189 .id = -1, 112 .name = "epllref",
190 .set_parent = s3c2443_setparent_epllref, 113 .id = -1,
114 },
115 .sources = &(struct clksrc_sources) {
116 .sources = clk_epllref_sources,
117 .nr_sources = ARRAY_SIZE(clk_epllref_sources),
118 },
119 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 7 },
191}; 120};
192 121
193static unsigned long s3c2443_getrate_mdivclk(struct clk *clk) 122static unsigned long s3c2443_getrate_mdivclk(struct clk *clk)
@@ -205,34 +134,29 @@ static struct clk clk_mdivclk = {
205 .name = "mdivclk", 134 .name = "mdivclk",
206 .parent = &clk_mpllref, 135 .parent = &clk_mpllref,
207 .id = -1, 136 .id = -1,
208 .get_rate = s3c2443_getrate_mdivclk, 137 .ops = &(struct clk_ops) {
138 .get_rate = s3c2443_getrate_mdivclk,
139 },
209}; 140};
210 141
211static int s3c2443_setparent_msysclk(struct clk *clk, struct clk *parent) 142static struct clk *clk_msysclk_sources[] = {
212{ 143 [0] = &clk_mpllref,
213 unsigned long clksrc = __raw_readl(S3C2443_CLKSRC); 144 [1] = &clk_mpll,
214 145 [2] = &clk_mdivclk,
215 clksrc &= ~(S3C2443_CLKSRC_MSYSCLK_MPLL | 146 [3] = &clk_mpllref,
216 S3C2443_CLKSRC_EXTCLK_DIV); 147};
217
218 if (parent == &clk_mpll)
219 clksrc |= S3C2443_CLKSRC_MSYSCLK_MPLL;
220 else if (parent == &clk_mdivclk)
221 clksrc |= S3C2443_CLKSRC_EXTCLK_DIV;
222 else if (parent != &clk_mpllref)
223 return -EINVAL;
224
225 __raw_writel(clksrc, S3C2443_CLKSRC);
226 clk->parent = parent;
227
228 return 0;
229}
230 148
231static struct clk clk_msysclk = { 149static struct clksrc_clk clk_msysclk = {
232 .name = "msysclk", 150 .clk = {
233 .parent = &clk_xtal, 151 .name = "msysclk",
234 .id = -1, 152 .parent = &clk_xtal,
235 .set_parent = s3c2443_setparent_msysclk, 153 .id = -1,
154 },
155 .sources = &(struct clksrc_sources) {
156 .sources = clk_msysclk_sources,
157 .nr_sources = ARRAY_SIZE(clk_msysclk_sources),
158 },
159 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 3 },
236}; 160};
237 161
238/* armdiv 162/* armdiv
@@ -241,152 +165,159 @@ static struct clk clk_msysclk = {
241 * divider values applied to it to then be fed into armclk. 165 * divider values applied to it to then be fed into armclk.
242*/ 166*/
243 167
244static struct clk clk_armdiv = { 168/* armdiv divisor table */
245 .name = "armdiv",
246 .id = -1,
247 .parent = &clk_msysclk,
248};
249 169
250/* armclk 170static unsigned int armdiv[16] = {
251 * 171 [S3C2443_CLKDIV0_ARMDIV_1 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 1,
252 * this is the clock fed into the ARM core itself, either from 172 [S3C2443_CLKDIV0_ARMDIV_2 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 2,
253 * armdiv or from hclk. 173 [S3C2443_CLKDIV0_ARMDIV_3 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 3,
254 */ 174 [S3C2443_CLKDIV0_ARMDIV_4 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 4,
175 [S3C2443_CLKDIV0_ARMDIV_6 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 6,
176 [S3C2443_CLKDIV0_ARMDIV_8 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 8,
177 [S3C2443_CLKDIV0_ARMDIV_12 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 12,
178 [S3C2443_CLKDIV0_ARMDIV_16 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 16,
179};
255 180
256static int s3c2443_setparent_armclk(struct clk *clk, struct clk *parent) 181static inline unsigned int s3c2443_fclk_div(unsigned long clkcon0)
257{ 182{
258 unsigned long clkdiv0; 183 clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK;
259
260 clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
261
262 if (parent == &clk_armdiv)
263 clkdiv0 &= ~S3C2443_CLKDIV0_DVS;
264 else if (parent == &clk_h)
265 clkdiv0 |= S3C2443_CLKDIV0_DVS;
266 else
267 return -EINVAL;
268 184
269 __raw_writel(clkdiv0, S3C2443_CLKDIV0); 185 return armdiv[clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT];
270 return 0;
271} 186}
272 187
273static struct clk clk_arm = { 188static unsigned long s3c2443_armclk_roundrate(struct clk *clk,
274 .name = "armclk", 189 unsigned long rate)
275 .id = -1, 190{
276 .set_parent = s3c2443_setparent_armclk, 191 unsigned long parent = clk_get_rate(clk->parent);
277}; 192 unsigned long calc;
193 unsigned best = 256; /* bigger than any value */
194 unsigned div;
195 int ptr;
278 196
279/* esysclk 197 for (ptr = 0; ptr < ARRAY_SIZE(armdiv); ptr++) {
280 * 198 div = armdiv[ptr];
281 * this is sourced from either the EPLL or the EPLLref clock 199 calc = parent / div;
282*/ 200 if (calc <= rate && div < best)
201 best = div;
202 }
283 203
284static int s3c2443_setparent_esysclk(struct clk *clk, struct clk *parent) 204 return parent / best;
205}
206
207static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate)
285{ 208{
286 unsigned long clksrc = __raw_readl(S3C2443_CLKSRC); 209 unsigned long parent = clk_get_rate(clk->parent);
210 unsigned long calc;
211 unsigned div;
212 unsigned best = 256; /* bigger than any value */
213 int ptr;
214 int val = -1;
215
216 for (ptr = 0; ptr < ARRAY_SIZE(armdiv); ptr++) {
217 div = armdiv[ptr];
218 calc = parent / div;
219 if (calc <= rate && div < best) {
220 best = div;
221 val = ptr;
222 }
223 }
287 224
288 if (parent == &clk_epll) 225 if (val >= 0) {
289 clksrc |= S3C2443_CLKSRC_ESYSCLK_EPLL; 226 unsigned long clkcon0;
290 else if (parent == &clk_epllref)
291 clksrc &= ~S3C2443_CLKSRC_ESYSCLK_EPLL;
292 else
293 return -EINVAL;
294 227
295 __raw_writel(clksrc, S3C2443_CLKSRC); 228 clkcon0 = __raw_readl(S3C2443_CLKDIV0);
296 clk->parent = parent; 229 clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK;
230 clkcon0 |= val << S3C2443_CLKDIV0_ARMDIV_SHIFT;
231 __raw_writel(clkcon0, S3C2443_CLKDIV0);
232 }
297 233
298 return 0; 234 return (val == -1) ? -EINVAL : 0;
299} 235}
300 236
301static struct clk clk_esysclk = { 237static struct clk clk_armdiv = {
302 .name = "esysclk", 238 .name = "armdiv",
303 .parent = &clk_epll,
304 .id = -1, 239 .id = -1,
305 .set_parent = s3c2443_setparent_esysclk, 240 .parent = &clk_msysclk.clk,
241 .ops = &(struct clk_ops) {
242 .round_rate = s3c2443_armclk_roundrate,
243 .set_rate = s3c2443_armclk_setrate,
244 },
306}; 245};
307 246
308/* uartclk 247/* armclk
309 * 248 *
310 * UART baud-rate clock sourced from esysclk via a divisor 249 * this is the clock fed into the ARM core itself, from armdiv or from hclk.
311*/ 250 */
312
313static unsigned long s3c2443_getrate_uart(struct clk *clk)
314{
315 unsigned long parent_rate = clk_get_rate(clk->parent);
316 unsigned long div = __raw_readl(S3C2443_CLKDIV1);
317
318 div &= S3C2443_CLKDIV1_UARTDIV_MASK;
319 div >>= S3C2443_CLKDIV1_UARTDIV_SHIFT;
320 251
321 return parent_rate / (div + 1); 252static struct clk *clk_arm_sources[] = {
322} 253 [0] = &clk_armdiv,
254 [1] = &clk_h,
255};
323 256
257static struct clksrc_clk clk_arm = {
258 .clk = {
259 .name = "armclk",
260 .id = -1,
261 },
262 .sources = &(struct clksrc_sources) {
263 .sources = clk_arm_sources,
264 .nr_sources = ARRAY_SIZE(clk_arm_sources),
265 },
266 .reg_src = { .reg = S3C2443_CLKDIV0, .size = 1, .shift = 13 },
267};
324 268
325static int s3c2443_setrate_uart(struct clk *clk, unsigned long rate) 269/* esysclk
326{ 270 *
327 unsigned long parent_rate = clk_get_rate(clk->parent); 271 * this is sourced from either the EPLL or the EPLLref clock
328 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1); 272*/
329 273
330 rate = s3c2443_roundrate_clksrc16(clk, rate); 274static struct clk *clk_sysclk_sources[] = {
331 rate = parent_rate / rate; 275 [0] = &clk_epllref.clk,
276 [1] = &clk_epll,
277};
332 278
333 clkdivn &= ~S3C2443_CLKDIV1_UARTDIV_MASK; 279static struct clksrc_clk clk_esysclk = {
334 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_UARTDIV_SHIFT; 280 .clk = {
281 .name = "esysclk",
282 .parent = &clk_epll,
283 .id = -1,
284 },
285 .sources = &(struct clksrc_sources) {
286 .sources = clk_sysclk_sources,
287 .nr_sources = ARRAY_SIZE(clk_sysclk_sources),
288 },
289 .reg_src = { .reg = S3C2443_CLKSRC, .size = 1, .shift = 6 },
290};
335 291
336 __raw_writel(clkdivn, S3C2443_CLKDIV1); 292/* uartclk
337 return 0; 293 *
338} 294 * UART baud-rate clock sourced from esysclk via a divisor
295*/
339 296
340static struct clk clk_uart = { 297static struct clksrc_clk clk_uart = {
341 .name = "uartclk", 298 .clk = {
342 .id = -1, 299 .name = "uartclk",
343 .parent = &clk_esysclk, 300 .id = -1,
344 .get_rate = s3c2443_getrate_uart, 301 .parent = &clk_esysclk.clk,
345 .set_rate = s3c2443_setrate_uart, 302 },
346 .round_rate = s3c2443_roundrate_clksrc16, 303 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 },
347}; 304};
348 305
306
349/* hsspi 307/* hsspi
350 * 308 *
351 * high-speed spi clock, sourced from esysclk 309 * high-speed spi clock, sourced from esysclk
352*/ 310*/
353 311
354static unsigned long s3c2443_getrate_hsspi(struct clk *clk) 312static struct clksrc_clk clk_hsspi = {
355{ 313 .clk = {
356 unsigned long parent_rate = clk_get_rate(clk->parent); 314 .name = "hsspi",
357 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 315 .id = -1,
358 316 .parent = &clk_esysclk.clk,
359 div &= S3C2443_CLKDIV1_HSSPIDIV_MASK; 317 .ctrlbit = S3C2443_SCLKCON_HSSPICLK,
360 div >>= S3C2443_CLKDIV1_HSSPIDIV_SHIFT; 318 .enable = s3c2443_clkcon_enable_s,
361 319 },
362 return parent_rate / (div + 1); 320 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 },
363}
364
365
366static int s3c2443_setrate_hsspi(struct clk *clk, unsigned long rate)
367{
368 unsigned long parent_rate = clk_get_rate(clk->parent);
369 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
370
371 rate = s3c2443_roundrate_clksrc4(clk, rate);
372 rate = parent_rate / rate;
373
374 clkdivn &= ~S3C2443_CLKDIV1_HSSPIDIV_MASK;
375 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_HSSPIDIV_SHIFT;
376
377 __raw_writel(clkdivn, S3C2443_CLKDIV1);
378 return 0;
379}
380
381static struct clk clk_hsspi = {
382 .name = "hsspi",
383 .id = -1,
384 .parent = &clk_esysclk,
385 .ctrlbit = S3C2443_SCLKCON_HSSPICLK,
386 .enable = s3c2443_clkcon_enable_s,
387 .get_rate = s3c2443_getrate_hsspi,
388 .set_rate = s3c2443_setrate_hsspi,
389 .round_rate = s3c2443_roundrate_clksrc4,
390}; 321};
391 322
392/* usbhost 323/* usbhost
@@ -394,41 +325,15 @@ static struct clk clk_hsspi = {
394 * usb host bus-clock, usually 48MHz to provide USB bus clock timing 325 * usb host bus-clock, usually 48MHz to provide USB bus clock timing
395*/ 326*/
396 327
397static unsigned long s3c2443_getrate_usbhost(struct clk *clk) 328static struct clksrc_clk clk_usb_bus_host = {
398{ 329 .clk = {
399 unsigned long parent_rate = clk_get_rate(clk->parent); 330 .name = "usb-bus-host-parent",
400 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 331 .id = -1,
401 332 .parent = &clk_esysclk.clk,
402 div &= S3C2443_CLKDIV1_USBHOSTDIV_MASK; 333 .ctrlbit = S3C2443_SCLKCON_USBHOST,
403 div >>= S3C2443_CLKDIV1_USBHOSTDIV_SHIFT; 334 .enable = s3c2443_clkcon_enable_s,
404 335 },
405 return parent_rate / (div + 1); 336 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 4 },
406}
407
408static int s3c2443_setrate_usbhost(struct clk *clk, unsigned long rate)
409{
410 unsigned long parent_rate = clk_get_rate(clk->parent);
411 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
412
413 rate = s3c2443_roundrate_clksrc4(clk, rate);
414 rate = parent_rate / rate;
415
416 clkdivn &= ~S3C2443_CLKDIV1_USBHOSTDIV_MASK;
417 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_USBHOSTDIV_SHIFT;
418
419 __raw_writel(clkdivn, S3C2443_CLKDIV1);
420 return 0;
421}
422
423static struct clk clk_usb_bus_host = {
424 .name = "usb-bus-host-parent",
425 .id = -1,
426 .parent = &clk_esysclk,
427 .ctrlbit = S3C2443_SCLKCON_USBHOST,
428 .enable = s3c2443_clkcon_enable_s,
429 .get_rate = s3c2443_getrate_usbhost,
430 .set_rate = s3c2443_setrate_usbhost,
431 .round_rate = s3c2443_roundrate_clksrc4,
432}; 337};
433 338
434/* clk_hsmcc_div 339/* clk_hsmcc_div
@@ -438,39 +343,13 @@ static struct clk clk_usb_bus_host = {
438 * be fed to the hsmmc block 343 * be fed to the hsmmc block
439*/ 344*/
440 345
441static unsigned long s3c2443_getrate_hsmmc_div(struct clk *clk) 346static struct clksrc_clk clk_hsmmc_div = {
442{ 347 .clk = {
443 unsigned long parent_rate = clk_get_rate(clk->parent); 348 .name = "hsmmc-div",
444 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 349 .id = -1,
445 350 .parent = &clk_esysclk.clk,
446 div &= S3C2443_CLKDIV1_HSMMCDIV_MASK; 351 },
447 div >>= S3C2443_CLKDIV1_HSMMCDIV_SHIFT; 352 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
448
449 return parent_rate / (div + 1);
450}
451
452static int s3c2443_setrate_hsmmc_div(struct clk *clk, unsigned long rate)
453{
454 unsigned long parent_rate = clk_get_rate(clk->parent);
455 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
456
457 rate = s3c2443_roundrate_clksrc4(clk, rate);
458 rate = parent_rate / rate;
459
460 clkdivn &= ~S3C2443_CLKDIV1_HSMMCDIV_MASK;
461 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_HSMMCDIV_SHIFT;
462
463 __raw_writel(clkdivn, S3C2443_CLKDIV1);
464 return 0;
465}
466
467static struct clk clk_hsmmc_div = {
468 .name = "hsmmc-div",
469 .id = -1,
470 .parent = &clk_esysclk,
471 .get_rate = s3c2443_getrate_hsmmc_div,
472 .set_rate = s3c2443_setrate_hsmmc_div,
473 .round_rate = s3c2443_roundrate_clksrc4,
474}; 353};
475 354
476static int s3c2443_setparent_hsmmc(struct clk *clk, struct clk *parent) 355static int s3c2443_setparent_hsmmc(struct clk *clk, struct clk *parent)
@@ -503,82 +382,55 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
503static struct clk clk_hsmmc = { 382static struct clk clk_hsmmc = {
504 .name = "hsmmc-if", 383 .name = "hsmmc-if",
505 .id = -1, 384 .id = -1,
506 .parent = &clk_hsmmc_div, 385 .parent = &clk_hsmmc_div.clk,
507 .enable = s3c2443_enable_hsmmc, 386 .enable = s3c2443_enable_hsmmc,
508 .set_parent = s3c2443_setparent_hsmmc, 387 .ops = &(struct clk_ops) {
388 .set_parent = s3c2443_setparent_hsmmc,
389 },
509}; 390};
510 391
511/* i2s_eplldiv 392/* i2s_eplldiv
512 * 393 *
513 * this clock is the output from the i2s divisor of esysclk 394 * This clock is the output from the I2S divisor of ESYSCLK, and is seperate
395 * from the mux that comes after it (cannot merge into one single clock)
514*/ 396*/
515 397
516static unsigned long s3c2443_getrate_i2s_eplldiv(struct clk *clk) 398static struct clksrc_clk clk_i2s_eplldiv = {
517{ 399 .clk = {
518 unsigned long parent_rate = clk_get_rate(clk->parent); 400 .name = "i2s-eplldiv",
519 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 401 .id = -1,
520 402 .parent = &clk_esysclk.clk,
521 div &= S3C2443_CLKDIV1_I2SDIV_MASK; 403 },
522 div >>= S3C2443_CLKDIV1_I2SDIV_SHIFT; 404 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, },
523
524 return parent_rate / (div + 1);
525}
526
527static int s3c2443_setrate_i2s_eplldiv(struct clk *clk, unsigned long rate)
528{
529 unsigned long parent_rate = clk_get_rate(clk->parent);
530 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
531
532 rate = s3c2443_roundrate_clksrc16(clk, rate);
533 rate = parent_rate / rate;
534
535 clkdivn &= ~S3C2443_CLKDIV1_I2SDIV_MASK;
536 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_I2SDIV_SHIFT;
537
538 __raw_writel(clkdivn, S3C2443_CLKDIV1);
539 return 0;
540}
541
542static struct clk clk_i2s_eplldiv = {
543 .name = "i2s-eplldiv",
544 .id = -1,
545 .parent = &clk_esysclk,
546 .get_rate = s3c2443_getrate_i2s_eplldiv,
547 .set_rate = s3c2443_setrate_i2s_eplldiv,
548 .round_rate = s3c2443_roundrate_clksrc16,
549}; 405};
550 406
551/* i2s-ref 407/* i2s-ref
552 * 408 *
553 * i2s bus reference clock, selectable from external, esysclk or epllref 409 * i2s bus reference clock, selectable from external, esysclk or epllref
410 *
411 * Note, this used to be two clocks, but was compressed into one.
554*/ 412*/
555 413
556static int s3c2443_setparent_i2s(struct clk *clk, struct clk *parent) 414struct clk *clk_i2s_srclist[] = {
557{ 415 [0] = &clk_i2s_eplldiv.clk,
558 unsigned long clksrc = __raw_readl(S3C2443_CLKSRC); 416 [1] = &clk_i2s_ext,
559 417 [2] = &clk_epllref.clk,
560 clksrc &= ~S3C2443_CLKSRC_I2S_MASK; 418 [3] = &clk_epllref.clk,
561 419};
562 if (parent == &clk_epllref)
563 clksrc |= S3C2443_CLKSRC_I2S_EPLLREF;
564 else if (parent == &clk_i2s_ext)
565 clksrc |= S3C2443_CLKSRC_I2S_EXT;
566 else if (parent != &clk_i2s_eplldiv)
567 return -EINVAL;
568
569 clk->parent = parent;
570 __raw_writel(clksrc, S3C2443_CLKSRC);
571
572 return 0;
573}
574 420
575static struct clk clk_i2s = { 421static struct clksrc_clk clk_i2s = {
576 .name = "i2s-if", 422 .clk = {
577 .id = -1, 423 .name = "i2s-if",
578 .parent = &clk_i2s_eplldiv, 424 .id = -1,
579 .ctrlbit = S3C2443_SCLKCON_I2SCLK, 425 .ctrlbit = S3C2443_SCLKCON_I2SCLK,
580 .enable = s3c2443_clkcon_enable_s, 426 .enable = s3c2443_clkcon_enable_s,
581 .set_parent = s3c2443_setparent_i2s, 427
428 },
429 .sources = &(struct clksrc_sources) {
430 .sources = clk_i2s_srclist,
431 .nr_sources = ARRAY_SIZE(clk_i2s_srclist),
432 },
433 .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 },
582}; 434};
583 435
584/* cam-if 436/* cam-if
@@ -586,41 +438,15 @@ static struct clk clk_i2s = {
586 * camera interface bus-clock, divided down from esysclk 438 * camera interface bus-clock, divided down from esysclk
587*/ 439*/
588 440
589static unsigned long s3c2443_getrate_cam(struct clk *clk) 441static struct clksrc_clk clk_cam = {
590{ 442 .clk = {
591 unsigned long parent_rate = clk_get_rate(clk->parent); 443 .name = "camif-upll", /* same as 2440 name */
592 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 444 .id = -1,
593 445 .parent = &clk_esysclk.clk,
594 div &= S3C2443_CLKDIV1_CAMDIV_MASK; 446 .ctrlbit = S3C2443_SCLKCON_CAMCLK,
595 div >>= S3C2443_CLKDIV1_CAMDIV_SHIFT; 447 .enable = s3c2443_clkcon_enable_s,
596 448 },
597 return parent_rate / (div + 1); 449 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 26 },
598}
599
600static int s3c2443_setrate_cam(struct clk *clk, unsigned long rate)
601{
602 unsigned long parent_rate = clk_get_rate(clk->parent);
603 unsigned long clkdiv1 = __raw_readl(S3C2443_CLKDIV1);
604
605 rate = s3c2443_roundrate_clksrc16(clk, rate);
606 rate = parent_rate / rate;
607
608 clkdiv1 &= ~S3C2443_CLKDIV1_CAMDIV_MASK;
609 clkdiv1 |= (rate - 1) << S3C2443_CLKDIV1_CAMDIV_SHIFT;
610
611 __raw_writel(clkdiv1, S3C2443_CLKDIV1);
612 return 0;
613}
614
615static struct clk clk_cam = {
616 .name = "camif-upll", /* same as 2440 name */
617 .id = -1,
618 .parent = &clk_esysclk,
619 .ctrlbit = S3C2443_SCLKCON_CAMCLK,
620 .enable = s3c2443_clkcon_enable_s,
621 .get_rate = s3c2443_getrate_cam,
622 .set_rate = s3c2443_setrate_cam,
623 .round_rate = s3c2443_roundrate_clksrc16,
624}; 450};
625 451
626/* display-if 452/* display-if
@@ -628,41 +454,15 @@ static struct clk clk_cam = {
628 * display interface clock, divided from esysclk 454 * display interface clock, divided from esysclk
629*/ 455*/
630 456
631static unsigned long s3c2443_getrate_display(struct clk *clk) 457static struct clksrc_clk clk_display = {
632{ 458 .clk = {
633 unsigned long parent_rate = clk_get_rate(clk->parent); 459 .name = "display-if",
634 unsigned long div = __raw_readl(S3C2443_CLKDIV1); 460 .id = -1,
635 461 .parent = &clk_esysclk.clk,
636 div &= S3C2443_CLKDIV1_DISPDIV_MASK; 462 .ctrlbit = S3C2443_SCLKCON_DISPCLK,
637 div >>= S3C2443_CLKDIV1_DISPDIV_SHIFT; 463 .enable = s3c2443_clkcon_enable_s,
638 464 },
639 return parent_rate / (div + 1); 465 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 8, .shift = 16 },
640}
641
642static int s3c2443_setrate_display(struct clk *clk, unsigned long rate)
643{
644 unsigned long parent_rate = clk_get_rate(clk->parent);
645 unsigned long clkdivn = __raw_readl(S3C2443_CLKDIV1);
646
647 rate = s3c2443_roundrate_clksrc256(clk, rate);
648 rate = parent_rate / rate;
649
650 clkdivn &= ~S3C2443_CLKDIV1_UARTDIV_MASK;
651 clkdivn |= (rate - 1) << S3C2443_CLKDIV1_UARTDIV_SHIFT;
652
653 __raw_writel(clkdivn, S3C2443_CLKDIV1);
654 return 0;
655}
656
657static struct clk clk_display = {
658 .name = "display-if",
659 .id = -1,
660 .parent = &clk_esysclk,
661 .ctrlbit = S3C2443_SCLKCON_DISPCLK,
662 .enable = s3c2443_clkcon_enable_s,
663 .get_rate = s3c2443_getrate_display,
664 .set_rate = s3c2443_setrate_display,
665 .round_rate = s3c2443_roundrate_clksrc256,
666}; 466};
667 467
668/* prediv 468/* prediv
@@ -684,8 +484,10 @@ static unsigned long s3c2443_prediv_getrate(struct clk *clk)
684static struct clk clk_prediv = { 484static struct clk clk_prediv = {
685 .name = "prediv", 485 .name = "prediv",
686 .id = -1, 486 .id = -1,
687 .parent = &clk_msysclk, 487 .parent = &clk_msysclk.clk,
688 .get_rate = s3c2443_prediv_getrate, 488 .ops = &(struct clk_ops) {
489 .get_rate = s3c2443_prediv_getrate,
490 },
689}; 491};
690 492
691/* standard clock definitions */ 493/* standard clock definitions */
@@ -857,7 +659,7 @@ static struct clk init_clocks[] = {
857 }, { 659 }, {
858 .name = "usb-bus-host", 660 .name = "usb-bus-host",
859 .id = -1, 661 .id = -1,
860 .parent = &clk_usb_bus_host, 662 .parent = &clk_usb_bus_host.clk,
861 }, { 663 }, {
862 .name = "ac97", 664 .name = "ac97",
863 .id = -1, 665 .id = -1,
@@ -868,103 +670,26 @@ static struct clk init_clocks[] = {
868 670
869/* clocks to add where we need to check their parentage */ 671/* clocks to add where we need to check their parentage */
870 672
871/* s3c2443_clk_initparents 673static struct clksrc_clk __initdata *init_list[] = {
872 * 674 &clk_epllref, /* should be first */
873 * Initialise the parents for the clocks that we get at start-time 675 &clk_esysclk,
874*/ 676 &clk_msysclk,
875 677 &clk_arm,
876static int __init clk_init_set_parent(struct clk *clk, struct clk *parent) 678 &clk_i2s_eplldiv,
877{ 679 &clk_i2s,
878 printk(KERN_DEBUG "clock %s: parent %s\n", clk->name, parent->name); 680 &clk_cam,
879 return clk_set_parent(clk, parent); 681 &clk_uart,
880} 682 &clk_display,
881 683 &clk_hsmmc_div,
882static void __init s3c2443_clk_initparents(void) 684 &clk_usb_bus_host,
883{
884 unsigned long clksrc = __raw_readl(S3C2443_CLKSRC);
885 struct clk *parent;
886
887 switch (clksrc & S3C2443_CLKSRC_EPLLREF_MASK) {
888 case S3C2443_CLKSRC_EPLLREF_EXTCLK:
889 parent = &clk_ext;
890 break;
891
892 case S3C2443_CLKSRC_EPLLREF_XTAL:
893 default:
894 parent = &clk_xtal;
895 break;
896
897 case S3C2443_CLKSRC_EPLLREF_MPLLREF:
898 case S3C2443_CLKSRC_EPLLREF_MPLLREF2:
899 parent = &clk_mpllref;
900 break;
901 }
902
903 clk_init_set_parent(&clk_epllref, parent);
904
905 switch (clksrc & S3C2443_CLKSRC_I2S_MASK) {
906 case S3C2443_CLKSRC_I2S_EXT:
907 parent = &clk_i2s_ext;
908 break;
909
910 case S3C2443_CLKSRC_I2S_EPLLDIV:
911 default:
912 parent = &clk_i2s_eplldiv;
913 break;
914
915 case S3C2443_CLKSRC_I2S_EPLLREF:
916 case S3C2443_CLKSRC_I2S_EPLLREF3:
917 parent = &clk_epllref;
918 }
919
920 clk_init_set_parent(&clk_i2s, &clk_epllref);
921
922 /* esysclk source */
923
924 parent = (clksrc & S3C2443_CLKSRC_ESYSCLK_EPLL) ?
925 &clk_epll : &clk_epllref;
926
927 clk_init_set_parent(&clk_esysclk, parent);
928
929 /* msysclk source */
930
931 if (clksrc & S3C2443_CLKSRC_MSYSCLK_MPLL) {
932 parent = &clk_mpll;
933 } else {
934 parent = (clksrc & S3C2443_CLKSRC_EXTCLK_DIV) ?
935 &clk_mdivclk : &clk_mpllref;
936 }
937
938 clk_init_set_parent(&clk_msysclk, parent);
939
940 /* arm */
941
942 if (__raw_readl(S3C2443_CLKDIV0) & S3C2443_CLKDIV0_DVS)
943 parent = &clk_h;
944 else
945 parent = &clk_armdiv;
946
947 clk_init_set_parent(&clk_arm, parent);
948}
949
950/* armdiv divisor table */
951
952static unsigned int armdiv[16] = {
953 [S3C2443_CLKDIV0_ARMDIV_1 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 1,
954 [S3C2443_CLKDIV0_ARMDIV_2 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 2,
955 [S3C2443_CLKDIV0_ARMDIV_3 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 3,
956 [S3C2443_CLKDIV0_ARMDIV_4 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 4,
957 [S3C2443_CLKDIV0_ARMDIV_6 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 6,
958 [S3C2443_CLKDIV0_ARMDIV_8 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 8,
959 [S3C2443_CLKDIV0_ARMDIV_12 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 12,
960 [S3C2443_CLKDIV0_ARMDIV_16 >> S3C2443_CLKDIV0_ARMDIV_SHIFT] = 16,
961}; 685};
962 686
963static inline unsigned int s3c2443_fclk_div(unsigned long clkcon0) 687static void __init s3c2443_clk_initparents(void)
964{ 688{
965 clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK; 689 int ptr;
966 690
967 return armdiv[clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT]; 691 for (ptr = 0; ptr < ARRAY_SIZE(init_list); ptr++)
692 s3c_set_clksrc(init_list[ptr], true);
968} 693}
969 694
970static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0) 695static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
@@ -976,15 +701,12 @@ static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
976 701
977/* clocks to add straight away */ 702/* clocks to add straight away */
978 703
979static struct clk *clks[] __initdata = { 704static struct clksrc_clk *clksrcs[] __initdata = {
980 &clk_ext,
981 &clk_epll,
982 &clk_usb_bus_host, 705 &clk_usb_bus_host,
983 &clk_usb_bus,
984 &clk_esysclk,
985 &clk_epllref, 706 &clk_epllref,
986 &clk_mpllref, 707 &clk_esysclk,
987 &clk_msysclk, 708 &clk_msysclk,
709 &clk_arm,
988 &clk_uart, 710 &clk_uart,
989 &clk_display, 711 &clk_display,
990 &clk_cam, 712 &clk_cam,
@@ -992,9 +714,15 @@ static struct clk *clks[] __initdata = {
992 &clk_i2s, 714 &clk_i2s,
993 &clk_hsspi, 715 &clk_hsspi,
994 &clk_hsmmc_div, 716 &clk_hsmmc_div,
717};
718
719static struct clk *clks[] __initdata = {
720 &clk_ext,
721 &clk_epll,
722 &clk_usb_bus,
723 &clk_mpllref,
995 &clk_hsmmc, 724 &clk_hsmmc,
996 &clk_armdiv, 725 &clk_armdiv,
997 &clk_arm,
998 &clk_prediv, 726 &clk_prediv,
999}; 727};
1000 728
@@ -1014,7 +742,7 @@ void __init_or_cpufreq s3c2443_setup_clocks(void)
1014 clk_put(xtal_clk); 742 clk_put(xtal_clk);
1015 743
1016 pll = s3c2443_get_mpll(mpllcon, xtal); 744 pll = s3c2443_get_mpll(mpllcon, xtal);
1017 clk_msysclk.rate = pll; 745 clk_msysclk.clk.rate = pll;
1018 746
1019 fclk = pll / s3c2443_fclk_div(clkdiv0); 747 fclk = pll / s3c2443_fclk_div(clkdiv0);
1020 hclk = s3c2443_prediv_getrate(&clk_prediv); 748 hclk = s3c2443_prediv_getrate(&clk_prediv);
@@ -1056,15 +784,18 @@ void __init s3c2443_init_clocks(int xtal)
1056 } 784 }
1057 } 785 }
1058 786
787 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
788 s3c_register_clksrc(clksrcs[ptr], 1);
789
1059 clk_epll.rate = s3c2443_get_epll(epllcon, xtal); 790 clk_epll.rate = s3c2443_get_epll(epllcon, xtal);
1060 clk_epll.parent = &clk_epllref; 791 clk_epll.parent = &clk_epllref.clk;
1061 clk_usb_bus.parent = &clk_usb_bus_host; 792 clk_usb_bus.parent = &clk_usb_bus_host.clk;
1062 793
1063 /* ensure usb bus clock is within correct rate of 48MHz */ 794 /* ensure usb bus clock is within correct rate of 48MHz */
1064 795
1065 if (clk_get_rate(&clk_usb_bus_host) != (48 * 1000 * 1000)) { 796 if (clk_get_rate(&clk_usb_bus_host.clk) != (48 * 1000 * 1000)) {
1066 printk(KERN_INFO "Warning: USB host bus not at 48MHz\n"); 797 printk(KERN_INFO "Warning: USB host bus not at 48MHz\n");
1067 clk_set_rate(&clk_usb_bus_host, 48*1000*1000); 798 clk_set_rate(&clk_usb_bus_host.clk, 48*1000*1000);
1068 } 799 }
1069 800
1070 printk("S3C2443: epll %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n", 801 printk("S3C2443: epll %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
@@ -1074,14 +805,7 @@ void __init s3c2443_init_clocks(int xtal)
1074 805
1075 /* register clocks from clock array */ 806 /* register clocks from clock array */
1076 807
1077 clkp = init_clocks; 808 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
1078 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
1079 ret = s3c24xx_register_clock(clkp);
1080 if (ret < 0) {
1081 printk(KERN_ERR "Failed to register clock %s (%d)\n",
1082 clkp->name, ret);
1083 }
1084 }
1085 809
1086 /* We must be careful disabling the clocks we are not intending to 810 /* We must be careful disabling the clocks we are not intending to
1087 * be using at boot time, as subsystems such as the LCD which do 811 * be using at boot time, as subsystems such as the LCD which do
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index 397f3b5c0b47..3f658685ec16 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -20,7 +20,7 @@
20 20
21#include <mach/dma.h> 21#include <mach/dma.h>
22 22
23#include <plat/dma-plat.h> 23#include <plat/dma-s3c24xx.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25 25
26#include <plat/regs-serial.h> 26#include <plat/regs-serial.h>
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index 039a46243105..e2e362bda9b7 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -40,7 +40,7 @@
40#include <plat/iic.h> 40#include <plat/iic.h>
41 41
42#include <plat/s3c2410.h> 42#include <plat/s3c2410.h>
43#include <plat/s3c2440.h> 43#include <plat/s3c2443.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/cpu.h> 46#include <plat/cpu.h>
@@ -106,6 +106,9 @@ static struct platform_device *smdk2443_devices[] __initdata = {
106 &s3c_device_wdt, 106 &s3c_device_wdt,
107 &s3c_device_i2c0, 107 &s3c_device_i2c0,
108 &s3c_device_hsmmc0, 108 &s3c_device_hsmmc0,
109#ifdef CONFIG_SND_SOC_SMDK2443_WM9710
110 &s3c_device_ac97,
111#endif
109}; 112};
110 113
111static void __init smdk2443_map_io(void) 114static void __init smdk2443_map_io(void)
@@ -118,6 +121,11 @@ static void __init smdk2443_map_io(void)
118static void __init smdk2443_machine_init(void) 121static void __init smdk2443_machine_init(void)
119{ 122{
120 s3c_i2c0_set_platdata(NULL); 123 s3c_i2c0_set_platdata(NULL);
124
125#ifdef CONFIG_SND_SOC_SMDK2443_WM9710
126 s3c24xx_ac97_setup_gpio(S3C24XX_AC97_GPE0);
127#endif
128
121 platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices)); 129 platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
122 smdk_machine_init(); 130 smdk_machine_init();
123} 131}
diff --git a/arch/arm/plat-s3c/include/mach/io.h b/arch/arm/mach-s3c24a0/include/mach/io.h
index f6a53631b665..4326c30fabcb 100644
--- a/arch/arm/plat-s3c/include/mach/io.h
+++ b/arch/arm/mach-s3c24a0/include/mach/io.h
@@ -1,9 +1,9 @@
1/* arch/arm/plat-s3c/include/mach/io.h 1/* arch/arm/mach-s3c24a0/include/mach/io.h
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben-linux@fluff.org> 4 * Ben Dooks <ben-linux@fluff.org>
5 * 5 *
6 * Default IO routines for plat-s3c based systems, such as S3C24A0 6 * Default IO routines for S3C24A0
7 */ 7 */
8 8
9#ifndef __ASM_ARM_ARCH_IO_H 9#ifndef __ASM_ARM_ARCH_IO_H
diff --git a/arch/arm/mach-s3c6400/Kconfig b/arch/arm/mach-s3c6400/Kconfig
deleted file mode 100644
index a250bf68709f..000000000000
--- a/arch/arm/mach-s3c6400/Kconfig
+++ /dev/null
@@ -1,30 +0,0 @@
1# Copyright 2008 Openmoko, Inc.
2# Simtec Electronics, Ben Dooks <ben@simtec.co.uk>
3#
4# Licensed under GPLv2
5
6# Configuration options for the S3C6410 CPU
7
8config CPU_S3C6400
9 bool
10 select CPU_S3C6400_INIT
11 select CPU_S3C6400_CLOCK
12 help
13 Enable S3C6400 CPU support
14
15config S3C6400_SETUP_SDHCI
16 bool
17 help
18 Internal configuration for default SDHCI
19 setup for S3C6400.
20
21# S36400 Macchine support
22
23config MACH_SMDK6400
24 bool "SMDK6400"
25 select CPU_S3C6400
26 select S3C_DEV_HSMMC
27 select S3C_DEV_NAND
28 select S3C6400_SETUP_SDHCI
29 help
30 Machine support for the Samsung SMDK6400
diff --git a/arch/arm/mach-s3c6400/Makefile b/arch/arm/mach-s3c6400/Makefile
deleted file mode 100644
index df1ce4aa03e5..000000000000
--- a/arch/arm/mach-s3c6400/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
1# arch/arm/mach-s3c6400/Makefile
2#
3# Copyright 2008 Openmoko, Inc.
4# Copyright 2008 Simtec Electronics
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S3C6400 system
14
15obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
16
17# setup support
18
19obj-$(CONFIG_S3C6400_SETUP_SDHCI) += setup-sdhci.o
20
21# Machine support
22
23obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
diff --git a/arch/arm/mach-s3c6400/include/mach/dma.h b/arch/arm/mach-s3c6400/include/mach/dma.h
deleted file mode 100644
index 6723860748be..000000000000
--- a/arch/arm/mach-s3c6400/include/mach/dma.h
+++ /dev/null
@@ -1,70 +0,0 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/dma.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6400 - DMA support
9 */
10
11#ifndef __ASM_ARCH_DMA_H
12#define __ASM_ARCH_DMA_H __FILE__
13
14#define S3C_DMA_CHANNELS (16)
15
16/* see mach-s3c2410/dma.h for notes on dma channel numbers */
17
18/* Note, for the S3C64XX architecture we keep the DMACH_
19 * defines in the order they are allocated to [S]DMA0/[S]DMA1
20 * so that is easy to do DHACH_ -> DMA controller conversion
21 */
22enum dma_ch {
23 /* DMA0/SDMA0 */
24 DMACH_UART0 = 0,
25 DMACH_UART0_SRC2,
26 DMACH_UART1,
27 DMACH_UART1_SRC2,
28 DMACH_UART2,
29 DMACH_UART2_SRC2,
30 DMACH_UART3,
31 DMACH_UART3_SRC2,
32 DMACH_PCM0_TX,
33 DMACH_PCM0_RX,
34 DMACH_I2S0_OUT,
35 DMACH_I2S0_IN,
36 DMACH_SPI0_TX,
37 DMACH_SPI0_RX,
38 DMACH_HSI_I2SV40_TX,
39 DMACH_HSI_I2SV40_RX,
40
41 /* DMA1/SDMA1 */
42 DMACH_PCM1_TX = 16,
43 DMACH_PCM1_RX,
44 DMACH_I2S1_OUT,
45 DMACH_I2S1_IN,
46 DMACH_SPI1_TX,
47 DMACH_SPI1_RX,
48 DMACH_AC97_PCMOUT,
49 DMACH_AC97_PCMIN,
50 DMACH_AC97_MICIN,
51 DMACH_PWM,
52 DMACH_IRDA,
53 DMACH_EXTERNAL,
54 DMACH_RES1,
55 DMACH_RES2,
56 DMACH_SECURITY_RX, /* SDMA1 only */
57 DMACH_SECURITY_TX, /* SDMA1 only */
58 DMACH_MAX /* the end */
59};
60
61static __inline__ bool s3c_dma_has_circular(void)
62{
63 return true;
64}
65
66#define S3C2410_DMAF_CIRCULAR (1 << 0)
67
68#include <plat/dma.h>
69
70#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/gpio-core.h b/arch/arm/mach-s3c6400/include/mach/gpio-core.h
deleted file mode 100644
index d89aae68b0a5..000000000000
--- a/arch/arm/mach-s3c6400/include/mach/gpio-core.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-s3c6400/include/mach/gpio-core.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - GPIO core support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_GPIO_CORE_H
16#define __ASM_ARCH_GPIO_CORE_H __FILE__
17
18/* currently we just include the platform support */
19#include <plat/gpio-core.h>
20
21#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/irqs.h b/arch/arm/mach-s3c6400/include/mach/irqs.h
deleted file mode 100644
index 4c97f9a4370b..000000000000
--- a/arch/arm/mach-s3c6400/include/mach/irqs.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/irqs.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6400 - IRQ definitions
9 */
10
11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H __FILE__
13
14#include <plat/irqs.h>
15
16#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-clock.h b/arch/arm/mach-s3c6400/include/mach/regs-clock.h
deleted file mode 100644
index a6c7f4eb3a1b..000000000000
--- a/arch/arm/mach-s3c6400/include/mach/regs-clock.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/* linux/arch/arm/mach-s3c6400/include/mach/regs-clock.h
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * S3C64XX - clock register compatibility with s3c24xx
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <plat/regs-clock.h>
16
diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile
deleted file mode 100644
index 3e48c3dbf973..000000000000
--- a/arch/arm/mach-s3c6410/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
1# arch/arm/plat-s3c6410/Makefile
2#
3# Copyright 2008 Openmoko, Inc.
4# Copyright 2008 Simtec Electronics
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S3C6410 system
14
15obj-$(CONFIG_CPU_S3C6410) += cpu.o
16
17# Helper and device support
18
19obj-$(CONFIG_S3C6410_SETUP_SDHCI) += setup-sdhci.o
20
21# machine support
22
23obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
24obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
25obj-$(CONFIG_MACH_NCP) += mach-ncp.o
26obj-$(CONFIG_MACH_HMT) += mach-hmt.o
diff --git a/arch/arm/mach-s3c6410/setup-sdhci.c b/arch/arm/mach-s3c6410/setup-sdhci.c
deleted file mode 100644
index 816d2d9f9ef8..000000000000
--- a/arch/arm/mach-s3c6410/setup-sdhci.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/* linux/arch/arm/mach-s3c6410/setup-sdhci.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/interrupt.h>
18#include <linux/platform_device.h>
19#include <linux/io.h>
20
21#include <linux/mmc/card.h>
22#include <linux/mmc/host.h>
23
24#include <plat/regs-sdhci.h>
25#include <plat/sdhci.h>
26
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28
29char *s3c6410_hsmmc_clksrcs[4] = {
30 [0] = "hsmmc",
31 [1] = "hsmmc",
32 [2] = "mmc_bus",
33 /* [3] = "48m", - note not successfully used yet */
34};
35
36
37void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev,
38 void __iomem *r,
39 struct mmc_ios *ios,
40 struct mmc_card *card)
41{
42 u32 ctrl2, ctrl3;
43
44 /* don't need to alter anything acording to card-type */
45
46 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
47
48 ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
49 ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
50 ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
51 S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
52 S3C_SDHCI_CTRL2_ENFBCLKRX |
53 S3C_SDHCI_CTRL2_DFCNT_NONE |
54 S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
55
56 if (ios->clock < 25 * 1000000)
57 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |
58 S3C_SDHCI_CTRL3_FCSEL2 |
59 S3C_SDHCI_CTRL3_FCSEL1 |
60 S3C_SDHCI_CTRL3_FCSEL0);
61 else
62 ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);
63
64 printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3);
65 writel(ctrl2, r + S3C_SDHCI_CONTROL2);
66 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
67}
68
diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index 162f4561f80f..959df3840de5 100644
--- a/arch/arm/mach-s3c6410/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -1,22 +1,78 @@
1# Copyright 2008 Openmoko, Inc. 1# Copyright 2008 Openmoko, Inc.
2# Copyright 2008 Simtec Electronics 2# Simtec Electronics, Ben Dooks <ben@simtec.co.uk>
3# 3#
4# Licensed under GPLv2 4# Licensed under GPLv2
5 5
6# temporary until we can eliminate all drivers using it.
7config PLAT_S3C64XX
8 bool
9 depends on ARCH_S3C64XX
10 default y
11 help
12 Base platform code for any Samsung S3C64XX device
13
14
6# Configuration options for the S3C6410 CPU 15# Configuration options for the S3C6410 CPU
7 16
17config CPU_S3C6400
18 bool
19 help
20 Enable S3C6400 CPU support
21
8config CPU_S3C6410 22config CPU_S3C6410
9 bool 23 bool
10 select CPU_S3C6400_INIT
11 select CPU_S3C6400_CLOCK
12 help 24 help
13 Enable S3C6410 CPU support 25 Enable S3C6410 CPU support
14 26
15config S3C6410_SETUP_SDHCI 27config S3C64XX_DMA
16 bool 28 bool "S3C64XX DMA"
29 select S3C_DMA
30
31config S3C64XX_SETUP_SDHCI
17 select S3C64XX_SETUP_SDHCI_GPIO 32 select S3C64XX_SETUP_SDHCI_GPIO
33 bool
18 help 34 help
19 Internal helper functions for S3C6410 based SDHCI systems 35 Internal configuration for default SDHCI setup for S3C6400 and
36 S3C6410 SoCs.
37
38# platform specific device setup
39
40config S3C64XX_SETUP_I2C0
41 bool
42 default y
43 help
44 Common setup code for i2c bus 0.
45
46 Note, currently since i2c0 is always compiled, this setup helper
47 is always compiled with it.
48
49config S3C64XX_SETUP_I2C1
50 bool
51 help
52 Common setup code for i2c bus 1.
53
54config S3C64XX_SETUP_FB_24BPP
55 bool
56 help
57 Common setup code for S3C64XX with an 24bpp RGB display helper.
58
59config S3C64XX_SETUP_SDHCI_GPIO
60 bool
61 help
62 Common setup code for S3C64XX SDHCI GPIO configurations
63
64# S36400 Macchine support
65
66config MACH_SMDK6400
67 bool "SMDK6400"
68 select CPU_S3C6400
69 select S3C_DEV_HSMMC
70 select S3C_DEV_NAND
71 select S3C64XX_SETUP_SDHCI
72 help
73 Machine support for the Samsung SMDK6400
74
75# S3C6410 machine support
20 76
21config MACH_ANW6410 77config MACH_ANW6410
22 bool "A&W6410" 78 bool "A&W6410"
@@ -35,7 +91,7 @@ config MACH_SMDK6410
35 select S3C_DEV_FB 91 select S3C_DEV_FB
36 select S3C_DEV_USB_HOST 92 select S3C_DEV_USB_HOST
37 select S3C_DEV_USB_HSOTG 93 select S3C_DEV_USB_HSOTG
38 select S3C6410_SETUP_SDHCI 94 select S3C64XX_SETUP_SDHCI
39 select S3C64XX_SETUP_I2C1 95 select S3C64XX_SETUP_I2C1
40 select S3C64XX_SETUP_FB_24BPP 96 select S3C64XX_SETUP_FB_24BPP
41 help 97 help
@@ -58,7 +114,7 @@ config SMDK6410_SD_CH0
58 at least some SMDK6410 boards come with the 114 at least some SMDK6410 boards come with the
59 resistors fitted so that the card detects for 115 resistors fitted so that the card detects for
60 channels 0 and 1 are the same. 116 channels 0 and 1 are the same.
61 117
62config SMDK6410_SD_CH1 118config SMDK6410_SD_CH1
63 bool "Use channel 1 only" 119 bool "Use channel 1 only"
64 depends on MACH_SMDK6410 120 depends on MACH_SMDK6410
@@ -88,6 +144,21 @@ config SMDK6410_WM1190_EV1
88 detected at runtime so the the resulting kernel can be used 144 detected at runtime so the the resulting kernel can be used
89 with or without the 1190-EV1 fitted. 145 with or without the 1190-EV1 fitted.
90 146
147config SMDK6410_WM1192_EV1
148 bool "Support Wolfson Microelectronics 1192-EV1 PMIC card"
149 depends on MACH_SMDK6410
150 select REGULATOR
151 select REGULATOR_WM831X
152 select S3C24XX_GPIO_EXTRA64
153 select MFD_WM831X
154 help
155 The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
156 daughtercard for the Samsung SMDK6410 reference platform.
157 Enabling this option will build support for this module into
158 the kernel. The presence of the daughtercard will be
159 detected at runtime so the the resulting kernel can be used
160 with or without the 1192-EV1 fitted.
161
91config MACH_NCP 162config MACH_NCP
92 bool "NCP" 163 bool "NCP"
93 select CPU_S3C6410 164 select CPU_S3C6410
diff --git a/arch/arm/plat-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index b85b4359e935..3758e15086be 100644
--- a/arch/arm/plat-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -1,4 +1,4 @@
1# arch/arm/plat-s3c64xx/Makefile 1# arch/arm/mach-s3c64xx/Makefile
2# 2#
3# Copyright 2008 Openmoko, Inc. 3# Copyright 2008 Openmoko, Inc.
4# Copyright 2008 Simtec Electronics 4# Copyright 2008 Simtec Electronics
@@ -7,29 +7,25 @@
7 7
8obj-y := 8obj-y :=
9obj-m := 9obj-m :=
10obj-n := dummy.o 10obj-n :=
11obj- := 11obj- :=
12 12
13# Core files 13# Core files
14
15obj-y += dev-uart.o
16obj-y += cpu.o 14obj-y += cpu.o
17obj-y += irq.o
18obj-y += irq-eint.o
19obj-y += clock.o 15obj-y += clock.o
20obj-y += gpiolib.o 16obj-y += gpiolib.o
21 17
22# CPU support 18# Core support for S3C6400 system
23 19
24obj-$(CONFIG_CPU_S3C6400_INIT) += s3c6400-init.o 20obj-$(CONFIG_CPU_S3C6400) += s3c6400.o
25obj-$(CONFIG_CPU_S3C6400_CLOCK) += s3c6400-clock.o 21obj-$(CONFIG_CPU_S3C6410) += s3c6410.o
26obj-$(CONFIG_CPU_FREQ_S3C64XX) += cpufreq.o
27 22
28# PM support 23obj-y += irq.o
24obj-y += irq-eint.o
29 25
30obj-$(CONFIG_PM) += pm.o 26# CPU frequency scaling
31obj-$(CONFIG_PM) += sleep.o 27
32obj-$(CONFIG_PM) += irq-pm.o 28obj-$(CONFIG_CPU_FREQ_S3C64XX) += cpufreq.o
33 29
34# DMA support 30# DMA support
35 31
@@ -39,6 +35,28 @@ obj-$(CONFIG_S3C64XX_DMA) += dma.o
39 35
40obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o 36obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
41obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o 37obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
38obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
42obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o 39obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
43obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o 40obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
44obj-$(CONFIG_SND_S3C24XX_SOC) += dev-audio.o 41
42# PM
43
44obj-$(CONFIG_PM) += pm.o
45obj-$(CONFIG_PM) += sleep.o
46obj-$(CONFIG_PM) += irq-pm.o
47
48# Machine support
49
50obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o
51obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
52obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o
53obj-$(CONFIG_MACH_NCP) += mach-ncp.o
54obj-$(CONFIG_MACH_HMT) += mach-hmt.o
55
56# device support
57
58obj-y += dev-uart.o
59obj-y += dev-rtc.o
60obj-y += dev-audio.o
61obj-$(CONFIG_S3C_ADC) += dev-adc.o
62obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o
diff --git a/arch/arm/mach-s3c6400/Makefile.boot b/arch/arm/mach-s3c64xx/Makefile.boot
index ba41fdc0a586..ba41fdc0a586 100644
--- a/arch/arm/mach-s3c6400/Makefile.boot
+++ b/arch/arm/mach-s3c64xx/Makefile.boot
diff --git a/arch/arm/mach-s3c64xx/clock.c b/arch/arm/mach-s3c64xx/clock.c
new file mode 100644
index 000000000000..2ac2e7d73e53
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/clock.c
@@ -0,0 +1,809 @@
1/* linux/arch/arm/plat-s3c64xx/clock.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX Base clock support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/clk.h>
20#include <linux/err.h>
21#include <linux/io.h>
22
23#include <mach/hardware.h>
24#include <mach/map.h>
25
26#include <mach/regs-sys.h>
27#include <mach/regs-clock.h>
28#include <mach/pll.h>
29
30#include <plat/cpu.h>
31#include <plat/devs.h>
32#include <plat/cpu-freq.h>
33#include <plat/clock.h>
34#include <plat/clock-clksrc.h>
35
36/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
37 * ext_xtal_mux for want of an actual name from the manual.
38*/
39
40static struct clk clk_ext_xtal_mux = {
41 .name = "ext_xtal",
42 .id = -1,
43};
44
45#define clk_fin_apll clk_ext_xtal_mux
46#define clk_fin_mpll clk_ext_xtal_mux
47#define clk_fin_epll clk_ext_xtal_mux
48
49#define clk_fout_mpll clk_mpll
50#define clk_fout_epll clk_epll
51
52struct clk clk_h2 = {
53 .name = "hclk2",
54 .id = -1,
55 .rate = 0,
56};
57
58struct clk clk_27m = {
59 .name = "clk_27m",
60 .id = -1,
61 .rate = 27000000,
62};
63
64static int clk_48m_ctrl(struct clk *clk, int enable)
65{
66 unsigned long flags;
67 u32 val;
68
69 /* can't rely on clock lock, this register has other usages */
70 local_irq_save(flags);
71
72 val = __raw_readl(S3C64XX_OTHERS);
73 if (enable)
74 val |= S3C64XX_OTHERS_USBMASK;
75 else
76 val &= ~S3C64XX_OTHERS_USBMASK;
77
78 __raw_writel(val, S3C64XX_OTHERS);
79 local_irq_restore(flags);
80
81 return 0;
82}
83
84struct clk clk_48m = {
85 .name = "clk_48m",
86 .id = -1,
87 .rate = 48000000,
88 .enable = clk_48m_ctrl,
89};
90
91static int inline s3c64xx_gate(void __iomem *reg,
92 struct clk *clk,
93 int enable)
94{
95 unsigned int ctrlbit = clk->ctrlbit;
96 u32 con;
97
98 con = __raw_readl(reg);
99
100 if (enable)
101 con |= ctrlbit;
102 else
103 con &= ~ctrlbit;
104
105 __raw_writel(con, reg);
106 return 0;
107}
108
109static int s3c64xx_pclk_ctrl(struct clk *clk, int enable)
110{
111 return s3c64xx_gate(S3C_PCLK_GATE, clk, enable);
112}
113
114static int s3c64xx_hclk_ctrl(struct clk *clk, int enable)
115{
116 return s3c64xx_gate(S3C_HCLK_GATE, clk, enable);
117}
118
119int s3c64xx_sclk_ctrl(struct clk *clk, int enable)
120{
121 return s3c64xx_gate(S3C_SCLK_GATE, clk, enable);
122}
123
124static struct clk init_clocks_disable[] = {
125 {
126 .name = "nand",
127 .id = -1,
128 .parent = &clk_h,
129 }, {
130 .name = "adc",
131 .id = -1,
132 .parent = &clk_p,
133 .enable = s3c64xx_pclk_ctrl,
134 .ctrlbit = S3C_CLKCON_PCLK_TSADC,
135 }, {
136 .name = "i2c",
137 .id = -1,
138 .parent = &clk_p,
139 .enable = s3c64xx_pclk_ctrl,
140 .ctrlbit = S3C_CLKCON_PCLK_IIC,
141 }, {
142 .name = "iis",
143 .id = 0,
144 .parent = &clk_p,
145 .enable = s3c64xx_pclk_ctrl,
146 .ctrlbit = S3C_CLKCON_PCLK_IIS0,
147 }, {
148 .name = "iis",
149 .id = 1,
150 .parent = &clk_p,
151 .enable = s3c64xx_pclk_ctrl,
152 .ctrlbit = S3C_CLKCON_PCLK_IIS1,
153 }, {
154#ifdef CONFIG_CPU_S3C6410
155 .name = "iis",
156 .id = -1, /* There's only one IISv4 port */
157 .parent = &clk_p,
158 .enable = s3c64xx_pclk_ctrl,
159 .ctrlbit = S3C6410_CLKCON_PCLK_IIS2,
160 }, {
161#endif
162 .name = "spi",
163 .id = 0,
164 .parent = &clk_p,
165 .enable = s3c64xx_pclk_ctrl,
166 .ctrlbit = S3C_CLKCON_PCLK_SPI0,
167 }, {
168 .name = "spi",
169 .id = 1,
170 .parent = &clk_p,
171 .enable = s3c64xx_pclk_ctrl,
172 .ctrlbit = S3C_CLKCON_PCLK_SPI1,
173 }, {
174 .name = "spi_48m",
175 .id = 0,
176 .parent = &clk_48m,
177 .enable = s3c64xx_sclk_ctrl,
178 .ctrlbit = S3C_CLKCON_SCLK_SPI0_48,
179 }, {
180 .name = "spi_48m",
181 .id = 1,
182 .parent = &clk_48m,
183 .enable = s3c64xx_sclk_ctrl,
184 .ctrlbit = S3C_CLKCON_SCLK_SPI1_48,
185 }, {
186 .name = "48m",
187 .id = 0,
188 .parent = &clk_48m,
189 .enable = s3c64xx_sclk_ctrl,
190 .ctrlbit = S3C_CLKCON_SCLK_MMC0_48,
191 }, {
192 .name = "48m",
193 .id = 1,
194 .parent = &clk_48m,
195 .enable = s3c64xx_sclk_ctrl,
196 .ctrlbit = S3C_CLKCON_SCLK_MMC1_48,
197 }, {
198 .name = "48m",
199 .id = 2,
200 .parent = &clk_48m,
201 .enable = s3c64xx_sclk_ctrl,
202 .ctrlbit = S3C_CLKCON_SCLK_MMC2_48,
203 }, {
204 .name = "dma0",
205 .id = -1,
206 .parent = &clk_h,
207 .enable = s3c64xx_hclk_ctrl,
208 .ctrlbit = S3C_CLKCON_HCLK_DMA0,
209 }, {
210 .name = "dma1",
211 .id = -1,
212 .parent = &clk_h,
213 .enable = s3c64xx_hclk_ctrl,
214 .ctrlbit = S3C_CLKCON_HCLK_DMA1,
215 },
216};
217
218static struct clk init_clocks[] = {
219 {
220 .name = "lcd",
221 .id = -1,
222 .parent = &clk_h,
223 .enable = s3c64xx_hclk_ctrl,
224 .ctrlbit = S3C_CLKCON_HCLK_LCD,
225 }, {
226 .name = "gpio",
227 .id = -1,
228 .parent = &clk_p,
229 .enable = s3c64xx_pclk_ctrl,
230 .ctrlbit = S3C_CLKCON_PCLK_GPIO,
231 }, {
232 .name = "usb-host",
233 .id = -1,
234 .parent = &clk_h,
235 .enable = s3c64xx_hclk_ctrl,
236 .ctrlbit = S3C_CLKCON_HCLK_UHOST,
237 }, {
238 .name = "hsmmc",
239 .id = 0,
240 .parent = &clk_h,
241 .enable = s3c64xx_hclk_ctrl,
242 .ctrlbit = S3C_CLKCON_HCLK_HSMMC0,
243 }, {
244 .name = "hsmmc",
245 .id = 1,
246 .parent = &clk_h,
247 .enable = s3c64xx_hclk_ctrl,
248 .ctrlbit = S3C_CLKCON_HCLK_HSMMC1,
249 }, {
250 .name = "hsmmc",
251 .id = 2,
252 .parent = &clk_h,
253 .enable = s3c64xx_hclk_ctrl,
254 .ctrlbit = S3C_CLKCON_HCLK_HSMMC2,
255 }, {
256 .name = "timers",
257 .id = -1,
258 .parent = &clk_p,
259 .enable = s3c64xx_pclk_ctrl,
260 .ctrlbit = S3C_CLKCON_PCLK_PWM,
261 }, {
262 .name = "uart",
263 .id = 0,
264 .parent = &clk_p,
265 .enable = s3c64xx_pclk_ctrl,
266 .ctrlbit = S3C_CLKCON_PCLK_UART0,
267 }, {
268 .name = "uart",
269 .id = 1,
270 .parent = &clk_p,
271 .enable = s3c64xx_pclk_ctrl,
272 .ctrlbit = S3C_CLKCON_PCLK_UART1,
273 }, {
274 .name = "uart",
275 .id = 2,
276 .parent = &clk_p,
277 .enable = s3c64xx_pclk_ctrl,
278 .ctrlbit = S3C_CLKCON_PCLK_UART2,
279 }, {
280 .name = "uart",
281 .id = 3,
282 .parent = &clk_p,
283 .enable = s3c64xx_pclk_ctrl,
284 .ctrlbit = S3C_CLKCON_PCLK_UART3,
285 }, {
286 .name = "rtc",
287 .id = -1,
288 .parent = &clk_p,
289 .enable = s3c64xx_pclk_ctrl,
290 .ctrlbit = S3C_CLKCON_PCLK_RTC,
291 }, {
292 .name = "watchdog",
293 .id = -1,
294 .parent = &clk_p,
295 .ctrlbit = S3C_CLKCON_PCLK_WDT,
296 }, {
297 .name = "ac97",
298 .id = -1,
299 .parent = &clk_p,
300 .ctrlbit = S3C_CLKCON_PCLK_AC97,
301 }
302};
303
304
305static struct clk clk_fout_apll = {
306 .name = "fout_apll",
307 .id = -1,
308};
309
310static struct clk *clk_src_apll_list[] = {
311 [0] = &clk_fin_apll,
312 [1] = &clk_fout_apll,
313};
314
315static struct clksrc_sources clk_src_apll = {
316 .sources = clk_src_apll_list,
317 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
318};
319
320static struct clksrc_clk clk_mout_apll = {
321 .clk = {
322 .name = "mout_apll",
323 .id = -1,
324 },
325 .reg_src = { .reg = S3C_CLK_SRC, .shift = 0, .size = 1 },
326 .sources = &clk_src_apll,
327};
328
329static struct clk *clk_src_epll_list[] = {
330 [0] = &clk_fin_epll,
331 [1] = &clk_fout_epll,
332};
333
334static struct clksrc_sources clk_src_epll = {
335 .sources = clk_src_epll_list,
336 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
337};
338
339static struct clksrc_clk clk_mout_epll = {
340 .clk = {
341 .name = "mout_epll",
342 .id = -1,
343 },
344 .reg_src = { .reg = S3C_CLK_SRC, .shift = 2, .size = 1 },
345 .sources = &clk_src_epll,
346};
347
348static struct clk *clk_src_mpll_list[] = {
349 [0] = &clk_fin_mpll,
350 [1] = &clk_fout_mpll,
351};
352
353static struct clksrc_sources clk_src_mpll = {
354 .sources = clk_src_mpll_list,
355 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
356};
357
358static struct clksrc_clk clk_mout_mpll = {
359 .clk = {
360 .name = "mout_mpll",
361 .id = -1,
362 },
363 .reg_src = { .reg = S3C_CLK_SRC, .shift = 1, .size = 1 },
364 .sources = &clk_src_mpll,
365};
366
367static unsigned int armclk_mask;
368
369static unsigned long s3c64xx_clk_arm_get_rate(struct clk *clk)
370{
371 unsigned long rate = clk_get_rate(clk->parent);
372 u32 clkdiv;
373
374 /* divisor mask starts at bit0, so no need to shift */
375 clkdiv = __raw_readl(S3C_CLK_DIV0) & armclk_mask;
376
377 return rate / (clkdiv + 1);
378}
379
380static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk,
381 unsigned long rate)
382{
383 unsigned long parent = clk_get_rate(clk->parent);
384 u32 div;
385
386 if (parent < rate)
387 return parent;
388
389 div = (parent / rate) - 1;
390 if (div > armclk_mask)
391 div = armclk_mask;
392
393 return parent / (div + 1);
394}
395
396static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate)
397{
398 unsigned long parent = clk_get_rate(clk->parent);
399 u32 div;
400 u32 val;
401
402 if (rate < parent / (armclk_mask + 1))
403 return -EINVAL;
404
405 rate = clk_round_rate(clk, rate);
406 div = clk_get_rate(clk->parent) / rate;
407
408 val = __raw_readl(S3C_CLK_DIV0);
409 val &= ~armclk_mask;
410 val |= (div - 1);
411 __raw_writel(val, S3C_CLK_DIV0);
412
413 return 0;
414
415}
416
417static struct clk clk_arm = {
418 .name = "armclk",
419 .id = -1,
420 .parent = &clk_mout_apll.clk,
421 .ops = &(struct clk_ops) {
422 .get_rate = s3c64xx_clk_arm_get_rate,
423 .set_rate = s3c64xx_clk_arm_set_rate,
424 .round_rate = s3c64xx_clk_arm_round_rate,
425 },
426};
427
428static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk)
429{
430 unsigned long rate = clk_get_rate(clk->parent);
431
432 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
433
434 if (__raw_readl(S3C_CLK_DIV0) & S3C6400_CLKDIV0_MPLL_MASK)
435 rate /= 2;
436
437 return rate;
438}
439
440static struct clk_ops clk_dout_ops = {
441 .get_rate = s3c64xx_clk_doutmpll_get_rate,
442};
443
444static struct clk clk_dout_mpll = {
445 .name = "dout_mpll",
446 .id = -1,
447 .parent = &clk_mout_mpll.clk,
448 .ops = &clk_dout_ops,
449};
450
451static struct clk *clkset_spi_mmc_list[] = {
452 &clk_mout_epll.clk,
453 &clk_dout_mpll,
454 &clk_fin_epll,
455 &clk_27m,
456};
457
458static struct clksrc_sources clkset_spi_mmc = {
459 .sources = clkset_spi_mmc_list,
460 .nr_sources = ARRAY_SIZE(clkset_spi_mmc_list),
461};
462
463static struct clk *clkset_irda_list[] = {
464 &clk_mout_epll.clk,
465 &clk_dout_mpll,
466 NULL,
467 &clk_27m,
468};
469
470static struct clksrc_sources clkset_irda = {
471 .sources = clkset_irda_list,
472 .nr_sources = ARRAY_SIZE(clkset_irda_list),
473};
474
475static struct clk *clkset_uart_list[] = {
476 &clk_mout_epll.clk,
477 &clk_dout_mpll,
478 NULL,
479 NULL
480};
481
482static struct clksrc_sources clkset_uart = {
483 .sources = clkset_uart_list,
484 .nr_sources = ARRAY_SIZE(clkset_uart_list),
485};
486
487static struct clk *clkset_uhost_list[] = {
488 &clk_48m,
489 &clk_mout_epll.clk,
490 &clk_dout_mpll,
491 &clk_fin_epll,
492};
493
494static struct clksrc_sources clkset_uhost = {
495 .sources = clkset_uhost_list,
496 .nr_sources = ARRAY_SIZE(clkset_uhost_list),
497};
498
499/* The peripheral clocks are all controlled via clocksource followed
500 * by an optional divider and gate stage. We currently roll this into
501 * one clock which hides the intermediate clock from the mux.
502 *
503 * Note, the JPEG clock can only be an even divider...
504 *
505 * The scaler and LCD clocks depend on the S3C64XX version, and also
506 * have a common parent divisor so are not included here.
507 */
508
509/* clocks that feed other parts of the clock source tree */
510
511static struct clk clk_iis_cd0 = {
512 .name = "iis_cdclk0",
513 .id = -1,
514};
515
516static struct clk clk_iis_cd1 = {
517 .name = "iis_cdclk1",
518 .id = -1,
519};
520
521static struct clk clk_pcm_cd = {
522 .name = "pcm_cdclk",
523 .id = -1,
524};
525
526static struct clk *clkset_audio0_list[] = {
527 [0] = &clk_mout_epll.clk,
528 [1] = &clk_dout_mpll,
529 [2] = &clk_fin_epll,
530 [3] = &clk_iis_cd0,
531 [4] = &clk_pcm_cd,
532};
533
534static struct clksrc_sources clkset_audio0 = {
535 .sources = clkset_audio0_list,
536 .nr_sources = ARRAY_SIZE(clkset_audio0_list),
537};
538
539static struct clk *clkset_audio1_list[] = {
540 [0] = &clk_mout_epll.clk,
541 [1] = &clk_dout_mpll,
542 [2] = &clk_fin_epll,
543 [3] = &clk_iis_cd1,
544 [4] = &clk_pcm_cd,
545};
546
547static struct clksrc_sources clkset_audio1 = {
548 .sources = clkset_audio1_list,
549 .nr_sources = ARRAY_SIZE(clkset_audio1_list),
550};
551
552static struct clk *clkset_camif_list[] = {
553 &clk_h2,
554};
555
556static struct clksrc_sources clkset_camif = {
557 .sources = clkset_camif_list,
558 .nr_sources = ARRAY_SIZE(clkset_camif_list),
559};
560
561static struct clksrc_clk clksrcs[] = {
562 {
563 .clk = {
564 .name = "mmc_bus",
565 .id = 0,
566 .ctrlbit = S3C_CLKCON_SCLK_MMC0,
567 .enable = s3c64xx_sclk_ctrl,
568 },
569 .reg_src = { .reg = S3C_CLK_SRC, .shift = 18, .size = 2 },
570 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 0, .size = 4 },
571 .sources = &clkset_spi_mmc,
572 }, {
573 .clk = {
574 .name = "mmc_bus",
575 .id = 1,
576 .ctrlbit = S3C_CLKCON_SCLK_MMC1,
577 .enable = s3c64xx_sclk_ctrl,
578 },
579 .reg_src = { .reg = S3C_CLK_SRC, .shift = 20, .size = 2 },
580 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 4, .size = 4 },
581 .sources = &clkset_spi_mmc,
582 }, {
583 .clk = {
584 .name = "mmc_bus",
585 .id = 2,
586 .ctrlbit = S3C_CLKCON_SCLK_MMC2,
587 .enable = s3c64xx_sclk_ctrl,
588 },
589 .reg_src = { .reg = S3C_CLK_SRC, .shift = 22, .size = 2 },
590 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 8, .size = 4 },
591 .sources = &clkset_spi_mmc,
592 }, {
593 .clk = {
594 .name = "usb-bus-host",
595 .id = -1,
596 .ctrlbit = S3C_CLKCON_SCLK_UHOST,
597 .enable = s3c64xx_sclk_ctrl,
598 },
599 .reg_src = { .reg = S3C_CLK_SRC, .shift = 5, .size = 2 },
600 .reg_div = { .reg = S3C_CLK_DIV1, .shift = 20, .size = 4 },
601 .sources = &clkset_uhost,
602 }, {
603 .clk = {
604 .name = "uclk1",
605 .id = -1,
606 .ctrlbit = S3C_CLKCON_SCLK_UART,
607 .enable = s3c64xx_sclk_ctrl,
608 },
609 .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 },
610 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 },
611 .sources = &clkset_uart,
612 }, {
613/* Where does UCLK0 come from? */
614 .clk = {
615 .name = "spi-bus",
616 .id = 0,
617 .ctrlbit = S3C_CLKCON_SCLK_SPI0,
618 .enable = s3c64xx_sclk_ctrl,
619 },
620 .reg_src = { .reg = S3C_CLK_SRC, .shift = 14, .size = 2 },
621 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 0, .size = 4 },
622 .sources = &clkset_spi_mmc,
623 }, {
624 .clk = {
625 .name = "spi-bus",
626 .id = 1,
627 .ctrlbit = S3C_CLKCON_SCLK_SPI1,
628 .enable = s3c64xx_sclk_ctrl,
629 },
630 .reg_src = { .reg = S3C_CLK_SRC, .shift = 16, .size = 2 },
631 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 4, .size = 4 },
632 .sources = &clkset_spi_mmc,
633 }, {
634 .clk = {
635 .name = "audio-bus",
636 .id = 0,
637 .ctrlbit = S3C_CLKCON_SCLK_AUDIO0,
638 .enable = s3c64xx_sclk_ctrl,
639 },
640 .reg_src = { .reg = S3C_CLK_SRC, .shift = 7, .size = 3 },
641 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 8, .size = 4 },
642 .sources = &clkset_audio0,
643 }, {
644 .clk = {
645 .name = "audio-bus",
646 .id = 1,
647 .ctrlbit = S3C_CLKCON_SCLK_AUDIO1,
648 .enable = s3c64xx_sclk_ctrl,
649 },
650 .reg_src = { .reg = S3C_CLK_SRC, .shift = 10, .size = 3 },
651 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 12, .size = 4 },
652 .sources = &clkset_audio1,
653 }, {
654 .clk = {
655 .name = "irda-bus",
656 .id = 0,
657 .ctrlbit = S3C_CLKCON_SCLK_IRDA,
658 .enable = s3c64xx_sclk_ctrl,
659 },
660 .reg_src = { .reg = S3C_CLK_SRC, .shift = 24, .size = 2 },
661 .reg_div = { .reg = S3C_CLK_DIV2, .shift = 20, .size = 4 },
662 .sources = &clkset_irda,
663 }, {
664 .clk = {
665 .name = "camera",
666 .id = -1,
667 .ctrlbit = S3C_CLKCON_SCLK_CAM,
668 .enable = s3c64xx_sclk_ctrl,
669 },
670 .reg_div = { .reg = S3C_CLK_DIV0, .shift = 20, .size = 4 },
671 .reg_src = { .reg = NULL, .shift = 0, .size = 0 },
672 .sources = &clkset_camif,
673 },
674};
675
676/* Clock initialisation code */
677
678static struct clksrc_clk *init_parents[] = {
679 &clk_mout_apll,
680 &clk_mout_epll,
681 &clk_mout_mpll,
682};
683
684#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
685
686void __init_or_cpufreq s3c6400_setup_clocks(void)
687{
688 struct clk *xtal_clk;
689 unsigned long xtal;
690 unsigned long fclk;
691 unsigned long hclk;
692 unsigned long hclk2;
693 unsigned long pclk;
694 unsigned long epll;
695 unsigned long apll;
696 unsigned long mpll;
697 unsigned int ptr;
698 u32 clkdiv0;
699
700 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
701
702 clkdiv0 = __raw_readl(S3C_CLK_DIV0);
703 printk(KERN_DEBUG "%s: clkdiv0 = %08x\n", __func__, clkdiv0);
704
705 xtal_clk = clk_get(NULL, "xtal");
706 BUG_ON(IS_ERR(xtal_clk));
707
708 xtal = clk_get_rate(xtal_clk);
709 clk_put(xtal_clk);
710
711 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
712
713 /* For now assume the mux always selects the crystal */
714 clk_ext_xtal_mux.parent = xtal_clk;
715
716 epll = s3c6400_get_epll(xtal);
717 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON));
718 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON));
719
720 fclk = mpll;
721
722 printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n",
723 apll, mpll, epll);
724
725 hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
726 hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK);
727 pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK);
728
729 printk(KERN_INFO "S3C64XX: HCLK2=%ld, HCLK=%ld, PCLK=%ld\n",
730 hclk2, hclk, pclk);
731
732 clk_fout_mpll.rate = mpll;
733 clk_fout_epll.rate = epll;
734 clk_fout_apll.rate = apll;
735
736 clk_h2.rate = hclk2;
737 clk_h.rate = hclk;
738 clk_p.rate = pclk;
739 clk_f.rate = fclk;
740
741 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
742 s3c_set_clksrc(init_parents[ptr], true);
743
744 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
745 s3c_set_clksrc(&clksrcs[ptr], true);
746}
747
748static struct clk *clks1[] __initdata = {
749 &clk_ext_xtal_mux,
750 &clk_iis_cd0,
751 &clk_iis_cd1,
752 &clk_pcm_cd,
753 &clk_mout_epll.clk,
754 &clk_mout_mpll.clk,
755 &clk_dout_mpll,
756 &clk_arm,
757};
758
759static struct clk *clks[] __initdata = {
760 &clk_ext,
761 &clk_epll,
762 &clk_27m,
763 &clk_48m,
764 &clk_h2,
765};
766
767/**
768 * s3c64xx_register_clocks - register clocks for s3c6400 and s3c6410
769 * @xtal: The rate for the clock crystal feeding the PLLs.
770 * @armclk_divlimit: Divisor mask for ARMCLK.
771 *
772 * Register the clocks for the S3C6400 and S3C6410 SoC range, such
773 * as ARMCLK as well as the necessary parent clocks.
774 *
775 * This call does not setup the clocks, which is left to the
776 * s3c6400_setup_clocks() call which may be needed by the cpufreq
777 * or resume code to re-set the clocks if the bootloader has changed
778 * them.
779 */
780void __init s3c64xx_register_clocks(unsigned long xtal,
781 unsigned armclk_divlimit)
782{
783 struct clk *clkp;
784 int ret;
785 int ptr;
786
787 armclk_mask = armclk_divlimit;
788
789 s3c24xx_register_baseclocks(xtal);
790 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
791
792 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
793
794 clkp = init_clocks_disable;
795 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
796
797 ret = s3c24xx_register_clock(clkp);
798 if (ret < 0) {
799 printk(KERN_ERR "Failed to register clock %s (%d)\n",
800 clkp->name, ret);
801 }
802
803 (clkp->enable)(clkp, 0);
804 }
805
806 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1));
807 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
808 s3c_pwmclk_init();
809}
diff --git a/arch/arm/plat-s3c64xx/cpu.c b/arch/arm/mach-s3c64xx/cpu.c
index 49796d2db86d..374e45e566b8 100644
--- a/arch/arm/plat-s3c64xx/cpu.c
+++ b/arch/arm/mach-s3c64xx/cpu.c
@@ -33,8 +33,8 @@
33#include <plat/devs.h> 33#include <plat/devs.h>
34#include <plat/clock.h> 34#include <plat/clock.h>
35 35
36#include <plat/s3c6400.h> 36#include <mach/s3c6400.h>
37#include <plat/s3c6410.h> 37#include <mach/s3c6410.h>
38 38
39/* table of supported CPUs */ 39/* table of supported CPUs */
40 40
@@ -73,17 +73,22 @@ static struct map_desc s3c_iodesc[] __initdata = {
73 .length = SZ_4K, 73 .length = SZ_4K,
74 .type = MT_DEVICE, 74 .type = MT_DEVICE,
75 }, { 75 }, {
76 .virtual = (unsigned long)S3C_VA_MEM,
77 .pfn = __phys_to_pfn(S3C64XX_PA_SROM),
78 .length = SZ_4K,
79 .type = MT_DEVICE,
80 }, {
76 .virtual = (unsigned long)(S3C_VA_UART + UART_OFFS), 81 .virtual = (unsigned long)(S3C_VA_UART + UART_OFFS),
77 .pfn = __phys_to_pfn(S3C_PA_UART), 82 .pfn = __phys_to_pfn(S3C_PA_UART),
78 .length = SZ_4K, 83 .length = SZ_4K,
79 .type = MT_DEVICE, 84 .type = MT_DEVICE,
80 }, { 85 }, {
81 .virtual = (unsigned long)S3C_VA_VIC0, 86 .virtual = (unsigned long)VA_VIC0,
82 .pfn = __phys_to_pfn(S3C64XX_PA_VIC0), 87 .pfn = __phys_to_pfn(S3C64XX_PA_VIC0),
83 .length = SZ_16K, 88 .length = SZ_16K,
84 .type = MT_DEVICE, 89 .type = MT_DEVICE,
85 }, { 90 }, {
86 .virtual = (unsigned long)S3C_VA_VIC1, 91 .virtual = (unsigned long)VA_VIC1,
87 .pfn = __phys_to_pfn(S3C64XX_PA_VIC1), 92 .pfn = __phys_to_pfn(S3C64XX_PA_VIC1),
88 .length = SZ_16K, 93 .length = SZ_16K,
89 .type = MT_DEVICE, 94 .type = MT_DEVICE,
@@ -124,6 +129,12 @@ static struct sys_device s3c64xx_sysdev = {
124 .cls = &s3c64xx_sysclass, 129 .cls = &s3c64xx_sysclass,
125}; 130};
126 131
132/* uart registration process */
133
134void __init s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
135{
136 s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
137}
127 138
128/* read cpu identification code */ 139/* read cpu identification code */
129 140
diff --git a/arch/arm/plat-s3c64xx/cpufreq.c b/arch/arm/mach-s3c64xx/cpufreq.c
index 74c0e8347de5..74c0e8347de5 100644
--- a/arch/arm/plat-s3c64xx/cpufreq.c
+++ b/arch/arm/mach-s3c64xx/cpufreq.c
diff --git a/arch/arm/mach-s3c64xx/dev-adc.c b/arch/arm/mach-s3c64xx/dev-adc.c
new file mode 100644
index 000000000000..fafef9b6bcfa
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-adc.c
@@ -0,0 +1,46 @@
1/* linux/arch/arm/plat-s3c64xx/dev-adc.c
2 *
3 * Copyright 2010 Maurus Cuelenaere
4 *
5 * S3C64xx series device definition for ADC device
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18
19#include <plat/adc.h>
20#include <plat/devs.h>
21#include <plat/cpu.h>
22
23static struct resource s3c_adc_resource[] = {
24 [0] = {
25 .start = S3C64XX_PA_ADC,
26 .end = S3C64XX_PA_ADC + SZ_256 - 1,
27 .flags = IORESOURCE_MEM,
28 },
29 [1] = {
30 .start = IRQ_TC,
31 .end = IRQ_TC,
32 .flags = IORESOURCE_IRQ,
33 },
34 [2] = {
35 .start = IRQ_ADC,
36 .end = IRQ_ADC,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41struct platform_device s3c_device_adc = {
42 .name = "s3c64xx-adc",
43 .id = -1,
44 .num_resources = ARRAY_SIZE(s3c_adc_resource),
45 .resource = s3c_adc_resource,
46};
diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c
new file mode 100644
index 000000000000..c3e9e73bd0f9
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-audio.c
@@ -0,0 +1,335 @@
1/* linux/arch/arm/plat-s3c/dev-audio.c
2 *
3 * Copyright 2009 Wolfson Microelectronics
4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/platform_device.h>
14#include <linux/dma-mapping.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18#include <mach/dma.h>
19#include <mach/gpio.h>
20
21#include <plat/devs.h>
22#include <plat/audio.h>
23#include <plat/gpio-cfg.h>
24
25#include <mach/gpio-bank-c.h>
26#include <mach/gpio-bank-d.h>
27#include <mach/gpio-bank-e.h>
28#include <mach/gpio-bank-h.h>
29
30static int s3c64xx_i2sv3_cfg_gpio(struct platform_device *pdev)
31{
32 switch (pdev->id) {
33 case 0:
34 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_I2S0_CLK);
35 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_I2S0_CDCLK);
36 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_I2S0_LRCLK);
37 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_I2S0_DI);
38 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_I2S0_D0);
39 break;
40 case 1:
41 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_I2S1_CLK);
42 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_I2S1_CDCLK);
43 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_I2S1_LRCLK);
44 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_I2S1_DI);
45 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_I2S1_D0);
46 default:
47 printk(KERN_DEBUG "Invalid I2S Controller number!");
48 return -EINVAL;
49 }
50
51 return 0;
52}
53
54static int s3c64xx_i2sv4_cfg_gpio(struct platform_device *pdev)
55{
56 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_I2S_V40_DO0);
57 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_I2S_V40_DO1);
58 s3c_gpio_cfgpin(S3C64XX_GPC(7), S3C64XX_GPC7_I2S_V40_DO2);
59 s3c_gpio_cfgpin(S3C64XX_GPH(6), S3C64XX_GPH6_I2S_V40_BCLK);
60 s3c_gpio_cfgpin(S3C64XX_GPH(7), S3C64XX_GPH7_I2S_V40_CDCLK);
61 s3c_gpio_cfgpin(S3C64XX_GPH(8), S3C64XX_GPH8_I2S_V40_LRCLK);
62 s3c_gpio_cfgpin(S3C64XX_GPH(9), S3C64XX_GPH9_I2S_V40_DI);
63
64 return 0;
65}
66
67static struct resource s3c64xx_iis0_resource[] = {
68 [0] = {
69 .start = S3C64XX_PA_IIS0,
70 .end = S3C64XX_PA_IIS0 + 0x100 - 1,
71 .flags = IORESOURCE_MEM,
72 },
73 [1] = {
74 .start = DMACH_I2S0_OUT,
75 .end = DMACH_I2S0_OUT,
76 .flags = IORESOURCE_DMA,
77 },
78 [2] = {
79 .start = DMACH_I2S0_IN,
80 .end = DMACH_I2S0_IN,
81 .flags = IORESOURCE_DMA,
82 },
83};
84
85static struct s3c_audio_pdata s3c_i2s0_pdata = {
86 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
87};
88
89struct platform_device s3c64xx_device_iis0 = {
90 .name = "s3c64xx-iis",
91 .id = 0,
92 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
93 .resource = s3c64xx_iis0_resource,
94 .dev = {
95 .platform_data = &s3c_i2s0_pdata,
96 },
97};
98EXPORT_SYMBOL(s3c64xx_device_iis0);
99
100static struct resource s3c64xx_iis1_resource[] = {
101 [0] = {
102 .start = S3C64XX_PA_IIS1,
103 .end = S3C64XX_PA_IIS1 + 0x100 - 1,
104 .flags = IORESOURCE_MEM,
105 },
106 [1] = {
107 .start = DMACH_I2S1_OUT,
108 .end = DMACH_I2S1_OUT,
109 .flags = IORESOURCE_DMA,
110 },
111 [2] = {
112 .start = DMACH_I2S1_IN,
113 .end = DMACH_I2S1_IN,
114 .flags = IORESOURCE_DMA,
115 },
116};
117
118static struct s3c_audio_pdata s3c_i2s1_pdata = {
119 .cfg_gpio = s3c64xx_i2sv3_cfg_gpio,
120};
121
122struct platform_device s3c64xx_device_iis1 = {
123 .name = "s3c64xx-iis",
124 .id = 1,
125 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
126 .resource = s3c64xx_iis1_resource,
127 .dev = {
128 .platform_data = &s3c_i2s1_pdata,
129 },
130};
131EXPORT_SYMBOL(s3c64xx_device_iis1);
132
133static struct resource s3c64xx_iisv4_resource[] = {
134 [0] = {
135 .start = S3C64XX_PA_IISV4,
136 .end = S3C64XX_PA_IISV4 + 0x100 - 1,
137 .flags = IORESOURCE_MEM,
138 },
139 [1] = {
140 .start = DMACH_HSI_I2SV40_TX,
141 .end = DMACH_HSI_I2SV40_TX,
142 .flags = IORESOURCE_DMA,
143 },
144 [2] = {
145 .start = DMACH_HSI_I2SV40_RX,
146 .end = DMACH_HSI_I2SV40_RX,
147 .flags = IORESOURCE_DMA,
148 },
149};
150
151static struct s3c_audio_pdata s3c_i2sv4_pdata = {
152 .cfg_gpio = s3c64xx_i2sv4_cfg_gpio,
153};
154
155struct platform_device s3c64xx_device_iisv4 = {
156 .name = "s3c64xx-iis-v4",
157 .id = -1,
158 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
159 .resource = s3c64xx_iisv4_resource,
160 .dev = {
161 .platform_data = &s3c_i2sv4_pdata,
162 },
163};
164EXPORT_SYMBOL(s3c64xx_device_iisv4);
165
166
167/* PCM Controller platform_devices */
168
169static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
170{
171 switch (pdev->id) {
172 case 0:
173 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK);
174 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK);
175 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC);
176 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN);
177 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT);
178 break;
179 case 1:
180 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK);
181 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK);
182 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC);
183 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN);
184 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT);
185 break;
186 default:
187 printk(KERN_DEBUG "Invalid PCM Controller number!");
188 return -EINVAL;
189 }
190
191 return 0;
192}
193
194static struct resource s3c64xx_pcm0_resource[] = {
195 [0] = {
196 .start = S3C64XX_PA_PCM0,
197 .end = S3C64XX_PA_PCM0 + 0x100 - 1,
198 .flags = IORESOURCE_MEM,
199 },
200 [1] = {
201 .start = DMACH_PCM0_TX,
202 .end = DMACH_PCM0_TX,
203 .flags = IORESOURCE_DMA,
204 },
205 [2] = {
206 .start = DMACH_PCM0_RX,
207 .end = DMACH_PCM0_RX,
208 .flags = IORESOURCE_DMA,
209 },
210};
211
212static struct s3c_audio_pdata s3c_pcm0_pdata = {
213 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
214};
215
216struct platform_device s3c64xx_device_pcm0 = {
217 .name = "samsung-pcm",
218 .id = 0,
219 .num_resources = ARRAY_SIZE(s3c64xx_pcm0_resource),
220 .resource = s3c64xx_pcm0_resource,
221 .dev = {
222 .platform_data = &s3c_pcm0_pdata,
223 },
224};
225EXPORT_SYMBOL(s3c64xx_device_pcm0);
226
227static struct resource s3c64xx_pcm1_resource[] = {
228 [0] = {
229 .start = S3C64XX_PA_PCM1,
230 .end = S3C64XX_PA_PCM1 + 0x100 - 1,
231 .flags = IORESOURCE_MEM,
232 },
233 [1] = {
234 .start = DMACH_PCM1_TX,
235 .end = DMACH_PCM1_TX,
236 .flags = IORESOURCE_DMA,
237 },
238 [2] = {
239 .start = DMACH_PCM1_RX,
240 .end = DMACH_PCM1_RX,
241 .flags = IORESOURCE_DMA,
242 },
243};
244
245static struct s3c_audio_pdata s3c_pcm1_pdata = {
246 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
247};
248
249struct platform_device s3c64xx_device_pcm1 = {
250 .name = "samsung-pcm",
251 .id = 1,
252 .num_resources = ARRAY_SIZE(s3c64xx_pcm1_resource),
253 .resource = s3c64xx_pcm1_resource,
254 .dev = {
255 .platform_data = &s3c_pcm1_pdata,
256 },
257};
258EXPORT_SYMBOL(s3c64xx_device_pcm1);
259
260/* AC97 Controller platform devices */
261
262static int s3c64xx_ac97_cfg_gpd(struct platform_device *pdev)
263{
264 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_AC97_BITCLK);
265 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_AC97_nRESET);
266 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_AC97_SYNC);
267 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_AC97_SDI);
268 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_AC97_SDO);
269
270 return 0;
271}
272
273static int s3c64xx_ac97_cfg_gpe(struct platform_device *pdev)
274{
275 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_AC97_BITCLK);
276 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_AC97_nRESET);
277 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_AC97_SYNC);
278 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_AC97_SDI);
279 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_AC97_SDO);
280
281 return 0;
282}
283
284static struct resource s3c64xx_ac97_resource[] = {
285 [0] = {
286 .start = S3C64XX_PA_AC97,
287 .end = S3C64XX_PA_AC97 + 0x100 - 1,
288 .flags = IORESOURCE_MEM,
289 },
290 [1] = {
291 .start = DMACH_AC97_PCMOUT,
292 .end = DMACH_AC97_PCMOUT,
293 .flags = IORESOURCE_DMA,
294 },
295 [2] = {
296 .start = DMACH_AC97_PCMIN,
297 .end = DMACH_AC97_PCMIN,
298 .flags = IORESOURCE_DMA,
299 },
300 [3] = {
301 .start = DMACH_AC97_MICIN,
302 .end = DMACH_AC97_MICIN,
303 .flags = IORESOURCE_DMA,
304 },
305 [4] = {
306 .start = IRQ_AC97,
307 .end = IRQ_AC97,
308 .flags = IORESOURCE_IRQ,
309 },
310};
311
312static struct s3c_audio_pdata s3c_ac97_pdata;
313
314static u64 s3c64xx_ac97_dmamask = DMA_BIT_MASK(32);
315
316struct platform_device s3c64xx_device_ac97 = {
317 .name = "s3c-ac97",
318 .id = -1,
319 .num_resources = ARRAY_SIZE(s3c64xx_ac97_resource),
320 .resource = s3c64xx_ac97_resource,
321 .dev = {
322 .platform_data = &s3c_ac97_pdata,
323 .dma_mask = &s3c64xx_ac97_dmamask,
324 .coherent_dma_mask = DMA_BIT_MASK(32),
325 },
326};
327EXPORT_SYMBOL(s3c64xx_device_ac97);
328
329void __init s3c64xx_ac97_setup_gpio(int num)
330{
331 if (num == S3C64XX_AC97_GPD)
332 s3c_ac97_pdata.cfg_gpio = s3c64xx_ac97_cfg_gpd;
333 else
334 s3c_ac97_pdata.cfg_gpio = s3c64xx_ac97_cfg_gpe;
335}
diff --git a/arch/arm/mach-s3c64xx/dev-rtc.c b/arch/arm/mach-s3c64xx/dev-rtc.c
new file mode 100644
index 000000000000..b9e7a05f0129
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-rtc.c
@@ -0,0 +1,43 @@
1/* linux/arch/arm/plat-s3c64xx/dev-rtc.c
2 *
3 * Copyright 2009 by Maurus Cuelenaere <mcuelenaere@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/kernel.h>
11#include <linux/string.h>
12#include <linux/platform_device.h>
13
14#include <mach/irqs.h>
15#include <mach/map.h>
16
17#include <plat/devs.h>
18
19static struct resource s3c_rtc_resource[] = {
20 [0] = {
21 .start = S3C64XX_PA_RTC,
22 .end = S3C64XX_PA_RTC + 0xff,
23 .flags = IORESOURCE_MEM,
24 },
25 [1] = {
26 .start = IRQ_RTC_ALARM,
27 .end = IRQ_RTC_ALARM,
28 .flags = IORESOURCE_IRQ,
29 },
30 [2] = {
31 .start = IRQ_RTC_TIC,
32 .end = IRQ_RTC_TIC,
33 .flags = IORESOURCE_IRQ
34 }
35};
36
37struct platform_device s3c_device_rtc = {
38 .name = "s3c64xx-rtc",
39 .id = -1,
40 .num_resources = ARRAY_SIZE(s3c_rtc_resource),
41 .resource = s3c_rtc_resource,
42};
43EXPORT_SYMBOL(s3c_device_rtc);
diff --git a/arch/arm/mach-s3c64xx/dev-spi.c b/arch/arm/mach-s3c64xx/dev-spi.c
new file mode 100644
index 000000000000..29c32d088515
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/dev-spi.c
@@ -0,0 +1,182 @@
1/* linux/arch/arm/plat-s3c64xx/dev-spi.c
2 *
3 * Copyright (C) 2009 Samsung Electronics Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/kernel.h>
12#include <linux/string.h>
13#include <linux/platform_device.h>
14#include <linux/dma-mapping.h>
15
16#include <mach/dma.h>
17#include <mach/map.h>
18#include <mach/gpio.h>
19#include <mach/gpio-bank-c.h>
20#include <mach/spi-clocks.h>
21
22#include <plat/s3c64xx-spi.h>
23#include <plat/gpio-cfg.h>
24#include <plat/irqs.h>
25
26static char *spi_src_clks[] = {
27 [S3C64XX_SPI_SRCCLK_PCLK] = "pclk",
28 [S3C64XX_SPI_SRCCLK_SPIBUS] = "spi-bus",
29 [S3C64XX_SPI_SRCCLK_48M] = "spi_48m",
30};
31
32/* SPI Controller platform_devices */
33
34/* Since we emulate multi-cs capability, we do not touch the GPC-3,7.
35 * The emulated CS is toggled by board specific mechanism, as it can
36 * be either some immediate GPIO or some signal out of some other
37 * chip in between ... or some yet another way.
38 * We simply do not assume anything about CS.
39 */
40static int s3c64xx_spi_cfg_gpio(struct platform_device *pdev)
41{
42 switch (pdev->id) {
43 case 0:
44 s3c_gpio_cfgpin(S3C64XX_GPC(0), S3C64XX_GPC0_SPI_MISO0);
45 s3c_gpio_cfgpin(S3C64XX_GPC(1), S3C64XX_GPC1_SPI_CLKO);
46 s3c_gpio_cfgpin(S3C64XX_GPC(2), S3C64XX_GPC2_SPI_MOSIO);
47 s3c_gpio_setpull(S3C64XX_GPC(0), S3C_GPIO_PULL_UP);
48 s3c_gpio_setpull(S3C64XX_GPC(1), S3C_GPIO_PULL_UP);
49 s3c_gpio_setpull(S3C64XX_GPC(2), S3C_GPIO_PULL_UP);
50 break;
51
52 case 1:
53 s3c_gpio_cfgpin(S3C64XX_GPC(4), S3C64XX_GPC4_SPI_MISO1);
54 s3c_gpio_cfgpin(S3C64XX_GPC(5), S3C64XX_GPC5_SPI_CLK1);
55 s3c_gpio_cfgpin(S3C64XX_GPC(6), S3C64XX_GPC6_SPI_MOSI1);
56 s3c_gpio_setpull(S3C64XX_GPC(4), S3C_GPIO_PULL_UP);
57 s3c_gpio_setpull(S3C64XX_GPC(5), S3C_GPIO_PULL_UP);
58 s3c_gpio_setpull(S3C64XX_GPC(6), S3C_GPIO_PULL_UP);
59 break;
60
61 default:
62 dev_err(&pdev->dev, "Invalid SPI Controller number!");
63 return -EINVAL;
64 }
65
66 return 0;
67}
68
69static struct resource s3c64xx_spi0_resource[] = {
70 [0] = {
71 .start = S3C64XX_PA_SPI0,
72 .end = S3C64XX_PA_SPI0 + 0x100 - 1,
73 .flags = IORESOURCE_MEM,
74 },
75 [1] = {
76 .start = DMACH_SPI0_TX,
77 .end = DMACH_SPI0_TX,
78 .flags = IORESOURCE_DMA,
79 },
80 [2] = {
81 .start = DMACH_SPI0_RX,
82 .end = DMACH_SPI0_RX,
83 .flags = IORESOURCE_DMA,
84 },
85 [3] = {
86 .start = IRQ_SPI0,
87 .end = IRQ_SPI0,
88 .flags = IORESOURCE_IRQ,
89 },
90};
91
92static struct s3c64xx_spi_info s3c64xx_spi0_pdata = {
93 .cfg_gpio = s3c64xx_spi_cfg_gpio,
94 .fifo_lvl_mask = 0x7f,
95 .rx_lvl_offset = 13,
96};
97
98static u64 spi_dmamask = DMA_BIT_MASK(32);
99
100struct platform_device s3c64xx_device_spi0 = {
101 .name = "s3c64xx-spi",
102 .id = 0,
103 .num_resources = ARRAY_SIZE(s3c64xx_spi0_resource),
104 .resource = s3c64xx_spi0_resource,
105 .dev = {
106 .dma_mask = &spi_dmamask,
107 .coherent_dma_mask = DMA_BIT_MASK(32),
108 .platform_data = &s3c64xx_spi0_pdata,
109 },
110};
111EXPORT_SYMBOL(s3c64xx_device_spi0);
112
113static struct resource s3c64xx_spi1_resource[] = {
114 [0] = {
115 .start = S3C64XX_PA_SPI1,
116 .end = S3C64XX_PA_SPI1 + 0x100 - 1,
117 .flags = IORESOURCE_MEM,
118 },
119 [1] = {
120 .start = DMACH_SPI1_TX,
121 .end = DMACH_SPI1_TX,
122 .flags = IORESOURCE_DMA,
123 },
124 [2] = {
125 .start = DMACH_SPI1_RX,
126 .end = DMACH_SPI1_RX,
127 .flags = IORESOURCE_DMA,
128 },
129 [3] = {
130 .start = IRQ_SPI1,
131 .end = IRQ_SPI1,
132 .flags = IORESOURCE_IRQ,
133 },
134};
135
136static struct s3c64xx_spi_info s3c64xx_spi1_pdata = {
137 .cfg_gpio = s3c64xx_spi_cfg_gpio,
138 .fifo_lvl_mask = 0x7f,
139 .rx_lvl_offset = 13,
140};
141
142struct platform_device s3c64xx_device_spi1 = {
143 .name = "s3c64xx-spi",
144 .id = 1,
145 .num_resources = ARRAY_SIZE(s3c64xx_spi1_resource),
146 .resource = s3c64xx_spi1_resource,
147 .dev = {
148 .dma_mask = &spi_dmamask,
149 .coherent_dma_mask = DMA_BIT_MASK(32),
150 .platform_data = &s3c64xx_spi1_pdata,
151 },
152};
153EXPORT_SYMBOL(s3c64xx_device_spi1);
154
155void __init s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs)
156{
157 struct s3c64xx_spi_info *pd;
158
159 /* Reject invalid configuration */
160 if (!num_cs || src_clk_nr < 0
161 || src_clk_nr > S3C64XX_SPI_SRCCLK_48M) {
162 printk(KERN_ERR "%s: Invalid SPI configuration\n", __func__);
163 return;
164 }
165
166 switch (cntrlr) {
167 case 0:
168 pd = &s3c64xx_spi0_pdata;
169 break;
170 case 1:
171 pd = &s3c64xx_spi1_pdata;
172 break;
173 default:
174 printk(KERN_ERR "%s: Invalid SPI controller(%d)\n",
175 __func__, cntrlr);
176 return;
177 }
178
179 pd->num_cs = num_cs;
180 pd->src_clk_nr = src_clk_nr;
181 pd->src_clk_name = spi_src_clks[src_clk_nr];
182}
diff --git a/arch/arm/plat-s3c64xx/dev-uart.c b/arch/arm/mach-s3c64xx/dev-uart.c
index 62c11a6fc7ba..f797f748b999 100644
--- a/arch/arm/plat-s3c64xx/dev-uart.c
+++ b/arch/arm/mach-s3c64xx/dev-uart.c
@@ -145,32 +145,3 @@ struct s3c24xx_uart_resources s3c64xx_uart_resources[] __initdata = {
145 .nr_resources = ARRAY_SIZE(s3c64xx_uart3_resource), 145 .nr_resources = ARRAY_SIZE(s3c64xx_uart3_resource),
146 }, 146 },
147}; 147};
148
149/* uart devices */
150
151static struct platform_device s3c24xx_uart_device0 = {
152 .id = 0,
153};
154
155static struct platform_device s3c24xx_uart_device1 = {
156 .id = 1,
157};
158
159static struct platform_device s3c24xx_uart_device2 = {
160 .id = 2,
161};
162
163static struct platform_device s3c24xx_uart_device3 = {
164 .id = 3,
165};
166
167struct platform_device *s3c24xx_uart_src[4] = {
168 &s3c24xx_uart_device0,
169 &s3c24xx_uart_device1,
170 &s3c24xx_uart_device2,
171 &s3c24xx_uart_device3,
172};
173
174struct platform_device *s3c24xx_uart_devs[4] = {
175};
176
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index d554b936fcfb..b62bdf18dca4 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -27,8 +27,7 @@
27#include <mach/map.h> 27#include <mach/map.h>
28#include <mach/irqs.h> 28#include <mach/irqs.h>
29 29
30#include <plat/dma-plat.h> 30#include <mach/regs-sys.h>
31#include <plat/regs-sys.h>
32 31
33#include <asm/hardware/pl080.h> 32#include <asm/hardware/pl080.h>
34 33
diff --git a/arch/arm/plat-s3c64xx/gpiolib.c b/arch/arm/mach-s3c64xx/gpiolib.c
index 778560457277..66e6794481d2 100644
--- a/arch/arm/plat-s3c64xx/gpiolib.c
+++ b/arch/arm/mach-s3c64xx/gpiolib.c
@@ -18,11 +18,11 @@
18 18
19#include <mach/map.h> 19#include <mach/map.h>
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21#include <mach/gpio-core.h>
22 21
22#include <plat/gpio-core.h>
23#include <plat/gpio-cfg.h> 23#include <plat/gpio-cfg.h>
24#include <plat/gpio-cfg-helpers.h> 24#include <plat/gpio-cfg-helpers.h>
25#include <plat/regs-gpio.h> 25#include <mach/regs-gpio.h>
26 26
27/* GPIO bank summary: 27/* GPIO bank summary:
28 * 28 *
@@ -49,150 +49,6 @@
49 * [2] BANK has two control registers, GPxCON0 and GPxCON1 49 * [2] BANK has two control registers, GPxCON0 and GPxCON1
50 */ 50 */
51 51
52#define OFF_GPCON (0x00)
53#define OFF_GPDAT (0x04)
54
55#define con_4bit_shift(__off) ((__off) * 4)
56
57#if 1
58#define gpio_dbg(x...) do { } while(0)
59#else
60#define gpio_dbg(x...) printk(KERN_DEBUG x)
61#endif
62
63/* The s3c64xx_gpiolib_4bit routines are to control the gpio banks where
64 * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
65 * following example:
66 *
67 * base + 0x00: Control register, 4 bits per gpio
68 * gpio n: 4 bits starting at (4*n)
69 * 0000 = input, 0001 = output, others mean special-function
70 * base + 0x04: Data register, 1 bit per gpio
71 * bit n: data bit n
72 *
73 * Note, since the data register is one bit per gpio and is at base + 0x4
74 * we can use s3c_gpiolib_get and s3c_gpiolib_set to change the state of
75 * the output.
76*/
77
78static int s3c64xx_gpiolib_4bit_input(struct gpio_chip *chip, unsigned offset)
79{
80 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
81 void __iomem *base = ourchip->base;
82 unsigned long con;
83
84 con = __raw_readl(base + OFF_GPCON);
85 con &= ~(0xf << con_4bit_shift(offset));
86 __raw_writel(con, base + OFF_GPCON);
87
88 gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con);
89
90 return 0;
91}
92
93static int s3c64xx_gpiolib_4bit_output(struct gpio_chip *chip,
94 unsigned offset, int value)
95{
96 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
97 void __iomem *base = ourchip->base;
98 unsigned long con;
99 unsigned long dat;
100
101 con = __raw_readl(base + OFF_GPCON);
102 con &= ~(0xf << con_4bit_shift(offset));
103 con |= 0x1 << con_4bit_shift(offset);
104
105 dat = __raw_readl(base + OFF_GPDAT);
106 if (value)
107 dat |= 1 << offset;
108 else
109 dat &= ~(1 << offset);
110
111 __raw_writel(dat, base + OFF_GPDAT);
112 __raw_writel(con, base + OFF_GPCON);
113 __raw_writel(dat, base + OFF_GPDAT);
114
115 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
116
117 return 0;
118}
119
120/* The next set of routines are for the case where the GPIO configuration
121 * registers are 4 bits per GPIO but there is more than one register (the
122 * bank has more than 8 GPIOs.
123 *
124 * This case is the similar to the 4 bit case, but the registers are as
125 * follows:
126 *
127 * base + 0x00: Control register, 4 bits per gpio (lower 8 GPIOs)
128 * gpio n: 4 bits starting at (4*n)
129 * 0000 = input, 0001 = output, others mean special-function
130 * base + 0x04: Control register, 4 bits per gpio (up to 8 additions GPIOs)
131 * gpio n: 4 bits starting at (4*n)
132 * 0000 = input, 0001 = output, others mean special-function
133 * base + 0x08: Data register, 1 bit per gpio
134 * bit n: data bit n
135 *
136 * To allow us to use the s3c_gpiolib_get and s3c_gpiolib_set routines we
137 * store the 'base + 0x4' address so that these routines see the data
138 * register at ourchip->base + 0x04.
139*/
140
141static int s3c64xx_gpiolib_4bit2_input(struct gpio_chip *chip, unsigned offset)
142{
143 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
144 void __iomem *base = ourchip->base;
145 void __iomem *regcon = base;
146 unsigned long con;
147
148 if (offset > 7)
149 offset -= 8;
150 else
151 regcon -= 4;
152
153 con = __raw_readl(regcon);
154 con &= ~(0xf << con_4bit_shift(offset));
155 __raw_writel(con, regcon);
156
157 gpio_dbg("%s: %p: CON %08lx\n", __func__, base, con);
158
159 return 0;
160
161}
162
163static int s3c64xx_gpiolib_4bit2_output(struct gpio_chip *chip,
164 unsigned offset, int value)
165{
166 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
167 void __iomem *base = ourchip->base;
168 void __iomem *regcon = base;
169 unsigned long con;
170 unsigned long dat;
171
172 if (offset > 7)
173 offset -= 8;
174 else
175 regcon -= 4;
176
177 con = __raw_readl(regcon);
178 con &= ~(0xf << con_4bit_shift(offset));
179 con |= 0x1 << con_4bit_shift(offset);
180
181 dat = __raw_readl(base + OFF_GPDAT);
182 if (value)
183 dat |= 1 << offset;
184 else
185 dat &= ~(1 << offset);
186
187 __raw_writel(dat, base + OFF_GPDAT);
188 __raw_writel(con, regcon);
189 __raw_writel(dat, base + OFF_GPDAT);
190
191 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
192
193 return 0;
194}
195
196static struct s3c_gpio_cfg gpio_4bit_cfg_noint = { 52static struct s3c_gpio_cfg gpio_4bit_cfg_noint = {
197 .set_config = s3c_gpio_setcfg_s3c64xx_4bit, 53 .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
198 .set_pull = s3c_gpio_setpull_updown, 54 .set_pull = s3c_gpio_setpull_updown,
@@ -399,20 +255,6 @@ static struct s3c_gpio_chip gpio_2bit[] = {
399 }, 255 },
400}; 256};
401 257
402static __init void s3c64xx_gpiolib_add_4bit(struct s3c_gpio_chip *chip)
403{
404 chip->chip.direction_input = s3c64xx_gpiolib_4bit_input;
405 chip->chip.direction_output = s3c64xx_gpiolib_4bit_output;
406 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
407}
408
409static __init void s3c64xx_gpiolib_add_4bit2(struct s3c_gpio_chip *chip)
410{
411 chip->chip.direction_input = s3c64xx_gpiolib_4bit2_input;
412 chip->chip.direction_output = s3c64xx_gpiolib_4bit2_output;
413 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
414}
415
416static __init void s3c64xx_gpiolib_add_2bit(struct s3c_gpio_chip *chip) 258static __init void s3c64xx_gpiolib_add_2bit(struct s3c_gpio_chip *chip)
417{ 259{
418 chip->pm = __gpio_pm(&s3c_gpio_pm_2bit); 260 chip->pm = __gpio_pm(&s3c_gpio_pm_2bit);
@@ -432,10 +274,10 @@ static __init void s3c64xx_gpiolib_add(struct s3c_gpio_chip *chips,
432static __init int s3c64xx_gpiolib_init(void) 274static __init int s3c64xx_gpiolib_init(void)
433{ 275{
434 s3c64xx_gpiolib_add(gpio_4bit, ARRAY_SIZE(gpio_4bit), 276 s3c64xx_gpiolib_add(gpio_4bit, ARRAY_SIZE(gpio_4bit),
435 s3c64xx_gpiolib_add_4bit); 277 samsung_gpiolib_add_4bit);
436 278
437 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2), 279 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2),
438 s3c64xx_gpiolib_add_4bit2); 280 samsung_gpiolib_add_4bit2);
439 281
440 s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit), 282 s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit),
441 s3c64xx_gpiolib_add_2bit); 283 s3c64xx_gpiolib_add_2bit);
diff --git a/arch/arm/mach-s3c6400/include/mach/debug-macro.S b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
index 5c88875d6a3f..b18ac5266dfc 100644
--- a/arch/arm/mach-s3c6400/include/mach/debug-macro.S
+++ b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
@@ -21,7 +21,7 @@
21 * aligned and add in the offset when we load the value here. 21 * aligned and add in the offset when we load the value here.
22 */ 22 */
23 23
24 .macro addruart, rx, tmp 24 .macro addruart, rx
25 mrc p15, 0, \rx, c1, c0 25 mrc p15, 0, \rx, c1, c0
26 tst \rx, #1 26 tst \rx, #1
27 ldreq \rx, = S3C_PA_UART 27 ldreq \rx, = S3C_PA_UART
diff --git a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h b/arch/arm/mach-s3c64xx/include/mach/dma.h
index 8f76a1e474d6..0a5d9268a23e 100644
--- a/arch/arm/plat-s3c64xx/include/plat/dma-plat.h
+++ b/arch/arm/mach-s3c64xx/include/mach/dma.h
@@ -1,16 +1,71 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/dma-plat.h 1/* linux/arch/arm/mach-s3c6400/include/mach/dma.h
2 * 2 *
3 * Copyright 2009 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2009 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * S3C64XX DMA core 8 * S3C6400 - DMA support
9 * 9 */
10 * This program is free software; you can redistribute it and/or modify 10
11 * it under the terms of the GNU General Public License version 2 as 11#ifndef __ASM_ARCH_DMA_H
12 * published by the Free Software Foundation. 12#define __ASM_ARCH_DMA_H __FILE__
13*/ 13
14#define S3C_DMA_CHANNELS (16)
15
16/* see mach-s3c2410/dma.h for notes on dma channel numbers */
17
18/* Note, for the S3C64XX architecture we keep the DMACH_
19 * defines in the order they are allocated to [S]DMA0/[S]DMA1
20 * so that is easy to do DHACH_ -> DMA controller conversion
21 */
22enum dma_ch {
23 /* DMA0/SDMA0 */
24 DMACH_UART0 = 0,
25 DMACH_UART0_SRC2,
26 DMACH_UART1,
27 DMACH_UART1_SRC2,
28 DMACH_UART2,
29 DMACH_UART2_SRC2,
30 DMACH_UART3,
31 DMACH_UART3_SRC2,
32 DMACH_PCM0_TX,
33 DMACH_PCM0_RX,
34 DMACH_I2S0_OUT,
35 DMACH_I2S0_IN,
36 DMACH_SPI0_TX,
37 DMACH_SPI0_RX,
38 DMACH_HSI_I2SV40_TX,
39 DMACH_HSI_I2SV40_RX,
40
41 /* DMA1/SDMA1 */
42 DMACH_PCM1_TX = 16,
43 DMACH_PCM1_RX,
44 DMACH_I2S1_OUT,
45 DMACH_I2S1_IN,
46 DMACH_SPI1_TX,
47 DMACH_SPI1_RX,
48 DMACH_AC97_PCMOUT,
49 DMACH_AC97_PCMIN,
50 DMACH_AC97_MICIN,
51 DMACH_PWM,
52 DMACH_IRDA,
53 DMACH_EXTERNAL,
54 DMACH_RES1,
55 DMACH_RES2,
56 DMACH_SECURITY_RX, /* SDMA1 only */
57 DMACH_SECURITY_TX, /* SDMA1 only */
58 DMACH_MAX /* the end */
59};
60
61static __inline__ bool s3c_dma_has_circular(void)
62{
63 return true;
64}
65
66#define S3C2410_DMAF_CIRCULAR (1 << 0)
67
68#include <plat/dma.h>
14 69
15#define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ 70#define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */
16 71
@@ -68,3 +123,5 @@ struct s3c2410_dma_chan {
68}; 123};
69 124
70#include <plat/dma-core.h> 125#include <plat/dma-core.h>
126
127#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-s3c64xx/include/mach/entry-macro.S b/arch/arm/mach-s3c64xx/include/mach/entry-macro.S
new file mode 100644
index 000000000000..dd362604dcce
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/entry-macro.S
@@ -0,0 +1,18 @@
1/* arch/arm/mach-s3c6400/include/mach/entry-macro.S
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * http://armlinux.simtec.co.uk/
6 * Ben Dooks <ben@simtec.co.uk>
7 *
8 * Low-level IRQ helper macros for the Samsung S3C64XX series
9 *
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
13*/
14
15#include <mach/map.h>
16#include <mach/irqs.h>
17
18#include <asm/entry-macro-vic2.S>
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-a.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h
index 9aa0e427d113..34212e1a7e81 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-a.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-a.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-a.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-b.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h
index 3933adb4d50a..7232c037e642 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-b.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-b.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-b.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h
index e22b49f4f982..db189ab1639a 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-c.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-c.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-d.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h
index 6fe4a49c26f0..1a01cee7aca3 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-d.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-d.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-d.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-e.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h
index 7fcf3d8e0a48..f057adb627dd 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-e.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-e.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-e.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-f.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h
index f3faff974a18..62ab8f5e7835 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-f.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-f.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-f.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-g.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h
index 35bbd2378e55..b94954af1598 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-g.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-g.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-g.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-h.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h
index 2ba1767512d7..5d75aaad865e 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-h.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-h.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-h.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-i.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h
index ce9ebe335566..4ceaa6098bc7 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-i.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-i.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-i.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-j.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h
index 21a906299d30..6f25cd079a40 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-j.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-j.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-j.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-n.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h
index 569e76120881..d0aeda1cd9de 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-n.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-n.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-n.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-o.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h
index b09e12954b57..21868fa102d0 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-o.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-o.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-o.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-p.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h
index 92f00517926b..46bcfb63b8de 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-p.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-p.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-p.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-q.h b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h
index 565e60aaee47..1712223487b0 100644
--- a/arch/arm/plat-s3c64xx/include/plat/gpio-bank-q.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/gpio-bank-q.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/gpio-bank-q.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/mach-s3c6400/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h
index e8e35e8fe731..0d46e994048a 100644
--- a/arch/arm/mach-s3c6400/include/mach/gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio.h
@@ -91,6 +91,10 @@ enum s3c_gpio_number {
91#define S3C_GPIO_END S3C64XX_GPIO_END 91#define S3C_GPIO_END S3C64XX_GPIO_END
92 92
93/* define the number of gpios we need to the one after the GPQ() range */ 93/* define the number of gpios we need to the one after the GPQ() range */
94#define ARCH_NR_GPIOS (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) 94#define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
95
96#define BOARD_NR_GPIOS 16
97
98#define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS)
95 99
96#include <asm-generic/gpio.h> 100#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s3c6400/include/mach/hardware.h b/arch/arm/mach-s3c64xx/include/mach/hardware.h
index 862d033e57a4..862d033e57a4 100644
--- a/arch/arm/mach-s3c6400/include/mach/hardware.h
+++ b/arch/arm/mach-s3c64xx/include/mach/hardware.h
diff --git a/arch/arm/mach-s3c64xx/include/mach/io.h b/arch/arm/mach-s3c64xx/include/mach/io.h
new file mode 100644
index 000000000000..de5716dbbd65
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/io.h
@@ -0,0 +1,18 @@
1/* arch/arm/mach-s3c64xxinclude/mach/io.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben-linux@fluff.org>
5 *
6 * Default IO routines for S3C64XX based
7 */
8
9#ifndef __ASM_ARM_ARCH_IO_H
10#define __ASM_ARM_ARCH_IO_H
11
12/* No current ISA/PCI bus support. */
13#define __io(a) __typesafe_io(a)
14#define __mem_pci(a) (a)
15
16#define IO_SPACE_LIMIT (0xFFFFFFFF)
17
18#endif
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/mach-s3c64xx/include/mach/irqs.h
index 7956fd3bb194..e9ab4ac0b9a8 100644
--- a/arch/arm/plat-s3c64xx/include/plat/irqs.h
+++ b/arch/arm/mach-s3c64xx/include/mach/irqs.h
@@ -1,15 +1,15 @@
1/* linux/arch/arm/plat-s3c64xx/include/mach/irqs.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/irqs.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * S3C64XX - Common IRQ support 8 * S3C64XX - IRQ support
9 */ 9 */
10 10
11#ifndef __ASM_PLAT_S3C64XX_IRQS_H 11#ifndef __ASM_MACH_S3C64XX_IRQS_H
12#define __ASM_PLAT_S3C64XX_IRQS_H __FILE__ 12#define __ASM_MACH_S3C64XX_IRQS_H __FILE__
13 13
14/* we keep the first set of CPU IRQs out of the range of 14/* we keep the first set of CPU IRQs out of the range of
15 * the ISA space, so that the PC104 has them to itself 15 * the ISA space, so that the PC104 has them to itself
@@ -24,8 +24,8 @@
24 24
25#define S3C_IRQ(x) ((x) + S3C_IRQ_OFFSET) 25#define S3C_IRQ(x) ((x) + S3C_IRQ_OFFSET)
26 26
27#define S3C_VIC0_BASE S3C_IRQ(0) 27#define IRQ_VIC0_BASE S3C_IRQ(0)
28#define S3C_VIC1_BASE S3C_IRQ(32) 28#define IRQ_VIC1_BASE S3C_IRQ(32)
29 29
30/* UART interrupts, each UART has 4 intterupts per channel so 30/* UART interrupts, each UART has 4 intterupts per channel so
31 * use the space between the ISA and S3C main interrupts. Note, these 31 * use the space between the ISA and S3C main interrupts. Note, these
@@ -59,8 +59,8 @@
59 59
60/* VIC based IRQs */ 60/* VIC based IRQs */
61 61
62#define S3C64XX_IRQ_VIC0(x) (S3C_VIC0_BASE + (x)) 62#define S3C64XX_IRQ_VIC0(x) (IRQ_VIC0_BASE + (x))
63#define S3C64XX_IRQ_VIC1(x) (S3C_VIC1_BASE + (x)) 63#define S3C64XX_IRQ_VIC1(x) (IRQ_VIC1_BASE + (x))
64 64
65/* VIC0 */ 65/* VIC0 */
66 66
@@ -198,7 +198,13 @@
198 * interrupt controllers). */ 198 * interrupt controllers). */
199#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1) 199#define IRQ_BOARD_START (IRQ_EINT_GROUP9_BASE + IRQ_EINT_GROUP9_NR + 1)
200 200
201#ifdef CONFIG_SMDK6410_WM1190_EV1
202#define IRQ_BOARD_NR 64
203#elif defined(CONFIG_SMDK6410_WM1192_EV1)
204#define IRQ_BOARD_NR 64
205#else
201#define IRQ_BOARD_NR 16 206#define IRQ_BOARD_NR 16
207#endif
202 208
203#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR) 209#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR)
204 210
@@ -206,5 +212,5 @@
206 212
207#define NR_IRQS (IRQ_BOARD_END + 1) 213#define NR_IRQS (IRQ_BOARD_END + 1)
208 214
209#endif /* __ASM_PLAT_S3C64XX_IRQS_H */ 215#endif /* __ASM_MACH_S3C64XX_IRQS_H */
210 216
diff --git a/arch/arm/mach-s3c6400/include/mach/map.h b/arch/arm/mach-s3c64xx/include/mach/map.h
index 106ee13581e2..801c1c0f3a95 100644
--- a/arch/arm/mach-s3c6400/include/mach/map.h
+++ b/arch/arm/mach-s3c64xx/include/mach/map.h
@@ -17,6 +17,18 @@
17 17
18#include <plat/map-base.h> 18#include <plat/map-base.h>
19 19
20/*
21 * Post-mux Chip Select Regions Xm0CSn_
22 * These may be used by SROM, NAND or CF depending on settings
23 */
24
25#define S3C64XX_PA_XM0CSN0 (0x10000000)
26#define S3C64XX_PA_XM0CSN1 (0x18000000)
27#define S3C64XX_PA_XM0CSN2 (0x20000000)
28#define S3C64XX_PA_XM0CSN3 (0x28000000)
29#define S3C64XX_PA_XM0CSN4 (0x30000000)
30#define S3C64XX_PA_XM0CSN5 (0x38000000)
31
20/* HSMMC units */ 32/* HSMMC units */
21#define S3C64XX_PA_HSMMC(x) (0x7C200000 + ((x) * 0x100000)) 33#define S3C64XX_PA_HSMMC(x) (0x7C200000 + ((x) * 0x100000))
22#define S3C64XX_PA_HSMMC0 S3C64XX_PA_HSMMC(0) 34#define S3C64XX_PA_HSMMC0 S3C64XX_PA_HSMMC(0)
@@ -38,16 +50,22 @@
38#define S3C_VA_UART2 S3C_VA_UARTx(2) 50#define S3C_VA_UART2 S3C_VA_UARTx(2)
39#define S3C_VA_UART3 S3C_VA_UARTx(3) 51#define S3C_VA_UART3 S3C_VA_UARTx(3)
40 52
53#define S3C64XX_PA_SROM (0x70000000)
54
41#define S3C64XX_PA_NAND (0x70200000) 55#define S3C64XX_PA_NAND (0x70200000)
42#define S3C64XX_PA_FB (0x77100000) 56#define S3C64XX_PA_FB (0x77100000)
43#define S3C64XX_PA_USB_HSOTG (0x7C000000) 57#define S3C64XX_PA_USB_HSOTG (0x7C000000)
44#define S3C64XX_PA_WATCHDOG (0x7E004000) 58#define S3C64XX_PA_WATCHDOG (0x7E004000)
59#define S3C64XX_PA_RTC (0x7E005000)
60#define S3C64XX_PA_ADC (0x7E00B000)
45#define S3C64XX_PA_SYSCON (0x7E00F000) 61#define S3C64XX_PA_SYSCON (0x7E00F000)
46#define S3C64XX_PA_AC97 (0x7F001000) 62#define S3C64XX_PA_AC97 (0x7F001000)
47#define S3C64XX_PA_IIS0 (0x7F002000) 63#define S3C64XX_PA_IIS0 (0x7F002000)
48#define S3C64XX_PA_IIS1 (0x7F003000) 64#define S3C64XX_PA_IIS1 (0x7F003000)
49#define S3C64XX_PA_TIMER (0x7F006000) 65#define S3C64XX_PA_TIMER (0x7F006000)
50#define S3C64XX_PA_IIC0 (0x7F004000) 66#define S3C64XX_PA_IIC0 (0x7F004000)
67#define S3C64XX_PA_SPI0 (0x7F00B000)
68#define S3C64XX_PA_SPI1 (0x7F00C000)
51#define S3C64XX_PA_PCM0 (0x7F009000) 69#define S3C64XX_PA_PCM0 (0x7F009000)
52#define S3C64XX_PA_PCM1 (0x7F00A000) 70#define S3C64XX_PA_PCM1 (0x7F00A000)
53#define S3C64XX_PA_IISV4 (0x7F00D000) 71#define S3C64XX_PA_IISV4 (0x7F00D000)
@@ -70,8 +88,8 @@
70#define S3C64XX_VA_USB_HSPHY S3C_ADDR_CPU(0x00200000) 88#define S3C64XX_VA_USB_HSPHY S3C_ADDR_CPU(0x00200000)
71 89
72/* place VICs close together */ 90/* place VICs close together */
73#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 91#define VA_VIC0 (S3C_VA_IRQ + 0x00)
74#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) 92#define VA_VIC1 (S3C_VA_IRQ + 0x10000)
75 93
76/* compatibiltiy defines. */ 94/* compatibiltiy defines. */
77#define S3C_PA_TIMER S3C64XX_PA_TIMER 95#define S3C_PA_TIMER S3C64XX_PA_TIMER
diff --git a/arch/arm/mach-s3c6400/include/mach/memory.h b/arch/arm/mach-s3c64xx/include/mach/memory.h
index a3ac84a65480..a3ac84a65480 100644
--- a/arch/arm/mach-s3c6400/include/mach/memory.h
+++ b/arch/arm/mach-s3c64xx/include/mach/memory.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/pll.h b/arch/arm/mach-s3c64xx/include/mach/pll.h
index 90bbd72fdc4e..90bbd72fdc4e 100644
--- a/arch/arm/plat-s3c64xx/include/plat/pll.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pll.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/pm-core.h b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
index d347de3ba0dc..1e9f20f0bb7b 100644
--- a/arch/arm/plat-s3c64xx/include/plat/pm-core.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pm-core.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c64xx/include/plat/pm-core.h 1/* linux/arch/arm/mach-s3c64xx/include/mach/pm-core.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -12,7 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14 14
15#include <plat/regs-gpio.h> 15#include <mach/regs-gpio.h>
16 16
17static inline void s3c_pm_debug_init_uart(void) 17static inline void s3c_pm_debug_init_uart(void)
18{ 18{
diff --git a/arch/arm/mach-s3c6400/include/mach/pwm-clock.h b/arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
index b25bedee0d52..b25bedee0d52 100644
--- a/arch/arm/mach-s3c6400/include/mach/pwm-clock.h
+++ b/arch/arm/mach-s3c64xx/include/mach/pwm-clock.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/mach-s3c64xx/include/mach/regs-clock.h
index ff46e7fa957a..3ef62741e5d1 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-clock.h
@@ -35,14 +35,6 @@
35#define S3C_MEM0_GATE S3C_CLKREG(0x3C) 35#define S3C_MEM0_GATE S3C_CLKREG(0x3C)
36 36
37/* CLKDIV0 */ 37/* CLKDIV0 */
38#define S3C6400_CLKDIV0_MFC_MASK (0xf << 28)
39#define S3C6400_CLKDIV0_MFC_SHIFT (28)
40#define S3C6400_CLKDIV0_JPEG_MASK (0xf << 24)
41#define S3C6400_CLKDIV0_JPEG_SHIFT (24)
42#define S3C6400_CLKDIV0_CAM_MASK (0xf << 20)
43#define S3C6400_CLKDIV0_CAM_SHIFT (20)
44#define S3C6400_CLKDIV0_SECURITY_MASK (0x3 << 18)
45#define S3C6400_CLKDIV0_SECURITY_SHIFT (18)
46#define S3C6400_CLKDIV0_PCLK_MASK (0xf << 12) 38#define S3C6400_CLKDIV0_PCLK_MASK (0xf << 12)
47#define S3C6400_CLKDIV0_PCLK_SHIFT (12) 39#define S3C6400_CLKDIV0_PCLK_SHIFT (12)
48#define S3C6400_CLKDIV0_HCLK2_MASK (0x7 << 9) 40#define S3C6400_CLKDIV0_HCLK2_MASK (0x7 << 9)
@@ -51,42 +43,11 @@
51#define S3C6400_CLKDIV0_HCLK_SHIFT (8) 43#define S3C6400_CLKDIV0_HCLK_SHIFT (8)
52#define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4) 44#define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4)
53#define S3C6400_CLKDIV0_MPLL_SHIFT (4) 45#define S3C6400_CLKDIV0_MPLL_SHIFT (4)
46
54#define S3C6400_CLKDIV0_ARM_MASK (0x7 << 0) 47#define S3C6400_CLKDIV0_ARM_MASK (0x7 << 0)
55#define S3C6410_CLKDIV0_ARM_MASK (0xf << 0) 48#define S3C6410_CLKDIV0_ARM_MASK (0xf << 0)
56#define S3C6400_CLKDIV0_ARM_SHIFT (0) 49#define S3C6400_CLKDIV0_ARM_SHIFT (0)
57 50
58/* CLKDIV1 */
59#define S3C6410_CLKDIV1_FIMC_MASK (0xf << 24)
60#define S3C6410_CLKDIV1_FIMC_SHIFT (24)
61#define S3C6400_CLKDIV1_UHOST_MASK (0xf << 20)
62#define S3C6400_CLKDIV1_UHOST_SHIFT (20)
63#define S3C6400_CLKDIV1_SCALER_MASK (0xf << 16)
64#define S3C6400_CLKDIV1_SCALER_SHIFT (16)
65#define S3C6400_CLKDIV1_LCD_MASK (0xf << 12)
66#define S3C6400_CLKDIV1_LCD_SHIFT (12)
67#define S3C6400_CLKDIV1_MMC2_MASK (0xf << 8)
68#define S3C6400_CLKDIV1_MMC2_SHIFT (8)
69#define S3C6400_CLKDIV1_MMC1_MASK (0xf << 4)
70#define S3C6400_CLKDIV1_MMC1_SHIFT (4)
71#define S3C6400_CLKDIV1_MMC0_MASK (0xf << 0)
72#define S3C6400_CLKDIV1_MMC0_SHIFT (0)
73
74/* CLKDIV2 */
75#define S3C6410_CLKDIV2_AUDIO2_MASK (0xf << 24)
76#define S3C6410_CLKDIV2_AUDIO2_SHIFT (24)
77#define S3C6400_CLKDIV2_IRDA_MASK (0xf << 20)
78#define S3C6400_CLKDIV2_IRDA_SHIFT (20)
79#define S3C6400_CLKDIV2_UART_MASK (0xf << 16)
80#define S3C6400_CLKDIV2_UART_SHIFT (16)
81#define S3C6400_CLKDIV2_AUDIO1_MASK (0xf << 12)
82#define S3C6400_CLKDIV2_AUDIO1_SHIFT (12)
83#define S3C6400_CLKDIV2_AUDIO0_MASK (0xf << 8)
84#define S3C6400_CLKDIV2_AUDIO0_SHIFT (8)
85#define S3C6400_CLKDIV2_SPI1_MASK (0xf << 4)
86#define S3C6400_CLKDIV2_SPI1_SHIFT (4)
87#define S3C6400_CLKDIV2_SPI0_MASK (0xf << 0)
88#define S3C6400_CLKDIV2_SPI0_SHIFT (0)
89
90/* HCLK GATE Registers */ 51/* HCLK GATE Registers */
91#define S3C_CLKCON_HCLK_3DSE (1<<31) 52#define S3C_CLKCON_HCLK_3DSE (1<<31)
92#define S3C_CLKCON_HCLK_UHOST (1<<29) 53#define S3C_CLKCON_HCLK_UHOST (1<<29)
@@ -192,34 +153,4 @@
192#define S3C6400_CLKSRC_EPLL_MOUT_SHIFT (2) 153#define S3C6400_CLKSRC_EPLL_MOUT_SHIFT (2)
193#define S3C6400_CLKSRC_MFC (1 << 4) 154#define S3C6400_CLKSRC_MFC (1 << 4)
194 155
195#define S3C6410_CLKSRC_TV27_MASK (0x1 << 31)
196#define S3C6410_CLKSRC_TV27_SHIFT (31)
197#define S3C6410_CLKSRC_DAC27_MASK (0x1 << 30)
198#define S3C6410_CLKSRC_DAC27_SHIFT (30)
199#define S3C6400_CLKSRC_SCALER_MASK (0x3 << 28)
200#define S3C6400_CLKSRC_SCALER_SHIFT (28)
201#define S3C6400_CLKSRC_LCD_MASK (0x3 << 26)
202#define S3C6400_CLKSRC_LCD_SHIFT (26)
203#define S3C6400_CLKSRC_IRDA_MASK (0x3 << 24)
204#define S3C6400_CLKSRC_IRDA_SHIFT (24)
205#define S3C6400_CLKSRC_MMC2_MASK (0x3 << 22)
206#define S3C6400_CLKSRC_MMC2_SHIFT (22)
207#define S3C6400_CLKSRC_MMC1_MASK (0x3 << 20)
208#define S3C6400_CLKSRC_MMC1_SHIFT (20)
209#define S3C6400_CLKSRC_MMC0_MASK (0x3 << 18)
210#define S3C6400_CLKSRC_MMC0_SHIFT (18)
211#define S3C6400_CLKSRC_SPI1_MASK (0x3 << 16)
212#define S3C6400_CLKSRC_SPI1_SHIFT (16)
213#define S3C6400_CLKSRC_SPI0_MASK (0x3 << 14)
214#define S3C6400_CLKSRC_SPI0_SHIFT (14)
215#define S3C6400_CLKSRC_UART_MASK (0x1 << 13)
216#define S3C6400_CLKSRC_UART_SHIFT (13)
217#define S3C6400_CLKSRC_AUDIO1_MASK (0x7 << 10)
218#define S3C6400_CLKSRC_AUDIO1_SHIFT (10)
219#define S3C6400_CLKSRC_AUDIO0_MASK (0x7 << 7)
220#define S3C6400_CLKSRC_AUDIO0_SHIFT (7)
221#define S3C6400_CLKSRC_UHOST_MASK (0x3 << 5)
222#define S3C6400_CLKSRC_UHOST_SHIFT (5)
223
224
225#endif /* _PLAT_REGS_CLOCK_H */ 156#endif /* _PLAT_REGS_CLOCK_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-fb.h b/arch/arm/mach-s3c64xx/include/mach/regs-fb.h
index f56611526c63..f56611526c63 100644
--- a/arch/arm/mach-s3c6400/include/mach/regs-fb.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-fb.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h b/arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h
index 82342f6fd27d..82342f6fd27d 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-gpio-memport.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-gpio-memport.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h b/arch/arm/mach-s3c64xx/include/mach/regs-gpio.h
index 81f7f6e6832e..81f7f6e6832e 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-gpio.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-gpio.h
diff --git a/arch/arm/mach-s3c6400/include/mach/regs-irq.h b/arch/arm/mach-s3c64xx/include/mach/regs-irq.h
index bcce68a0bb75..bcce68a0bb75 100644
--- a/arch/arm/mach-s3c6400/include/mach/regs-irq.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-irq.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-modem.h b/arch/arm/mach-s3c64xx/include/mach/regs-modem.h
index 49f7759dedfa..49f7759dedfa 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-modem.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-modem.h
diff --git a/arch/arm/mach-s3c64xx/include/mach/regs-srom.h b/arch/arm/mach-s3c64xx/include/mach/regs-srom.h
new file mode 100644
index 000000000000..756731b36297
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-srom.h
@@ -0,0 +1,59 @@
1/* arch/arm/plat-s3c64xx/include/plat/regs-srom.h
2 *
3 * Copyright 2009 Andy Green <andy@warmcat.com>
4 *
5 * S3C64XX SROM definitions
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#ifndef __PLAT_REGS_SROM_H
13#define __PLAT_REGS_SROM_H __FILE__
14
15#define S3C64XX_SROMREG(x) (S3C_VA_MEM + (x))
16
17#define S3C64XX_SROM_BW S3C64XX_SROMREG(0)
18#define S3C64XX_SROM_BC0 S3C64XX_SROMREG(4)
19#define S3C64XX_SROM_BC1 S3C64XX_SROMREG(8)
20#define S3C64XX_SROM_BC2 S3C64XX_SROMREG(0xc)
21#define S3C64XX_SROM_BC3 S3C64XX_SROMREG(0x10)
22#define S3C64XX_SROM_BC4 S3C64XX_SROMREG(0x14)
23#define S3C64XX_SROM_BC5 S3C64XX_SROMREG(0x18)
24
25/*
26 * one register BW holds 5 x 4-bit packed settings for NCS0 - NCS4
27 */
28
29#define S3C64XX_SROM_BW__DATAWIDTH__SHIFT 0
30#define S3C64XX_SROM_BW__WAITENABLE__SHIFT 2
31#define S3C64XX_SROM_BW__BYTEENABLE__SHIFT 3
32#define S3C64XX_SROM_BW__CS_MASK 0xf
33
34#define S3C64XX_SROM_BW__NCS0__SHIFT 0
35#define S3C64XX_SROM_BW__NCS1__SHIFT 4
36#define S3C64XX_SROM_BW__NCS2__SHIFT 8
37#define S3C64XX_SROM_BW__NCS3__SHIFT 0xc
38#define S3C64XX_SROM_BW__NCS4__SHIFT 0x10
39
40/*
41 * applies to same to BCS0 - BCS4
42 */
43
44#define S3C64XX_SROM_BCX__PMC__SHIFT 0
45#define S3C64XX_SROM_BCX__PMC__MASK 3
46#define S3C64XX_SROM_BCX__TACP__SHIFT 4
47#define S3C64XX_SROM_BCX__TACP__MASK 0xf
48#define S3C64XX_SROM_BCX__TCAH__SHIFT 8
49#define S3C64XX_SROM_BCX__TCAH__MASK 0xf
50#define S3C64XX_SROM_BCX__TCOH__SHIFT 12
51#define S3C64XX_SROM_BCX__TCOH__MASK 0xf
52#define S3C64XX_SROM_BCX__TACC__SHIFT 16
53#define S3C64XX_SROM_BCX__TACC__MASK 0x1f
54#define S3C64XX_SROM_BCX__TCOS__SHIFT 24
55#define S3C64XX_SROM_BCX__TCOS__MASK 0xf
56#define S3C64XX_SROM_BCX__TACS__SHIFT 28
57#define S3C64XX_SROM_BCX__TACS__MASK 0xf
58
59#endif /* _PLAT_REGS_SROM_H */
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-sys.h b/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
index 69b78d9f83b8..69b78d9f83b8 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-sys.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-sys.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h b/arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h
index 270d96ac9705..270d96ac9705 100644
--- a/arch/arm/plat-s3c64xx/include/plat/regs-syscon-power.h
+++ b/arch/arm/mach-s3c64xx/include/mach/regs-syscon-power.h
diff --git a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h b/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
index 11f2e1e119b0..f86958d05352 100644
--- a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h
+++ b/arch/arm/mach-s3c64xx/include/mach/s3c6400.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c64xx/include/plat/s3c6400.h 1/* arch/arm/mach-s3c64xx/include/macht/s3c6400.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -15,9 +15,10 @@
15/* Common init code for S3C6400 related SoCs */ 15/* Common init code for S3C6400 related SoCs */
16 16
17extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); 17extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
18extern void s3c6400_register_clocks(unsigned armclk_divlimit);
19extern void s3c6400_setup_clocks(void); 18extern void s3c6400_setup_clocks(void);
20 19
20extern void s3c64xx_register_clocks(unsigned long xtal, unsigned armclk_limit);
21
21#ifdef CONFIG_CPU_S3C6400 22#ifdef CONFIG_CPU_S3C6400
22 23
23extern int s3c6400_init(void); 24extern int s3c6400_init(void);
@@ -33,4 +34,3 @@ extern void s3c6400_init_clocks(int xtal);
33#define s3c6400_map_io NULL 34#define s3c6400_map_io NULL
34#define s3c6400_init NULL 35#define s3c6400_init NULL
35#endif 36#endif
36
diff --git a/arch/arm/plat-s3c64xx/include/plat/s3c6410.h b/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
index 50dcdd6f6800..24f1141ffcb7 100644
--- a/arch/arm/plat-s3c64xx/include/plat/s3c6410.h
+++ b/arch/arm/mach-s3c64xx/include/mach/s3c6410.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c64xx/include/plat/s3c6410.h 1/* arch/arm/mach-s3c64xx/include/mach/s3c6410.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
new file mode 100644
index 000000000000..9d0c43b4b687
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
@@ -0,0 +1,18 @@
1/* linux/arch/arm/mach-s3c64xx/include/mach/spi-clocks.h
2 *
3 * Copyright (C) 2009 Samsung Electronics Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __S3C64XX_PLAT_SPI_CLKS_H
12#define __S3C64XX_PLAT_SPI_CLKS_H __FILE__
13
14#define S3C64XX_SPI_SRCCLK_PCLK 0
15#define S3C64XX_SPI_SRCCLK_SPIBUS 1
16#define S3C64XX_SPI_SRCCLK_48M 2
17
18#endif /* __S3C64XX_PLAT_SPI_CLKS_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/system.h b/arch/arm/mach-s3c64xx/include/mach/system.h
index 2e58cb7a7147..2e58cb7a7147 100644
--- a/arch/arm/mach-s3c6400/include/mach/system.h
+++ b/arch/arm/mach-s3c64xx/include/mach/system.h
diff --git a/arch/arm/mach-s3c6400/include/mach/tick.h b/arch/arm/mach-s3c64xx/include/mach/tick.h
index d9c0dc7014ec..ebe18a9469b8 100644
--- a/arch/arm/mach-s3c6400/include/mach/tick.h
+++ b/arch/arm/mach-s3c64xx/include/mach/tick.h
@@ -20,7 +20,7 @@
20 */ 20 */
21static inline u32 s3c24xx_ostimer_pending(void) 21static inline u32 s3c24xx_ostimer_pending(void)
22{ 22{
23 u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS); 23 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
24 return pend & 1 << (IRQ_TIMER4_VIC - S3C64XX_IRQ_VIC0(0)); 24 return pend & 1 << (IRQ_TIMER4_VIC - S3C64XX_IRQ_VIC0(0));
25} 25}
26 26
diff --git a/arch/arm/mach-s3c64xx/include/mach/timex.h b/arch/arm/mach-s3c64xx/include/mach/timex.h
new file mode 100644
index 000000000000..fb2e8cd40829
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/timex.h
@@ -0,0 +1,24 @@
1/* arch/arm/mach-s3c64xx/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C6400 - time parameters
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s3c6400/include/mach/uncompress.h b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
index c6a82a20bf2a..c6a82a20bf2a 100644
--- a/arch/arm/mach-s3c6400/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
diff --git a/arch/arm/mach-s3c64xx/include/mach/vmalloc.h b/arch/arm/mach-s3c64xx/include/mach/vmalloc.h
new file mode 100644
index 000000000000..7411ef3711a6
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/include/mach/vmalloc.h
@@ -0,0 +1,20 @@
1/* arch/arm/mach-s3c64xx/include/mach/vmalloc.h
2 *
3 * from arch/arm/mach-iop3xx/include/mach/vmalloc.h
4 *
5 * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
6 * http://www.simtec.co.uk/products/SWLINUX/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * S3C6400 vmalloc definition
13*/
14
15#ifndef __ASM_ARCH_VMALLOC_H
16#define __ASM_ARCH_VMALLOC_H
17
18#define VMALLOC_END (0xE0000000)
19
20#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/mach-s3c64xx/irq-eint.c
index ebdf183a0911..5682d6a7f4af 100644
--- a/arch/arm/plat-s3c64xx/irq-eint.c
+++ b/arch/arm/mach-s3c64xx/irq-eint.c
@@ -22,7 +22,7 @@
22#include <asm/hardware/vic.h> 22#include <asm/hardware/vic.h>
23 23
24#include <plat/regs-irqtype.h> 24#include <plat/regs-irqtype.h>
25#include <plat/regs-gpio.h> 25#include <mach/regs-gpio.h>
26#include <plat/gpio-cfg.h> 26#include <plat/gpio-cfg.h>
27 27
28#include <mach/map.h> 28#include <mach/map.h>
diff --git a/arch/arm/plat-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index ca523b5d4c17..da1bec64b9da 100644
--- a/arch/arm/plat-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -23,7 +23,7 @@
23 23
24#include <plat/regs-serial.h> 24#include <plat/regs-serial.h>
25#include <plat/regs-timer.h> 25#include <plat/regs-timer.h>
26#include <plat/regs-gpio.h> 26#include <mach/regs-gpio.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/pm.h> 28#include <plat/pm.h>
29 29
diff --git a/arch/arm/mach-s3c64xx/irq.c b/arch/arm/mach-s3c64xx/irq.c
new file mode 100644
index 000000000000..67a145d440f3
--- /dev/null
+++ b/arch/arm/mach-s3c64xx/irq.c
@@ -0,0 +1,69 @@
1/* arch/arm/plat-s3c64xx/irq.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - Interrupt handling
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/interrupt.h>
17#include <linux/serial_core.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include <asm/hardware/vic.h>
22
23#include <mach/map.h>
24#include <plat/irq-vic-timer.h>
25#include <plat/irq-uart.h>
26#include <plat/cpu.h>
27
28static struct s3c_uart_irq uart_irqs[] = {
29 [0] = {
30 .regs = S3C_VA_UART0,
31 .base_irq = IRQ_S3CUART_BASE0,
32 .parent_irq = IRQ_UART0,
33 },
34 [1] = {
35 .regs = S3C_VA_UART1,
36 .base_irq = IRQ_S3CUART_BASE1,
37 .parent_irq = IRQ_UART1,
38 },
39 [2] = {
40 .regs = S3C_VA_UART2,
41 .base_irq = IRQ_S3CUART_BASE2,
42 .parent_irq = IRQ_UART2,
43 },
44 [3] = {
45 .regs = S3C_VA_UART3,
46 .base_irq = IRQ_S3CUART_BASE3,
47 .parent_irq = IRQ_UART3,
48 },
49};
50
51
52void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
53{
54 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
55
56 /* initialise the pair of VICs */
57 vic_init(VA_VIC0, IRQ_VIC0_BASE, vic0_valid, 0);
58 vic_init(VA_VIC1, IRQ_VIC1_BASE, vic1_valid, 0);
59
60 /* add the timer sub-irqs */
61
62 s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
63 s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
64 s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
65 s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
66 s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
67
68 s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
69}
diff --git a/arch/arm/mach-s3c6410/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c
index 661cca63de25..4a0bb243d14a 100644
--- a/arch/arm/mach-s3c6410/mach-anw6410.c
+++ b/arch/arm/mach-s3c64xx/mach-anw6410.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c6410/mach-anw6410.c 1/* linux/arch/arm/mach-s3c64xx/mach-anw6410.c
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -45,12 +45,12 @@
45#include <plat/iic.h> 45#include <plat/iic.h>
46#include <plat/fb.h> 46#include <plat/fb.h>
47 47
48#include <plat/s3c6410.h> 48#include <mach/s3c6410.h>
49#include <plat/clock.h> 49#include <plat/clock.h>
50#include <plat/devs.h> 50#include <plat/devs.h>
51#include <plat/cpu.h> 51#include <plat/cpu.h>
52#include <plat/regs-gpio.h> 52#include <mach/regs-gpio.h>
53#include <plat/regs-modem.h> 53#include <mach/regs-modem.h>
54 54
55/* DM9000 */ 55/* DM9000 */
56#define ANW6410_PA_DM9000 (0x18000000) 56#define ANW6410_PA_DM9000 (0x18000000)
diff --git a/arch/arm/mach-s3c6410/mach-hmt.c b/arch/arm/mach-s3c64xx/mach-hmt.c
index 7619456f2ae8..187441a78dd5 100644
--- a/arch/arm/mach-s3c6410/mach-hmt.c
+++ b/arch/arm/mach-s3c64xx/mach-hmt.c
@@ -38,7 +38,7 @@
38#include <plat/fb.h> 38#include <plat/fb.h>
39#include <plat/nand.h> 39#include <plat/nand.h>
40 40
41#include <plat/s3c6410.h> 41#include <mach/s3c6410.h>
42#include <plat/clock.h> 42#include <plat/clock.h>
43#include <plat/devs.h> 43#include <plat/devs.h>
44#include <plat/cpu.h> 44#include <plat/cpu.h>
@@ -233,7 +233,7 @@ static struct platform_device *hmt_devices[] __initdata = {
233 &s3c_device_i2c0, 233 &s3c_device_i2c0,
234 &s3c_device_nand, 234 &s3c_device_nand,
235 &s3c_device_fb, 235 &s3c_device_fb,
236 &s3c_device_usb, 236 &s3c_device_ohci,
237 &s3c_device_timer[1], 237 &s3c_device_timer[1],
238 &hmt_backlight_device, 238 &hmt_backlight_device,
239 &hmt_leds_device, 239 &hmt_leds_device,
diff --git a/arch/arm/mach-s3c6410/mach-ncp.c b/arch/arm/mach-s3c64xx/mach-ncp.c
index 55e9bbfaf68b..bf65747ea68e 100644
--- a/arch/arm/mach-s3c6410/mach-ncp.c
+++ b/arch/arm/mach-s3c64xx/mach-ncp.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-s3c6410/mach-ncp.c 2 * linux/arch/arm/mach-s3c64xx/mach-ncp.c
3 * 3 *
4 * Copyright (C) 2008-2009 Samsung Electronics 4 * Copyright (C) 2008-2009 Samsung Electronics
5 * 5 *
@@ -40,7 +40,7 @@
40#include <plat/iic.h> 40#include <plat/iic.h>
41#include <plat/fb.h> 41#include <plat/fb.h>
42 42
43#include <plat/s3c6410.h> 43#include <mach/s3c6410.h>
44#include <plat/clock.h> 44#include <plat/clock.h>
45#include <plat/devs.h> 45#include <plat/devs.h>
46#include <plat/cpu.h> 46#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c6400/mach-smdk6400.c b/arch/arm/mach-s3c64xx/mach-smdk6400.c
index ab19285389a7..f7b18983950c 100644
--- a/arch/arm/mach-s3c6400/mach-smdk6400.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6400.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c6400/mach-smdk6400.c 1/* linux/arch/arm/mach-s3c64xx/mach-smdk6400.c
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -31,7 +31,7 @@
31 31
32#include <plat/regs-serial.h> 32#include <plat/regs-serial.h>
33 33
34#include <plat/s3c6400.h> 34#include <mach/s3c6400.h>
35#include <plat/clock.h> 35#include <plat/clock.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/cpu.h> 37#include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 8969fe73b83f..2d5afd221d77 100644
--- a/arch/arm/mach-s3c6410/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c6410/mach-smdk6410.c 1/* linux/arch/arm/mach-s3c64xx/mach-smdk6410.c
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -21,6 +21,7 @@
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/leds.h>
24#include <linux/fb.h> 25#include <linux/fb.h>
25#include <linux/gpio.h> 26#include <linux/gpio.h>
26#include <linux/delay.h> 27#include <linux/delay.h>
@@ -32,6 +33,11 @@
32#include <linux/mfd/wm8350/pmic.h> 33#include <linux/mfd/wm8350/pmic.h>
33#endif 34#endif
34 35
36#ifdef CONFIG_SMDK6410_WM1192_EV1
37#include <linux/mfd/wm831x/core.h>
38#include <linux/mfd/wm831x/pdata.h>
39#endif
40
35#include <video/platform_lcd.h> 41#include <video/platform_lcd.h>
36 42
37#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
@@ -46,14 +52,15 @@
46#include <asm/mach-types.h> 52#include <asm/mach-types.h>
47 53
48#include <plat/regs-serial.h> 54#include <plat/regs-serial.h>
49#include <plat/regs-modem.h> 55#include <mach/regs-modem.h>
50#include <plat/regs-gpio.h> 56#include <mach/regs-gpio.h>
51#include <plat/regs-sys.h> 57#include <mach/regs-sys.h>
58#include <mach/regs-srom.h>
52#include <plat/iic.h> 59#include <plat/iic.h>
53#include <plat/fb.h> 60#include <plat/fb.h>
54#include <plat/gpio-cfg.h> 61#include <plat/gpio-cfg.h>
55 62
56#include <plat/s3c6410.h> 63#include <mach/s3c6410.h>
57#include <plat/clock.h> 64#include <plat/clock.h>
58#include <plat/devs.h> 65#include <plat/devs.h>
59#include <plat/cpu.h> 66#include <plat/cpu.h>
@@ -154,10 +161,20 @@ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
154 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 161 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
155}; 162};
156 163
164/*
165 * Configuring Ethernet on SMDK6410
166 *
167 * Both CS8900A and LAN9115 chips share one chip select mediated by CFG6.
168 * The constant address below corresponds to nCS1
169 *
170 * 1) Set CFGB2 p3 ON others off, no other CFGB selects "ethernet"
171 * 2) CFG6 needs to be switched to "LAN9115" side
172 */
173
157static struct resource smdk6410_smsc911x_resources[] = { 174static struct resource smdk6410_smsc911x_resources[] = {
158 [0] = { 175 [0] = {
159 .start = 0x18000000, 176 .start = S3C64XX_PA_XM0CSN1,
160 .end = 0x18000000 + SZ_64K - 1, 177 .end = S3C64XX_PA_XM0CSN1 + SZ_64K - 1,
161 .flags = IORESOURCE_MEM, 178 .flags = IORESOURCE_MEM,
162 }, 179 },
163 [1] = { 180 [1] = {
@@ -235,8 +252,9 @@ static struct platform_device *smdk6410_devices[] __initdata = {
235 &s3c_device_i2c0, 252 &s3c_device_i2c0,
236 &s3c_device_i2c1, 253 &s3c_device_i2c1,
237 &s3c_device_fb, 254 &s3c_device_fb,
238 &s3c_device_usb, 255 &s3c_device_ohci,
239 &s3c_device_usb_hsotg, 256 &s3c_device_usb_hsotg,
257 &s3c64xx_device_iisv4,
240 258
241#ifdef CONFIG_REGULATOR 259#ifdef CONFIG_REGULATOR
242 &smdk6410_b_pwr_5v, 260 &smdk6410_b_pwr_5v,
@@ -246,77 +264,124 @@ static struct platform_device *smdk6410_devices[] __initdata = {
246 &smdk6410_smsc911x, 264 &smdk6410_smsc911x,
247}; 265};
248 266
249#ifdef CONFIG_SMDK6410_WM1190_EV1 267#ifdef CONFIG_REGULATOR
250/* S3C64xx internal logic & PLL */ 268/* ARM core */
251static struct regulator_init_data wm8350_dcdc1_data = { 269static struct regulator_consumer_supply smdk6410_vddarm_consumers[] = {
270 {
271 .supply = "vddarm",
272 }
273};
274
275/* VDDARM, BUCK1 on J5 */
276static struct regulator_init_data smdk6410_vddarm = {
252 .constraints = { 277 .constraints = {
253 .name = "PVDD_INT/PVDD_PLL", 278 .name = "PVDD_ARM",
254 .min_uV = 1200000, 279 .min_uV = 1000000,
280 .max_uV = 1300000,
281 .always_on = 1,
282 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
283 },
284 .num_consumer_supplies = ARRAY_SIZE(smdk6410_vddarm_consumers),
285 .consumer_supplies = smdk6410_vddarm_consumers,
286};
287
288/* VDD_INT, BUCK2 on J5 */
289static struct regulator_init_data smdk6410_vddint = {
290 .constraints = {
291 .name = "PVDD_INT",
292 .min_uV = 1000000,
255 .max_uV = 1200000, 293 .max_uV = 1200000,
256 .always_on = 1, 294 .always_on = 1,
257 .apply_uV = 1, 295 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
258 }, 296 },
259}; 297};
260 298
261/* Memory */ 299/* VDD_HI, LDO3 on J5 */
262static struct regulator_init_data wm8350_dcdc3_data = { 300static struct regulator_init_data smdk6410_vddhi = {
263 .constraints = { 301 .constraints = {
264 .name = "PVDD_MEM", 302 .name = "PVDD_HI",
265 .min_uV = 1800000,
266 .max_uV = 1800000,
267 .always_on = 1, 303 .always_on = 1,
268 .state_mem = {
269 .uV = 1800000,
270 .mode = REGULATOR_MODE_NORMAL,
271 .enabled = 1,
272 },
273 .initial_state = PM_SUSPEND_MEM,
274 }, 304 },
275}; 305};
276 306
277/* USB, EXT, PCM, ADC/DAC, USB, MMC */ 307/* VDD_PLL, LDO2 on J5 */
278static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = { 308static struct regulator_init_data smdk6410_vddpll = {
279 { 309 .constraints = {
280 /* WM8580 */ 310 .name = "PVDD_PLL",
281 .supply = "DVDD", 311 .always_on = 1,
282 .dev_name = "0-001b",
283 }, 312 },
284}; 313};
285 314
286static struct regulator_init_data wm8350_dcdc4_data = { 315/* VDD_UH_MMC, LDO5 on J5 */
316static struct regulator_init_data smdk6410_vdduh_mmc = {
287 .constraints = { 317 .constraints = {
288 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 318 .name = "PVDD_UH/PVDD_MMC",
289 .min_uV = 3000000,
290 .max_uV = 3000000,
291 .always_on = 1, 319 .always_on = 1,
292 }, 320 },
293 .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers),
294 .consumer_supplies = wm8350_dcdc4_consumers,
295}; 321};
296 322
297/* ARM core */ 323/* VCCM3BT, LDO8 on J5 */
298static struct regulator_consumer_supply dcdc6_consumers[] = { 324static struct regulator_init_data smdk6410_vccmc3bt = {
299 { 325 .constraints = {
300 .supply = "vddarm", 326 .name = "PVCCM3BT",
301 } 327 .always_on = 1,
328 },
302}; 329};
303 330
304static struct regulator_init_data wm8350_dcdc6_data = { 331/* VCCM2MTV, LDO11 on J5 */
332static struct regulator_init_data smdk6410_vccm2mtv = {
305 .constraints = { 333 .constraints = {
306 .name = "PVDD_ARM", 334 .name = "PVCCM2MTV",
307 .min_uV = 1000000,
308 .max_uV = 1300000,
309 .always_on = 1, 335 .always_on = 1,
310 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
311 }, 336 },
312 .num_consumer_supplies = ARRAY_SIZE(dcdc6_consumers),
313 .consumer_supplies = dcdc6_consumers,
314}; 337};
315 338
316/* Alive */ 339/* VDD_LCD, LDO12 on J5 */
317static struct regulator_init_data wm8350_ldo1_data = { 340static struct regulator_init_data smdk6410_vddlcd = {
341 .constraints = {
342 .name = "PVDD_LCD",
343 .always_on = 1,
344 },
345};
346
347/* VDD_OTGI, LDO9 on J5 */
348static struct regulator_init_data smdk6410_vddotgi = {
349 .constraints = {
350 .name = "PVDD_OTGI",
351 .always_on = 1,
352 },
353};
354
355/* VDD_OTG, LDO14 on J5 */
356static struct regulator_init_data smdk6410_vddotg = {
357 .constraints = {
358 .name = "PVDD_OTG",
359 .always_on = 1,
360 },
361};
362
363/* VDD_ALIVE, LDO15 on J5 */
364static struct regulator_init_data smdk6410_vddalive = {
318 .constraints = { 365 .constraints = {
319 .name = "PVDD_ALIVE", 366 .name = "PVDD_ALIVE",
367 .always_on = 1,
368 },
369};
370
371/* VDD_AUDIO, VLDO_AUDIO on J5 */
372static struct regulator_init_data smdk6410_vddaudio = {
373 .constraints = {
374 .name = "PVDD_AUDIO",
375 .always_on = 1,
376 },
377};
378#endif
379
380#ifdef CONFIG_SMDK6410_WM1190_EV1
381/* S3C64xx internal logic & PLL */
382static struct regulator_init_data wm8350_dcdc1_data = {
383 .constraints = {
384 .name = "PVDD_INT/PVDD_PLL",
320 .min_uV = 1200000, 385 .min_uV = 1200000,
321 .max_uV = 1200000, 386 .max_uV = 1200000,
322 .always_on = 1, 387 .always_on = 1,
@@ -324,24 +389,40 @@ static struct regulator_init_data wm8350_ldo1_data = {
324 }, 389 },
325}; 390};
326 391
327/* OTG */ 392/* Memory */
328static struct regulator_init_data wm8350_ldo2_data = { 393static struct regulator_init_data wm8350_dcdc3_data = {
329 .constraints = { 394 .constraints = {
330 .name = "PVDD_OTG", 395 .name = "PVDD_MEM",
331 .min_uV = 3300000, 396 .min_uV = 1800000,
332 .max_uV = 3300000, 397 .max_uV = 1800000,
333 .always_on = 1, 398 .always_on = 1,
399 .state_mem = {
400 .uV = 1800000,
401 .mode = REGULATOR_MODE_NORMAL,
402 .enabled = 1,
403 },
404 .initial_state = PM_SUSPEND_MEM,
334 }, 405 },
335}; 406};
336 407
337/* LCD */ 408/* USB, EXT, PCM, ADC/DAC, USB, MMC */
338static struct regulator_init_data wm8350_ldo3_data = { 409static struct regulator_consumer_supply wm8350_dcdc4_consumers[] = {
410 {
411 /* WM8580 */
412 .supply = "DVDD",
413 .dev_name = "0-001b",
414 },
415};
416
417static struct regulator_init_data wm8350_dcdc4_data = {
339 .constraints = { 418 .constraints = {
340 .name = "PVDD_LCD", 419 .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV",
341 .min_uV = 3000000, 420 .min_uV = 3000000,
342 .max_uV = 3000000, 421 .max_uV = 3000000,
343 .always_on = 1, 422 .always_on = 1,
344 }, 423 },
424 .num_consumer_supplies = ARRAY_SIZE(wm8350_dcdc4_consumers),
425 .consumer_supplies = wm8350_dcdc4_consumers,
345}; 426};
346 427
347/* OTGi/1190-EV1 HPVDD & AVDD */ 428/* OTGi/1190-EV1 HPVDD & AVDD */
@@ -362,10 +443,10 @@ static struct {
362 { WM8350_DCDC_1, &wm8350_dcdc1_data }, 443 { WM8350_DCDC_1, &wm8350_dcdc1_data },
363 { WM8350_DCDC_3, &wm8350_dcdc3_data }, 444 { WM8350_DCDC_3, &wm8350_dcdc3_data },
364 { WM8350_DCDC_4, &wm8350_dcdc4_data }, 445 { WM8350_DCDC_4, &wm8350_dcdc4_data },
365 { WM8350_DCDC_6, &wm8350_dcdc6_data }, 446 { WM8350_DCDC_6, &smdk6410_vddarm },
366 { WM8350_LDO_1, &wm8350_ldo1_data }, 447 { WM8350_LDO_1, &smdk6410_vddalive },
367 { WM8350_LDO_2, &wm8350_ldo2_data }, 448 { WM8350_LDO_2, &smdk6410_vddotg },
368 { WM8350_LDO_3, &wm8350_ldo3_data }, 449 { WM8350_LDO_3, &smdk6410_vddlcd },
369 { WM8350_LDO_4, &wm8350_ldo4_data }, 450 { WM8350_LDO_4, &wm8350_ldo4_data },
370}; 451};
371 452
@@ -388,6 +469,107 @@ static int __init smdk6410_wm8350_init(struct wm8350 *wm8350)
388static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = { 469static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = {
389 .init = smdk6410_wm8350_init, 470 .init = smdk6410_wm8350_init,
390 .irq_high = 1, 471 .irq_high = 1,
472 .irq_base = IRQ_BOARD_START,
473};
474#endif
475
476#ifdef CONFIG_SMDK6410_WM1192_EV1
477static struct gpio_led wm1192_pmic_leds[] = {
478 {
479 .name = "PMIC:red:power",
480 .gpio = GPIO_BOARD_START + 3,
481 .default_state = LEDS_GPIO_DEFSTATE_ON,
482 },
483};
484
485static struct gpio_led_platform_data wm1192_pmic_led = {
486 .num_leds = ARRAY_SIZE(wm1192_pmic_leds),
487 .leds = wm1192_pmic_leds,
488};
489
490static struct platform_device wm1192_pmic_led_dev = {
491 .name = "leds-gpio",
492 .id = -1,
493 .dev = {
494 .platform_data = &wm1192_pmic_led,
495 },
496};
497
498static int wm1192_pre_init(struct wm831x *wm831x)
499{
500 int ret;
501
502 /* Configure the IRQ line */
503 s3c_gpio_setpull(S3C64XX_GPN(12), S3C_GPIO_PULL_UP);
504
505 ret = platform_device_register(&wm1192_pmic_led_dev);
506 if (ret != 0)
507 dev_err(wm831x->dev, "Failed to add PMIC LED: %d\n", ret);
508
509 return 0;
510}
511
512static struct wm831x_backlight_pdata wm1192_backlight_pdata = {
513 .isink = 1,
514 .max_uA = 27554,
515};
516
517static struct regulator_init_data wm1192_dcdc3 = {
518 .constraints = {
519 .name = "PVDD_MEM/PVDD_GPS",
520 .always_on = 1,
521 },
522};
523
524static struct regulator_consumer_supply wm1192_ldo1_consumers[] = {
525 { .supply = "DVDD", .dev_name = "0-001b", }, /* WM8580 */
526};
527
528static struct regulator_init_data wm1192_ldo1 = {
529 .constraints = {
530 .name = "PVDD_LCD/PVDD_EXT",
531 .always_on = 1,
532 },
533 .consumer_supplies = wm1192_ldo1_consumers,
534 .num_consumer_supplies = ARRAY_SIZE(wm1192_ldo1_consumers),
535};
536
537static struct wm831x_status_pdata wm1192_led7_pdata = {
538 .name = "LED7:green:",
539};
540
541static struct wm831x_status_pdata wm1192_led8_pdata = {
542 .name = "LED8:green:",
543};
544
545static struct wm831x_pdata smdk6410_wm1192_pdata = {
546 .pre_init = wm1192_pre_init,
547 .irq_base = IRQ_BOARD_START,
548
549 .backlight = &wm1192_backlight_pdata,
550 .dcdc = {
551 &smdk6410_vddarm, /* DCDC1 */
552 &smdk6410_vddint, /* DCDC2 */
553 &wm1192_dcdc3,
554 },
555 .gpio_base = GPIO_BOARD_START,
556 .ldo = {
557 &wm1192_ldo1, /* LDO1 */
558 &smdk6410_vdduh_mmc, /* LDO2 */
559 NULL, /* LDO3 NC */
560 &smdk6410_vddotgi, /* LDO4 */
561 &smdk6410_vddotg, /* LDO5 */
562 &smdk6410_vddhi, /* LDO6 */
563 &smdk6410_vddaudio, /* LDO7 */
564 &smdk6410_vccm2mtv, /* LDO8 */
565 &smdk6410_vddpll, /* LDO9 */
566 &smdk6410_vccmc3bt, /* LDO10 */
567 &smdk6410_vddalive, /* LDO11 */
568 },
569 .status = {
570 &wm1192_led7_pdata,
571 &wm1192_led8_pdata,
572 },
391}; 573};
392#endif 574#endif
393 575
@@ -395,6 +577,13 @@ static struct i2c_board_info i2c_devs0[] __initdata = {
395 { I2C_BOARD_INFO("24c08", 0x50), }, 577 { I2C_BOARD_INFO("24c08", 0x50), },
396 { I2C_BOARD_INFO("wm8580", 0x1b), }, 578 { I2C_BOARD_INFO("wm8580", 0x1b), },
397 579
580#ifdef CONFIG_SMDK6410_WM1192_EV1
581 { I2C_BOARD_INFO("wm8312", 0x34),
582 .platform_data = &smdk6410_wm1192_pdata,
583 .irq = S3C_EINT(12),
584 },
585#endif
586
398#ifdef CONFIG_SMDK6410_WM1190_EV1 587#ifdef CONFIG_SMDK6410_WM1190_EV1
399 { I2C_BOARD_INFO("wm8350", 0x1a), 588 { I2C_BOARD_INFO("wm8350", 0x1a),
400 .platform_data = &smdk6410_wm8350_pdata, 589 .platform_data = &smdk6410_wm8350_pdata,
@@ -430,10 +619,32 @@ static void __init smdk6410_map_io(void)
430 619
431static void __init smdk6410_machine_init(void) 620static void __init smdk6410_machine_init(void)
432{ 621{
622 u32 cs1;
623
433 s3c_i2c0_set_platdata(NULL); 624 s3c_i2c0_set_platdata(NULL);
434 s3c_i2c1_set_platdata(NULL); 625 s3c_i2c1_set_platdata(NULL);
435 s3c_fb_set_platdata(&smdk6410_lcd_pdata); 626 s3c_fb_set_platdata(&smdk6410_lcd_pdata);
436 627
628 /* configure nCS1 width to 16 bits */
629
630 cs1 = __raw_readl(S3C64XX_SROM_BW) &
631 ~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
632 cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
633 (1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
634 (1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
635 S3C64XX_SROM_BW__NCS1__SHIFT;
636 __raw_writel(cs1, S3C64XX_SROM_BW);
637
638 /* set timing for nCS1 suitable for ethernet chip */
639
640 __raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
641 (6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
642 (4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
643 (1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
644 (0xe << S3C64XX_SROM_BCX__TACC__SHIFT) |
645 (4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
646 (0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);
647
437 gpio_request(S3C64XX_GPN(5), "LCD power"); 648 gpio_request(S3C64XX_GPN(5), "LCD power");
438 gpio_request(S3C64XX_GPF(13), "LCD power"); 649 gpio_request(S3C64XX_GPF(13), "LCD power");
439 gpio_request(S3C64XX_GPF(15), "LCD power"); 650 gpio_request(S3C64XX_GPF(15), "LCD power");
diff --git a/arch/arm/plat-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c
index 47632fc7eb66..b8ac4597fad7 100644
--- a/arch/arm/plat-s3c64xx/pm.c
+++ b/arch/arm/mach-s3c64xx/pm.c
@@ -20,14 +20,14 @@
20#include <mach/map.h> 20#include <mach/map.h>
21 21
22#include <plat/pm.h> 22#include <plat/pm.h>
23#include <plat/regs-sys.h> 23#include <mach/regs-sys.h>
24#include <plat/regs-gpio.h> 24#include <mach/regs-gpio.h>
25#include <plat/regs-clock.h> 25#include <mach/regs-clock.h>
26#include <plat/regs-syscon-power.h> 26#include <mach/regs-syscon-power.h>
27#include <plat/regs-gpio-memport.h> 27#include <mach/regs-gpio-memport.h>
28 28
29#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 29#ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
30#include <plat/gpio-bank-n.h> 30#include <mach/gpio-bank-n.h>
31 31
32void s3c_pm_debug_smdkled(u32 set, u32 clear) 32void s3c_pm_debug_smdkled(u32 set, u32 clear)
33{ 33{
diff --git a/arch/arm/mach-s3c6400/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index d876ee503671..707e34e3afd1 100644
--- a/arch/arm/mach-s3c6400/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c6410/cpu.c 1/* linux/arch/arm/mach-s3c64xx/cpu.c
2 * 2 *
3 * Copyright 2009 Simtec Electronics 3 * Copyright 2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -30,14 +30,14 @@
30 30
31#include <plat/cpu-freq.h> 31#include <plat/cpu-freq.h>
32#include <plat/regs-serial.h> 32#include <plat/regs-serial.h>
33#include <plat/regs-clock.h> 33#include <mach/regs-clock.h>
34 34
35#include <plat/cpu.h> 35#include <plat/cpu.h>
36#include <plat/devs.h> 36#include <plat/devs.h>
37#include <plat/clock.h> 37#include <plat/clock.h>
38#include <plat/sdhci.h> 38#include <plat/sdhci.h>
39#include <plat/iic-core.h> 39#include <plat/iic-core.h>
40#include <plat/s3c6400.h> 40#include <mach/s3c6400.h>
41 41
42void __init s3c6400_map_io(void) 42void __init s3c6400_map_io(void)
43{ 43{
@@ -55,10 +55,7 @@ void __init s3c6400_map_io(void)
55 55
56void __init s3c6400_init_clocks(int xtal) 56void __init s3c6400_init_clocks(int xtal)
57{ 57{
58 printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 58 s3c64xx_register_clocks(xtal, S3C6400_CLKDIV0_ARM_MASK);
59 s3c24xx_register_baseclocks(xtal);
60 s3c64xx_register_clocks();
61 s3c6400_register_clocks(S3C6400_CLKDIV0_ARM_MASK);
62 s3c6400_setup_clocks(); 59 s3c6400_setup_clocks();
63} 60}
64 61
diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 522c08691952..59635d19466a 100644
--- a/arch/arm/mach-s3c6410/cpu.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/mach-s3c6410/cpu.c 1/* linux/arch/arm/mach-s3c64xx/s3c6410.c
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -31,30 +31,18 @@
31 31
32#include <plat/cpu-freq.h> 32#include <plat/cpu-freq.h>
33#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
34#include <plat/regs-clock.h> 34#include <mach/regs-clock.h>
35 35
36#include <plat/cpu.h> 36#include <plat/cpu.h>
37#include <plat/devs.h> 37#include <plat/devs.h>
38#include <plat/clock.h> 38#include <plat/clock.h>
39#include <plat/sdhci.h> 39#include <plat/sdhci.h>
40#include <plat/iic-core.h> 40#include <plat/iic-core.h>
41#include <plat/s3c6400.h> 41#include <mach/s3c6400.h>
42#include <plat/s3c6410.h> 42#include <mach/s3c6410.h>
43
44/* Initial IO mappings */
45
46static struct map_desc s3c6410_iodesc[] __initdata = {
47};
48
49/* s3c6410_map_io
50 *
51 * register the standard cpu IO areas
52*/
53 43
54void __init s3c6410_map_io(void) 44void __init s3c6410_map_io(void)
55{ 45{
56 iotable_init(s3c6410_iodesc, ARRAY_SIZE(s3c6410_iodesc));
57
58 /* initialise device information early */ 46 /* initialise device information early */
59 s3c6410_default_sdhci0(); 47 s3c6410_default_sdhci0();
60 s3c6410_default_sdhci1(); 48 s3c6410_default_sdhci1();
@@ -70,9 +58,7 @@ void __init s3c6410_map_io(void)
70void __init s3c6410_init_clocks(int xtal) 58void __init s3c6410_init_clocks(int xtal)
71{ 59{
72 printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 60 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
73 s3c24xx_register_baseclocks(xtal); 61 s3c64xx_register_clocks(xtal, S3C6410_CLKDIV0_ARM_MASK);
74 s3c64xx_register_clocks();
75 s3c6400_register_clocks(S3C6410_CLKDIV0_ARM_MASK);
76 s3c6400_setup_clocks(); 62 s3c6400_setup_clocks();
77} 63}
78 64
diff --git a/arch/arm/plat-s3c64xx/setup-fb-24bpp.c b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
index 8e28e448dd20..8e28e448dd20 100644
--- a/arch/arm/plat-s3c64xx/setup-fb-24bpp.c
+++ b/arch/arm/mach-s3c64xx/setup-fb-24bpp.c
diff --git a/arch/arm/plat-s3c64xx/setup-i2c0.c b/arch/arm/mach-s3c64xx/setup-i2c0.c
index 364480763728..d1b11e6e77e8 100644
--- a/arch/arm/plat-s3c64xx/setup-i2c0.c
+++ b/arch/arm/mach-s3c64xx/setup-i2c0.c
@@ -18,8 +18,8 @@
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21#include <mach/gpio-bank-b.h>
21#include <plat/iic.h> 22#include <plat/iic.h>
22#include <plat/gpio-bank-b.h>
23#include <plat/gpio-cfg.h> 23#include <plat/gpio-cfg.h>
24 24
25void s3c_i2c0_cfg_gpio(struct platform_device *dev) 25void s3c_i2c0_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/plat-s3c64xx/setup-i2c1.c b/arch/arm/mach-s3c64xx/setup-i2c1.c
index bbe229bd90ca..2dce57d8c6f8 100644
--- a/arch/arm/plat-s3c64xx/setup-i2c1.c
+++ b/arch/arm/mach-s3c64xx/setup-i2c1.c
@@ -18,8 +18,8 @@
18struct platform_device; /* don't need the contents */ 18struct platform_device; /* don't need the contents */
19 19
20#include <mach/gpio.h> 20#include <mach/gpio.h>
21#include <mach/gpio-bank-b.h>
21#include <plat/iic.h> 22#include <plat/iic.h>
22#include <plat/gpio-bank-b.h>
23#include <plat/gpio-cfg.h> 23#include <plat/gpio-cfg.h>
24 24
25void s3c_i2c1_cfg_gpio(struct platform_device *dev) 25void s3c_i2c1_cfg_gpio(struct platform_device *dev)
diff --git a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
index a58c0cc7ba5e..a58c0cc7ba5e 100644
--- a/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
diff --git a/arch/arm/mach-s3c6400/setup-sdhci.c b/arch/arm/mach-s3c64xx/setup-sdhci.c
index 1039937403be..1a942037c4ef 100644
--- a/arch/arm/mach-s3c6400/setup-sdhci.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci.c
@@ -1,11 +1,11 @@
1/* linux/arch/arm/mach-s3c6410/setup-sdhci.c 1/* linux/arch/arm/mach-s3c64xx/setup-sdhci.c
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/ 6 * http://armlinux.simtec.co.uk/
7 * 7 *
8 * S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC) 8 * S3C6400/S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC)
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -26,7 +26,7 @@
26 26
27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 27/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
28 28
29char *s3c6400_hsmmc_clksrcs[4] = { 29char *s3c64xx_hsmmc_clksrcs[4] = {
30 [0] = "hsmmc", 30 [0] = "hsmmc",
31 [1] = "hsmmc", 31 [1] = "hsmmc",
32 [2] = "mmc_bus", 32 [2] = "mmc_bus",
@@ -61,3 +61,12 @@ void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
61 writel(ctrl3, r + S3C_SDHCI_CONTROL3); 61 writel(ctrl3, r + S3C_SDHCI_CONTROL3);
62} 62}
63 63
64void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
65 void __iomem *r,
66 struct mmc_ios *ios,
67 struct mmc_card *card)
68{
69 writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4);
70
71 s3c6400_setup_sdhci_cfg_card(dev, r, ios, card);
72}
diff --git a/arch/arm/plat-s3c64xx/sleep.S b/arch/arm/mach-s3c64xx/sleep.S
index 8e71fe90a373..b2ef44317368 100644
--- a/arch/arm/plat-s3c64xx/sleep.S
+++ b/arch/arm/mach-s3c64xx/sleep.S
@@ -1,4 +1,4 @@
1/* linux/0arch/arm/plat-s3c64xx/sleep.S 1/* linux/arch/arm/plat-s3c64xx/sleep.S
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
@@ -19,8 +19,8 @@
19#undef S3C64XX_VA_GPIO 19#undef S3C64XX_VA_GPIO
20#define S3C64XX_VA_GPIO (0x0) 20#define S3C64XX_VA_GPIO (0x0)
21 21
22#include <plat/regs-gpio.h> 22#include <mach/regs-gpio.h>
23#include <plat/gpio-bank-n.h> 23#include <mach/gpio-bank-n.h>
24 24
25#define LL_UART (S3C_PA_UART + (0x400 * CONFIG_S3C_LOWLEVEL_UART_PORT)) 25#define LL_UART (S3C_PA_UART + (0x400 * CONFIG_S3C_LOWLEVEL_UART_PORT))
26 26
diff --git a/arch/arm/mach-s5p6440/Kconfig b/arch/arm/mach-s5p6440/Kconfig
new file mode 100644
index 000000000000..4c29ff8b07de
--- /dev/null
+++ b/arch/arm/mach-s5p6440/Kconfig
@@ -0,0 +1,21 @@
1# arch/arm/mach-s5p6440/Kconfig
2#
3# Copyright (c) 2009 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8if ARCH_S5P6440
9
10config CPU_S5P6440
11 bool
12 help
13 Enable S5P6440 CPU support
14
15config MACH_SMDK6440
16 bool "SMDK6440"
17 select CPU_S5P6440
18 help
19 Machine support for the Samsung SMDK6440
20
21endif
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile
new file mode 100644
index 000000000000..1ad894b1d3ab
--- /dev/null
+++ b/arch/arm/mach-s5p6440/Makefile
@@ -0,0 +1,19 @@
1# arch/arm/mach-s5p6440/Makefile
2#
3# Copyright (c) 2009 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S5P6440 system
14
15obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o
16
17# machine support
18
19obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o
diff --git a/arch/arm/mach-s5p6440/Makefile.boot b/arch/arm/mach-s5p6440/Makefile.boot
new file mode 100644
index 000000000000..ff90aa13bd67
--- /dev/null
+++ b/arch/arm/mach-s5p6440/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x20008000
2params_phys-y := 0x20000100
diff --git a/arch/arm/mach-s5p6440/clock.c b/arch/arm/mach-s5p6440/clock.c
new file mode 100644
index 000000000000..b2672e16e7aa
--- /dev/null
+++ b/arch/arm/mach-s5p6440/clock.c
@@ -0,0 +1,698 @@
1/* linux/arch/arm/mach-s5p6440/clock.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/clk.h>
20#include <linux/sysdev.h>
21#include <linux/io.h>
22
23#include <mach/hardware.h>
24#include <mach/map.h>
25
26#include <plat/cpu-freq.h>
27#include <mach/regs-clock.h>
28#include <plat/clock.h>
29#include <plat/cpu.h>
30#include <plat/clock-clksrc.h>
31#include <plat/s5p-clock.h>
32#include <plat/pll.h>
33#include <plat/s5p6440.h>
34
35/* APLL Mux output clock */
36static struct clksrc_clk clk_mout_apll = {
37 .clk = {
38 .name = "mout_apll",
39 .id = -1,
40 },
41 .sources = &clk_src_apll,
42 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1 },
43};
44
45static int s5p6440_epll_enable(struct clk *clk, int enable)
46{
47 unsigned int ctrlbit = clk->ctrlbit;
48 unsigned int epll_con = __raw_readl(S5P_EPLL_CON) & ~ctrlbit;
49
50 if (enable)
51 __raw_writel(epll_con | ctrlbit, S5P_EPLL_CON);
52 else
53 __raw_writel(epll_con, S5P_EPLL_CON);
54
55 return 0;
56}
57
58static unsigned long s5p6440_epll_get_rate(struct clk *clk)
59{
60 return clk->rate;
61}
62
63static u32 epll_div[][5] = {
64 { 36000000, 0, 48, 1, 4 },
65 { 48000000, 0, 32, 1, 3 },
66 { 60000000, 0, 40, 1, 3 },
67 { 72000000, 0, 48, 1, 3 },
68 { 84000000, 0, 28, 1, 2 },
69 { 96000000, 0, 32, 1, 2 },
70 { 32768000, 45264, 43, 1, 4 },
71 { 45158000, 6903, 30, 1, 3 },
72 { 49152000, 50332, 32, 1, 3 },
73 { 67738000, 10398, 45, 1, 3 },
74 { 73728000, 9961, 49, 1, 3 }
75};
76
77static int s5p6440_epll_set_rate(struct clk *clk, unsigned long rate)
78{
79 unsigned int epll_con, epll_con_k;
80 unsigned int i;
81
82 if (clk->rate == rate) /* Return if nothing changed */
83 return 0;
84
85 epll_con = __raw_readl(S5P_EPLL_CON);
86 epll_con_k = __raw_readl(S5P_EPLL_CON_K);
87
88 epll_con_k &= ~(PLL90XX_KDIV_MASK);
89 epll_con &= ~(PLL90XX_MDIV_MASK | PLL90XX_PDIV_MASK | PLL90XX_SDIV_MASK);
90
91 for (i = 0; i < ARRAY_SIZE(epll_div); i++) {
92 if (epll_div[i][0] == rate) {
93 epll_con_k |= (epll_div[i][1] << PLL90XX_KDIV_SHIFT);
94 epll_con |= (epll_div[i][2] << PLL90XX_MDIV_SHIFT) |
95 (epll_div[i][3] << PLL90XX_PDIV_SHIFT) |
96 (epll_div[i][4] << PLL90XX_SDIV_SHIFT);
97 break;
98 }
99 }
100
101 if (i == ARRAY_SIZE(epll_div)) {
102 printk(KERN_ERR "%s: Invalid Clock EPLL Frequency\n", __func__);
103 return -EINVAL;
104 }
105
106 __raw_writel(epll_con, S5P_EPLL_CON);
107 __raw_writel(epll_con_k, S5P_EPLL_CON_K);
108
109 clk->rate = rate;
110
111 return 0;
112}
113
114static struct clk_ops s5p6440_epll_ops = {
115 .get_rate = s5p6440_epll_get_rate,
116 .set_rate = s5p6440_epll_set_rate,
117};
118
119static struct clksrc_clk clk_mout_epll = {
120 .clk = {
121 .name = "mout_epll",
122 .id = -1,
123 },
124 .sources = &clk_src_epll,
125 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 2, .size = 1 },
126};
127
128static struct clksrc_clk clk_mout_mpll = {
129 .clk = {
130 .name = "mout_mpll",
131 .id = -1,
132 },
133 .sources = &clk_src_mpll,
134 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 1, .size = 1 },
135};
136
137static struct clk clk_h_low = {
138 .name = "hclk_low",
139 .id = -1,
140 .rate = 0,
141 .parent = NULL,
142 .ctrlbit = 0,
143 .ops = &clk_ops_def_setrate,
144};
145
146static struct clk clk_p_low = {
147 .name = "pclk_low",
148 .id = -1,
149 .rate = 0,
150 .parent = NULL,
151 .ctrlbit = 0,
152 .ops = &clk_ops_def_setrate,
153};
154
155enum perf_level {
156 L0 = 532*1000,
157 L1 = 266*1000,
158 L2 = 133*1000,
159};
160
161static const u32 clock_table[][3] = {
162 /*{ARM_CLK, DIVarm, DIVhclk}*/
163 {L0 * 1000, (0 << ARM_DIV_RATIO_SHIFT), (3 << S5P_CLKDIV0_HCLK_SHIFT)},
164 {L1 * 1000, (1 << ARM_DIV_RATIO_SHIFT), (1 << S5P_CLKDIV0_HCLK_SHIFT)},
165 {L2 * 1000, (3 << ARM_DIV_RATIO_SHIFT), (0 << S5P_CLKDIV0_HCLK_SHIFT)},
166};
167
168static unsigned long s5p6440_armclk_get_rate(struct clk *clk)
169{
170 unsigned long rate = clk_get_rate(clk->parent);
171 u32 clkdiv;
172
173 /* divisor mask starts at bit0, so no need to shift */
174 clkdiv = __raw_readl(ARM_CLK_DIV) & ARM_DIV_MASK;
175
176 return rate / (clkdiv + 1);
177}
178
179static unsigned long s5p6440_armclk_round_rate(struct clk *clk,
180 unsigned long rate)
181{
182 u32 iter;
183
184 for (iter = 1 ; iter < ARRAY_SIZE(clock_table) ; iter++) {
185 if (rate > clock_table[iter][0])
186 return clock_table[iter-1][0];
187 }
188
189 return clock_table[ARRAY_SIZE(clock_table) - 1][0];
190}
191
192static int s5p6440_armclk_set_rate(struct clk *clk, unsigned long rate)
193{
194 u32 round_tmp;
195 u32 iter;
196 u32 clk_div0_tmp;
197 u32 cur_rate = clk->ops->get_rate(clk);
198 unsigned long flags;
199
200 round_tmp = clk->ops->round_rate(clk, rate);
201 if (round_tmp == cur_rate)
202 return 0;
203
204
205 for (iter = 0 ; iter < ARRAY_SIZE(clock_table) ; iter++) {
206 if (round_tmp == clock_table[iter][0])
207 break;
208 }
209
210 if (iter >= ARRAY_SIZE(clock_table))
211 iter = ARRAY_SIZE(clock_table) - 1;
212
213 local_irq_save(flags);
214 if (cur_rate > round_tmp) {
215 /* Frequency Down */
216 clk_div0_tmp = __raw_readl(ARM_CLK_DIV) & ~(ARM_DIV_MASK);
217 clk_div0_tmp |= clock_table[iter][1];
218 __raw_writel(clk_div0_tmp, ARM_CLK_DIV);
219
220 clk_div0_tmp = __raw_readl(ARM_CLK_DIV) &
221 ~(S5P_CLKDIV0_HCLK_MASK);
222 clk_div0_tmp |= clock_table[iter][2];
223 __raw_writel(clk_div0_tmp, ARM_CLK_DIV);
224
225
226 } else {
227 /* Frequency Up */
228 clk_div0_tmp = __raw_readl(ARM_CLK_DIV) &
229 ~(S5P_CLKDIV0_HCLK_MASK);
230 clk_div0_tmp |= clock_table[iter][2];
231 __raw_writel(clk_div0_tmp, ARM_CLK_DIV);
232
233 clk_div0_tmp = __raw_readl(ARM_CLK_DIV) & ~(ARM_DIV_MASK);
234 clk_div0_tmp |= clock_table[iter][1];
235 __raw_writel(clk_div0_tmp, ARM_CLK_DIV);
236 }
237 local_irq_restore(flags);
238
239 clk->rate = clock_table[iter][0];
240
241 return 0;
242}
243
244static struct clk_ops s5p6440_clkarm_ops = {
245 .get_rate = s5p6440_armclk_get_rate,
246 .set_rate = s5p6440_armclk_set_rate,
247 .round_rate = s5p6440_armclk_round_rate,
248};
249
250static unsigned long s5p6440_clk_doutmpll_get_rate(struct clk *clk)
251{
252 unsigned long rate = clk_get_rate(clk->parent);
253
254 if (__raw_readl(S5P_CLK_DIV0) & S5P_CLKDIV0_MPLL_MASK)
255 rate /= 2;
256
257 return rate;
258}
259
260static struct clk clk_dout_mpll = {
261 .name = "dout_mpll",
262 .id = -1,
263 .parent = &clk_mout_mpll.clk,
264 .ops = &(struct clk_ops) {
265 .get_rate = s5p6440_clk_doutmpll_get_rate,
266 },
267};
268
269int s5p6440_clk48m_ctrl(struct clk *clk, int enable)
270{
271 unsigned long flags;
272 u32 val;
273
274 /* can't rely on clock lock, this register has other usages */
275 local_irq_save(flags);
276
277 val = __raw_readl(S5P_OTHERS);
278 if (enable)
279 val |= S5P_OTHERS_USB_SIG_MASK;
280 else
281 val &= ~S5P_OTHERS_USB_SIG_MASK;
282
283 __raw_writel(val, S5P_OTHERS);
284
285 local_irq_restore(flags);
286
287 return 0;
288}
289
290static int s5p6440_pclk_ctrl(struct clk *clk, int enable)
291{
292 return s5p_gatectrl(S5P_CLK_GATE_PCLK, clk, enable);
293}
294
295static int s5p6440_hclk0_ctrl(struct clk *clk, int enable)
296{
297 return s5p_gatectrl(S5P_CLK_GATE_HCLK0, clk, enable);
298}
299
300static int s5p6440_hclk1_ctrl(struct clk *clk, int enable)
301{
302 return s5p_gatectrl(S5P_CLK_GATE_HCLK1, clk, enable);
303}
304
305static int s5p6440_sclk_ctrl(struct clk *clk, int enable)
306{
307 return s5p_gatectrl(S5P_CLK_GATE_SCLK0, clk, enable);
308}
309
310static int s5p6440_mem_ctrl(struct clk *clk, int enable)
311{
312 return s5p_gatectrl(S5P_CLK_GATE_MEM0, clk, enable);
313}
314
315/*
316 * The following clocks will be disabled during clock initialization. It is
317 * recommended to keep the following clocks disabled until the driver requests
318 * for enabling the clock.
319 */
320static struct clk init_clocks_disable[] = {
321 {
322 .name = "nand",
323 .id = -1,
324 .parent = &clk_h,
325 .enable = s5p6440_mem_ctrl,
326 .ctrlbit = S5P_CLKCON_MEM0_HCLK_NFCON,
327 }, {
328 .name = "adc",
329 .id = -1,
330 .parent = &clk_p_low,
331 .enable = s5p6440_pclk_ctrl,
332 .ctrlbit = S5P_CLKCON_PCLK_TSADC,
333 }, {
334 .name = "i2c",
335 .id = -1,
336 .parent = &clk_p_low,
337 .enable = s5p6440_pclk_ctrl,
338 .ctrlbit = S5P_CLKCON_PCLK_IIC0,
339 }, {
340 .name = "i2s_v40",
341 .id = 0,
342 .parent = &clk_p_low,
343 .enable = s5p6440_pclk_ctrl,
344 .ctrlbit = S5P_CLKCON_PCLK_IIS2,
345 }, {
346 .name = "spi",
347 .id = 0,
348 .parent = &clk_p_low,
349 .enable = s5p6440_pclk_ctrl,
350 .ctrlbit = S5P_CLKCON_PCLK_SPI0,
351 }, {
352 .name = "spi",
353 .id = 1,
354 .parent = &clk_p_low,
355 .enable = s5p6440_pclk_ctrl,
356 .ctrlbit = S5P_CLKCON_PCLK_SPI1,
357 }, {
358 .name = "sclk_spi_48",
359 .id = 0,
360 .parent = &clk_48m,
361 .enable = s5p6440_sclk_ctrl,
362 .ctrlbit = S5P_CLKCON_SCLK0_SPI0_48,
363 }, {
364 .name = "sclk_spi_48",
365 .id = 1,
366 .parent = &clk_48m,
367 .enable = s5p6440_sclk_ctrl,
368 .ctrlbit = S5P_CLKCON_SCLK0_SPI1_48,
369 }, {
370 .name = "mmc_48m",
371 .id = 0,
372 .parent = &clk_48m,
373 .enable = s5p6440_sclk_ctrl,
374 .ctrlbit = S5P_CLKCON_SCLK0_MMC0_48,
375 }, {
376 .name = "mmc_48m",
377 .id = 1,
378 .parent = &clk_48m,
379 .enable = s5p6440_sclk_ctrl,
380 .ctrlbit = S5P_CLKCON_SCLK0_MMC1_48,
381 }, {
382 .name = "mmc_48m",
383 .id = 2,
384 .parent = &clk_48m,
385 .enable = s5p6440_sclk_ctrl,
386 .ctrlbit = S5P_CLKCON_SCLK0_MMC2_48,
387 }, {
388 .name = "otg",
389 .id = -1,
390 .parent = &clk_h_low,
391 .enable = s5p6440_hclk0_ctrl,
392 .ctrlbit = S5P_CLKCON_HCLK0_USB
393 }, {
394 .name = "post",
395 .id = -1,
396 .parent = &clk_h_low,
397 .enable = s5p6440_hclk0_ctrl,
398 .ctrlbit = S5P_CLKCON_HCLK0_POST0
399 }, {
400 .name = "lcd",
401 .id = -1,
402 .parent = &clk_h_low,
403 .enable = s5p6440_hclk1_ctrl,
404 .ctrlbit = S5P_CLKCON_HCLK1_DISPCON,
405 }, {
406 .name = "hsmmc",
407 .id = 0,
408 .parent = &clk_h_low,
409 .enable = s5p6440_hclk0_ctrl,
410 .ctrlbit = S5P_CLKCON_HCLK0_HSMMC0,
411 }, {
412 .name = "hsmmc",
413 .id = 1,
414 .parent = &clk_h_low,
415 .enable = s5p6440_hclk0_ctrl,
416 .ctrlbit = S5P_CLKCON_HCLK0_HSMMC1,
417 }, {
418 .name = "hsmmc",
419 .id = 2,
420 .parent = &clk_h_low,
421 .enable = s5p6440_hclk0_ctrl,
422 .ctrlbit = S5P_CLKCON_HCLK0_HSMMC2,
423 }, {
424 .name = "rtc",
425 .id = -1,
426 .parent = &clk_p_low,
427 .enable = s5p6440_pclk_ctrl,
428 .ctrlbit = S5P_CLKCON_PCLK_RTC,
429 }, {
430 .name = "watchdog",
431 .id = -1,
432 .parent = &clk_p_low,
433 .enable = s5p6440_pclk_ctrl,
434 .ctrlbit = S5P_CLKCON_PCLK_WDT,
435 }, {
436 .name = "timers",
437 .id = -1,
438 .parent = &clk_p_low,
439 .enable = s5p6440_pclk_ctrl,
440 .ctrlbit = S5P_CLKCON_PCLK_PWM,
441 }
442};
443
444/*
445 * The following clocks will be enabled during clock initialization.
446 */
447static struct clk init_clocks[] = {
448 {
449 .name = "gpio",
450 .id = -1,
451 .parent = &clk_p_low,
452 .enable = s5p6440_pclk_ctrl,
453 .ctrlbit = S5P_CLKCON_PCLK_GPIO,
454 }, {
455 .name = "uart",
456 .id = 0,
457 .parent = &clk_p_low,
458 .enable = s5p6440_pclk_ctrl,
459 .ctrlbit = S5P_CLKCON_PCLK_UART0,
460 }, {
461 .name = "uart",
462 .id = 1,
463 .parent = &clk_p_low,
464 .enable = s5p6440_pclk_ctrl,
465 .ctrlbit = S5P_CLKCON_PCLK_UART1,
466 }, {
467 .name = "uart",
468 .id = 2,
469 .parent = &clk_p_low,
470 .enable = s5p6440_pclk_ctrl,
471 .ctrlbit = S5P_CLKCON_PCLK_UART2,
472 }, {
473 .name = "uart",
474 .id = 3,
475 .parent = &clk_p_low,
476 .enable = s5p6440_pclk_ctrl,
477 .ctrlbit = S5P_CLKCON_PCLK_UART3,
478 }
479};
480
481static struct clk clk_iis_cd_v40 = {
482 .name = "iis_cdclk_v40",
483 .id = -1,
484};
485
486static struct clk clk_pcm_cd = {
487 .name = "pcm_cdclk",
488 .id = -1,
489};
490
491static struct clk *clkset_spi_mmc_list[] = {
492 &clk_mout_epll.clk,
493 &clk_dout_mpll,
494 &clk_fin_epll,
495};
496
497static struct clksrc_sources clkset_spi_mmc = {
498 .sources = clkset_spi_mmc_list,
499 .nr_sources = ARRAY_SIZE(clkset_spi_mmc_list),
500};
501
502static struct clk *clkset_uart_list[] = {
503 &clk_mout_epll.clk,
504 &clk_dout_mpll
505};
506
507static struct clksrc_sources clkset_uart = {
508 .sources = clkset_uart_list,
509 .nr_sources = ARRAY_SIZE(clkset_uart_list),
510};
511
512static struct clksrc_clk clksrcs[] = {
513 {
514 .clk = {
515 .name = "mmc_bus",
516 .id = 0,
517 .ctrlbit = S5P_CLKCON_SCLK0_MMC0,
518 .enable = s5p6440_sclk_ctrl,
519 },
520 .sources = &clkset_spi_mmc,
521 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 18, .size = 2 },
522 .reg_div = { .reg = S5P_CLK_DIV1, .shift = 0, .size = 4 },
523 }, {
524 .clk = {
525 .name = "mmc_bus",
526 .id = 1,
527 .ctrlbit = S5P_CLKCON_SCLK0_MMC1,
528 .enable = s5p6440_sclk_ctrl,
529 },
530 .sources = &clkset_spi_mmc,
531 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 20, .size = 2 },
532 .reg_div = { .reg = S5P_CLK_DIV1, .shift = 4, .size = 4 },
533 }, {
534 .clk = {
535 .name = "mmc_bus",
536 .id = 2,
537 .ctrlbit = S5P_CLKCON_SCLK0_MMC2,
538 .enable = s5p6440_sclk_ctrl,
539 },
540 .sources = &clkset_spi_mmc,
541 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 22, .size = 2 },
542 .reg_div = { .reg = S5P_CLK_DIV1, .shift = 8, .size = 4 },
543 }, {
544 .clk = {
545 .name = "uclk1",
546 .id = -1,
547 .ctrlbit = S5P_CLKCON_SCLK0_UART,
548 .enable = s5p6440_sclk_ctrl,
549 },
550 .sources = &clkset_uart,
551 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 13, .size = 1 },
552 .reg_div = { .reg = S5P_CLK_DIV2, .shift = 16, .size = 4 },
553 }, {
554 .clk = {
555 .name = "spi_epll",
556 .id = 0,
557 .ctrlbit = S5P_CLKCON_SCLK0_SPI0,
558 .enable = s5p6440_sclk_ctrl,
559 },
560 .sources = &clkset_spi_mmc,
561 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 14, .size = 2 },
562 .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 },
563 }, {
564 .clk = {
565 .name = "spi_epll",
566 .id = 1,
567 .ctrlbit = S5P_CLKCON_SCLK0_SPI1,
568 .enable = s5p6440_sclk_ctrl,
569 },
570 .sources = &clkset_spi_mmc,
571 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 16, .size = 2 },
572 .reg_div = { .reg = S5P_CLK_DIV2, .shift = 4, .size = 4 },
573 }
574};
575
576/* Clock initialisation code */
577static struct clksrc_clk *init_parents[] = {
578 &clk_mout_apll,
579 &clk_mout_epll,
580 &clk_mout_mpll,
581};
582
583void __init_or_cpufreq s5p6440_setup_clocks(void)
584{
585 struct clk *xtal_clk;
586 unsigned long xtal;
587 unsigned long fclk;
588 unsigned long hclk;
589 unsigned long hclk_low;
590 unsigned long pclk;
591 unsigned long pclk_low;
592 unsigned long epll;
593 unsigned long apll;
594 unsigned long mpll;
595 unsigned int ptr;
596 u32 clkdiv0;
597 u32 clkdiv3;
598
599 /* Set S5P6440 functions for clk_fout_epll */
600 clk_fout_epll.enable = s5p6440_epll_enable;
601 clk_fout_epll.ops = &s5p6440_epll_ops;
602
603 /* Set S5P6440 functions for arm clock */
604 clk_arm.parent = &clk_mout_apll.clk;
605 clk_arm.ops = &s5p6440_clkarm_ops;
606 clk_48m.enable = s5p6440_clk48m_ctrl;
607
608 clkdiv0 = __raw_readl(S5P_CLK_DIV0);
609 clkdiv3 = __raw_readl(S5P_CLK_DIV3);
610
611 xtal_clk = clk_get(NULL, "ext_xtal");
612 BUG_ON(IS_ERR(xtal_clk));
613
614 xtal = clk_get_rate(xtal_clk);
615 clk_put(xtal_clk);
616
617 epll = s5p_get_pll90xx(xtal, __raw_readl(S5P_EPLL_CON),
618 __raw_readl(S5P_EPLL_CON_K));
619 mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
620 apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4502);
621
622 printk(KERN_INFO "S5P6440: PLL settings, A=%ld.%ldMHz, M=%ld.%ldMHz," \
623 " E=%ld.%ldMHz\n",
624 print_mhz(apll), print_mhz(mpll), print_mhz(epll));
625
626 fclk = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_ARM);
627 hclk = fclk / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK);
628 pclk = hclk / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK);
629
630 if (__raw_readl(S5P_OTHERS) & S5P_OTHERS_HCLK_LOW_SEL_MPLL) {
631 /* Asynchronous mode */
632 hclk_low = mpll / GET_DIV(clkdiv3, S5P_CLKDIV3_HCLK_LOW);
633 } else {
634 /* Synchronous mode */
635 hclk_low = apll / GET_DIV(clkdiv3, S5P_CLKDIV3_HCLK_LOW);
636 }
637
638 pclk_low = hclk_low / GET_DIV(clkdiv3, S5P_CLKDIV3_PCLK_LOW);
639
640 printk(KERN_INFO "S5P6440: HCLK=%ld.%ldMHz, HCLK_LOW=%ld.%ldMHz," \
641 " PCLK=%ld.%ldMHz, PCLK_LOW=%ld.%ldMHz\n",
642 print_mhz(hclk), print_mhz(hclk_low),
643 print_mhz(pclk), print_mhz(pclk_low));
644
645 clk_fout_mpll.rate = mpll;
646 clk_fout_epll.rate = epll;
647 clk_fout_apll.rate = apll;
648
649 clk_f.rate = fclk;
650 clk_h.rate = hclk;
651 clk_p.rate = pclk;
652 clk_h_low.rate = hclk_low;
653 clk_p_low.rate = pclk_low;
654
655 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
656 s3c_set_clksrc(init_parents[ptr], true);
657
658 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
659 s3c_set_clksrc(&clksrcs[ptr], true);
660}
661
662static struct clk *clks[] __initdata = {
663 &clk_ext,
664 &clk_mout_epll.clk,
665 &clk_mout_mpll.clk,
666 &clk_dout_mpll,
667 &clk_iis_cd_v40,
668 &clk_pcm_cd,
669 &clk_p_low,
670 &clk_h_low,
671};
672
673void __init s5p6440_register_clocks(void)
674{
675 struct clk *clkp;
676 int ret;
677 int ptr;
678
679 ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
680 if (ret > 0)
681 printk(KERN_ERR "Failed to register %u clocks\n", ret);
682
683 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
684 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
685
686 clkp = init_clocks_disable;
687 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
688
689 ret = s3c24xx_register_clock(clkp);
690 if (ret < 0) {
691 printk(KERN_ERR "Failed to register clock %s (%d)\n",
692 clkp->name, ret);
693 }
694 (clkp->enable)(clkp, 0);
695 }
696
697 s3c_pwmclk_init();
698}
diff --git a/arch/arm/mach-s5p6440/cpu.c b/arch/arm/mach-s5p6440/cpu.c
new file mode 100644
index 000000000000..1794131aeacb
--- /dev/null
+++ b/arch/arm/mach-s5p6440/cpu.c
@@ -0,0 +1,114 @@
1/* linux/arch/arm/mach-s5p6440/cpu.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
17#include <linux/clk.h>
18#include <linux/io.h>
19#include <linux/sysdev.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/irq.h>
26
27#include <asm/proc-fns.h>
28
29#include <mach/hardware.h>
30#include <mach/map.h>
31#include <asm/irq.h>
32
33#include <plat/regs-serial.h>
34#include <mach/regs-clock.h>
35
36#include <plat/cpu.h>
37#include <plat/devs.h>
38#include <plat/clock.h>
39#include <plat/s5p6440.h>
40
41static void s5p6440_idle(void)
42{
43 unsigned long val;
44
45 if (!need_resched()) {
46 val = __raw_readl(S5P_PWR_CFG);
47 val &= ~(0x3<<5);
48 val |= (0x1<<5);
49 __raw_writel(val, S5P_PWR_CFG);
50
51 cpu_do_idle();
52 }
53 local_irq_enable();
54}
55
56/* s5p6440_map_io
57 *
58 * register the standard cpu IO areas
59*/
60
61void __init s5p6440_map_io(void)
62{
63 /* initialize any device information early */
64}
65
66void __init s5p6440_init_clocks(int xtal)
67{
68 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
69
70 s3c24xx_register_baseclocks(xtal);
71 s5p_register_clocks(xtal);
72 s5p6440_register_clocks();
73 s5p6440_setup_clocks();
74}
75
76void __init s5p6440_init_irq(void)
77{
78 /* S5P6440 supports only 2 VIC */
79 u32 vic[2];
80
81 /*
82 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
83 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
84 */
85 vic[0] = 0xff800ae7;
86 vic[1] = 0xffbf23e5;
87
88 s5p_init_irq(vic, ARRAY_SIZE(vic));
89}
90
91static struct sysdev_class s5p6440_sysclass = {
92 .name = "s5p6440-core",
93};
94
95static struct sys_device s5p6440_sysdev = {
96 .cls = &s5p6440_sysclass,
97};
98
99static int __init s5p6440_core_init(void)
100{
101 return sysdev_class_register(&s5p6440_sysclass);
102}
103
104core_initcall(s5p6440_core_init);
105
106int __init s5p6440_init(void)
107{
108 printk(KERN_INFO "S5P6440: Initializing architecture\n");
109
110 /* set idle function */
111 pm_idle = s5p6440_idle;
112
113 return sysdev_register(&s5p6440_sysdev);
114}
diff --git a/arch/arm/mach-s5p6440/gpio.c b/arch/arm/mach-s5p6440/gpio.c
new file mode 100644
index 000000000000..b0ea741177ad
--- /dev/null
+++ b/arch/arm/mach-s5p6440/gpio.c
@@ -0,0 +1,322 @@
1/* arch/arm/mach-s5p6440/gpio.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - GPIOlib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/kernel.h>
14#include <linux/irq.h>
15#include <linux/io.h>
16#include <mach/map.h>
17#include <mach/gpio.h>
18#include <mach/regs-gpio.h>
19#include <plat/gpio-core.h>
20#include <plat/gpio-cfg.h>
21#include <plat/gpio-cfg-helpers.h>
22
23/* GPIO bank summary:
24*
25* Bank GPIOs Style SlpCon ExtInt Group
26* A 6 4Bit Yes 1
27* B 7 4Bit Yes 1
28* C 8 4Bit Yes 2
29* F 2 2Bit Yes 4 [1]
30* G 7 4Bit Yes 5
31* H 10 4Bit[2] Yes 6
32* I 16 2Bit Yes None
33* J 12 2Bit Yes None
34* N 16 2Bit No IRQ_EINT
35* P 8 2Bit Yes 8
36* R 15 4Bit[2] Yes 8
37*
38* [1] BANKF pins 14,15 do not form part of the external interrupt sources
39* [2] BANK has two control registers, GPxCON0 and GPxCON1
40*/
41
42static int s5p6440_gpiolib_rbank_4bit2_input(struct gpio_chip *chip,
43 unsigned int offset)
44{
45 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
46 void __iomem *base = ourchip->base;
47 void __iomem *regcon = base;
48 unsigned long con;
49
50 switch (offset) {
51 case 6:
52 offset += 1;
53 case 0:
54 case 1:
55 case 2:
56 case 3:
57 case 4:
58 case 5:
59 regcon -= 4;
60 break;
61 default:
62 offset -= 7;
63 break;
64 }
65
66 con = __raw_readl(regcon);
67 con &= ~(0xf << con_4bit_shift(offset));
68 __raw_writel(con, regcon);
69
70 return 0;
71}
72
73static int s5p6440_gpiolib_rbank_4bit2_output(struct gpio_chip *chip,
74 unsigned int offset, int value)
75{
76 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
77 void __iomem *base = ourchip->base;
78 void __iomem *regcon = base;
79 unsigned long con;
80 unsigned long dat;
81 unsigned con_offset = offset;
82
83 switch (con_offset) {
84 case 6:
85 con_offset += 1;
86 case 0:
87 case 1:
88 case 2:
89 case 3:
90 case 4:
91 case 5:
92 regcon -= 4;
93 break;
94 default:
95 con_offset -= 7;
96 break;
97 }
98
99 con = __raw_readl(regcon);
100 con &= ~(0xf << con_4bit_shift(con_offset));
101 con |= 0x1 << con_4bit_shift(con_offset);
102
103 dat = __raw_readl(base + GPIODAT_OFF);
104 if (value)
105 dat |= 1 << offset;
106 else
107 dat &= ~(1 << offset);
108
109 __raw_writel(con, regcon);
110 __raw_writel(dat, base + GPIODAT_OFF);
111
112 return 0;
113}
114
115int s5p6440_gpio_setcfg_4bit_rbank(struct s3c_gpio_chip *chip,
116 unsigned int off, unsigned int cfg)
117{
118 void __iomem *reg = chip->base;
119 unsigned int shift;
120 u32 con;
121
122 switch (off) {
123 case 0:
124 case 1:
125 case 2:
126 case 3:
127 case 4:
128 case 5:
129 shift = (off & 7) * 4;
130 reg -= 4;
131 break;
132 case 6:
133 shift = ((off + 1) & 7) * 4;
134 reg -= 4;
135 default:
136 shift = ((off + 1) & 7) * 4;
137 break;
138 }
139
140 if (s3c_gpio_is_cfg_special(cfg)) {
141 cfg &= 0xf;
142 cfg <<= shift;
143 }
144
145 con = __raw_readl(reg);
146 con &= ~(0xf << shift);
147 con |= cfg;
148 __raw_writel(con, reg);
149
150 return 0;
151}
152
153static struct s3c_gpio_cfg s5p6440_gpio_cfgs[] = {
154 {
155 .cfg_eint = 0,
156 }, {
157 .cfg_eint = 7,
158 }, {
159 .cfg_eint = 3,
160 .set_config = s5p6440_gpio_setcfg_4bit_rbank,
161 }, {
162 .cfg_eint = 0,
163 .set_config = s3c_gpio_setcfg_s3c24xx,
164 }, {
165 .cfg_eint = 2,
166 .set_config = s3c_gpio_setcfg_s3c24xx,
167 }, {
168 .cfg_eint = 3,
169 .set_config = s3c_gpio_setcfg_s3c24xx,
170 },
171};
172
173static struct s3c_gpio_chip s5p6440_gpio_4bit[] = {
174 {
175 .base = S5P6440_GPA_BASE,
176 .config = &s5p6440_gpio_cfgs[1],
177 .chip = {
178 .base = S5P6440_GPA(0),
179 .ngpio = S5P6440_GPIO_A_NR,
180 .label = "GPA",
181 },
182 }, {
183 .base = S5P6440_GPB_BASE,
184 .config = &s5p6440_gpio_cfgs[1],
185 .chip = {
186 .base = S5P6440_GPB(0),
187 .ngpio = S5P6440_GPIO_B_NR,
188 .label = "GPB",
189 },
190 }, {
191 .base = S5P6440_GPC_BASE,
192 .config = &s5p6440_gpio_cfgs[1],
193 .chip = {
194 .base = S5P6440_GPC(0),
195 .ngpio = S5P6440_GPIO_C_NR,
196 .label = "GPC",
197 },
198 }, {
199 .base = S5P6440_GPG_BASE,
200 .config = &s5p6440_gpio_cfgs[1],
201 .chip = {
202 .base = S5P6440_GPG(0),
203 .ngpio = S5P6440_GPIO_G_NR,
204 .label = "GPG",
205 },
206 },
207};
208
209static struct s3c_gpio_chip s5p6440_gpio_4bit2[] = {
210 {
211 .base = S5P6440_GPH_BASE + 0x4,
212 .config = &s5p6440_gpio_cfgs[1],
213 .chip = {
214 .base = S5P6440_GPH(0),
215 .ngpio = S5P6440_GPIO_H_NR,
216 .label = "GPH",
217 },
218 },
219};
220
221static struct s3c_gpio_chip gpio_rbank_4bit2[] = {
222 {
223 .base = S5P6440_GPR_BASE + 0x4,
224 .config = &s5p6440_gpio_cfgs[2],
225 .chip = {
226 .base = S5P6440_GPR(0),
227 .ngpio = S5P6440_GPIO_R_NR,
228 .label = "GPR",
229 },
230 },
231};
232
233static struct s3c_gpio_chip s5p6440_gpio_2bit[] = {
234 {
235 .base = S5P6440_GPF_BASE,
236 .config = &s5p6440_gpio_cfgs[5],
237 .chip = {
238 .base = S5P6440_GPF(0),
239 .ngpio = S5P6440_GPIO_F_NR,
240 .label = "GPF",
241 },
242 }, {
243 .base = S5P6440_GPI_BASE,
244 .config = &s5p6440_gpio_cfgs[3],
245 .chip = {
246 .base = S5P6440_GPI(0),
247 .ngpio = S5P6440_GPIO_I_NR,
248 .label = "GPI",
249 },
250 }, {
251 .base = S5P6440_GPJ_BASE,
252 .config = &s5p6440_gpio_cfgs[3],
253 .chip = {
254 .base = S5P6440_GPJ(0),
255 .ngpio = S5P6440_GPIO_J_NR,
256 .label = "GPJ",
257 },
258 }, {
259 .base = S5P6440_GPN_BASE,
260 .config = &s5p6440_gpio_cfgs[4],
261 .chip = {
262 .base = S5P6440_GPN(0),
263 .ngpio = S5P6440_GPIO_N_NR,
264 .label = "GPN",
265 },
266 }, {
267 .base = S5P6440_GPP_BASE,
268 .config = &s5p6440_gpio_cfgs[5],
269 .chip = {
270 .base = S5P6440_GPP(0),
271 .ngpio = S5P6440_GPIO_P_NR,
272 .label = "GPP",
273 },
274 },
275};
276
277void __init s5p6440_gpiolib_set_cfg(struct s3c_gpio_cfg *chipcfg, int nr_chips)
278{
279 for (; nr_chips > 0; nr_chips--, chipcfg++) {
280 if (!chipcfg->set_config)
281 chipcfg->set_config = s3c_gpio_setcfg_s3c64xx_4bit;
282 if (!chipcfg->set_pull)
283 chipcfg->set_pull = s3c_gpio_setpull_updown;
284 if (!chipcfg->get_pull)
285 chipcfg->get_pull = s3c_gpio_getpull_updown;
286 }
287}
288
289static void __init s5p6440_gpio_add_rbank_4bit2(struct s3c_gpio_chip *chip,
290 int nr_chips)
291{
292 for (; nr_chips > 0; nr_chips--, chip++) {
293 chip->chip.direction_input = s5p6440_gpiolib_rbank_4bit2_input;
294 chip->chip.direction_output =
295 s5p6440_gpiolib_rbank_4bit2_output;
296 s3c_gpiolib_add(chip);
297 }
298}
299
300static int __init s5p6440_gpiolib_init(void)
301{
302 struct s3c_gpio_chip *chips = s5p6440_gpio_2bit;
303 int nr_chips = ARRAY_SIZE(s5p6440_gpio_2bit);
304
305 s5p6440_gpiolib_set_cfg(s5p6440_gpio_cfgs,
306 ARRAY_SIZE(s5p6440_gpio_cfgs));
307
308 for (; nr_chips > 0; nr_chips--, chips++)
309 s3c_gpiolib_add(chips);
310
311 samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit,
312 ARRAY_SIZE(s5p6440_gpio_4bit));
313
314 samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2,
315 ARRAY_SIZE(s5p6440_gpio_4bit2));
316
317 s5p6440_gpio_add_rbank_4bit2(gpio_rbank_4bit2,
318 ARRAY_SIZE(gpio_rbank_4bit2));
319
320 return 0;
321}
322arch_initcall(s5p6440_gpiolib_init);
diff --git a/arch/arm/mach-s5p6440/include/mach/debug-macro.S b/arch/arm/mach-s5p6440/include/mach/debug-macro.S
new file mode 100644
index 000000000000..48cdb0da026c
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/debug-macro.S
@@ -0,0 +1,37 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/debug-macro.S
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11/* pull in the relevant register and map files. */
12
13#include <mach/map.h>
14#include <plat/regs-serial.h>
15
16 /* note, for the boot process to work we have to keep the UART
17 * virtual address aligned to an 1MiB boundary for the L1
18 * mapping the head code makes. We keep the UART virtual address
19 * aligned and add in the offset when we load the value here.
20 */
21
22 .macro addruart, rx
23 mrc p15, 0, \rx, c1, c0
24 tst \rx, #1
25 ldreq \rx, = S3C_PA_UART
26 ldrne \rx, = S3C_VA_UART
27#if CONFIG_DEBUG_S3C_UART != 0
28 add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
29#endif
30 .endm
31
32/* include the reset of the code which will do the work, we're only
33 * compiling for a single cpu processor type so the default of s3c2440
34 * will be fine with us.
35 */
36
37#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-s5p6440/include/mach/entry-macro.S b/arch/arm/mach-s5p6440/include/mach/entry-macro.S
new file mode 100644
index 000000000000..e65f1b967262
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/entry-macro.S
@@ -0,0 +1,16 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/entry-macro.S
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Low-level IRQ helper macros for the Samsung S5P6440
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <mach/map.h>
14#include <plat/irqs.h>
15
16#include <asm/entry-macro-vic2.S>
diff --git a/arch/arm/mach-s5p6440/include/mach/gpio.h b/arch/arm/mach-s5p6440/include/mach/gpio.h
new file mode 100644
index 000000000000..21783834f2a2
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/gpio.h
@@ -0,0 +1,80 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/gpio.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - GPIO lib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_GPIO_H
14#define __ASM_ARCH_GPIO_H __FILE__
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21/* GPIO bank sizes */
22#define S5P6440_GPIO_A_NR (6)
23#define S5P6440_GPIO_B_NR (7)
24#define S5P6440_GPIO_C_NR (8)
25#define S5P6440_GPIO_F_NR (2)
26#define S5P6440_GPIO_G_NR (7)
27#define S5P6440_GPIO_H_NR (10)
28#define S5P6440_GPIO_I_NR (16)
29#define S5P6440_GPIO_J_NR (12)
30#define S5P6440_GPIO_N_NR (16)
31#define S5P6440_GPIO_P_NR (8)
32#define S5P6440_GPIO_R_NR (15)
33
34/* GPIO bank numbers */
35
36/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
37 * space for debugging purposes so that any accidental
38 * change from one gpio bank to another can be caught.
39*/
40#define S5P6440_GPIO_NEXT(__gpio) \
41 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
42
43enum s5p_gpio_number {
44 S5P6440_GPIO_A_START = 0,
45 S5P6440_GPIO_B_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_A),
46 S5P6440_GPIO_C_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_B),
47 S5P6440_GPIO_F_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_C),
48 S5P6440_GPIO_G_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_F),
49 S5P6440_GPIO_H_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_G),
50 S5P6440_GPIO_I_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_H),
51 S5P6440_GPIO_J_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_I),
52 S5P6440_GPIO_N_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_J),
53 S5P6440_GPIO_P_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_N),
54 S5P6440_GPIO_R_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_P),
55};
56
57/* S5P6440 GPIO number definitions. */
58#define S5P6440_GPA(_nr) (S5P6440_GPIO_A_START + (_nr))
59#define S5P6440_GPB(_nr) (S5P6440_GPIO_B_START + (_nr))
60#define S5P6440_GPC(_nr) (S5P6440_GPIO_C_START + (_nr))
61#define S5P6440_GPF(_nr) (S5P6440_GPIO_F_START + (_nr))
62#define S5P6440_GPG(_nr) (S5P6440_GPIO_G_START + (_nr))
63#define S5P6440_GPH(_nr) (S5P6440_GPIO_H_START + (_nr))
64#define S5P6440_GPI(_nr) (S5P6440_GPIO_I_START + (_nr))
65#define S5P6440_GPJ(_nr) (S5P6440_GPIO_J_START + (_nr))
66#define S5P6440_GPN(_nr) (S5P6440_GPIO_N_START + (_nr))
67#define S5P6440_GPP(_nr) (S5P6440_GPIO_P_START + (_nr))
68#define S5P6440_GPR(_nr) (S5P6440_GPIO_R_START + (_nr))
69
70/* the end of the S5P6440 specific gpios */
71#define S5P6440_GPIO_END (S5P6440_GPR(S5P6440_GPIO_R_NR) + 1)
72#define S3C_GPIO_END S5P6440_GPIO_END
73
74/* define the number of gpios we need to the one after the GPR() range */
75#define ARCH_NR_GPIOS (S5P6440_GPR(S5P6440_GPIO_R_NR) + \
76 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
77
78#include <asm-generic/gpio.h>
79
80#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/hardware.h b/arch/arm/mach-s5p6440/include/mach/hardware.h
new file mode 100644
index 000000000000..be8b26e875db
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/hardware.h
@@ -0,0 +1,18 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/hardware.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Hardware support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H __FILE__
15
16/* currently nothing here, placeholder */
17
18#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/io.h b/arch/arm/mach-s5p6440/include/mach/io.h
new file mode 100644
index 000000000000..fa2d69cb1ad7
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/io.h
@@ -0,0 +1,18 @@
1/* arch/arm/mach-s5p6440/include/mach/io.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben-linux@fluff.org>
5 *
6 * Default IO routines for S3C64XX based
7 */
8
9#ifndef __ASM_ARM_ARCH_IO_H
10#define __ASM_ARM_ARCH_IO_H
11
12/* No current ISA/PCI bus support. */
13#define __io(a) __typesafe_io(a)
14#define __mem_pci(a) (a)
15
16#define IO_SPACE_LIMIT (0xFFFFFFFF)
17
18#endif
diff --git a/arch/arm/mach-s5p6440/include/mach/irqs.h b/arch/arm/mach-s5p6440/include/mach/irqs.h
new file mode 100644
index 000000000000..a4b9b40d18f2
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/irqs.h
@@ -0,0 +1,111 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/irqs.h
2 *
3 * Copyright 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - IRQ definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_S5P_IRQS_H
14#define __ASM_ARCH_S5P_IRQS_H __FILE__
15
16#include <plat/irqs.h>
17
18/* VIC0 */
19
20#define IRQ_EINT0_3 S5P_IRQ_VIC0(0)
21#define IRQ_EINT4_11 S5P_IRQ_VIC0(1)
22#define IRQ_RTC_TIC S5P_IRQ_VIC0(2)
23#define IRQ_IIC1 S5P_IRQ_VIC0(5)
24#define IRQ_I2SV40 S5P_IRQ_VIC0(6)
25#define IRQ_GPS S5P_IRQ_VIC0(7)
26#define IRQ_POST0 S5P_IRQ_VIC0(9)
27#define IRQ_2D S5P_IRQ_VIC0(11)
28#define IRQ_TIMER0_VIC S5P_IRQ_VIC0(23)
29#define IRQ_TIMER1_VIC S5P_IRQ_VIC0(24)
30#define IRQ_TIMER2_VIC S5P_IRQ_VIC0(25)
31#define IRQ_WDT S5P_IRQ_VIC0(26)
32#define IRQ_TIMER3_VIC S5P_IRQ_VIC0(27)
33#define IRQ_TIMER4_VIC S5P_IRQ_VIC0(28)
34#define IRQ_DISPCON0 S5P_IRQ_VIC0(29)
35#define IRQ_DISPCON1 S5P_IRQ_VIC0(30)
36#define IRQ_DISPCON2 S5P_IRQ_VIC0(31)
37
38/* VIC1 */
39
40#define IRQ_EINT12_15 S5P_IRQ_VIC1(0)
41#define IRQ_PCM0 S5P_IRQ_VIC1(2)
42#define IRQ_UART0 S5P_IRQ_VIC1(5)
43#define IRQ_UART1 S5P_IRQ_VIC1(6)
44#define IRQ_UART2 S5P_IRQ_VIC1(7)
45#define IRQ_UART3 S5P_IRQ_VIC1(8)
46#define IRQ_DMA0 S5P_IRQ_VIC1(9)
47#define IRQ_NFC S5P_IRQ_VIC1(13)
48#define IRQ_SPI0 S5P_IRQ_VIC1(16)
49#define IRQ_SPI1 S5P_IRQ_VIC1(17)
50#define IRQ_IIC S5P_IRQ_VIC1(18)
51#define IRQ_DISPCON3 S5P_IRQ_VIC1(19)
52#define IRQ_FIMGVG S5P_IRQ_VIC1(20)
53#define IRQ_EINT_GROUPS S5P_IRQ_VIC1(21)
54#define IRQ_PMUIRQ S5P_IRQ_VIC1(23)
55#define IRQ_HSMMC0 S5P_IRQ_VIC1(24)
56#define IRQ_HSMMC1 S5P_IRQ_VIC1(25)
57#define IRQ_HSMMC2 IRQ_SPI1 /* shared with SPI1 */
58#define IRQ_OTG S5P_IRQ_VIC1(26)
59#define IRQ_DSI S5P_IRQ_VIC1(27)
60#define IRQ_RTC_ALARM S5P_IRQ_VIC1(28)
61#define IRQ_TSI S5P_IRQ_VIC1(29)
62#define IRQ_PENDN S5P_IRQ_VIC1(30)
63#define IRQ_TC IRQ_PENDN
64#define IRQ_ADC S5P_IRQ_VIC1(31)
65
66/*
67 * Since the IRQ_EINT(x) are a linear mapping on s5p6440 we just defined
68 * them as an IRQ_EINT(x) macro from S5P_IRQ_EINT_BASE which we place
69 * after the pair of VICs.
70 */
71
72#define S5P_IRQ_EINT_BASE (S5P_IRQ_VIC1(31) + 6)
73
74#define S5P_EINT(x) ((x) + S5P_IRQ_EINT_BASE)
75#define IRQ_EINT(x) S5P_EINT(x)
76
77/*
78 * Next the external interrupt groups. These are similar to the IRQ_EINT(x)
79 * that they are sourced from the GPIO pins but with a different scheme for
80 * priority and source indication.
81 *
82 * The IRQ_EINT(x) can be thought of as 'group 0' of the available GPIO
83 * interrupts, but for historical reasons they are kept apart from these
84 * next interrupts.
85 *
86 * Use IRQ_EINT_GROUP(group, offset) to get the number for use in the
87 * machine specific support files.
88 */
89
90/* Actually, #6 and #7 are missing in the EINT_GROUP1 */
91#define IRQ_EINT_GROUP1_NR (15)
92#define IRQ_EINT_GROUP2_NR (8)
93#define IRQ_EINT_GROUP5_NR (7)
94#define IRQ_EINT_GROUP6_NR (10)
95/* Actually, #0, #1 and #2 are missing in the EINT_GROUP8 */
96#define IRQ_EINT_GROUP8_NR (11)
97
98#define IRQ_EINT_GROUP_BASE S5P_EINT(16)
99#define IRQ_EINT_GROUP1_BASE (IRQ_EINT_GROUP_BASE + 0)
100#define IRQ_EINT_GROUP2_BASE (IRQ_EINT_GROUP1_BASE + IRQ_EINT_GROUP1_NR)
101#define IRQ_EINT_GROUP5_BASE (IRQ_EINT_GROUP2_BASE + IRQ_EINT_GROUP2_NR)
102#define IRQ_EINT_GROUP6_BASE (IRQ_EINT_GROUP5_BASE + IRQ_EINT_GROUP5_NR)
103#define IRQ_EINT_GROUP8_BASE (IRQ_EINT_GROUP6_BASE + IRQ_EINT_GROUP6_NR)
104
105#define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x))
106
107/* Set the default NR_IRQS */
108
109#define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1)
110
111#endif /* __ASM_ARCH_S5P_IRQS_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h
new file mode 100644
index 000000000000..8924e5a4d6a6
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/map.h
@@ -0,0 +1,68 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/map.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H __FILE__
15
16#include <plat/map-base.h>
17#include <plat/map-s5p.h>
18
19#define S5P6440_PA_CHIPID (0xE0000000)
20#define S5P_PA_CHIPID S5P6440_PA_CHIPID
21
22#define S5P6440_PA_SYSCON (0xE0100000)
23#define S5P6440_PA_CLK (S5P6440_PA_SYSCON + 0x0)
24#define S5P_PA_SYSCON S5P6440_PA_SYSCON
25
26#define S5P6440_PA_GPIO (0xE0308000)
27#define S5P_PA_GPIO S5P6440_PA_GPIO
28
29#define S5P6440_PA_VIC0 (0xE4000000)
30#define S5P_PA_VIC0 S5P6440_PA_VIC0
31
32#define S5P6440_PA_VIC1 (0xE4100000)
33#define S5P_PA_VIC1 S5P6440_PA_VIC1
34
35#define S5P6440_PA_TIMER (0xEA000000)
36#define S5P_PA_TIMER S5P6440_PA_TIMER
37
38#define S5P6440_PA_RTC (0xEA100000)
39#define S5P_PA_RTC S5P6440_PA_RTC
40
41#define S5P6440_PA_WDT (0xEA200000)
42#define S5P_PA_WDT S5P6440_PA_WDT
43
44#define S5P6440_PA_UART (0xEC000000)
45
46#define S5P_PA_UART0 (S5P6440_PA_UART + 0x0)
47#define S5P_PA_UART1 (S5P6440_PA_UART + 0x400)
48#define S5P_PA_UART2 (S5P6440_PA_UART + 0x800)
49#define S5P_PA_UART3 (S5P6440_PA_UART + 0xC00)
50
51#define S5P_SZ_UART SZ_256
52
53#define S5P6440_PA_IIC0 (0xEC104000)
54
55#define S5P6440_PA_HSOTG (0xED100000)
56
57#define S5P6440_PA_HSMMC0 (0xED800000)
58#define S5P6440_PA_HSMMC1 (0xED900000)
59#define S5P6440_PA_HSMMC2 (0xEDA00000)
60
61#define S5P6440_PA_SDRAM (0x20000000)
62#define S5P_PA_SDRAM S5P6440_PA_SDRAM
63
64/* compatibiltiy defines. */
65#define S3C_PA_UART S5P6440_PA_UART
66#define S3C_PA_IIC S5P6440_PA_IIC0
67
68#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/memory.h b/arch/arm/mach-s5p6440/include/mach/memory.h
new file mode 100644
index 000000000000..d62910c71b56
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/memory.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/memory.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Memory definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#define PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE SZ_8M
18
19#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/pwm-clock.h b/arch/arm/mach-s5p6440/include/mach/pwm-clock.h
new file mode 100644
index 000000000000..c4bb7c555477
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/pwm-clock.h
@@ -0,0 +1,62 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/pwm-clock.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * Copyright 2009 Samsung Electronics Co., Ltd.
8 * http://www.samsung.com/
9 *
10 * S5P6440 - pwm clock and timer support
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17/**
18 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
19 * @cfg: The timer TCFG1 register bits shifted down to 0.
20 *
21 * Return true if the given configuration from TCFG1 is a TCLK instead
22 * any of the TDIV clocks.
23 */
24static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
25{
26 return tcfg == S3C2410_TCFG1_MUX_TCLK;
27}
28
29/**
30 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
31 * @tcfg1: The tcfg1 setting, shifted down.
32 *
33 * Get the divisor value for the given tcfg1 setting. We assume the
34 * caller has already checked to see if this is not a TCLK source.
35 */
36static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
37{
38 return 1 << (1 + tcfg1);
39}
40
41/**
42 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
43 *
44 * Return true if we have a /1 in the tdiv setting.
45 */
46static inline unsigned int pwm_tdiv_has_div1(void)
47{
48 return 0;
49}
50
51/**
52 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
53 * @div: The divisor to calculate the bit information for.
54 *
55 * Turn a divisor into the necessary bit field for TCFG1.
56 */
57static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
58{
59 return ilog2(div) - 1;
60}
61
62#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK
diff --git a/arch/arm/mach-s5p6440/include/mach/regs-clock.h b/arch/arm/mach-s5p6440/include/mach/regs-clock.h
new file mode 100644
index 000000000000..c783ecc9f193
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/regs-clock.h
@@ -0,0 +1,130 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/regs-clock.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Clock register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_CLOCK_H
14#define __ASM_ARCH_REGS_CLOCK_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_CLKREG(x) (S3C_VA_SYS + (x))
19
20#define S5P_APLL_LOCK S5P_CLKREG(0x00)
21#define S5P_MPLL_LOCK S5P_CLKREG(0x04)
22#define S5P_EPLL_LOCK S5P_CLKREG(0x08)
23#define S5P_APLL_CON S5P_CLKREG(0x0C)
24#define S5P_MPLL_CON S5P_CLKREG(0x10)
25#define S5P_EPLL_CON S5P_CLKREG(0x14)
26#define S5P_EPLL_CON_K S5P_CLKREG(0x18)
27#define S5P_CLK_SRC0 S5P_CLKREG(0x1C)
28#define S5P_CLK_DIV0 S5P_CLKREG(0x20)
29#define S5P_CLK_DIV1 S5P_CLKREG(0x24)
30#define S5P_CLK_DIV2 S5P_CLKREG(0x28)
31#define S5P_CLK_OUT S5P_CLKREG(0x2C)
32#define S5P_CLK_GATE_HCLK0 S5P_CLKREG(0x30)
33#define S5P_CLK_GATE_PCLK S5P_CLKREG(0x34)
34#define S5P_CLK_GATE_SCLK0 S5P_CLKREG(0x38)
35#define S5P_CLK_GATE_MEM0 S5P_CLKREG(0x3C)
36#define S5P_CLK_DIV3 S5P_CLKREG(0x40)
37#define S5P_CLK_GATE_HCLK1 S5P_CLKREG(0x44)
38#define S5P_CLK_GATE_SCLK1 S5P_CLKREG(0x48)
39#define S5P_AHB_CON0 S5P_CLKREG(0x100)
40#define S5P_CLK_SRC1 S5P_CLKREG(0x10C)
41#define S5P_SWRESET S5P_CLKREG(0x114)
42#define S5P_SYS_ID S5P_CLKREG(0x118)
43#define S5P_SYS_OTHERS S5P_CLKREG(0x11C)
44#define S5P_MEM_CFG_STAT S5P_CLKREG(0x12C)
45#define S5P_PWR_CFG S5P_CLKREG(0x804)
46#define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0x808)
47#define S5P_NORMAL_CFG S5P_CLKREG(0x810)
48#define S5P_STOP_CFG S5P_CLKREG(0x814)
49#define S5P_SLEEP_CFG S5P_CLKREG(0x818)
50#define S5P_OSC_FREQ S5P_CLKREG(0x820)
51#define S5P_OSC_STABLE S5P_CLKREG(0x824)
52#define S5P_PWR_STABLE S5P_CLKREG(0x828)
53#define S5P_MTC_STABLE S5P_CLKREG(0x830)
54#define S5P_OTHERS S5P_CLKREG(0x900)
55#define S5P_RST_STAT S5P_CLKREG(0x904)
56#define S5P_WAKEUP_STAT S5P_CLKREG(0x908)
57#define S5P_SLPEN S5P_CLKREG(0x930)
58#define S5P_INFORM0 S5P_CLKREG(0xA00)
59#define S5P_INFORM1 S5P_CLKREG(0xA04)
60#define S5P_INFORM2 S5P_CLKREG(0xA08)
61#define S5P_INFORM3 S5P_CLKREG(0xA0C)
62
63/* CLKDIV0 */
64#define S5P_CLKDIV0_PCLK_MASK (0xf << 12)
65#define S5P_CLKDIV0_PCLK_SHIFT (12)
66#define S5P_CLKDIV0_HCLK_MASK (0xf << 8)
67#define S5P_CLKDIV0_HCLK_SHIFT (8)
68#define S5P_CLKDIV0_MPLL_MASK (0x1 << 4)
69#define S5P_CLKDIV0_ARM_MASK (0xf << 0)
70#define S5P_CLKDIV0_ARM_SHIFT (0)
71
72/* CLKDIV3 */
73#define S5P_CLKDIV3_PCLK_LOW_MASK (0xf << 12)
74#define S5P_CLKDIV3_PCLK_LOW_SHIFT (12)
75#define S5P_CLKDIV3_HCLK_LOW_MASK (0xf << 8)
76#define S5P_CLKDIV3_HCLK_LOW_SHIFT (8)
77
78/* HCLK0 GATE Registers */
79#define S5P_CLKCON_HCLK0_USB (1<<20)
80#define S5P_CLKCON_HCLK0_HSMMC2 (1<<19)
81#define S5P_CLKCON_HCLK0_HSMMC1 (1<<18)
82#define S5P_CLKCON_HCLK0_HSMMC0 (1<<17)
83#define S5P_CLKCON_HCLK0_POST0 (1<<5)
84
85/* HCLK1 GATE Registers */
86#define S5P_CLKCON_HCLK1_DISPCON (1<<1)
87
88/* PCLK GATE Registers */
89#define S5P_CLKCON_PCLK_IIS2 (1<<26)
90#define S5P_CLKCON_PCLK_SPI1 (1<<22)
91#define S5P_CLKCON_PCLK_SPI0 (1<<21)
92#define S5P_CLKCON_PCLK_GPIO (1<<18)
93#define S5P_CLKCON_PCLK_IIC0 (1<<17)
94#define S5P_CLKCON_PCLK_TSADC (1<<12)
95#define S5P_CLKCON_PCLK_PWM (1<<7)
96#define S5P_CLKCON_PCLK_RTC (1<<6)
97#define S5P_CLKCON_PCLK_WDT (1<<5)
98#define S5P_CLKCON_PCLK_UART3 (1<<4)
99#define S5P_CLKCON_PCLK_UART2 (1<<3)
100#define S5P_CLKCON_PCLK_UART1 (1<<2)
101#define S5P_CLKCON_PCLK_UART0 (1<<1)
102
103/* SCLK0 GATE Registers */
104#define S5P_CLKCON_SCLK0_MMC2_48 (1<<29)
105#define S5P_CLKCON_SCLK0_MMC1_48 (1<<28)
106#define S5P_CLKCON_SCLK0_MMC0_48 (1<<27)
107#define S5P_CLKCON_SCLK0_MMC2 (1<<26)
108#define S5P_CLKCON_SCLK0_MMC1 (1<<25)
109#define S5P_CLKCON_SCLK0_MMC0 (1<<24)
110#define S5P_CLKCON_SCLK0_SPI1_48 (1<<23)
111#define S5P_CLKCON_SCLK0_SPI0_48 (1<<22)
112#define S5P_CLKCON_SCLK0_SPI1 (1<<21)
113#define S5P_CLKCON_SCLK0_SPI0 (1<<20)
114#define S5P_CLKCON_SCLK0_UART (1<<5)
115
116/* SCLK1 GATE Registers */
117
118/* MEM0 GATE Registers */
119#define S5P_CLKCON_MEM0_HCLK_NFCON (1<<2)
120
121/*OTHERS Resgister */
122#define S5P_OTHERS_USB_SIG_MASK (1<<16)
123#define S5P_OTHERS_HCLK_LOW_SEL_MPLL (1<<6)
124
125/* Compatibility defines */
126#define ARM_CLK_DIV S5P_CLK_DIV0
127#define ARM_DIV_RATIO_SHIFT 0
128#define ARM_DIV_MASK (0xf << ARM_DIV_RATIO_SHIFT)
129
130#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/regs-gpio.h b/arch/arm/mach-s5p6440/include/mach/regs-gpio.h
new file mode 100644
index 000000000000..82ff753913da
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/regs-gpio.h
@@ -0,0 +1,54 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/regs-gpio.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - GPIO register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __ASM_ARCH_REGS_GPIO_H
14#define __ASM_ARCH_REGS_GPIO_H __FILE__
15
16#include <mach/map.h>
17
18/* Base addresses for each of the banks */
19#define S5P6440_GPA_BASE (S5P_VA_GPIO + 0x0000)
20#define S5P6440_GPB_BASE (S5P_VA_GPIO + 0x0020)
21#define S5P6440_GPC_BASE (S5P_VA_GPIO + 0x0040)
22#define S5P6440_GPF_BASE (S5P_VA_GPIO + 0x00A0)
23#define S5P6440_GPG_BASE (S5P_VA_GPIO + 0x00C0)
24#define S5P6440_GPH_BASE (S5P_VA_GPIO + 0x00E0)
25#define S5P6440_GPI_BASE (S5P_VA_GPIO + 0x0100)
26#define S5P6440_GPJ_BASE (S5P_VA_GPIO + 0x0120)
27#define S5P6440_GPN_BASE (S5P_VA_GPIO + 0x0830)
28#define S5P6440_GPP_BASE (S5P_VA_GPIO + 0x0160)
29#define S5P6440_GPR_BASE (S5P_VA_GPIO + 0x0290)
30#define S5P6440_EINT0CON0 (S5P_VA_GPIO + 0x900)
31#define S5P6440_EINT0FLTCON0 (S5P_VA_GPIO + 0x910)
32#define S5P6440_EINT0FLTCON1 (S5P_VA_GPIO + 0x914)
33#define S5P6440_EINT0MASK (S5P_VA_GPIO + 0x920)
34#define S5P6440_EINT0PEND (S5P_VA_GPIO + 0x924)
35
36/* for LCD */
37#define S5P6440_SPCON_LCD_SEL_RGB (1 << 0)
38#define S5P6440_SPCON_LCD_SEL_MASK (3 << 0)
39
40/* These set of macros are not really useful for the
41 * GPF/GPI/GPJ/GPN/GPP,
42 * useful for others set of GPIO's (4 bit)
43 */
44#define S5P6440_GPIO_CONMASK(__gpio) (0xf << ((__gpio) * 4))
45#define S5P6440_GPIO_INPUT(__gpio) (0x0 << ((__gpio) * 4))
46#define S5P6440_GPIO_OUTPUT(__gpio) (0x1 << ((__gpio) * 4))
47
48/* Use these macros for GPF/GPI/GPJ/GPN/GPP set of GPIO (2 bit)
49 * */
50#define S5P6440_GPIO2_CONMASK(__gpio) (0x3 << ((__gpio) * 2))
51#define S5P6440_GPIO2_INPUT(__gpio) (0x0 << ((__gpio) * 2))
52#define S5P6440_GPIO2_OUTPUT(__gpio) (0x1 << ((__gpio) * 2))
53
54#endif /* __ASM_ARCH_REGS_GPIO_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/regs-irq.h b/arch/arm/mach-s5p6440/include/mach/regs-irq.h
new file mode 100644
index 000000000000..a961f4beeb0c
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/regs-irq.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/regs-irq.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - IRQ register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15
16#include <asm/hardware/vic.h>
17#include <mach/map.h>
18
19#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/system.h b/arch/arm/mach-s5p6440/include/mach/system.h
new file mode 100644
index 000000000000..d2dd817da66a
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/system.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/system.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - system support header
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__
15
16static void arch_idle(void)
17{
18 /* nothing here yet */
19}
20
21static void arch_reset(char mode, const char *cmd)
22{
23 /* nothing here yet */
24}
25
26#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/tick.h b/arch/arm/mach-s5p6440/include/mach/tick.h
new file mode 100644
index 000000000000..2f25c7f07970
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/tick.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/tick.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Timer tick support definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_TICK_H
14#define __ASM_ARCH_TICK_H __FILE__
15
16static inline u32 s3c24xx_ostimer_pending(void)
17{
18 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
19 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
20}
21
22#define TICK_MAX (0xffffffff)
23
24#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/timex.h b/arch/arm/mach-s5p6440/include/mach/timex.h
new file mode 100644
index 000000000000..fb2e8cd40829
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/timex.h
@@ -0,0 +1,24 @@
1/* arch/arm/mach-s3c64xx/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C6400 - time parameters
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/uncompress.h b/arch/arm/mach-s5p6440/include/mach/uncompress.h
new file mode 100644
index 000000000000..7c1f600d65c0
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/uncompress.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5p6440/include/mach/uncompress.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - uncompress code
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16#include <mach/map.h>
17#include <plat/uncompress.h>
18
19static void arch_detect_cpu(void)
20{
21 /* we do not need to do any cpu detection here at the moment. */
22}
23
24#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5p6440/include/mach/vmalloc.h b/arch/arm/mach-s5p6440/include/mach/vmalloc.h
new file mode 100644
index 000000000000..16df257b1dce
--- /dev/null
+++ b/arch/arm/mach-s5p6440/include/mach/vmalloc.h
@@ -0,0 +1,17 @@
1/* arch/arm/mach-s5p6440/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C6400 vmalloc definition
10*/
11
12#ifndef __ASM_ARCH_VMALLOC_H
13#define __ASM_ARCH_VMALLOC_H
14
15#define VMALLOC_END (0xE0000000)
16
17#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5p6440/init.c b/arch/arm/mach-s5p6440/init.c
new file mode 100644
index 000000000000..a1f3727e4021
--- /dev/null
+++ b/arch/arm/mach-s5p6440/init.c
@@ -0,0 +1,52 @@
1/* linux/arch/arm/mach-s5p6440/init.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6440 - Init support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/init.h>
16#include <linux/serial_core.h>
17
18#include <plat/cpu.h>
19#include <plat/devs.h>
20#include <plat/s5p6440.h>
21#include <plat/regs-serial.h>
22
23static struct s3c24xx_uart_clksrc s5p6440_serial_clocks[] = {
24 [0] = {
25 .name = "pclk_low",
26 .divisor = 1,
27 .min_baud = 0,
28 .max_baud = 0,
29 },
30 [1] = {
31 .name = "uclk1",
32 .divisor = 1,
33 .min_baud = 0,
34 .max_baud = 0,
35 },
36};
37
38/* uart registration process */
39void __init s5p6440_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
40{
41 struct s3c2410_uartcfg *tcfg = cfg;
42 u32 ucnt;
43
44 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
45 if (!tcfg->clocks) {
46 tcfg->clocks = s5p6440_serial_clocks;
47 tcfg->clocks_size = ARRAY_SIZE(s5p6440_serial_clocks);
48 }
49 }
50
51 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no);
52}
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c b/arch/arm/mach-s5p6440/mach-smdk6440.c
new file mode 100644
index 000000000000..3ae88f2c7c77
--- /dev/null
+++ b/arch/arm/mach-s5p6440/mach-smdk6440.c
@@ -0,0 +1,111 @@
1/* linux/arch/arm/mach-s5p6440/mach-smdk6440.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/delay.h>
17#include <linux/init.h>
18#include <linux/serial_core.h>
19#include <linux/platform_device.h>
20#include <linux/io.h>
21#include <linux/module.h>
22#include <linux/clk.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26
27#include <mach/hardware.h>
28#include <mach/map.h>
29
30#include <asm/irq.h>
31#include <asm/mach-types.h>
32
33#include <plat/regs-serial.h>
34
35#include <plat/s5p6440.h>
36#include <plat/clock.h>
37#include <mach/regs-clock.h>
38#include <plat/devs.h>
39#include <plat/cpu.h>
40#include <plat/pll.h>
41
42#define S5P6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
43 S3C2410_UCON_RXILEVEL | \
44 S3C2410_UCON_TXIRQMODE | \
45 S3C2410_UCON_RXIRQMODE | \
46 S3C2410_UCON_RXFIFO_TOI | \
47 S3C2443_UCON_RXERR_IRQEN)
48
49#define S5P6440_ULCON_DEFAULT S3C2410_LCON_CS8
50
51#define S5P6440_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
52 S3C2440_UFCON_TXTRIG16 | \
53 S3C2410_UFCON_RXTRIG8)
54
55static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = {
56 [0] = {
57 .hwport = 0,
58 .flags = 0,
59 .ucon = S5P6440_UCON_DEFAULT,
60 .ulcon = S5P6440_ULCON_DEFAULT,
61 .ufcon = S5P6440_UFCON_DEFAULT,
62 },
63 [1] = {
64 .hwport = 1,
65 .flags = 0,
66 .ucon = S5P6440_UCON_DEFAULT,
67 .ulcon = S5P6440_ULCON_DEFAULT,
68 .ufcon = S5P6440_UFCON_DEFAULT,
69 },
70 [2] = {
71 .hwport = 2,
72 .flags = 0,
73 .ucon = S5P6440_UCON_DEFAULT,
74 .ulcon = S5P6440_ULCON_DEFAULT,
75 .ufcon = S5P6440_UFCON_DEFAULT,
76 },
77 [3] = {
78 .hwport = 3,
79 .flags = 0,
80 .ucon = S5P6440_UCON_DEFAULT,
81 .ulcon = S5P6440_ULCON_DEFAULT,
82 .ufcon = S5P6440_UFCON_DEFAULT,
83 },
84};
85
86static struct platform_device *smdk6440_devices[] __initdata = {
87};
88
89static void __init smdk6440_map_io(void)
90{
91 s5p_init_io(NULL, 0, S5P_SYS_ID);
92 s3c24xx_init_clocks(12000000);
93 s3c24xx_init_uarts(smdk6440_uartcfgs, ARRAY_SIZE(smdk6440_uartcfgs));
94}
95
96static void __init smdk6440_machine_init(void)
97{
98 platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
99}
100
101MACHINE_START(SMDK6440, "SMDK6440")
102 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
103 .phys_io = S3C_PA_UART & 0xfff00000,
104 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
105 .boot_params = S5P_PA_SDRAM + 0x100,
106
107 .init_irq = s5p6440_init_irq,
108 .map_io = smdk6440_map_io,
109 .init_machine = smdk6440_machine_init,
110 .timer = &s3c24xx_timer,
111MACHINE_END
diff --git a/arch/arm/mach-s5p6442/Kconfig b/arch/arm/mach-s5p6442/Kconfig
new file mode 100644
index 000000000000..4f3f6de6a013
--- /dev/null
+++ b/arch/arm/mach-s5p6442/Kconfig
@@ -0,0 +1,24 @@
1# arch/arm/mach-s5p6442/Kconfig
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8# Configuration options for the S5P6442
9
10if ARCH_S5P6442
11
12config CPU_S5P6442
13 bool
14 select PLAT_S5P
15 help
16 Enable S5P6442 CPU support
17
18config MACH_SMDK6442
19 bool "SMDK6442"
20 select CPU_S5P6442
21 help
22 Machine support for Samsung SMDK6442
23
24endif
diff --git a/arch/arm/mach-s5p6442/Makefile b/arch/arm/mach-s5p6442/Makefile
new file mode 100644
index 000000000000..dde39a6ce6bc
--- /dev/null
+++ b/arch/arm/mach-s5p6442/Makefile
@@ -0,0 +1,19 @@
1# arch/arm/mach-s5p6442/Makefile
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S5P6442 system
14
15obj-$(CONFIG_CPU_S5P6442) += cpu.o init.o clock.o
16
17# machine support
18
19obj-$(CONFIG_MACH_SMDK6442) += mach-smdk6442.o
diff --git a/arch/arm/mach-s5p6442/Makefile.boot b/arch/arm/mach-s5p6442/Makefile.boot
new file mode 100644
index 000000000000..ff90aa13bd67
--- /dev/null
+++ b/arch/arm/mach-s5p6442/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x20008000
2params_phys-y := 0x20000100
diff --git a/arch/arm/mach-s5p6442/clock.c b/arch/arm/mach-s5p6442/clock.c
new file mode 100644
index 000000000000..3aadbf42c112
--- /dev/null
+++ b/arch/arm/mach-s5p6442/clock.c
@@ -0,0 +1,396 @@
1/* linux/arch/arm/mach-s5p6442/clock.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - Clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/err.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20
21#include <mach/map.h>
22
23#include <plat/cpu-freq.h>
24#include <mach/regs-clock.h>
25#include <plat/clock.h>
26#include <plat/cpu.h>
27#include <plat/pll.h>
28#include <plat/s5p-clock.h>
29#include <plat/clock-clksrc.h>
30#include <plat/s5p6442.h>
31
32static struct clksrc_clk clk_mout_apll = {
33 .clk = {
34 .name = "mout_apll",
35 .id = -1,
36 },
37 .sources = &clk_src_apll,
38 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1 },
39};
40
41static struct clksrc_clk clk_mout_mpll = {
42 .clk = {
43 .name = "mout_mpll",
44 .id = -1,
45 },
46 .sources = &clk_src_mpll,
47 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1 },
48};
49
50static struct clksrc_clk clk_mout_epll = {
51 .clk = {
52 .name = "mout_epll",
53 .id = -1,
54 },
55 .sources = &clk_src_epll,
56 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 8, .size = 1 },
57};
58
59/* Possible clock sources for ARM Mux */
60static struct clk *clk_src_arm_list[] = {
61 [1] = &clk_mout_apll.clk,
62 [2] = &clk_mout_mpll.clk,
63};
64
65static struct clksrc_sources clk_src_arm = {
66 .sources = clk_src_arm_list,
67 .nr_sources = ARRAY_SIZE(clk_src_arm_list),
68};
69
70static struct clksrc_clk clk_mout_arm = {
71 .clk = {
72 .name = "mout_arm",
73 .id = -1,
74 },
75 .sources = &clk_src_arm,
76 .reg_src = { .reg = S5P_CLK_MUX_STAT0, .shift = 16, .size = 3 },
77};
78
79static struct clk clk_dout_a2m = {
80 .name = "dout_a2m",
81 .id = -1,
82 .parent = &clk_mout_apll.clk,
83};
84
85/* Possible clock sources for D0 Mux */
86static struct clk *clk_src_d0_list[] = {
87 [1] = &clk_mout_mpll.clk,
88 [2] = &clk_dout_a2m,
89};
90
91static struct clksrc_sources clk_src_d0 = {
92 .sources = clk_src_d0_list,
93 .nr_sources = ARRAY_SIZE(clk_src_d0_list),
94};
95
96static struct clksrc_clk clk_mout_d0 = {
97 .clk = {
98 .name = "mout_d0",
99 .id = -1,
100 },
101 .sources = &clk_src_d0,
102 .reg_src = { .reg = S5P_CLK_MUX_STAT0, .shift = 20, .size = 3 },
103};
104
105static struct clk clk_dout_apll = {
106 .name = "dout_apll",
107 .id = -1,
108 .parent = &clk_mout_arm.clk,
109};
110
111/* Possible clock sources for D0SYNC Mux */
112static struct clk *clk_src_d0sync_list[] = {
113 [1] = &clk_mout_d0.clk,
114 [2] = &clk_dout_apll,
115};
116
117static struct clksrc_sources clk_src_d0sync = {
118 .sources = clk_src_d0sync_list,
119 .nr_sources = ARRAY_SIZE(clk_src_d0sync_list),
120};
121
122static struct clksrc_clk clk_mout_d0sync = {
123 .clk = {
124 .name = "mout_d0sync",
125 .id = -1,
126 },
127 .sources = &clk_src_d0sync,
128 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 28, .size = 3 },
129};
130
131/* Possible clock sources for D1 Mux */
132static struct clk *clk_src_d1_list[] = {
133 [1] = &clk_mout_mpll.clk,
134 [2] = &clk_dout_a2m,
135};
136
137static struct clksrc_sources clk_src_d1 = {
138 .sources = clk_src_d1_list,
139 .nr_sources = ARRAY_SIZE(clk_src_d1_list),
140};
141
142static struct clksrc_clk clk_mout_d1 = {
143 .clk = {
144 .name = "mout_d1",
145 .id = -1,
146 },
147 .sources = &clk_src_d1,
148 .reg_src = { .reg = S5P_CLK_MUX_STAT0, .shift = 24, .size = 3 },
149};
150
151/* Possible clock sources for D1SYNC Mux */
152static struct clk *clk_src_d1sync_list[] = {
153 [1] = &clk_mout_d1.clk,
154 [2] = &clk_dout_apll,
155};
156
157static struct clksrc_sources clk_src_d1sync = {
158 .sources = clk_src_d1sync_list,
159 .nr_sources = ARRAY_SIZE(clk_src_d1sync_list),
160};
161
162static struct clksrc_clk clk_mout_d1sync = {
163 .clk = {
164 .name = "mout_d1sync",
165 .id = -1,
166 },
167 .sources = &clk_src_d1sync,
168 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 24, .size = 3 },
169};
170
171static struct clk clk_hclkd0 = {
172 .name = "hclkd0",
173 .id = -1,
174 .parent = &clk_mout_d0sync.clk,
175};
176
177static struct clk clk_hclkd1 = {
178 .name = "hclkd1",
179 .id = -1,
180 .parent = &clk_mout_d1sync.clk,
181};
182
183static struct clk clk_pclkd0 = {
184 .name = "pclkd0",
185 .id = -1,
186 .parent = &clk_hclkd0,
187};
188
189static struct clk clk_pclkd1 = {
190 .name = "pclkd1",
191 .id = -1,
192 .parent = &clk_hclkd1,
193};
194
195int s5p6442_clk_ip3_ctrl(struct clk *clk, int enable)
196{
197 return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable);
198}
199
200static struct clksrc_clk clksrcs[] = {
201 {
202 .clk = {
203 .name = "dout_a2m",
204 .id = -1,
205 .parent = &clk_mout_apll.clk,
206 },
207 .sources = &clk_src_apll,
208 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1 },
209 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 4, .size = 3 },
210 }, {
211 .clk = {
212 .name = "dout_apll",
213 .id = -1,
214 .parent = &clk_mout_arm.clk,
215 },
216 .sources = &clk_src_arm,
217 .reg_src = { .reg = S5P_CLK_MUX_STAT0, .shift = 16, .size = 3 },
218 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 0, .size = 3 },
219 }, {
220 .clk = {
221 .name = "hclkd1",
222 .id = -1,
223 .parent = &clk_mout_d1sync.clk,
224 },
225 .sources = &clk_src_d1sync,
226 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 24, .size = 3 },
227 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 24, .size = 4 },
228 }, {
229 .clk = {
230 .name = "hclkd0",
231 .id = -1,
232 .parent = &clk_mout_d0sync.clk,
233 },
234 .sources = &clk_src_d0sync,
235 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 28, .size = 3 },
236 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 16, .size = 4 },
237 }, {
238 .clk = {
239 .name = "pclkd0",
240 .id = -1,
241 .parent = &clk_hclkd0,
242 },
243 .sources = &clk_src_d0sync,
244 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 28, .size = 3 },
245 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 20, .size = 3 },
246 }, {
247 .clk = {
248 .name = "pclkd1",
249 .id = -1,
250 .parent = &clk_hclkd1,
251 },
252 .sources = &clk_src_d1sync,
253 .reg_src = { .reg = S5P_CLK_MUX_STAT1, .shift = 24, .size = 3 },
254 .reg_div = { .reg = S5P_CLK_DIV0, .shift = 28, .size = 3 },
255 }
256};
257
258/* Clock initialisation code */
259static struct clksrc_clk *init_parents[] = {
260 &clk_mout_apll,
261 &clk_mout_mpll,
262 &clk_mout_epll,
263 &clk_mout_arm,
264 &clk_mout_d0,
265 &clk_mout_d0sync,
266 &clk_mout_d1,
267 &clk_mout_d1sync,
268};
269
270void __init_or_cpufreq s5p6442_setup_clocks(void)
271{
272 struct clk *pclkd0_clk;
273 struct clk *pclkd1_clk;
274
275 unsigned long xtal;
276 unsigned long arm;
277 unsigned long hclkd0 = 0;
278 unsigned long hclkd1 = 0;
279 unsigned long pclkd0 = 0;
280 unsigned long pclkd1 = 0;
281
282 unsigned long apll;
283 unsigned long mpll;
284 unsigned long epll;
285 unsigned int ptr;
286
287 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
288
289 xtal = clk_get_rate(&clk_xtal);
290
291 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
292
293 apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4508);
294 mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
295 epll = s5p_get_pll45xx(xtal, __raw_readl(S5P_EPLL_CON), pll_4500);
296
297 printk(KERN_INFO "S5P6440: PLL settings, A=%ld, M=%ld, E=%ld",
298 apll, mpll, epll);
299
300 clk_fout_apll.rate = apll;
301 clk_fout_mpll.rate = mpll;
302 clk_fout_epll.rate = epll;
303
304 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
305 s3c_set_clksrc(init_parents[ptr], true);
306
307 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
308 s3c_set_clksrc(&clksrcs[ptr], true);
309
310 arm = clk_get_rate(&clk_dout_apll);
311 hclkd0 = clk_get_rate(&clk_hclkd0);
312 hclkd1 = clk_get_rate(&clk_hclkd1);
313
314 pclkd0_clk = clk_get(NULL, "pclkd0");
315 BUG_ON(IS_ERR(pclkd0_clk));
316
317 pclkd0 = clk_get_rate(pclkd0_clk);
318 clk_put(pclkd0_clk);
319
320 pclkd1_clk = clk_get(NULL, "pclkd1");
321 BUG_ON(IS_ERR(pclkd1_clk));
322
323 pclkd1 = clk_get_rate(pclkd1_clk);
324 clk_put(pclkd1_clk);
325
326 printk(KERN_INFO "S5P6442: HCLKD0=%ld, HCLKD1=%ld, PCLKD0=%ld, PCLKD1=%ld\n",
327 hclkd0, hclkd1, pclkd0, pclkd1);
328
329 /* For backward compatibility */
330 clk_f.rate = arm;
331 clk_h.rate = hclkd1;
332 clk_p.rate = pclkd1;
333
334 clk_pclkd0.rate = pclkd0;
335 clk_pclkd1.rate = pclkd1;
336}
337
338static struct clk init_clocks[] = {
339 {
340 .name = "systimer",
341 .id = -1,
342 .parent = &clk_pclkd1,
343 .enable = s5p6442_clk_ip3_ctrl,
344 .ctrlbit = (1<<16),
345 }, {
346 .name = "uart",
347 .id = 0,
348 .parent = &clk_pclkd1,
349 .enable = s5p6442_clk_ip3_ctrl,
350 .ctrlbit = (1<<17),
351 }, {
352 .name = "uart",
353 .id = 1,
354 .parent = &clk_pclkd1,
355 .enable = s5p6442_clk_ip3_ctrl,
356 .ctrlbit = (1<<18),
357 }, {
358 .name = "uart",
359 .id = 2,
360 .parent = &clk_pclkd1,
361 .enable = s5p6442_clk_ip3_ctrl,
362 .ctrlbit = (1<<19),
363 }, {
364 .name = "timers",
365 .id = -1,
366 .parent = &clk_pclkd1,
367 .enable = s5p6442_clk_ip3_ctrl,
368 .ctrlbit = (1<<23),
369 },
370};
371
372static struct clk *clks[] __initdata = {
373 &clk_ext,
374 &clk_epll,
375 &clk_mout_apll.clk,
376 &clk_mout_mpll.clk,
377 &clk_mout_epll.clk,
378 &clk_mout_d0.clk,
379 &clk_mout_d0sync.clk,
380 &clk_mout_d1.clk,
381 &clk_mout_d1sync.clk,
382 &clk_hclkd0,
383 &clk_pclkd0,
384 &clk_hclkd1,
385 &clk_pclkd1,
386};
387
388void __init s5p6442_register_clocks(void)
389{
390 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
391
392 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
393 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
394
395 s3c_pwmclk_init();
396}
diff --git a/arch/arm/mach-s5p6442/cpu.c b/arch/arm/mach-s5p6442/cpu.c
new file mode 100644
index 000000000000..bc2524df89b3
--- /dev/null
+++ b/arch/arm/mach-s5p6442/cpu.c
@@ -0,0 +1,121 @@
1/* linux/arch/arm/mach-s5p6442/cpu.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
17#include <linux/clk.h>
18#include <linux/io.h>
19#include <linux/sysdev.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/irq.h>
26
27#include <asm/proc-fns.h>
28
29#include <mach/hardware.h>
30#include <mach/map.h>
31#include <asm/irq.h>
32
33#include <plat/regs-serial.h>
34#include <mach/regs-clock.h>
35
36#include <plat/cpu.h>
37#include <plat/devs.h>
38#include <plat/clock.h>
39#include <plat/s5p6442.h>
40
41/* Initial IO mappings */
42
43static struct map_desc s5p6442_iodesc[] __initdata = {
44 {
45 .virtual = (unsigned long)S5P_VA_SYSTIMER,
46 .pfn = __phys_to_pfn(S5P6442_PA_SYSTIMER),
47 .length = SZ_16K,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = (unsigned long)VA_VIC2,
51 .pfn = __phys_to_pfn(S5P6442_PA_VIC2),
52 .length = SZ_16K,
53 .type = MT_DEVICE,
54 }
55};
56
57static void s5p6442_idle(void)
58{
59 if (!need_resched())
60 cpu_do_idle();
61
62 local_irq_enable();
63}
64
65/* s5p6442_map_io
66 *
67 * register the standard cpu IO areas
68*/
69
70void __init s5p6442_map_io(void)
71{
72 iotable_init(s5p6442_iodesc, ARRAY_SIZE(s5p6442_iodesc));
73}
74
75void __init s5p6442_init_clocks(int xtal)
76{
77 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
78
79 s3c24xx_register_baseclocks(xtal);
80 s5p_register_clocks(xtal);
81 s5p6442_register_clocks();
82 s5p6442_setup_clocks();
83}
84
85void __init s5p6442_init_irq(void)
86{
87 /* S5P6442 supports 3 VIC */
88 u32 vic[3];
89
90 /* VIC0, VIC1, and VIC2: some interrupt reserved */
91 vic[0] = 0x7fefffff;
92 vic[1] = 0X7f389c81;
93 vic[2] = 0X1bbbcfff;
94
95 s5p_init_irq(vic, ARRAY_SIZE(vic));
96}
97
98static struct sysdev_class s5p6442_sysclass = {
99 .name = "s5p6442-core",
100};
101
102static struct sys_device s5p6442_sysdev = {
103 .cls = &s5p6442_sysclass,
104};
105
106static int __init s5p6442_core_init(void)
107{
108 return sysdev_class_register(&s5p6442_sysclass);
109}
110
111core_initcall(s5p6442_core_init);
112
113int __init s5p6442_init(void)
114{
115 printk(KERN_INFO "S5P6442: Initializing architecture\n");
116
117 /* set idle function */
118 pm_idle = s5p6442_idle;
119
120 return sysdev_register(&s5p6442_sysdev);
121}
diff --git a/arch/arm/mach-s5p6442/include/mach/debug-macro.S b/arch/arm/mach-s5p6442/include/mach/debug-macro.S
new file mode 100644
index 000000000000..1aae691e58ef
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/debug-macro.S
@@ -0,0 +1,36 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/debug-macro.S
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* pull in the relevant register and map files. */
14
15#include <mach/map.h>
16#include <plat/regs-serial.h>
17
18 .macro addruart, rx
19 mrc p15, 0, \rx, c1, c0
20 tst \rx, #1
21 ldreq \rx, = S3C_PA_UART
22 ldrne \rx, = S3C_VA_UART
23#if CONFIG_DEBUG_S3C_UART != 0
24 add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
25#endif
26 .endm
27
28#define fifo_full fifo_full_s5pv210
29#define fifo_level fifo_level_s5pv210
30
31/* include the reset of the code which will do the work, we're only
32 * compiling for a single cpu processor type so the default of s3c2440
33 * will be fine with us.
34 */
35
36#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-s5p6442/include/mach/entry-macro.S b/arch/arm/mach-s5p6442/include/mach/entry-macro.S
new file mode 100644
index 000000000000..6d574edbf1ae
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/entry-macro.S
@@ -0,0 +1,48 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/entry-macro.S
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Low-level IRQ helper macros for the Samsung S5P6442
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <asm/hardware/vic.h>
14#include <mach/map.h>
15#include <plat/irqs.h>
16
17 .macro disable_fiq
18 .endm
19
20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =VA_VIC0
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28
29 @ check the vic0
30 mov \irqnr, # S5P_IRQ_OFFSET + 31
31 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
32 teq \irqstat, #0
33
34 @ otherwise try vic1
35 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
36 addeq \irqnr, \irqnr, #32
37 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
38 teqeq \irqstat, #0
39
40 @ otherwise try vic2
41 addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
42 addeq \irqnr, \irqnr, #32
43 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
44 teqeq \irqstat, #0
45
46 clzne \irqstat, \irqstat
47 subne \irqnr, \irqnr, \irqstat
48 .endm
diff --git a/arch/arm/mach-s5p6442/include/mach/gpio.h b/arch/arm/mach-s5p6442/include/mach/gpio.h
new file mode 100644
index 000000000000..b8715df2fdab
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/gpio.h
@@ -0,0 +1,123 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/gpio.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - GPIO lib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_GPIO_H
14#define __ASM_ARCH_GPIO_H __FILE__
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21/* GPIO bank sizes */
22#define S5P6442_GPIO_A0_NR (8)
23#define S5P6442_GPIO_A1_NR (2)
24#define S5P6442_GPIO_B_NR (4)
25#define S5P6442_GPIO_C0_NR (5)
26#define S5P6442_GPIO_C1_NR (5)
27#define S5P6442_GPIO_D0_NR (2)
28#define S5P6442_GPIO_D1_NR (6)
29#define S5P6442_GPIO_E0_NR (8)
30#define S5P6442_GPIO_E1_NR (5)
31#define S5P6442_GPIO_F0_NR (8)
32#define S5P6442_GPIO_F1_NR (8)
33#define S5P6442_GPIO_F2_NR (8)
34#define S5P6442_GPIO_F3_NR (6)
35#define S5P6442_GPIO_G0_NR (7)
36#define S5P6442_GPIO_G1_NR (7)
37#define S5P6442_GPIO_G2_NR (7)
38#define S5P6442_GPIO_H0_NR (8)
39#define S5P6442_GPIO_H1_NR (8)
40#define S5P6442_GPIO_H2_NR (8)
41#define S5P6442_GPIO_H3_NR (8)
42#define S5P6442_GPIO_J0_NR (8)
43#define S5P6442_GPIO_J1_NR (6)
44#define S5P6442_GPIO_J2_NR (8)
45#define S5P6442_GPIO_J3_NR (8)
46#define S5P6442_GPIO_J4_NR (5)
47
48/* GPIO bank numbers */
49
50/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
51 * space for debugging purposes so that any accidental
52 * change from one gpio bank to another can be caught.
53*/
54
55#define S5P6442_GPIO_NEXT(__gpio) \
56 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
57
58enum s5p_gpio_number {
59 S5P6442_GPIO_A0_START = 0,
60 S5P6442_GPIO_A1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_A0),
61 S5P6442_GPIO_B_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_A1),
62 S5P6442_GPIO_C0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_B),
63 S5P6442_GPIO_C1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_C0),
64 S5P6442_GPIO_D0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_C1),
65 S5P6442_GPIO_D1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_D0),
66 S5P6442_GPIO_E0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_D1),
67 S5P6442_GPIO_E1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_E0),
68 S5P6442_GPIO_F0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_E1),
69 S5P6442_GPIO_F1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F0),
70 S5P6442_GPIO_F2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F1),
71 S5P6442_GPIO_F3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F2),
72 S5P6442_GPIO_G0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_F3),
73 S5P6442_GPIO_G1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G0),
74 S5P6442_GPIO_G2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G1),
75 S5P6442_GPIO_H0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_G2),
76 S5P6442_GPIO_H1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H0),
77 S5P6442_GPIO_H2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H1),
78 S5P6442_GPIO_H3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H2),
79 S5P6442_GPIO_J0_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_H3),
80 S5P6442_GPIO_J1_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J0),
81 S5P6442_GPIO_J2_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J1),
82 S5P6442_GPIO_J3_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J2),
83 S5P6442_GPIO_J4_START = S5P6442_GPIO_NEXT(S5P6442_GPIO_J3),
84};
85
86/* S5P6442 GPIO number definitions. */
87#define S5P6442_GPA0(_nr) (S5P6442_GPIO_A0_START + (_nr))
88#define S5P6442_GPA1(_nr) (S5P6442_GPIO_A1_START + (_nr))
89#define S5P6442_GPB(_nr) (S5P6442_GPIO_B_START + (_nr))
90#define S5P6442_GPC0(_nr) (S5P6442_GPIO_C0_START + (_nr))
91#define S5P6442_GPC1(_nr) (S5P6442_GPIO_C1_START + (_nr))
92#define S5P6442_GPD0(_nr) (S5P6442_GPIO_D0_START + (_nr))
93#define S5P6442_GPD1(_nr) (S5P6442_GPIO_D1_START + (_nr))
94#define S5P6442_GPE0(_nr) (S5P6442_GPIO_E0_START + (_nr))
95#define S5P6442_GPE1(_nr) (S5P6442_GPIO_E1_START + (_nr))
96#define S5P6442_GPF0(_nr) (S5P6442_GPIO_F0_START + (_nr))
97#define S5P6442_GPF1(_nr) (S5P6442_GPIO_F1_START + (_nr))
98#define S5P6442_GPF2(_nr) (S5P6442_GPIO_F2_START + (_nr))
99#define S5P6442_GPF3(_nr) (S5P6442_GPIO_F3_START + (_nr))
100#define S5P6442_GPG0(_nr) (S5P6442_GPIO_G0_START + (_nr))
101#define S5P6442_GPG1(_nr) (S5P6442_GPIO_G1_START + (_nr))
102#define S5P6442_GPG2(_nr) (S5P6442_GPIO_G2_START + (_nr))
103#define S5P6442_GPH0(_nr) (S5P6442_GPIO_H0_START + (_nr))
104#define S5P6442_GPH1(_nr) (S5P6442_GPIO_H1_START + (_nr))
105#define S5P6442_GPH2(_nr) (S5P6442_GPIO_H2_START + (_nr))
106#define S5P6442_GPH3(_nr) (S5P6442_GPIO_H3_START + (_nr))
107#define S5P6442_GPJ0(_nr) (S5P6442_GPIO_J0_START + (_nr))
108#define S5P6442_GPJ1(_nr) (S5P6442_GPIO_J1_START + (_nr))
109#define S5P6442_GPJ2(_nr) (S5P6442_GPIO_J2_START + (_nr))
110#define S5P6442_GPJ3(_nr) (S5P6442_GPIO_J3_START + (_nr))
111#define S5P6442_GPJ4(_nr) (S5P6442_GPIO_J4_START + (_nr))
112
113/* the end of the S5P6442 specific gpios */
114#define S5P6442_GPIO_END (S5P6442_GPJ4(S5P6442_GPIO_J4_NR) + 1)
115#define S3C_GPIO_END S5P6442_GPIO_END
116
117/* define the number of gpios we need to the one after the GPJ4() range */
118#define ARCH_NR_GPIOS (S5P6442_GPJ4(S5P6442_GPIO_J4_NR) + \
119 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
120
121#include <asm-generic/gpio.h>
122
123#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/hardware.h b/arch/arm/mach-s5p6442/include/mach/hardware.h
new file mode 100644
index 000000000000..8cd7b67b49d4
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/hardware.h
@@ -0,0 +1,18 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/hardware.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - Hardware support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H __FILE__
15
16/* currently nothing here, placeholder */
17
18#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/io.h b/arch/arm/mach-s5p6442/include/mach/io.h
new file mode 100644
index 000000000000..5d2195ad0b67
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/io.h
@@ -0,0 +1,17 @@
1/* arch/arm/mach-s5p6442/include/mach/io.h
2 *
3 * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * Default IO routines for S5P6442
6 */
7
8#ifndef __ASM_ARM_ARCH_IO_H
9#define __ASM_ARM_ARCH_IO_H
10
11/* No current ISA/PCI bus support. */
12#define __io(a) __typesafe_io(a)
13#define __mem_pci(a) (a)
14
15#define IO_SPACE_LIMIT (0xFFFFFFFF)
16
17#endif
diff --git a/arch/arm/mach-s5p6442/include/mach/irqs.h b/arch/arm/mach-s5p6442/include/mach/irqs.h
new file mode 100644
index 000000000000..da665809f6e4
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/irqs.h
@@ -0,0 +1,86 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/irqs.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - IRQ definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_IRQS_H
14#define __ASM_ARCH_IRQS_H __FILE__
15
16#include <plat/irqs.h>
17
18/* VIC0 */
19#define IRQ_EINT16_31 S5P_IRQ_VIC0(16)
20#define IRQ_BATF S5P_IRQ_VIC0(17)
21#define IRQ_MDMA S5P_IRQ_VIC0(18)
22#define IRQ_PDMA S5P_IRQ_VIC0(19)
23#define IRQ_TIMER0_VIC S5P_IRQ_VIC0(21)
24#define IRQ_TIMER1_VIC S5P_IRQ_VIC0(22)
25#define IRQ_TIMER2_VIC S5P_IRQ_VIC0(23)
26#define IRQ_TIMER3_VIC S5P_IRQ_VIC0(24)
27#define IRQ_TIMER4_VIC S5P_IRQ_VIC0(25)
28#define IRQ_SYSTIMER S5P_IRQ_VIC0(26)
29#define IRQ_WDT S5P_IRQ_VIC0(27)
30#define IRQ_RTC_ALARM S5P_IRQ_VIC0(28)
31#define IRQ_RTC_TIC S5P_IRQ_VIC0(29)
32#define IRQ_GPIOINT S5P_IRQ_VIC0(30)
33
34/* VIC1 */
35#define IRQ_nPMUIRQ S5P_IRQ_VIC1(0)
36#define IRQ_ONENAND S5P_IRQ_VIC1(7)
37#define IRQ_UART0 S5P_IRQ_VIC1(10)
38#define IRQ_UART1 S5P_IRQ_VIC1(11)
39#define IRQ_UART2 S5P_IRQ_VIC1(12)
40#define IRQ_SPI0 S5P_IRQ_VIC1(15)
41#define IRQ_IIC S5P_IRQ_VIC1(19)
42#define IRQ_IIC1 S5P_IRQ_VIC1(20)
43#define IRQ_IIC2 S5P_IRQ_VIC1(21)
44#define IRQ_OTG S5P_IRQ_VIC1(24)
45#define IRQ_MSM S5P_IRQ_VIC1(25)
46#define IRQ_HSMMC0 S5P_IRQ_VIC1(26)
47#define IRQ_HSMMC1 S5P_IRQ_VIC1(27)
48#define IRQ_HSMMC2 S5P_IRQ_VIC1(28)
49#define IRQ_COMMRX S5P_IRQ_VIC1(29)
50#define IRQ_COMMTX S5P_IRQ_VIC1(30)
51
52/* VIC2 */
53#define IRQ_LCD0 S5P_IRQ_VIC2(0)
54#define IRQ_LCD1 S5P_IRQ_VIC2(1)
55#define IRQ_LCD2 S5P_IRQ_VIC2(2)
56#define IRQ_LCD3 S5P_IRQ_VIC2(3)
57#define IRQ_ROTATOR S5P_IRQ_VIC2(4)
58#define IRQ_FIMC0 S5P_IRQ_VIC2(5)
59#define IRQ_FIMC1 S5P_IRQ_VIC2(6)
60#define IRQ_FIMC2 S5P_IRQ_VIC2(7)
61#define IRQ_JPEG S5P_IRQ_VIC2(8)
62#define IRQ_3D S5P_IRQ_VIC2(10)
63#define IRQ_Mixer S5P_IRQ_VIC2(11)
64#define IRQ_MFC S5P_IRQ_VIC2(14)
65#define IRQ_TVENC S5P_IRQ_VIC2(15)
66#define IRQ_I2S0 S5P_IRQ_VIC2(16)
67#define IRQ_I2S1 S5P_IRQ_VIC2(17)
68#define IRQ_RP S5P_IRQ_VIC2(19)
69#define IRQ_PCM0 S5P_IRQ_VIC2(20)
70#define IRQ_PCM1 S5P_IRQ_VIC2(21)
71#define IRQ_ADC S5P_IRQ_VIC2(23)
72#define IRQ_PENDN S5P_IRQ_VIC2(24)
73#define IRQ_KEYPAD S5P_IRQ_VIC2(25)
74#define IRQ_SSS_INT S5P_IRQ_VIC2(27)
75#define IRQ_SSS_HASH S5P_IRQ_VIC2(28)
76#define IRQ_VIC_END S5P_IRQ_VIC2(31)
77
78#define S5P_IRQ_EINT_BASE (IRQ_VIC_END + 1)
79
80#define IRQ_EINT(x) ((x) < 16 ? S5P_IRQ_VIC0(x) : \
81 (S5P_IRQ_EINT_BASE + (x)-16))
82/* Set the default NR_IRQS */
83
84#define NR_IRQS (IRQ_EINT(31) + 1)
85
86#endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/map.h b/arch/arm/mach-s5p6442/include/mach/map.h
new file mode 100644
index 000000000000..685277d792fb
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/map.h
@@ -0,0 +1,58 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/map.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H __FILE__
15
16#include <plat/map-base.h>
17#include <plat/map-s5p.h>
18
19#define S5P6442_PA_CHIPID (0xE0000000)
20#define S5P_PA_CHIPID S5P6442_PA_CHIPID
21
22#define S5P6442_PA_SYSCON (0xE0100000)
23#define S5P_PA_SYSCON S5P6442_PA_SYSCON
24
25#define S5P6442_PA_GPIO (0xE0200000)
26#define S5P_PA_GPIO S5P6442_PA_GPIO
27
28#define S5P6442_PA_VIC0 (0xE4000000)
29#define S5P_PA_VIC0 S5P6442_PA_VIC0
30
31#define S5P6442_PA_VIC1 (0xE4100000)
32#define S5P_PA_VIC1 S5P6442_PA_VIC1
33
34#define S5P6442_PA_VIC2 (0xE4200000)
35#define S5P_PA_VIC2 S5P6442_PA_VIC2
36
37#define S5P6442_PA_TIMER (0xEA000000)
38#define S5P_PA_TIMER S5P6442_PA_TIMER
39
40#define S5P6442_PA_SYSTIMER (0xEA100000)
41
42#define S5P6442_PA_UART (0xEC000000)
43
44#define S5P_PA_UART0 (S5P6442_PA_UART + 0x0)
45#define S5P_PA_UART1 (S5P6442_PA_UART + 0x400)
46#define S5P_PA_UART2 (S5P6442_PA_UART + 0x800)
47#define S5P_SZ_UART SZ_256
48
49#define S5P6442_PA_IIC0 (0xEC100000)
50
51#define S5P6442_PA_SDRAM (0x20000000)
52#define S5P_PA_SDRAM S5P6442_PA_SDRAM
53
54/* compatibiltiy defines. */
55#define S3C_PA_UART S5P6442_PA_UART
56#define S3C_PA_IIC S5P6442_PA_IIC0
57
58#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/memory.h b/arch/arm/mach-s5p6442/include/mach/memory.h
new file mode 100644
index 000000000000..9ddd877ba2ea
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/memory.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/memory.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - Memory definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#define PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE SZ_8M
18
19#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/pwm-clock.h b/arch/arm/mach-s5p6442/include/mach/pwm-clock.h
new file mode 100644
index 000000000000..15e8525da0f1
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/pwm-clock.h
@@ -0,0 +1,69 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/pwm-clock.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * Copyright 2010 Samsung Electronics Co., Ltd.
8 * http://www.samsung.com/
9 *
10 * Based on arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
11 *
12 * S5P6442 - pwm clock and timer support
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17*/
18
19#ifndef __ASM_ARCH_PWMCLK_H
20#define __ASM_ARCH_PWMCLK_H __FILE__
21
22/**
23 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
24 * @cfg: The timer TCFG1 register bits shifted down to 0.
25 *
26 * Return true if the given configuration from TCFG1 is a TCLK instead
27 * any of the TDIV clocks.
28 */
29static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
30{
31 return tcfg == S3C2410_TCFG1_MUX_TCLK;
32}
33
34/**
35 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
36 * @tcfg1: The tcfg1 setting, shifted down.
37 *
38 * Get the divisor value for the given tcfg1 setting. We assume the
39 * caller has already checked to see if this is not a TCLK source.
40 */
41static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
42{
43 return 1 << (1 + tcfg1);
44}
45
46/**
47 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
48 *
49 * Return true if we have a /1 in the tdiv setting.
50 */
51static inline unsigned int pwm_tdiv_has_div1(void)
52{
53 return 0;
54}
55
56/**
57 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
58 * @div: The divisor to calculate the bit information for.
59 *
60 * Turn a divisor into the necessary bit field for TCFG1.
61 */
62static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
63{
64 return ilog2(div) - 1;
65}
66
67#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK
68
69#endif /* __ASM_ARCH_PWMCLK_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/regs-clock.h b/arch/arm/mach-s5p6442/include/mach/regs-clock.h
new file mode 100644
index 000000000000..d8360b5d4ece
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/regs-clock.h
@@ -0,0 +1,103 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/regs-clock.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - Clock register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_CLOCK_H
14#define __ASM_ARCH_REGS_CLOCK_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_CLKREG(x) (S3C_VA_SYS + (x))
19
20#define S5P_APLL_LOCK S5P_CLKREG(0x00)
21#define S5P_MPLL_LOCK S5P_CLKREG(0x08)
22#define S5P_EPLL_LOCK S5P_CLKREG(0x10)
23#define S5P_VPLL_LOCK S5P_CLKREG(0x20)
24
25#define S5P_APLL_CON S5P_CLKREG(0x100)
26#define S5P_MPLL_CON S5P_CLKREG(0x108)
27#define S5P_EPLL_CON S5P_CLKREG(0x110)
28#define S5P_VPLL_CON S5P_CLKREG(0x120)
29
30#define S5P_CLK_SRC0 S5P_CLKREG(0x200)
31#define S5P_CLK_SRC1 S5P_CLKREG(0x204)
32#define S5P_CLK_SRC2 S5P_CLKREG(0x208)
33#define S5P_CLK_SRC3 S5P_CLKREG(0x20C)
34#define S5P_CLK_SRC4 S5P_CLKREG(0x210)
35#define S5P_CLK_SRC5 S5P_CLKREG(0x214)
36#define S5P_CLK_SRC6 S5P_CLKREG(0x218)
37
38#define S5P_CLK_SRC_MASK0 S5P_CLKREG(0x280)
39#define S5P_CLK_SRC_MASK1 S5P_CLKREG(0x284)
40
41#define S5P_CLK_DIV0 S5P_CLKREG(0x300)
42#define S5P_CLK_DIV1 S5P_CLKREG(0x304)
43#define S5P_CLK_DIV2 S5P_CLKREG(0x308)
44#define S5P_CLK_DIV3 S5P_CLKREG(0x30C)
45#define S5P_CLK_DIV4 S5P_CLKREG(0x310)
46#define S5P_CLK_DIV5 S5P_CLKREG(0x314)
47#define S5P_CLK_DIV6 S5P_CLKREG(0x318)
48
49#define S5P_CLKGATE_IP3 S5P_CLKREG(0x46C)
50
51/* CLK_OUT */
52#define S5P_CLK_OUT_SHIFT (12)
53#define S5P_CLK_OUT_MASK (0x1F << S5P_CLK_OUT_SHIFT)
54#define S5P_CLK_OUT S5P_CLKREG(0x500)
55
56#define S5P_CLK_DIV_STAT0 S5P_CLKREG(0x1000)
57#define S5P_CLK_DIV_STAT1 S5P_CLKREG(0x1004)
58
59#define S5P_CLK_MUX_STAT0 S5P_CLKREG(0x1100)
60#define S5P_CLK_MUX_STAT1 S5P_CLKREG(0x1104)
61
62#define S5P_MDNIE_SEL S5P_CLKREG(0x7008)
63
64/* Register Bit definition */
65#define S5P_EPLL_EN (1<<31)
66#define S5P_EPLL_MASK 0xffffffff
67#define S5P_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
68
69/* CLKDIV0 */
70#define S5P_CLKDIV0_APLL_SHIFT (0)
71#define S5P_CLKDIV0_APLL_MASK (0x7 << S5P_CLKDIV0_APLL_SHIFT)
72#define S5P_CLKDIV0_A2M_SHIFT (4)
73#define S5P_CLKDIV0_A2M_MASK (0x7 << S5P_CLKDIV0_A2M_SHIFT)
74#define S5P_CLKDIV0_D0CLK_SHIFT (16)
75#define S5P_CLKDIV0_D0CLK_MASK (0xF << S5P_CLKDIV0_D0CLK_SHIFT)
76#define S5P_CLKDIV0_P0CLK_SHIFT (20)
77#define S5P_CLKDIV0_P0CLK_MASK (0x7 << S5P_CLKDIV0_P0CLK_SHIFT)
78#define S5P_CLKDIV0_D1CLK_SHIFT (24)
79#define S5P_CLKDIV0_D1CLK_MASK (0xF << S5P_CLKDIV0_D1CLK_SHIFT)
80#define S5P_CLKDIV0_P1CLK_SHIFT (28)
81#define S5P_CLKDIV0_P1CLK_MASK (0x7 << S5P_CLKDIV0_P1CLK_SHIFT)
82
83/* Clock MUX status Registers */
84#define S5P_CLK_MUX_STAT0_APLL_SHIFT (0)
85#define S5P_CLK_MUX_STAT0_APLL_MASK (0x7 << S5P_CLK_MUX_STAT0_APLL_SHIFT)
86#define S5P_CLK_MUX_STAT0_MPLL_SHIFT (4)
87#define S5P_CLK_MUX_STAT0_MPLL_MASK (0x7 << S5P_CLK_MUX_STAT0_MPLL_SHIFT)
88#define S5P_CLK_MUX_STAT0_EPLL_SHIFT (8)
89#define S5P_CLK_MUX_STAT0_EPLL_MASK (0x7 << S5P_CLK_MUX_STAT0_EPLL_SHIFT)
90#define S5P_CLK_MUX_STAT0_VPLL_SHIFT (12)
91#define S5P_CLK_MUX_STAT0_VPLL_MASK (0x7 << S5P_CLK_MUX_STAT0_VPLL_SHIFT)
92#define S5P_CLK_MUX_STAT0_MUXARM_SHIFT (16)
93#define S5P_CLK_MUX_STAT0_MUXARM_MASK (0x7 << S5P_CLK_MUX_STAT0_MUXARM_SHIFT)
94#define S5P_CLK_MUX_STAT0_MUXD0_SHIFT (20)
95#define S5P_CLK_MUX_STAT0_MUXD0_MASK (0x7 << S5P_CLK_MUX_STAT0_MUXD0_SHIFT)
96#define S5P_CLK_MUX_STAT0_MUXD1_SHIFT (24)
97#define S5P_CLK_MUX_STAT0_MUXD1_MASK (0x7 << S5P_CLK_MUX_STAT0_MUXD1_SHIFT)
98#define S5P_CLK_MUX_STAT1_D1SYNC_SHIFT (24)
99#define S5P_CLK_MUX_STAT1_D1SYNC_MASK (0x7 << S5P_CLK_MUX_STAT1_D1SYNC_SHIFT)
100#define S5P_CLK_MUX_STAT1_D0SYNC_SHIFT (28)
101#define S5P_CLK_MUX_STAT1_D0SYNC_MASK (0x7 << S5P_CLK_MUX_STAT1_D0SYNC_SHIFT)
102
103#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/regs-irq.h b/arch/arm/mach-s5p6442/include/mach/regs-irq.h
new file mode 100644
index 000000000000..73782b52a83b
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/regs-irq.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/regs-irq.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - IRQ register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15
16#include <asm/hardware/vic.h>
17#include <mach/map.h>
18
19#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/system.h b/arch/arm/mach-s5p6442/include/mach/system.h
new file mode 100644
index 000000000000..8bcd8ed0c3c3
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/system.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/system.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - system support header
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__
15
16static void arch_idle(void)
17{
18 /* nothing here yet */
19}
20
21static void arch_reset(char mode, const char *cmd)
22{
23 /* nothing here yet */
24}
25
26#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/tick.h b/arch/arm/mach-s5p6442/include/mach/tick.h
new file mode 100644
index 000000000000..e1d4cabf8297
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/tick.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/tick.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/tick.h
7 *
8 * S5P6442 - Timer tick support definitions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__
17
18static inline u32 s3c24xx_ostimer_pending(void)
19{
20 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
21 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
22}
23
24#define TICK_MAX (0xffffffff)
25
26#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/timex.h b/arch/arm/mach-s5p6442/include/mach/timex.h
new file mode 100644
index 000000000000..ff8f2fcadeb7
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/timex.h
@@ -0,0 +1,24 @@
1/* arch/arm/mach-s5p6442/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S5P6442 - time parameters
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/uncompress.h b/arch/arm/mach-s5p6442/include/mach/uncompress.h
new file mode 100644
index 000000000000..5ac7cbeeb987
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/uncompress.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/uncompress.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P6442 - uncompress code
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16#include <mach/map.h>
17#include <plat/uncompress.h>
18
19static void arch_detect_cpu(void)
20{
21 /* we do not need to do any cpu detection here at the moment. */
22}
23
24#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5p6442/include/mach/vmalloc.h b/arch/arm/mach-s5p6442/include/mach/vmalloc.h
new file mode 100644
index 000000000000..be3333688c20
--- /dev/null
+++ b/arch/arm/mach-s5p6442/include/mach/vmalloc.h
@@ -0,0 +1,17 @@
1/* arch/arm/mach-s5p6442/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S5P6442 vmalloc definition
10*/
11
12#ifndef __ASM_ARCH_VMALLOC_H
13#define __ASM_ARCH_VMALLOC_H
14
15#define VMALLOC_END (0xE0000000)
16
17#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5p6442/init.c b/arch/arm/mach-s5p6442/init.c
new file mode 100644
index 000000000000..1874bdb71e1d
--- /dev/null
+++ b/arch/arm/mach-s5p6442/init.c
@@ -0,0 +1,44 @@
1/* linux/arch/arm/mach-s5p6442/s5p6442-init.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <plat/cpu.h>
17#include <plat/devs.h>
18#include <plat/s5p6442.h>
19#include <plat/regs-serial.h>
20
21static struct s3c24xx_uart_clksrc s5p6442_serial_clocks[] = {
22 [0] = {
23 .name = "pclk",
24 .divisor = 1,
25 .min_baud = 0,
26 .max_baud = 0,
27 },
28};
29
30/* uart registration process */
31void __init s5p6442_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
32{
33 struct s3c2410_uartcfg *tcfg = cfg;
34 u32 ucnt;
35
36 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
37 if (!tcfg->clocks) {
38 tcfg->clocks = s5p6442_serial_clocks;
39 tcfg->clocks_size = ARRAY_SIZE(s5p6442_serial_clocks);
40 }
41 }
42
43 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
44}
diff --git a/arch/arm/mach-s5p6442/mach-smdk6442.c b/arch/arm/mach-s5p6442/mach-smdk6442.c
new file mode 100644
index 000000000000..0d63371ce07c
--- /dev/null
+++ b/arch/arm/mach-s5p6442/mach-smdk6442.c
@@ -0,0 +1,91 @@
1/* linux/arch/arm/mach-s5p6442/mach-smdk6442.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/setup.h>
19#include <asm/mach-types.h>
20
21#include <mach/map.h>
22#include <mach/regs-clock.h>
23
24#include <plat/regs-serial.h>
25#include <plat/s5p6442.h>
26#include <plat/devs.h>
27#include <plat/cpu.h>
28
29/* Following are default values for UCON, ULCON and UFCON UART registers */
30#define S5P6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
31 S3C2410_UCON_RXILEVEL | \
32 S3C2410_UCON_TXIRQMODE | \
33 S3C2410_UCON_RXIRQMODE | \
34 S3C2410_UCON_RXFIFO_TOI | \
35 S3C2443_UCON_RXERR_IRQEN)
36
37#define S5P6442_ULCON_DEFAULT S3C2410_LCON_CS8
38
39#define S5P6442_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
40 S5PV210_UFCON_TXTRIG4 | \
41 S5PV210_UFCON_RXTRIG4)
42
43static struct s3c2410_uartcfg smdk6442_uartcfgs[] __initdata = {
44 [0] = {
45 .hwport = 0,
46 .flags = 0,
47 .ucon = S5P6442_UCON_DEFAULT,
48 .ulcon = S5P6442_ULCON_DEFAULT,
49 .ufcon = S5P6442_UFCON_DEFAULT,
50 },
51 [1] = {
52 .hwport = 1,
53 .flags = 0,
54 .ucon = S5P6442_UCON_DEFAULT,
55 .ulcon = S5P6442_ULCON_DEFAULT,
56 .ufcon = S5P6442_UFCON_DEFAULT,
57 },
58 [2] = {
59 .hwport = 2,
60 .flags = 0,
61 .ucon = S5P6442_UCON_DEFAULT,
62 .ulcon = S5P6442_ULCON_DEFAULT,
63 .ufcon = S5P6442_UFCON_DEFAULT,
64 },
65};
66
67static struct platform_device *smdk6442_devices[] __initdata = {
68};
69
70static void __init smdk6442_map_io(void)
71{
72 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
73 s3c24xx_init_clocks(12000000);
74 s3c24xx_init_uarts(smdk6442_uartcfgs, ARRAY_SIZE(smdk6442_uartcfgs));
75}
76
77static void __init smdk6442_machine_init(void)
78{
79 platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices));
80}
81
82MACHINE_START(SMDK6442, "SMDK6442")
83 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
84 .phys_io = S3C_PA_UART & 0xfff00000,
85 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
86 .boot_params = S5P_PA_SDRAM + 0x100,
87 .init_irq = s5p6442_init_irq,
88 .map_io = smdk6442_map_io,
89 .init_machine = smdk6442_machine_init,
90 .timer = &s3c24xx_timer,
91MACHINE_END
diff --git a/arch/arm/mach-s5pc100/include/mach/gpio-core.h b/arch/arm/mach-s5pc100/include/mach/gpio-core.h
deleted file mode 100644
index ad28d8ec8a78..000000000000
--- a/arch/arm/mach-s5pc100/include/mach/gpio-core.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-s5pc100/include/mach/gpio-core.h
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * S5PC100 - GPIO core support
7 *
8 * Based on mach-s3c6400/include/mach/gpio-core.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_GPIO_CORE_H
16#define __ASM_ARCH_GPIO_CORE_H __FILE__
17
18/* currently we just include the platform support */
19#include <plat/gpio-core.h>
20
21#endif /* __ASM_ARCH_GPIO_CORE_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/io.h b/arch/arm/mach-s5pc100/include/mach/io.h
new file mode 100644
index 000000000000..819acf5eaf89
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/io.h
@@ -0,0 +1,18 @@
1/* arch/arm/mach-s5pc100/include/mach/io.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben-linux@fluff.org>
5 *
6 * Default IO routines for S5PC100 systems
7 */
8
9#ifndef __ASM_ARM_ARCH_IO_H
10#define __ASM_ARM_ARCH_IO_H
11
12/* No current ISA/PCI bus support. */
13#define __io(a) __typesafe_io(a)
14#define __mem_pci(a) (a)
15
16#define IO_SPACE_LIMIT (0xFFFFFFFF)
17
18#endif
diff --git a/arch/arm/mach-s5pc100/include/mach/tick.h b/arch/arm/mach-s5pc100/include/mach/tick.h
index d3de0f3591ae..f338c9eec717 100644
--- a/arch/arm/mach-s5pc100/include/mach/tick.h
+++ b/arch/arm/mach-s5pc100/include/mach/tick.h
@@ -21,7 +21,7 @@
21static inline u32 s3c24xx_ostimer_pending(void) 21static inline u32 s3c24xx_ostimer_pending(void)
22{ 22{
23 u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS); 23 u32 pend = __raw_readl(S3C_VA_VIC0 + VIC_RAW_STATUS);
24 return pend & 1 << (IRQ_TIMER4 - S5PC1XX_IRQ_VIC0(0)); 24 return pend & 1 << (IRQ_TIMER4_VIC - S5PC1XX_IRQ_VIC0(0));
25} 25}
26 26
27#define TICK_MAX (0xffffffff) 27#define TICK_MAX (0xffffffff)
diff --git a/arch/arm/mach-s5pc100/include/mach/timex.h b/arch/arm/mach-s5pc100/include/mach/timex.h
new file mode 100644
index 000000000000..47ffb17aff96
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/timex.h
@@ -0,0 +1,24 @@
1/* arch/arm/mach-s5pc100/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C6400 - time parameters
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_TIMEX_H
14#define __ASM_ARCH_TIMEX_H
15
16/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
17 * a variable is useless. It seems as long as we make our timers an
18 * exact multiple of HZ, any value that makes a 1->1 correspondence
19 * for the time conversion functions to/from jiffies is acceptable.
20*/
21
22#define CLOCK_TICK_RATE 12000000
23
24#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/vmalloc.h b/arch/arm/mach-s5pc100/include/mach/vmalloc.h
new file mode 100644
index 000000000000..be9df79903ed
--- /dev/null
+++ b/arch/arm/mach-s5pc100/include/mach/vmalloc.h
@@ -0,0 +1,17 @@
1/* arch/arm/mach-s5pc100/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * S3C6400 vmalloc definition
10*/
11
12#ifndef __ASM_ARCH_VMALLOC_H
13#define __ASM_ARCH_VMALLOC_H
14
15#define VMALLOC_END (0xe0000000UL)
16
17#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5pc100/setup-sdhci.c b/arch/arm/mach-s5pc100/setup-sdhci.c
index 4385986a3da0..ea7ff19adb95 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci.c
@@ -28,8 +28,8 @@
28char *s5pc100_hsmmc_clksrcs[4] = { 28char *s5pc100_hsmmc_clksrcs[4] = {
29 [0] = "hsmmc", 29 [0] = "hsmmc",
30 [1] = "hsmmc", 30 [1] = "hsmmc",
31 /* [2] = "mmc_bus", not yet succesfuuly used yet */ 31 /* [2] = "mmc_bus", not yet successfully used yet */
32 /* [3] = "48m", - note not succesfully used yet */ 32 /* [3] = "48m", - note not successfully used yet */
33}; 33};
34 34
35 35
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
new file mode 100644
index 000000000000..af33a1a89b72
--- /dev/null
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -0,0 +1,40 @@
1# arch/arm/mach-s5pv210/Kconfig
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8# Configuration options for the S5PV210/S5PC110
9
10if ARCH_S5PV210
11
12config CPU_S5PV210
13 bool
14 select PLAT_S5P
15 help
16 Enable S5PV210 CPU support
17
18choice
19 prompt "Select machine type"
20 depends on ARCH_S5PV210
21 default MACH_SMDKV210
22
23config MACH_SMDKV210
24 bool "SMDKV210"
25 select CPU_S5PV210
26 select ARCH_SPARSEMEM_ENABLE
27 help
28 Machine support for Samsung SMDKV210
29
30config MACH_SMDKC110
31 bool "SMDKC110"
32 select CPU_S5PV210
33 select ARCH_SPARSEMEM_ENABLE
34 help
35 Machine support for Samsung SMDKC110
36 S5PC110(MCP) is one of package option of S5PV210
37
38endchoice
39
40endif
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
new file mode 100644
index 000000000000..8ebf51c52a01
--- /dev/null
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -0,0 +1,20 @@
1# arch/arm/mach-s5pv210/Makefile
2#
3# Copyright (c) 2010 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n :=
11obj- :=
12
13# Core support for S5PV210 system
14
15obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o
16
17# machine support
18
19obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
20obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
diff --git a/arch/arm/mach-s5pv210/Makefile.boot b/arch/arm/mach-s5pv210/Makefile.boot
new file mode 100644
index 000000000000..ff90aa13bd67
--- /dev/null
+++ b/arch/arm/mach-s5pv210/Makefile.boot
@@ -0,0 +1,2 @@
1 zreladdr-y := 0x20008000
2params_phys-y := 0x20000100
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
new file mode 100644
index 000000000000..ccccae262351
--- /dev/null
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -0,0 +1,454 @@
1/* linux/arch/arm/mach-s5pv210/clock.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/clk.h>
20#include <linux/sysdev.h>
21#include <linux/io.h>
22
23#include <mach/map.h>
24
25#include <plat/cpu-freq.h>
26#include <mach/regs-clock.h>
27#include <plat/clock.h>
28#include <plat/cpu.h>
29#include <plat/pll.h>
30#include <plat/s5p-clock.h>
31#include <plat/clock-clksrc.h>
32#include <plat/s5pv210.h>
33
34static int s5pv210_clk_ip0_ctrl(struct clk *clk, int enable)
35{
36 return s5p_gatectrl(S5P_CLKGATE_IP0, clk, enable);
37}
38
39static int s5pv210_clk_ip1_ctrl(struct clk *clk, int enable)
40{
41 return s5p_gatectrl(S5P_CLKGATE_IP1, clk, enable);
42}
43
44static int s5pv210_clk_ip2_ctrl(struct clk *clk, int enable)
45{
46 return s5p_gatectrl(S5P_CLKGATE_IP2, clk, enable);
47}
48
49static int s5pv210_clk_ip3_ctrl(struct clk *clk, int enable)
50{
51 return s5p_gatectrl(S5P_CLKGATE_IP3, clk, enable);
52}
53
54static struct clk clk_h200 = {
55 .name = "hclk200",
56 .id = -1,
57};
58
59static struct clk clk_h100 = {
60 .name = "hclk100",
61 .id = -1,
62};
63
64static struct clk clk_h166 = {
65 .name = "hclk166",
66 .id = -1,
67};
68
69static struct clk clk_h133 = {
70 .name = "hclk133",
71 .id = -1,
72};
73
74static struct clk clk_p100 = {
75 .name = "pclk100",
76 .id = -1,
77};
78
79static struct clk clk_p83 = {
80 .name = "pclk83",
81 .id = -1,
82};
83
84static struct clk clk_p66 = {
85 .name = "pclk66",
86 .id = -1,
87};
88
89static struct clk *sys_clks[] = {
90 &clk_h200,
91 &clk_h100,
92 &clk_h166,
93 &clk_h133,
94 &clk_p100,
95 &clk_p83,
96 &clk_p66
97};
98
99static struct clk init_clocks_disable[] = {
100 {
101 .name = "rot",
102 .id = -1,
103 .parent = &clk_h166,
104 .enable = s5pv210_clk_ip0_ctrl,
105 .ctrlbit = (1<<29),
106 }, {
107 .name = "otg",
108 .id = -1,
109 .parent = &clk_h133,
110 .enable = s5pv210_clk_ip1_ctrl,
111 .ctrlbit = (1<<16),
112 }, {
113 .name = "usb-host",
114 .id = -1,
115 .parent = &clk_h133,
116 .enable = s5pv210_clk_ip1_ctrl,
117 .ctrlbit = (1<<17),
118 }, {
119 .name = "lcd",
120 .id = -1,
121 .parent = &clk_h166,
122 .enable = s5pv210_clk_ip1_ctrl,
123 .ctrlbit = (1<<0),
124 }, {
125 .name = "cfcon",
126 .id = 0,
127 .parent = &clk_h133,
128 .enable = s5pv210_clk_ip1_ctrl,
129 .ctrlbit = (1<<25),
130 }, {
131 .name = "hsmmc",
132 .id = 0,
133 .parent = &clk_h133,
134 .enable = s5pv210_clk_ip2_ctrl,
135 .ctrlbit = (1<<16),
136 }, {
137 .name = "hsmmc",
138 .id = 1,
139 .parent = &clk_h133,
140 .enable = s5pv210_clk_ip2_ctrl,
141 .ctrlbit = (1<<17),
142 }, {
143 .name = "hsmmc",
144 .id = 2,
145 .parent = &clk_h133,
146 .enable = s5pv210_clk_ip2_ctrl,
147 .ctrlbit = (1<<18),
148 }, {
149 .name = "hsmmc",
150 .id = 3,
151 .parent = &clk_h133,
152 .enable = s5pv210_clk_ip2_ctrl,
153 .ctrlbit = (1<<19),
154 }, {
155 .name = "systimer",
156 .id = -1,
157 .parent = &clk_p66,
158 .enable = s5pv210_clk_ip3_ctrl,
159 .ctrlbit = (1<<16),
160 }, {
161 .name = "watchdog",
162 .id = -1,
163 .parent = &clk_p66,
164 .enable = s5pv210_clk_ip3_ctrl,
165 .ctrlbit = (1<<22),
166 }, {
167 .name = "rtc",
168 .id = -1,
169 .parent = &clk_p66,
170 .enable = s5pv210_clk_ip3_ctrl,
171 .ctrlbit = (1<<15),
172 }, {
173 .name = "i2c",
174 .id = 0,
175 .parent = &clk_p66,
176 .enable = s5pv210_clk_ip3_ctrl,
177 .ctrlbit = (1<<7),
178 }, {
179 .name = "i2c",
180 .id = 1,
181 .parent = &clk_p66,
182 .enable = s5pv210_clk_ip3_ctrl,
183 .ctrlbit = (1<<8),
184 }, {
185 .name = "i2c",
186 .id = 2,
187 .parent = &clk_p66,
188 .enable = s5pv210_clk_ip3_ctrl,
189 .ctrlbit = (1<<9),
190 }, {
191 .name = "spi",
192 .id = 0,
193 .parent = &clk_p66,
194 .enable = s5pv210_clk_ip3_ctrl,
195 .ctrlbit = (1<<12),
196 }, {
197 .name = "spi",
198 .id = 1,
199 .parent = &clk_p66,
200 .enable = s5pv210_clk_ip3_ctrl,
201 .ctrlbit = (1<<13),
202 }, {
203 .name = "spi",
204 .id = 2,
205 .parent = &clk_p66,
206 .enable = s5pv210_clk_ip3_ctrl,
207 .ctrlbit = (1<<14),
208 }, {
209 .name = "timers",
210 .id = -1,
211 .parent = &clk_p66,
212 .enable = s5pv210_clk_ip3_ctrl,
213 .ctrlbit = (1<<23),
214 }, {
215 .name = "adc",
216 .id = -1,
217 .parent = &clk_p66,
218 .enable = s5pv210_clk_ip3_ctrl,
219 .ctrlbit = (1<<24),
220 }, {
221 .name = "keypad",
222 .id = -1,
223 .parent = &clk_p66,
224 .enable = s5pv210_clk_ip3_ctrl,
225 .ctrlbit = (1<<21),
226 }, {
227 .name = "i2s_v50",
228 .id = 0,
229 .parent = &clk_p,
230 .enable = s5pv210_clk_ip3_ctrl,
231 .ctrlbit = (1<<4),
232 }, {
233 .name = "i2s_v32",
234 .id = 0,
235 .parent = &clk_p,
236 .enable = s5pv210_clk_ip3_ctrl,
237 .ctrlbit = (1<<4),
238 }, {
239 .name = "i2s_v32",
240 .id = 1,
241 .parent = &clk_p,
242 .enable = s5pv210_clk_ip3_ctrl,
243 .ctrlbit = (1<<4),
244 }
245};
246
247static struct clk init_clocks[] = {
248 {
249 .name = "uart",
250 .id = 0,
251 .parent = &clk_p66,
252 .enable = s5pv210_clk_ip3_ctrl,
253 .ctrlbit = (1<<7),
254 }, {
255 .name = "uart",
256 .id = 1,
257 .parent = &clk_p66,
258 .enable = s5pv210_clk_ip3_ctrl,
259 .ctrlbit = (1<<8),
260 }, {
261 .name = "uart",
262 .id = 2,
263 .parent = &clk_p66,
264 .enable = s5pv210_clk_ip3_ctrl,
265 .ctrlbit = (1<<9),
266 }, {
267 .name = "uart",
268 .id = 3,
269 .parent = &clk_p66,
270 .enable = s5pv210_clk_ip3_ctrl,
271 .ctrlbit = (1<<10),
272 },
273};
274
275static struct clksrc_clk clk_mout_apll = {
276 .clk = {
277 .name = "mout_apll",
278 .id = -1,
279 },
280 .sources = &clk_src_apll,
281 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 0, .size = 1 },
282};
283
284static struct clksrc_clk clk_mout_epll = {
285 .clk = {
286 .name = "mout_epll",
287 .id = -1,
288 },
289 .sources = &clk_src_epll,
290 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 8, .size = 1 },
291};
292
293static struct clksrc_clk clk_mout_mpll = {
294 .clk = {
295 .name = "mout_mpll",
296 .id = -1,
297 },
298 .sources = &clk_src_mpll,
299 .reg_src = { .reg = S5P_CLK_SRC0, .shift = 4, .size = 1 },
300};
301
302static struct clk *clkset_uart_list[] = {
303 [6] = &clk_mout_mpll.clk,
304 [7] = &clk_mout_epll.clk,
305};
306
307static struct clksrc_sources clkset_uart = {
308 .sources = clkset_uart_list,
309 .nr_sources = ARRAY_SIZE(clkset_uart_list),
310};
311
312static struct clksrc_clk clksrcs[] = {
313 {
314 .clk = {
315 .name = "uclk1",
316 .id = -1,
317 .ctrlbit = (1<<17),
318 .enable = s5pv210_clk_ip3_ctrl,
319 },
320 .sources = &clkset_uart,
321 .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 },
322 .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 },
323 }
324};
325
326/* Clock initialisation code */
327static struct clksrc_clk *init_parents[] = {
328 &clk_mout_apll,
329 &clk_mout_epll,
330 &clk_mout_mpll,
331};
332
333#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
334
335void __init_or_cpufreq s5pv210_setup_clocks(void)
336{
337 struct clk *xtal_clk;
338 unsigned long xtal;
339 unsigned long armclk;
340 unsigned long hclk200;
341 unsigned long hclk166;
342 unsigned long hclk133;
343 unsigned long pclk100;
344 unsigned long pclk83;
345 unsigned long pclk66;
346 unsigned long apll;
347 unsigned long mpll;
348 unsigned long epll;
349 unsigned int ptr;
350 u32 clkdiv0, clkdiv1;
351
352 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
353
354 clkdiv0 = __raw_readl(S5P_CLK_DIV0);
355 clkdiv1 = __raw_readl(S5P_CLK_DIV1);
356
357 printk(KERN_DEBUG "%s: clkdiv0 = %08x, clkdiv1 = %08x\n",
358 __func__, clkdiv0, clkdiv1);
359
360 xtal_clk = clk_get(NULL, "xtal");
361 BUG_ON(IS_ERR(xtal_clk));
362
363 xtal = clk_get_rate(xtal_clk);
364 clk_put(xtal_clk);
365
366 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
367
368 apll = s5p_get_pll45xx(xtal, __raw_readl(S5P_APLL_CON), pll_4508);
369 mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
370 epll = s5p_get_pll45xx(xtal, __raw_readl(S5P_EPLL_CON), pll_4500);
371
372 printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld",
373 apll, mpll, epll);
374
375 armclk = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_APLL);
376 if (__raw_readl(S5P_CLK_SRC0) & S5P_CLKSRC0_MUX200_MASK)
377 hclk200 = mpll / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK200);
378 else
379 hclk200 = armclk / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK200);
380
381 if (__raw_readl(S5P_CLK_SRC0) & S5P_CLKSRC0_MUX166_MASK) {
382 hclk166 = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_A2M);
383 hclk166 = hclk166 / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK166);
384 } else
385 hclk166 = mpll / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK166);
386
387 if (__raw_readl(S5P_CLK_SRC0) & S5P_CLKSRC0_MUX133_MASK) {
388 hclk133 = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_A2M);
389 hclk133 = hclk133 / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK133);
390 } else
391 hclk133 = mpll / GET_DIV(clkdiv0, S5P_CLKDIV0_HCLK133);
392
393 pclk100 = hclk200 / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK100);
394 pclk83 = hclk166 / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK83);
395 pclk66 = hclk133 / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66);
396
397 printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld, \
398 HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n",
399 armclk, hclk200, hclk166, hclk133, pclk100, pclk83, pclk66);
400
401 clk_fout_apll.rate = apll;
402 clk_fout_mpll.rate = mpll;
403 clk_fout_epll.rate = epll;
404
405 clk_f.rate = armclk;
406 clk_h.rate = hclk133;
407 clk_p.rate = pclk66;
408 clk_p66.rate = pclk66;
409 clk_p83.rate = pclk83;
410 clk_h133.rate = hclk133;
411 clk_h166.rate = hclk166;
412 clk_h200.rate = hclk200;
413
414 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
415 s3c_set_clksrc(init_parents[ptr], true);
416
417 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
418 s3c_set_clksrc(&clksrcs[ptr], true);
419}
420
421static struct clk *clks[] __initdata = {
422 &clk_mout_epll.clk,
423 &clk_mout_mpll.clk,
424};
425
426void __init s5pv210_register_clocks(void)
427{
428 struct clk *clkp;
429 int ret;
430 int ptr;
431
432 ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
433 if (ret > 0)
434 printk(KERN_ERR "Failed to register %u clocks\n", ret);
435
436 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
437 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks));
438
439 ret = s3c24xx_register_clocks(sys_clks, ARRAY_SIZE(sys_clks));
440 if (ret > 0)
441 printk(KERN_ERR "Failed to register system clocks\n");
442
443 clkp = init_clocks_disable;
444 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
445 ret = s3c24xx_register_clock(clkp);
446 if (ret < 0) {
447 printk(KERN_ERR "Failed to register clock %s (%d)\n",
448 clkp->name, ret);
449 }
450 (clkp->enable)(clkp, 0);
451 }
452
453 s3c_pwmclk_init();
454}
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
new file mode 100644
index 000000000000..0e0f8fde2aa6
--- /dev/null
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -0,0 +1,126 @@
1/* linux/arch/arm/mach-s5pv210/cpu.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/clk.h>
19#include <linux/io.h>
20#include <linux/sysdev.h>
21#include <linux/platform_device.h>
22
23#include <asm/mach/arch.h>
24#include <asm/mach/map.h>
25#include <asm/mach/irq.h>
26
27#include <asm/proc-fns.h>
28#include <mach/map.h>
29#include <mach/regs-clock.h>
30
31#include <plat/cpu.h>
32#include <plat/devs.h>
33#include <plat/clock.h>
34#include <plat/s5pv210.h>
35
36/* Initial IO mappings */
37
38static struct map_desc s5pv210_iodesc[] __initdata = {
39 {
40 .virtual = (unsigned long)S5P_VA_SYSTIMER,
41 .pfn = __phys_to_pfn(S5PV210_PA_SYSTIMER),
42 .length = SZ_1M,
43 .type = MT_DEVICE,
44 }, {
45 .virtual = (unsigned long)VA_VIC2,
46 .pfn = __phys_to_pfn(S5PV210_PA_VIC2),
47 .length = SZ_16K,
48 .type = MT_DEVICE,
49 }, {
50 .virtual = (unsigned long)VA_VIC3,
51 .pfn = __phys_to_pfn(S5PV210_PA_VIC3),
52 .length = SZ_16K,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = (unsigned long)S5P_VA_SROMC,
56 .pfn = __phys_to_pfn(S5PV210_PA_SROMC),
57 .length = SZ_4K,
58 .type = MT_DEVICE,
59 }
60};
61
62static void s5pv210_idle(void)
63{
64 if (!need_resched())
65 cpu_do_idle();
66
67 local_irq_enable();
68}
69
70/* s5pv210_map_io
71 *
72 * register the standard cpu IO areas
73*/
74
75void __init s5pv210_map_io(void)
76{
77 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
78}
79
80void __init s5pv210_init_clocks(int xtal)
81{
82 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
83
84 s3c24xx_register_baseclocks(xtal);
85 s5p_register_clocks(xtal);
86 s5pv210_register_clocks();
87 s5pv210_setup_clocks();
88}
89
90void __init s5pv210_init_irq(void)
91{
92 u32 vic[4]; /* S5PV210 supports 4 VIC */
93
94 /* All the VICs are fully populated. */
95 vic[0] = ~0;
96 vic[1] = ~0;
97 vic[2] = ~0;
98 vic[3] = ~0;
99
100 s5p_init_irq(vic, ARRAY_SIZE(vic));
101}
102
103static struct sysdev_class s5pv210_sysclass = {
104 .name = "s5pv210-core",
105};
106
107static struct sys_device s5pv210_sysdev = {
108 .cls = &s5pv210_sysclass,
109};
110
111static int __init s5pv210_core_init(void)
112{
113 return sysdev_class_register(&s5pv210_sysclass);
114}
115
116core_initcall(s5pv210_core_init);
117
118int __init s5pv210_init(void)
119{
120 printk(KERN_INFO "S5PV210: Initializing architecture\n");
121
122 /* set idle function */
123 pm_idle = s5pv210_idle;
124
125 return sysdev_register(&s5pv210_sysdev);
126}
diff --git a/arch/arm/mach-s5pv210/include/mach/debug-macro.S b/arch/arm/mach-s5pv210/include/mach/debug-macro.S
new file mode 100644
index 000000000000..7872f5c3dfc2
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/debug-macro.S
@@ -0,0 +1,42 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/debug-macro.S
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/debug-macro.S
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* pull in the relevant register and map files. */
14
15#include <mach/map.h>
16#include <plat/regs-serial.h>
17
18 /* note, for the boot process to work we have to keep the UART
19 * virtual address aligned to an 1MiB boundary for the L1
20 * mapping the head code makes. We keep the UART virtual address
21 * aligned and add in the offset when we load the value here.
22 */
23
24 .macro addruart, rx, tmp
25 mrc p15, 0, \rx, c1, c0
26 tst \rx, #1
27 ldreq \rx, = S3C_PA_UART
28 ldrne \rx, = S3C_VA_UART
29#if CONFIG_DEBUG_S3C_UART != 0
30 add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
31#endif
32 .endm
33
34#define fifo_full fifo_full_s5pv210
35#define fifo_level fifo_level_s5pv210
36
37/* include the reset of the code which will do the work, we're only
38 * compiling for a single cpu processor type so the default of s3c2440
39 * will be fine with us.
40 */
41
42#include <plat/debug-macro.S>
diff --git a/arch/arm/mach-s5pv210/include/mach/entry-macro.S b/arch/arm/mach-s5pv210/include/mach/entry-macro.S
new file mode 100644
index 000000000000..3aa41ac59f07
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/entry-macro.S
@@ -0,0 +1,54 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/entry-macro.S
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Low-level IRQ helper macros for the Samsung S5PV210
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <asm/hardware/vic.h>
14#include <mach/map.h>
15#include <plat/irqs.h>
16
17 .macro disable_fiq
18 .endm
19
20 .macro get_irqnr_preamble, base, tmp
21 ldr \base, =VA_VIC0
22 .endm
23
24 .macro arch_ret_to_user, tmp1, tmp2
25 .endm
26
27 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
28
29 @ check the vic0
30 mov \irqnr, # S5P_IRQ_OFFSET + 31
31 ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
32 teq \irqstat, #0
33
34 @ otherwise try vic1
35 addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
36 addeq \irqnr, \irqnr, #32
37 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
38 teqeq \irqstat, #0
39
40 @ otherwise try vic2
41 addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
42 addeq \irqnr, \irqnr, #32
43 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
44 teqeq \irqstat, #0
45
46 @ otherwise try vic3
47 addeq \tmp, \base, #(VA_VIC3 - VA_VIC0)
48 addeq \irqnr, \irqnr, #32
49 ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
50 teqeq \irqstat, #0
51
52 clzne \irqstat, \irqstat
53 subne \irqnr, \irqnr, \irqstat
54 .endm
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h
new file mode 100644
index 000000000000..533b020e21e9
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -0,0 +1,129 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/gpio.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - GPIO lib support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_GPIO_H
14#define __ASM_ARCH_GPIO_H __FILE__
15
16#define gpio_get_value __gpio_get_value
17#define gpio_set_value __gpio_set_value
18#define gpio_cansleep __gpio_cansleep
19#define gpio_to_irq __gpio_to_irq
20
21/* GPIO bank sizes */
22#define S5PV210_GPIO_A0_NR (8)
23#define S5PV210_GPIO_A1_NR (4)
24#define S5PV210_GPIO_B_NR (8)
25#define S5PV210_GPIO_C0_NR (5)
26#define S5PV210_GPIO_C1_NR (5)
27#define S5PV210_GPIO_D0_NR (4)
28#define S5PV210_GPIO_D1_NR (6)
29#define S5PV210_GPIO_E0_NR (8)
30#define S5PV210_GPIO_E1_NR (5)
31#define S5PV210_GPIO_F0_NR (8)
32#define S5PV210_GPIO_F1_NR (8)
33#define S5PV210_GPIO_F2_NR (8)
34#define S5PV210_GPIO_F3_NR (6)
35#define S5PV210_GPIO_G0_NR (7)
36#define S5PV210_GPIO_G1_NR (7)
37#define S5PV210_GPIO_G2_NR (7)
38#define S5PV210_GPIO_G3_NR (7)
39#define S5PV210_GPIO_H0_NR (8)
40#define S5PV210_GPIO_H1_NR (8)
41#define S5PV210_GPIO_H2_NR (8)
42#define S5PV210_GPIO_H3_NR (8)
43#define S5PV210_GPIO_I_NR (7)
44#define S5PV210_GPIO_J0_NR (8)
45#define S5PV210_GPIO_J1_NR (6)
46#define S5PV210_GPIO_J2_NR (8)
47#define S5PV210_GPIO_J3_NR (8)
48#define S5PV210_GPIO_J4_NR (5)
49
50/* GPIO bank numbers */
51
52/* CONFIG_S3C_GPIO_SPACE allows the user to select extra
53 * space for debugging purposes so that any accidental
54 * change from one gpio bank to another can be caught.
55*/
56
57#define S5PV210_GPIO_NEXT(__gpio) \
58 ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1)
59
60enum s5p_gpio_number {
61 S5PV210_GPIO_A0_START = 0,
62 S5PV210_GPIO_A1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_A0),
63 S5PV210_GPIO_B_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_A1),
64 S5PV210_GPIO_C0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_B),
65 S5PV210_GPIO_C1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_C0),
66 S5PV210_GPIO_D0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_C1),
67 S5PV210_GPIO_D1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_D0),
68 S5PV210_GPIO_E0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_D1),
69 S5PV210_GPIO_E1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_E0),
70 S5PV210_GPIO_F0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_E1),
71 S5PV210_GPIO_F1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_F0),
72 S5PV210_GPIO_F2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_F1),
73 S5PV210_GPIO_F3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_F2),
74 S5PV210_GPIO_G0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_F3),
75 S5PV210_GPIO_G1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_G0),
76 S5PV210_GPIO_G2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_G1),
77 S5PV210_GPIO_G3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_G2),
78 S5PV210_GPIO_H0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_G3),
79 S5PV210_GPIO_H1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_H0),
80 S5PV210_GPIO_H2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_H1),
81 S5PV210_GPIO_H3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_H2),
82 S5PV210_GPIO_I_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_H3),
83 S5PV210_GPIO_J0_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_I),
84 S5PV210_GPIO_J1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J0),
85 S5PV210_GPIO_J2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J1),
86 S5PV210_GPIO_J3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J2),
87 S5PV210_GPIO_J4_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J3),
88};
89
90/* S5PV210 GPIO number definitions */
91#define S5PV210_GPA0(_nr) (S5PV210_GPIO_A0_START + (_nr))
92#define S5PV210_GPA1(_nr) (S5PV210_GPIO_A1_START + (_nr))
93#define S5PV210_GPB(_nr) (S5PV210_GPIO_B_START + (_nr))
94#define S5PV210_GPC0(_nr) (S5PV210_GPIO_C0_START + (_nr))
95#define S5PV210_GPC1(_nr) (S5PV210_GPIO_C1_START + (_nr))
96#define S5PV210_GPD0(_nr) (S5PV210_GPIO_D0_START + (_nr))
97#define S5PV210_GPD1(_nr) (S5PV210_GPIO_D1_START + (_nr))
98#define S5PV210_GPE0(_nr) (S5PV210_GPIO_E0_START + (_nr))
99#define S5PV210_GPE1(_nr) (S5PV210_GPIO_E1_START + (_nr))
100#define S5PV210_GPF0(_nr) (S5PV210_GPIO_F0_START + (_nr))
101#define S5PV210_GPF1(_nr) (S5PV210_GPIO_F1_START + (_nr))
102#define S5PV210_GPF2(_nr) (S5PV210_GPIO_F2_START + (_nr))
103#define S5PV210_GPF3(_nr) (S5PV210_GPIO_F3_START + (_nr))
104#define S5PV210_GPG0(_nr) (S5PV210_GPIO_G0_START + (_nr))
105#define S5PV210_GPG1(_nr) (S5PV210_GPIO_G1_START + (_nr))
106#define S5PV210_GPG2(_nr) (S5PV210_GPIO_G2_START + (_nr))
107#define S5PV210_GPG3(_nr) (S5PV210_GPIO_G3_START + (_nr))
108#define S5PV210_GPH0(_nr) (S5PV210_GPIO_H0_START + (_nr))
109#define S5PV210_GPH1(_nr) (S5PV210_GPIO_H1_START + (_nr))
110#define S5PV210_GPH2(_nr) (S5PV210_GPIO_H2_START + (_nr))
111#define S5PV210_GPH3(_nr) (S5PV210_GPIO_H3_START + (_nr))
112#define S5PV210_GPI(_nr) (S5PV210_GPIO_I_START + (_nr))
113#define S5PV210_GPJ0(_nr) (S5PV210_GPIO_J0_START + (_nr))
114#define S5PV210_GPJ1(_nr) (S5PV210_GPIO_J1_START + (_nr))
115#define S5PV210_GPJ2(_nr) (S5PV210_GPIO_J2_START + (_nr))
116#define S5PV210_GPJ3(_nr) (S5PV210_GPIO_J3_START + (_nr))
117#define S5PV210_GPJ4(_nr) (S5PV210_GPIO_J4_START + (_nr))
118
119/* the end of the S5PV210 specific gpios */
120#define S5PV210_GPIO_END (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + 1)
121#define S3C_GPIO_END S5PV210_GPIO_END
122
123/* define the number of gpios we need to the one after the GPJ4() range */
124#define ARCH_NR_GPIOS (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + \
125 CONFIG_SAMSUNG_GPIO_EXTRA + 1)
126
127#include <asm-generic/gpio.h>
128
129#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/hardware.h b/arch/arm/mach-s5pv210/include/mach/hardware.h
new file mode 100644
index 000000000000..fada7a392d09
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/hardware.h
@@ -0,0 +1,18 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/hardware.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Hardware support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_HARDWARE_H
14#define __ASM_ARCH_HARDWARE_H __FILE__
15
16/* currently nothing here, placeholder */
17
18#endif /* __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/io.h b/arch/arm/mach-s5pv210/include/mach/io.h
new file mode 100644
index 000000000000..5ab9d560bc86
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/io.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/io.h
2 *
3 * Copyright 2008-2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 *
8 * Based on arch/arm/mach-s5p6442/include/mach/io.h
9 *
10 * Default IO routines for S5PV210
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17#ifndef __ASM_ARM_ARCH_IO_H
18#define __ASM_ARM_ARCH_IO_H __FILE__
19
20/* No current ISA/PCI bus support. */
21#define __io(a) __typesafe_io(a)
22#define __mem_pci(a) (a)
23
24#define IO_SPACE_LIMIT (0xFFFFFFFF)
25
26#endif /* __ASM_ARM_ARCH_IO_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h
new file mode 100644
index 000000000000..62c5175ef291
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -0,0 +1,146 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/irqs.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - IRQ definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_IRQS_H
14#define __ASM_ARCH_IRQS_H __FILE__
15
16#include <plat/irqs.h>
17
18/* VIC0: System, DMA, Timer */
19
20#define IRQ_EINT0 S5P_IRQ_VIC0(0)
21#define IRQ_EINT1 S5P_IRQ_VIC0(1)
22#define IRQ_EINT2 S5P_IRQ_VIC0(2)
23#define IRQ_EINT3 S5P_IRQ_VIC0(3)
24#define IRQ_EINT4 S5P_IRQ_VIC0(4)
25#define IRQ_EINT5 S5P_IRQ_VIC0(5)
26#define IRQ_EINT6 S5P_IRQ_VIC0(6)
27#define IRQ_EINT7 S5P_IRQ_VIC0(7)
28#define IRQ_EINT8 S5P_IRQ_VIC0(8)
29#define IRQ_EINT9 S5P_IRQ_VIC0(9)
30#define IRQ_EINT10 S5P_IRQ_VIC0(10)
31#define IRQ_EINT11 S5P_IRQ_VIC0(11)
32#define IRQ_EINT12 S5P_IRQ_VIC0(12)
33#define IRQ_EINT13 S5P_IRQ_VIC0(13)
34#define IRQ_EINT14 S5P_IRQ_VIC0(14)
35#define IRQ_EINT15 S5P_IRQ_VIC0(15)
36#define IRQ_EINT16_31 S5P_IRQ_VIC0(16)
37#define IRQ_BATF S5P_IRQ_VIC0(17)
38#define IRQ_MDMA S5P_IRQ_VIC0(18)
39#define IRQ_PDMA0 S5P_IRQ_VIC0(19)
40#define IRQ_PDMA1 S5P_IRQ_VIC0(20)
41#define IRQ_TIMER0_VIC S5P_IRQ_VIC0(21)
42#define IRQ_TIMER1_VIC S5P_IRQ_VIC0(22)
43#define IRQ_TIMER2_VIC S5P_IRQ_VIC0(23)
44#define IRQ_TIMER3_VIC S5P_IRQ_VIC0(24)
45#define IRQ_TIMER4_VIC S5P_IRQ_VIC0(25)
46#define IRQ_SYSTIMER S5P_IRQ_VIC0(26)
47#define IRQ_WDT S5P_IRQ_VIC0(27)
48#define IRQ_RTC_ALARM S5P_IRQ_VIC0(28)
49#define IRQ_RTC_TIC S5P_IRQ_VIC0(29)
50#define IRQ_GPIOINT S5P_IRQ_VIC0(30)
51#define IRQ_FIMC3 S5P_IRQ_VIC0(31)
52
53/* VIC1: ARM, Power, Memory, Connectivity, Storage */
54
55#define IRQ_CORTEX0 S5P_IRQ_VIC1(0)
56#define IRQ_CORTEX1 S5P_IRQ_VIC1(1)
57#define IRQ_CORTEX2 S5P_IRQ_VIC1(2)
58#define IRQ_CORTEX3 S5P_IRQ_VIC1(3)
59#define IRQ_CORTEX4 S5P_IRQ_VIC1(4)
60#define IRQ_IEMAPC S5P_IRQ_VIC1(5)
61#define IRQ_IEMIEC S5P_IRQ_VIC1(6)
62#define IRQ_ONENAND S5P_IRQ_VIC1(7)
63#define IRQ_NFC S5P_IRQ_VIC1(8)
64#define IRQ_CFC S5P_IRQ_VIC1(9)
65#define IRQ_UART0 S5P_IRQ_VIC1(10)
66#define IRQ_UART1 S5P_IRQ_VIC1(11)
67#define IRQ_UART2 S5P_IRQ_VIC1(12)
68#define IRQ_UART3 S5P_IRQ_VIC1(13)
69#define IRQ_IIC S5P_IRQ_VIC1(14)
70#define IRQ_SPI0 S5P_IRQ_VIC1(15)
71#define IRQ_SPI1 S5P_IRQ_VIC1(16)
72#define IRQ_SPI2 S5P_IRQ_VIC1(17)
73#define IRQ_IRDA S5P_IRQ_VIC1(18)
74#define IRQ_CAN0 S5P_IRQ_VIC1(19)
75#define IRQ_CAN1 S5P_IRQ_VIC1(20)
76#define IRQ_HSIRX S5P_IRQ_VIC1(21)
77#define IRQ_HSITX S5P_IRQ_VIC1(22)
78#define IRQ_UHOST S5P_IRQ_VIC1(23)
79#define IRQ_OTG S5P_IRQ_VIC1(24)
80#define IRQ_MSM S5P_IRQ_VIC1(25)
81#define IRQ_HSMMC0 S5P_IRQ_VIC1(26)
82#define IRQ_HSMMC1 S5P_IRQ_VIC1(27)
83#define IRQ_HSMMC2 S5P_IRQ_VIC1(28)
84#define IRQ_MIPICSI S5P_IRQ_VIC1(29)
85#define IRQ_MIPIDSI S5P_IRQ_VIC1(30)
86#define IRQ_ONENAND_AUDI S5P_IRQ_VIC1(31)
87
88/* VIC2: Multimedia, Audio, Security */
89
90#define IRQ_LCD0 S5P_IRQ_VIC2(0)
91#define IRQ_LCD1 S5P_IRQ_VIC2(1)
92#define IRQ_LCD2 S5P_IRQ_VIC2(2)
93#define IRQ_LCD3 S5P_IRQ_VIC2(3)
94#define IRQ_ROTATOR S5P_IRQ_VIC2(4)
95#define IRQ_FIMC0 S5P_IRQ_VIC2(5)
96#define IRQ_FIMC1 S5P_IRQ_VIC2(6)
97#define IRQ_FIMC2 S5P_IRQ_VIC2(7)
98#define IRQ_JPEG S5P_IRQ_VIC2(8)
99#define IRQ_2D S5P_IRQ_VIC2(9)
100#define IRQ_3D S5P_IRQ_VIC2(10)
101#define IRQ_MIXER S5P_IRQ_VIC2(11)
102#define IRQ_HDMI S5P_IRQ_VIC2(12)
103#define IRQ_IIC1 S5P_IRQ_VIC2(13)
104#define IRQ_MFC S5P_IRQ_VIC2(14)
105#define IRQ_TVENC S5P_IRQ_VIC2(15)
106#define IRQ_I2S0 S5P_IRQ_VIC2(16)
107#define IRQ_I2S1 S5P_IRQ_VIC2(17)
108#define IRQ_I2S2 S5P_IRQ_VIC2(18)
109#define IRQ_AC97 S5P_IRQ_VIC2(19)
110#define IRQ_PCM0 S5P_IRQ_VIC2(20)
111#define IRQ_PCM1 S5P_IRQ_VIC2(21)
112#define IRQ_SPDIF S5P_IRQ_VIC2(22)
113#define IRQ_ADC S5P_IRQ_VIC2(23)
114#define IRQ_PENDN S5P_IRQ_VIC2(24)
115#define IRQ_TC IRQ_PENDN
116#define IRQ_KEYPAD S5P_IRQ_VIC2(25)
117#define IRQ_CG S5P_IRQ_VIC2(26)
118#define IRQ_SEC S5P_IRQ_VIC2(27)
119#define IRQ_SECRX S5P_IRQ_VIC2(28)
120#define IRQ_SECTX S5P_IRQ_VIC2(29)
121#define IRQ_SDMIRQ S5P_IRQ_VIC2(30)
122#define IRQ_SDMFIQ S5P_IRQ_VIC2(31)
123
124/* VIC3: Etc */
125
126#define IRQ_IPC S5P_IRQ_VIC3(0)
127#define IRQ_HOSTIF S5P_IRQ_VIC3(1)
128#define IRQ_MMC3 S5P_IRQ_VIC3(2)
129#define IRQ_CEC S5P_IRQ_VIC3(3)
130#define IRQ_TSI S5P_IRQ_VIC3(4)
131#define IRQ_MDNIE0 S5P_IRQ_VIC3(5)
132#define IRQ_MDNIE1 S5P_IRQ_VIC3(6)
133#define IRQ_MDNIE2 S5P_IRQ_VIC3(7)
134#define IRQ_MDNIE3 S5P_IRQ_VIC3(8)
135#define IRQ_VIC_END S5P_IRQ_VIC3(31)
136
137#define S5P_IRQ_EINT_BASE (IRQ_VIC_END + 1)
138
139#define S5P_EINT(x) ((x) + S5P_IRQ_EINT_BASE)
140#define IRQ_EINT(x) S5P_EINT(x)
141
142/* Set the default NR_IRQS */
143
144#define NR_IRQS (IRQ_EINT(31) + 1)
145
146#endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
new file mode 100644
index 000000000000..c22694c8231f
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -0,0 +1,65 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/map.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MAP_H
14#define __ASM_ARCH_MAP_H __FILE__
15
16#include <plat/map-base.h>
17#include <plat/map-s5p.h>
18
19#define S5PV210_PA_CHIPID (0xE0000000)
20#define S5P_PA_CHIPID S5PV210_PA_CHIPID
21
22#define S5PV210_PA_SYSCON (0xE0100000)
23#define S5P_PA_SYSCON S5PV210_PA_SYSCON
24
25#define S5PV210_PA_GPIO (0xE0200000)
26#define S5P_PA_GPIO S5PV210_PA_GPIO
27
28#define S5PV210_PA_IIC0 (0xE1800000)
29
30#define S5PV210_PA_TIMER (0xE2500000)
31#define S5P_PA_TIMER S5PV210_PA_TIMER
32
33#define S5PV210_PA_SYSTIMER (0xE2600000)
34
35#define S5PV210_PA_UART (0xE2900000)
36
37#define S5P_PA_UART0 (S5PV210_PA_UART + 0x0)
38#define S5P_PA_UART1 (S5PV210_PA_UART + 0x400)
39#define S5P_PA_UART2 (S5PV210_PA_UART + 0x800)
40#define S5P_PA_UART3 (S5PV210_PA_UART + 0xC00)
41
42#define S5P_SZ_UART SZ_256
43
44#define S5PV210_PA_SROMC (0xE8000000)
45
46#define S5PV210_PA_VIC0 (0xF2000000)
47#define S5P_PA_VIC0 S5PV210_PA_VIC0
48
49#define S5PV210_PA_VIC1 (0xF2100000)
50#define S5P_PA_VIC1 S5PV210_PA_VIC1
51
52#define S5PV210_PA_VIC2 (0xF2200000)
53#define S5P_PA_VIC2 S5PV210_PA_VIC2
54
55#define S5PV210_PA_VIC3 (0xF2300000)
56#define S5P_PA_VIC3 S5PV210_PA_VIC3
57
58#define S5PV210_PA_SDRAM (0x20000000)
59#define S5P_PA_SDRAM S5PV210_PA_SDRAM
60
61/* compatibiltiy defines. */
62#define S3C_PA_UART S5PV210_PA_UART
63#define S3C_PA_IIC S5PV210_PA_IIC0
64
65#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/memory.h b/arch/arm/mach-s5pv210/include/mach/memory.h
new file mode 100644
index 000000000000..379117e27600
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/memory.h
@@ -0,0 +1,23 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/memory.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Memory definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_MEMORY_H
14#define __ASM_ARCH_MEMORY_H
15
16#define PHYS_OFFSET UL(0x20000000)
17#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M)
18
19/* Maximum of 256MiB in one bank */
20#define MAX_PHYSMEM_BITS 32
21#define SECTION_SIZE_BITS 28
22
23#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/pwm-clock.h b/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
new file mode 100644
index 000000000000..69027fea987a
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
@@ -0,0 +1,69 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/pwm-clock.h
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
8 * http://www.samsung.com/
9 *
10 * Based on arch/arm/plat-s3c24xx/include/mach/pwm-clock.h
11 *
12 * S5PV210 - pwm clock and timer support
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17*/
18
19#ifndef __ASM_ARCH_PWMCLK_H
20#define __ASM_ARCH_PWMCLK_H __FILE__
21
22/**
23 * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk
24 * @cfg: The timer TCFG1 register bits shifted down to 0.
25 *
26 * Return true if the given configuration from TCFG1 is a TCLK instead
27 * any of the TDIV clocks.
28 */
29static inline int pwm_cfg_src_is_tclk(unsigned long tcfg)
30{
31 return tcfg == S3C2410_TCFG1_MUX_TCLK;
32}
33
34/**
35 * tcfg_to_divisor() - convert tcfg1 setting to a divisor
36 * @tcfg1: The tcfg1 setting, shifted down.
37 *
38 * Get the divisor value for the given tcfg1 setting. We assume the
39 * caller has already checked to see if this is not a TCLK source.
40 */
41static inline unsigned long tcfg_to_divisor(unsigned long tcfg1)
42{
43 return 1 << (1 + tcfg1);
44}
45
46/**
47 * pwm_tdiv_has_div1() - does the tdiv setting have a /1
48 *
49 * Return true if we have a /1 in the tdiv setting.
50 */
51static inline unsigned int pwm_tdiv_has_div1(void)
52{
53 return 0;
54}
55
56/**
57 * pwm_tdiv_div_bits() - calculate TCFG1 divisor value.
58 * @div: The divisor to calculate the bit information for.
59 *
60 * Turn a divisor into the necessary bit field for TCFG1.
61 */
62static inline unsigned long pwm_tdiv_div_bits(unsigned int div)
63{
64 return ilog2(div) - 1;
65}
66
67#define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK
68
69#endif /* __ASM_ARCH_PWMCLK_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
new file mode 100644
index 000000000000..e56e0e4673ed
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -0,0 +1,169 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/regs-clock.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - Clock register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_CLOCK_H
14#define __ASM_ARCH_REGS_CLOCK_H __FILE__
15
16#include <mach/map.h>
17
18#define S5P_CLKREG(x) (S3C_VA_SYS + (x))
19
20#define S5P_APLL_LOCK S5P_CLKREG(0x00)
21#define S5P_MPLL_LOCK S5P_CLKREG(0x08)
22#define S5P_EPLL_LOCK S5P_CLKREG(0x10)
23#define S5P_VPLL_LOCK S5P_CLKREG(0x20)
24
25#define S5P_APLL_CON S5P_CLKREG(0x100)
26#define S5P_MPLL_CON S5P_CLKREG(0x108)
27#define S5P_EPLL_CON S5P_CLKREG(0x110)
28#define S5P_VPLL_CON S5P_CLKREG(0x120)
29
30#define S5P_CLK_SRC0 S5P_CLKREG(0x200)
31#define S5P_CLK_SRC1 S5P_CLKREG(0x204)
32#define S5P_CLK_SRC2 S5P_CLKREG(0x208)
33#define S5P_CLK_SRC3 S5P_CLKREG(0x20C)
34#define S5P_CLK_SRC4 S5P_CLKREG(0x210)
35#define S5P_CLK_SRC5 S5P_CLKREG(0x214)
36#define S5P_CLK_SRC6 S5P_CLKREG(0x218)
37
38#define S5P_CLK_SRC_MASK0 S5P_CLKREG(0x280)
39#define S5P_CLK_SRC_MASK1 S5P_CLKREG(0x284)
40
41#define S5P_CLK_DIV0 S5P_CLKREG(0x300)
42#define S5P_CLK_DIV1 S5P_CLKREG(0x304)
43#define S5P_CLK_DIV2 S5P_CLKREG(0x308)
44#define S5P_CLK_DIV3 S5P_CLKREG(0x30C)
45#define S5P_CLK_DIV4 S5P_CLKREG(0x310)
46#define S5P_CLK_DIV5 S5P_CLKREG(0x314)
47#define S5P_CLK_DIV6 S5P_CLKREG(0x318)
48#define S5P_CLK_DIV7 S5P_CLKREG(0x31C)
49
50#define S5P_CLKGATE_MAIN0 S5P_CLKREG(0x400)
51#define S5P_CLKGATE_MAIN1 S5P_CLKREG(0x404)
52#define S5P_CLKGATE_MAIN2 S5P_CLKREG(0x408)
53
54#define S5P_CLKGATE_PERI0 S5P_CLKREG(0x420)
55#define S5P_CLKGATE_PERI1 S5P_CLKREG(0x424)
56
57#define S5P_CLKGATE_SCLK0 S5P_CLKREG(0x440)
58#define S5P_CLKGATE_SCLK1 S5P_CLKREG(0x444)
59#define S5P_CLKGATE_IP0 S5P_CLKREG(0x460)
60#define S5P_CLKGATE_IP1 S5P_CLKREG(0x464)
61#define S5P_CLKGATE_IP2 S5P_CLKREG(0x468)
62#define S5P_CLKGATE_IP3 S5P_CLKREG(0x46C)
63#define S5P_CLKGATE_IP4 S5P_CLKREG(0x470)
64
65#define S5P_CLKGATE_BLOCK S5P_CLKREG(0x480)
66#define S5P_CLKGATE_BUS0 S5P_CLKREG(0x484)
67#define S5P_CLKGATE_BUS1 S5P_CLKREG(0x488)
68#define S5P_CLK_OUT S5P_CLKREG(0x500)
69
70/* CLKSRC0 */
71#define S5P_CLKSRC0_MUX200_MASK (0x1<<16)
72#define S5P_CLKSRC0_MUX166_MASK (0x1<<20)
73#define S5P_CLKSRC0_MUX133_MASK (0x1<<24)
74
75/* CLKDIV0 */
76#define S5P_CLKDIV0_APLL_SHIFT (0)
77#define S5P_CLKDIV0_APLL_MASK (0x7 << S5P_CLKDIV0_APLL_SHIFT)
78#define S5P_CLKDIV0_A2M_SHIFT (4)
79#define S5P_CLKDIV0_A2M_MASK (0x7 << S5P_CLKDIV0_A2M_SHIFT)
80#define S5P_CLKDIV0_HCLK200_SHIFT (8)
81#define S5P_CLKDIV0_HCLK200_MASK (0x7 << S5P_CLKDIV0_HCLK200_SHIFT)
82#define S5P_CLKDIV0_PCLK100_SHIFT (12)
83#define S5P_CLKDIV0_PCLK100_MASK (0x7 << S5P_CLKDIV0_PCLK100_SHIFT)
84#define S5P_CLKDIV0_HCLK166_SHIFT (16)
85#define S5P_CLKDIV0_HCLK166_MASK (0xF << S5P_CLKDIV0_HCLK166_SHIFT)
86#define S5P_CLKDIV0_PCLK83_SHIFT (20)
87#define S5P_CLKDIV0_PCLK83_MASK (0x7 << S5P_CLKDIV0_PCLK83_SHIFT)
88#define S5P_CLKDIV0_HCLK133_SHIFT (24)
89#define S5P_CLKDIV0_HCLK133_MASK (0xF << S5P_CLKDIV0_HCLK133_SHIFT)
90#define S5P_CLKDIV0_PCLK66_SHIFT (28)
91#define S5P_CLKDIV0_PCLK66_MASK (0x7 << S5P_CLKDIV0_PCLK66_SHIFT)
92
93/* Registers related to power management */
94#define S5P_PWR_CFG S5P_CLKREG(0xC000)
95#define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0xC004)
96#define S5P_WAKEUP_MASK S5P_CLKREG(0xC008)
97#define S5P_PWR_MODE S5P_CLKREG(0xC00C)
98#define S5P_NORMAL_CFG S5P_CLKREG(0xC010)
99#define S5P_IDLE_CFG S5P_CLKREG(0xC020)
100#define S5P_STOP_CFG S5P_CLKREG(0xC030)
101#define S5P_STOP_MEM_CFG S5P_CLKREG(0xC034)
102#define S5P_SLEEP_CFG S5P_CLKREG(0xC040)
103
104#define S5P_OSC_FREQ S5P_CLKREG(0xC100)
105#define S5P_OSC_STABLE S5P_CLKREG(0xC104)
106#define S5P_PWR_STABLE S5P_CLKREG(0xC108)
107#define S5P_MTC_STABLE S5P_CLKREG(0xC110)
108#define S5P_CLAMP_STABLE S5P_CLKREG(0xC114)
109
110#define S5P_WAKEUP_STAT S5P_CLKREG(0xC200)
111#define S5P_BLK_PWR_STAT S5P_CLKREG(0xC204)
112
113#define S5P_OTHERS S5P_CLKREG(0xE000)
114#define S5P_OM_STAT S5P_CLKREG(0xE100)
115#define S5P_USB_PHY_CONTROL S5P_CLKREG(0xE80C)
116#define S5P_DAC_CONTROL S5P_CLKREG(0xE810)
117
118#define S5P_INFORM0 S5P_CLKREG(0xF000)
119#define S5P_INFORM1 S5P_CLKREG(0xF004)
120#define S5P_INFORM2 S5P_CLKREG(0xF008)
121#define S5P_INFORM3 S5P_CLKREG(0xF00C)
122#define S5P_INFORM4 S5P_CLKREG(0xF010)
123#define S5P_INFORM5 S5P_CLKREG(0xF014)
124#define S5P_INFORM6 S5P_CLKREG(0xF018)
125#define S5P_INFORM7 S5P_CLKREG(0xF01C)
126
127#define S5P_RST_STAT S5P_CLKREG(0xA000)
128#define S5P_OSC_CON S5P_CLKREG(0x8000)
129#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200)
130#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204)
131#define S5P_MIPI_CONTROL S5P_CLKREG(0xE814)
132
133#define S5P_IDLE_CFG_TL_MASK (3 << 30)
134#define S5P_IDLE_CFG_TM_MASK (3 << 28)
135#define S5P_IDLE_CFG_TL_ON (2 << 30)
136#define S5P_IDLE_CFG_TM_ON (2 << 28)
137#define S5P_IDLE_CFG_DIDLE (1 << 0)
138
139#define S5P_CFG_WFI_CLEAN (~(3 << 8))
140#define S5P_CFG_WFI_IDLE (1 << 8)
141#define S5P_CFG_WFI_STOP (2 << 8)
142#define S5P_CFG_WFI_SLEEP (3 << 8)
143
144#define S5P_OTHER_SYS_INT 24
145#define S5P_OTHER_STA_TYPE 23
146#define S5P_OTHER_SYSC_INTOFF (1 << 0)
147#define STA_TYPE_EXPON 0
148#define STA_TYPE_SFR 1
149
150#define S5P_PWR_STA_EXP_SCALE 0
151#define S5P_PWR_STA_CNT 4
152
153#define S5P_PWR_STABLE_COUNT 85500
154
155#define S5P_SLEEP_CFG_OSC_EN (1 << 0)
156#define S5P_SLEEP_CFG_USBOSC_EN (1 << 1)
157
158/* OTHERS Resgister */
159#define S5P_OTHERS_USB_SIG_MASK (1 << 16)
160#define S5P_OTHERS_MIPI_DPHY_EN (1 << 28)
161
162/* MIPI */
163#define S5P_MIPI_DPHY_EN (3)
164
165/* S5P_DAC_CONTROL */
166#define S5P_DAC_ENABLE (1)
167#define S5P_DAC_DISABLE (0)
168
169#endif /* __ASM_ARCH_REGS_CLOCK_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-irq.h b/arch/arm/mach-s5pv210/include/mach/regs-irq.h
new file mode 100644
index 000000000000..5c3b104a7c86
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/regs-irq.h
@@ -0,0 +1,19 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/regs-irq.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - IRQ register definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_REGS_IRQ_H
14#define __ASM_ARCH_REGS_IRQ_H __FILE__
15
16#include <asm/hardware/vic.h>
17#include <mach/map.h>
18
19#endif /* __ASM_ARCH_REGS_IRQ_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/system.h b/arch/arm/mach-s5pv210/include/mach/system.h
new file mode 100644
index 000000000000..1ca04d5025b3
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/system.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/system.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - system support header
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SYSTEM_H
14#define __ASM_ARCH_SYSTEM_H __FILE__
15
16static void arch_idle(void)
17{
18 /* nothing here yet */
19}
20
21static void arch_reset(char mode, const char *cmd)
22{
23 /* nothing here yet */
24}
25
26#endif /* __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/tick.h b/arch/arm/mach-s5pv210/include/mach/tick.h
new file mode 100644
index 000000000000..7993b3603ccf
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/tick.h
@@ -0,0 +1,26 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/tick.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on arch/arm/mach-s3c6400/include/mach/tick.h
7 *
8 * S5PV210 - Timer tick support definitions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#ifndef __ASM_ARCH_TICK_H
16#define __ASM_ARCH_TICK_H __FILE__
17
18static inline u32 s3c24xx_ostimer_pending(void)
19{
20 u32 pend = __raw_readl(VA_VIC0 + VIC_RAW_STATUS);
21 return pend & (1 << (IRQ_TIMER4_VIC - S5P_IRQ_VIC0(0)));
22}
23
24#define TICK_MAX (0xffffffff)
25
26#endif /* __ASM_ARCH_TICK_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/timex.h b/arch/arm/mach-s5pv210/include/mach/timex.h
new file mode 100644
index 000000000000..73dc85496a83
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/timex.h
@@ -0,0 +1,29 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/timex.h
2 *
3 * Copyright (c) 2003-2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
7 * http://www.samsung.com/
8 *
9 * Based on arch/arm/mach-s5p6442/include/mach/timex.h
10 *
11 * S5PV210 - time parameters
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16*/
17
18#ifndef __ASM_ARCH_TIMEX_H
19#define __ASM_ARCH_TIMEX_H __FILE__
20
21/* CLOCK_TICK_RATE needs to be evaluatable by the cpp, so making it
22 * a variable is useless. It seems as long as we make our timers an
23 * exact multiple of HZ, any value that makes a 1->1 correspondence
24 * for the time conversion functions to/from jiffies is acceptable.
25*/
26
27#define CLOCK_TICK_RATE 12000000
28
29#endif /* __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h
new file mode 100644
index 000000000000..08ff2fda1fb9
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h
@@ -0,0 +1,24 @@
1/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5PV210 - uncompress code
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_UNCOMPRESS_H
14#define __ASM_ARCH_UNCOMPRESS_H
15
16#include <mach/map.h>
17#include <plat/uncompress.h>
18
19static void arch_detect_cpu(void)
20{
21 /* we do not need to do any cpu detection here at the moment. */
22}
23
24#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/vmalloc.h b/arch/arm/mach-s5pv210/include/mach/vmalloc.h
new file mode 100644
index 000000000000..58f515e0747e
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/vmalloc.h
@@ -0,0 +1,22 @@
1/* linux/arch/arm/mach-s5p6442/include/mach/vmalloc.h
2 *
3 * Copyright 2010 Ben Dooks <ben-linux@fluff.org>
4 *
5 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 *
8 * Based on arch/arm/mach-s5p6442/include/mach/vmalloc.h
9 *
10 * S5PV210 vmalloc definition
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17#ifndef __ASM_ARCH_VMALLOC_H
18#define __ASM_ARCH_VMALLOC_H __FILE__
19
20#define VMALLOC_END (0xE0000000)
21
22#endif /* __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-s5pv210/init.c b/arch/arm/mach-s5pv210/init.c
new file mode 100644
index 000000000000..4865ae2c475a
--- /dev/null
+++ b/arch/arm/mach-s5pv210/init.c
@@ -0,0 +1,44 @@
1/* linux/arch/arm/mach-s5pv210/init.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <plat/cpu.h>
17#include <plat/devs.h>
18#include <plat/s5pv210.h>
19#include <plat/regs-serial.h>
20
21static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
22 [0] = {
23 .name = "pclk",
24 .divisor = 1,
25 .min_baud = 0,
26 .max_baud = 0,
27 },
28};
29
30/* uart registration process */
31void __init s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
32{
33 struct s3c2410_uartcfg *tcfg = cfg;
34 u32 ucnt;
35
36 for (ucnt = 0; ucnt < no; ucnt++, tcfg++) {
37 if (!tcfg->clocks) {
38 tcfg->clocks = s5pv210_serial_clocks;
39 tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks);
40 }
41 }
42
43 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no);
44}
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
new file mode 100644
index 000000000000..ab4869df30c0
--- /dev/null
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -0,0 +1,98 @@
1/* linux/arch/arm/mach-s5pv210/mach-smdkc110.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/setup.h>
19#include <asm/mach-types.h>
20
21#include <mach/map.h>
22#include <mach/regs-clock.h>
23
24#include <plat/regs-serial.h>
25#include <plat/s5pv210.h>
26#include <plat/devs.h>
27#include <plat/cpu.h>
28
29/* Following are default values for UCON, ULCON and UFCON UART registers */
30#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
31 S3C2410_UCON_RXILEVEL | \
32 S3C2410_UCON_TXIRQMODE | \
33 S3C2410_UCON_RXIRQMODE | \
34 S3C2410_UCON_RXFIFO_TOI | \
35 S3C2443_UCON_RXERR_IRQEN)
36
37#define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
38
39#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
40 S5PV210_UFCON_TXTRIG4 | \
41 S5PV210_UFCON_RXTRIG4)
42
43static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
44 [0] = {
45 .hwport = 0,
46 .flags = 0,
47 .ucon = S5PV210_UCON_DEFAULT,
48 .ulcon = S5PV210_ULCON_DEFAULT,
49 .ufcon = S5PV210_UFCON_DEFAULT,
50 },
51 [1] = {
52 .hwport = 1,
53 .flags = 0,
54 .ucon = S5PV210_UCON_DEFAULT,
55 .ulcon = S5PV210_ULCON_DEFAULT,
56 .ufcon = S5PV210_UFCON_DEFAULT,
57 },
58 [2] = {
59 .hwport = 2,
60 .flags = 0,
61 .ucon = S5PV210_UCON_DEFAULT,
62 .ulcon = S5PV210_ULCON_DEFAULT,
63 .ufcon = S5PV210_UFCON_DEFAULT,
64 },
65 [3] = {
66 .hwport = 3,
67 .flags = 0,
68 .ucon = S5PV210_UCON_DEFAULT,
69 .ulcon = S5PV210_ULCON_DEFAULT,
70 .ufcon = S5PV210_UFCON_DEFAULT,
71 },
72};
73
74static struct platform_device *smdkc110_devices[] __initdata = {
75};
76
77static void __init smdkc110_map_io(void)
78{
79 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
80 s3c24xx_init_clocks(24000000);
81 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
82}
83
84static void __init smdkc110_machine_init(void)
85{
86 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
87}
88
89MACHINE_START(SMDKC110, "SMDKC110")
90 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
91 .phys_io = S3C_PA_UART & 0xfff00000,
92 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
93 .boot_params = S5P_PA_SDRAM + 0x100,
94 .init_irq = s5pv210_init_irq,
95 .map_io = smdkc110_map_io,
96 .init_machine = smdkc110_machine_init,
97 .timer = &s3c24xx_timer,
98MACHINE_END
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
new file mode 100644
index 000000000000..a27883253204
--- /dev/null
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -0,0 +1,98 @@
1/* linux/arch/arm/mach-s5pv210/mach-smdkv210.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/init.h>
14#include <linux/serial_core.h>
15
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <asm/setup.h>
19#include <asm/mach-types.h>
20
21#include <mach/map.h>
22#include <mach/regs-clock.h>
23
24#include <plat/regs-serial.h>
25#include <plat/s5pv210.h>
26#include <plat/devs.h>
27#include <plat/cpu.h>
28
29/* Following are default values for UCON, ULCON and UFCON UART registers */
30#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
31 S3C2410_UCON_RXILEVEL | \
32 S3C2410_UCON_TXIRQMODE | \
33 S3C2410_UCON_RXIRQMODE | \
34 S3C2410_UCON_RXFIFO_TOI | \
35 S3C2443_UCON_RXERR_IRQEN)
36
37#define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
38
39#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
40 S5PV210_UFCON_TXTRIG4 | \
41 S5PV210_UFCON_RXTRIG4)
42
43static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
44 [0] = {
45 .hwport = 0,
46 .flags = 0,
47 .ucon = S5PV210_UCON_DEFAULT,
48 .ulcon = S5PV210_ULCON_DEFAULT,
49 .ufcon = S5PV210_UFCON_DEFAULT,
50 },
51 [1] = {
52 .hwport = 1,
53 .flags = 0,
54 .ucon = S5PV210_UCON_DEFAULT,
55 .ulcon = S5PV210_ULCON_DEFAULT,
56 .ufcon = S5PV210_UFCON_DEFAULT,
57 },
58 [2] = {
59 .hwport = 2,
60 .flags = 0,
61 .ucon = S5PV210_UCON_DEFAULT,
62 .ulcon = S5PV210_ULCON_DEFAULT,
63 .ufcon = S5PV210_UFCON_DEFAULT,
64 },
65 [3] = {
66 .hwport = 3,
67 .flags = 0,
68 .ucon = S5PV210_UCON_DEFAULT,
69 .ulcon = S5PV210_ULCON_DEFAULT,
70 .ufcon = S5PV210_UFCON_DEFAULT,
71 },
72};
73
74static struct platform_device *smdkv210_devices[] __initdata = {
75};
76
77static void __init smdkv210_map_io(void)
78{
79 s5p_init_io(NULL, 0, S5P_VA_CHIPID);
80 s3c24xx_init_clocks(24000000);
81 s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
82}
83
84static void __init smdkv210_machine_init(void)
85{
86 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
87}
88
89MACHINE_START(SMDKV210, "SMDKV210")
90 /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
91 .phys_io = S3C_PA_UART & 0xfff00000,
92 .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
93 .boot_params = S5P_PA_SDRAM + 0x100,
94 .init_irq = s5pv210_init_irq,
95 .map_io = smdkv210_map_io,
96 .init_machine = smdkv210_machine_init,
97 .timer = &s3c24xx_timer,
98MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 051ec0f0023c..259cb2c15fff 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -51,6 +51,10 @@ static struct resource sa1111_resources[] = {
51 }, 51 },
52}; 52};
53 53
54static struct sa1111_platform_data sa1111_info = {
55 .irq_base = IRQ_BOARD_END,
56};
57
54static u64 sa1111_dmamask = 0xffffffffUL; 58static u64 sa1111_dmamask = 0xffffffffUL;
55 59
56static struct platform_device sa1111_device = { 60static struct platform_device sa1111_device = {
@@ -59,6 +63,7 @@ static struct platform_device sa1111_device = {
59 .dev = { 63 .dev = {
60 .dma_mask = &sa1111_dmamask, 64 .dma_mask = &sa1111_dmamask,
61 .coherent_dma_mask = 0xffffffff, 65 .coherent_dma_mask = 0xffffffff,
66 .platform_data = &sa1111_info,
62 }, 67 },
63 .num_resources = ARRAY_SIZE(sa1111_resources), 68 .num_resources = ARRAY_SIZE(sa1111_resources),
64 .resource = sa1111_resources, 69 .resource = sa1111_resources,
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 9982c5c28edf..5d5f330c5d94 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -234,6 +234,10 @@ static struct resource locomo_resources[] = {
234 }, 234 },
235}; 235};
236 236
237static struct locomo_platform_data locomo_info = {
238 .irq_base = IRQ_BOARD_START,
239};
240
237struct platform_device collie_locomo_device = { 241struct platform_device collie_locomo_device = {
238 .name = "locomo", 242 .name = "locomo",
239 .id = 0, 243 .id = 0,
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h
index 71a0b3fdcc8c..52acda7061b7 100644
--- a/arch/arm/mach-sa1100/include/mach/collie.h
+++ b/arch/arm/mach-sa1100/include/mach/collie.h
@@ -72,13 +72,6 @@
72#define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25 72#define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25
73#define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26 73#define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26
74 74
75#define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0
76#define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1
77#define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2
78#define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3
79#define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13
80#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14
81
82/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */ 75/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */
83#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13) 76#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13)
84#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 77#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0
diff --git a/arch/arm/mach-sa1100/include/mach/irqs.h b/arch/arm/mach-sa1100/include/mach/irqs.h
index ae81f80b0cf9..8c8845b5ae5b 100644
--- a/arch/arm/mach-sa1100/include/mach/irqs.h
+++ b/arch/arm/mach-sa1100/include/mach/irqs.h
@@ -68,93 +68,17 @@
68#define IRQ_BOARD_START 49 68#define IRQ_BOARD_START 49
69#define IRQ_BOARD_END 65 69#define IRQ_BOARD_END 65
70 70
71#define IRQ_SA1111_START (IRQ_BOARD_END)
72#define IRQ_GPAIN0 (IRQ_BOARD_END + 0)
73#define IRQ_GPAIN1 (IRQ_BOARD_END + 1)
74#define IRQ_GPAIN2 (IRQ_BOARD_END + 2)
75#define IRQ_GPAIN3 (IRQ_BOARD_END + 3)
76#define IRQ_GPBIN0 (IRQ_BOARD_END + 4)
77#define IRQ_GPBIN1 (IRQ_BOARD_END + 5)
78#define IRQ_GPBIN2 (IRQ_BOARD_END + 6)
79#define IRQ_GPBIN3 (IRQ_BOARD_END + 7)
80#define IRQ_GPBIN4 (IRQ_BOARD_END + 8)
81#define IRQ_GPBIN5 (IRQ_BOARD_END + 9)
82#define IRQ_GPCIN0 (IRQ_BOARD_END + 10)
83#define IRQ_GPCIN1 (IRQ_BOARD_END + 11)
84#define IRQ_GPCIN2 (IRQ_BOARD_END + 12)
85#define IRQ_GPCIN3 (IRQ_BOARD_END + 13)
86#define IRQ_GPCIN4 (IRQ_BOARD_END + 14)
87#define IRQ_GPCIN5 (IRQ_BOARD_END + 15)
88#define IRQ_GPCIN6 (IRQ_BOARD_END + 16)
89#define IRQ_GPCIN7 (IRQ_BOARD_END + 17)
90#define IRQ_MSTXINT (IRQ_BOARD_END + 18)
91#define IRQ_MSRXINT (IRQ_BOARD_END + 19)
92#define IRQ_MSSTOPERRINT (IRQ_BOARD_END + 20)
93#define IRQ_TPTXINT (IRQ_BOARD_END + 21)
94#define IRQ_TPRXINT (IRQ_BOARD_END + 22)
95#define IRQ_TPSTOPERRINT (IRQ_BOARD_END + 23)
96#define SSPXMTINT (IRQ_BOARD_END + 24)
97#define SSPRCVINT (IRQ_BOARD_END + 25)
98#define SSPROR (IRQ_BOARD_END + 26)
99#define AUDXMTDMADONEA (IRQ_BOARD_END + 32)
100#define AUDRCVDMADONEA (IRQ_BOARD_END + 33)
101#define AUDXMTDMADONEB (IRQ_BOARD_END + 34)
102#define AUDRCVDMADONEB (IRQ_BOARD_END + 35)
103#define AUDTFSR (IRQ_BOARD_END + 36)
104#define AUDRFSR (IRQ_BOARD_END + 37)
105#define AUDTUR (IRQ_BOARD_END + 38)
106#define AUDROR (IRQ_BOARD_END + 39)
107#define AUDDTS (IRQ_BOARD_END + 40)
108#define AUDRDD (IRQ_BOARD_END + 41)
109#define AUDSTO (IRQ_BOARD_END + 42)
110#define IRQ_USBPWR (IRQ_BOARD_END + 43)
111#define IRQ_HCIM (IRQ_BOARD_END + 44)
112#define IRQ_HCIBUFFACC (IRQ_BOARD_END + 45)
113#define IRQ_HCIRMTWKP (IRQ_BOARD_END + 46)
114#define IRQ_NHCIMFCIR (IRQ_BOARD_END + 47)
115#define IRQ_USB_PORT_RESUME (IRQ_BOARD_END + 48)
116#define IRQ_S0_READY_NINT (IRQ_BOARD_END + 49)
117#define IRQ_S1_READY_NINT (IRQ_BOARD_END + 50)
118#define IRQ_S0_CD_VALID (IRQ_BOARD_END + 51)
119#define IRQ_S1_CD_VALID (IRQ_BOARD_END + 52)
120#define IRQ_S0_BVD1_STSCHG (IRQ_BOARD_END + 53)
121#define IRQ_S1_BVD1_STSCHG (IRQ_BOARD_END + 54)
122
123#define IRQ_LOCOMO_START (IRQ_BOARD_END)
124#define IRQ_LOCOMO_KEY (IRQ_BOARD_END + 0)
125#define IRQ_LOCOMO_GPIO0 (IRQ_BOARD_END + 1)
126#define IRQ_LOCOMO_GPIO1 (IRQ_BOARD_END + 2)
127#define IRQ_LOCOMO_GPIO2 (IRQ_BOARD_END + 3)
128#define IRQ_LOCOMO_GPIO3 (IRQ_BOARD_END + 4)
129#define IRQ_LOCOMO_GPIO4 (IRQ_BOARD_END + 5)
130#define IRQ_LOCOMO_GPIO5 (IRQ_BOARD_END + 6)
131#define IRQ_LOCOMO_GPIO6 (IRQ_BOARD_END + 7)
132#define IRQ_LOCOMO_GPIO7 (IRQ_BOARD_END + 8)
133#define IRQ_LOCOMO_GPIO8 (IRQ_BOARD_END + 9)
134#define IRQ_LOCOMO_GPIO9 (IRQ_BOARD_END + 10)
135#define IRQ_LOCOMO_GPIO10 (IRQ_BOARD_END + 11)
136#define IRQ_LOCOMO_GPIO11 (IRQ_BOARD_END + 12)
137#define IRQ_LOCOMO_GPIO12 (IRQ_BOARD_END + 13)
138#define IRQ_LOCOMO_GPIO13 (IRQ_BOARD_END + 14)
139#define IRQ_LOCOMO_GPIO14 (IRQ_BOARD_END + 15)
140#define IRQ_LOCOMO_GPIO15 (IRQ_BOARD_END + 16)
141#define IRQ_LOCOMO_LT (IRQ_BOARD_END + 17)
142#define IRQ_LOCOMO_SPI_RFR (IRQ_BOARD_END + 18)
143#define IRQ_LOCOMO_SPI_RFW (IRQ_BOARD_END + 19)
144#define IRQ_LOCOMO_SPI_REND (IRQ_BOARD_END + 20)
145#define IRQ_LOCOMO_SPI_TEND (IRQ_BOARD_END + 21)
146
147/* 71/*
148 * Figure out the MAX IRQ number. 72 * Figure out the MAX IRQ number.
149 * 73 *
150 * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1. 74 * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
151 * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1 75 * If we have an LoCoMo, the max IRQ is IRQ_BOARD_START + 4
152 * Otherwise, we have the standard IRQs only. 76 * Otherwise, we have the standard IRQs only.
153 */ 77 */
154#ifdef CONFIG_SA1111 78#ifdef CONFIG_SA1111
155#define NR_IRQS (IRQ_S1_BVD1_STSCHG + 1) 79#define NR_IRQS (IRQ_BOARD_END + 55)
156#elif defined(CONFIG_SHARP_LOCOMO) 80#elif defined(CONFIG_SHARPSL_LOCOMO)
157#define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) 81#define NR_IRQS (IRQ_BOARD_START + 4)
158#else 82#else
159#define NR_IRQS (IRQ_BOARD_START) 83#define NR_IRQS (IRQ_BOARD_START)
160#endif 84#endif
@@ -166,10 +90,3 @@
166#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0) 90#define IRQ_NEPONSET_SMC9196 (IRQ_BOARD_START + 0)
167#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1) 91#define IRQ_NEPONSET_USAR (IRQ_BOARD_START + 1)
168#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2) 92#define IRQ_NEPONSET_SA1111 (IRQ_BOARD_START + 2)
169
170/* LoCoMo Interrupts (CONFIG_SHARP_LOCOMO) */
171#define IRQ_LOCOMO_KEY_BASE (IRQ_BOARD_START + 0)
172#define IRQ_LOCOMO_GPIO_BASE (IRQ_BOARD_START + 1)
173#define IRQ_LOCOMO_LT_BASE (IRQ_BOARD_START + 2)
174#define IRQ_LOCOMO_SPI_BASE (IRQ_BOARD_START + 3)
175
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 13ebd2d99bfd..d3ec620618f1 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -208,6 +208,10 @@ static struct resource sa1111_resources[] = {
208 }, 208 },
209}; 209};
210 210
211static struct sa1111_platform_data sa1111_info = {
212 .irq_base = IRQ_BOARD_END,
213};
214
211static u64 sa1111_dmamask = 0xffffffffUL; 215static u64 sa1111_dmamask = 0xffffffffUL;
212 216
213static struct platform_device sa1111_device = { 217static struct platform_device sa1111_device = {
@@ -216,6 +220,7 @@ static struct platform_device sa1111_device = {
216 .dev = { 220 .dev = {
217 .dma_mask = &sa1111_dmamask, 221 .dma_mask = &sa1111_dmamask,
218 .coherent_dma_mask = 0xffffffff, 222 .coherent_dma_mask = 0xffffffff,
223 .platform_data = &sa1111_info,
219 }, 224 },
220 .num_resources = ARRAY_SIZE(sa1111_resources), 225 .num_resources = ARRAY_SIZE(sa1111_resources),
221 .resource = sa1111_resources, 226 .resource = sa1111_resources,
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 6ccd175bc4cf..0b505d9f22d6 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -241,6 +241,10 @@ static struct resource sa1111_resources[] = {
241 }, 241 },
242}; 242};
243 243
244static struct sa1111_platform_data sa1111_info = {
245 .irq_base = IRQ_BOARD_END,
246};
247
244static u64 sa1111_dmamask = 0xffffffffUL; 248static u64 sa1111_dmamask = 0xffffffffUL;
245 249
246static struct platform_device sa1111_device = { 250static struct platform_device sa1111_device = {
@@ -249,6 +253,7 @@ static struct platform_device sa1111_device = {
249 .dev = { 253 .dev = {
250 .dma_mask = &sa1111_dmamask, 254 .dma_mask = &sa1111_dmamask,
251 .coherent_dma_mask = 0xffffffff, 255 .coherent_dma_mask = 0xffffffff,
256 .platform_data = &sa1111_info,
252 }, 257 },
253 .num_resources = ARRAY_SIZE(sa1111_resources), 258 .num_resources = ARRAY_SIZE(sa1111_resources),
254 .resource = sa1111_resources, 259 .resource = sa1111_resources,
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index b9cbb56d6e9d..74b6e0e570b6 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -35,14 +35,12 @@ static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
35static int 35static int
36sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c) 36sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
37{ 37{
38 unsigned long flags, next, oscr; 38 unsigned long next, oscr;
39 39
40 raw_local_irq_save(flags);
41 OIER |= OIER_E0; 40 OIER |= OIER_E0;
42 next = OSCR + delta; 41 next = OSCR + delta;
43 OSMR0 = next; 42 OSMR0 = next;
44 oscr = OSCR; 43 oscr = OSCR;
45 raw_local_irq_restore(flags);
46 44
47 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0; 45 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
48} 46}
@@ -50,16 +48,12 @@ sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
50static void 48static void
51sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c) 49sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
52{ 50{
53 unsigned long flags;
54
55 switch (mode) { 51 switch (mode) {
56 case CLOCK_EVT_MODE_ONESHOT: 52 case CLOCK_EVT_MODE_ONESHOT:
57 case CLOCK_EVT_MODE_UNUSED: 53 case CLOCK_EVT_MODE_UNUSED:
58 case CLOCK_EVT_MODE_SHUTDOWN: 54 case CLOCK_EVT_MODE_SHUTDOWN:
59 raw_local_irq_save(flags);
60 OIER &= ~OIER_E0; 55 OIER &= ~OIER_E0;
61 OSSR = OSSR_M0; 56 OSSR = OSSR_M0;
62 raw_local_irq_restore(flags);
63 break; 57 break;
64 58
65 case CLOCK_EVT_MODE_RESUME: 59 case CLOCK_EVT_MODE_RESUME:
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
new file mode 100644
index 000000000000..aeceb9b92aeb
--- /dev/null
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -0,0 +1,84 @@
1if ARCH_SHMOBILE
2
3comment "SH-Mobile System Type"
4
5config ARCH_SH7367
6 bool "SH-Mobile G3 (SH7367)"
7 select CPU_V6
8 select HAVE_CLK
9 select COMMON_CLKDEV
10 select GENERIC_TIME
11 select GENERIC_CLOCKEVENTS
12
13config ARCH_SH7377
14 bool "SH-Mobile G4 (SH7377)"
15 select CPU_V7
16 select HAVE_CLK
17 select COMMON_CLKDEV
18 select GENERIC_TIME
19 select GENERIC_CLOCKEVENTS
20
21config ARCH_SH7372
22 bool "SH-Mobile AP4 (SH7372)"
23 select CPU_V7
24 select HAVE_CLK
25 select COMMON_CLKDEV
26 select GENERIC_TIME
27 select GENERIC_CLOCKEVENTS
28
29comment "SH-Mobile Board Type"
30
31config MACH_G3EVM
32 bool "G3EVM board"
33 depends on ARCH_SH7367
34 select ARCH_REQUIRE_GPIOLIB
35
36config MACH_G4EVM
37 bool "G4EVM board"
38 depends on ARCH_SH7377
39 select ARCH_REQUIRE_GPIOLIB
40
41config MACH_AP4EVB
42 bool "AP4EVB board"
43 depends on ARCH_SH7372
44 select ARCH_REQUIRE_GPIOLIB
45
46comment "SH-Mobile System Configuration"
47
48menu "Memory configuration"
49
50config MEMORY_START
51 hex "Physical memory start address"
52 default "0x50000000" if MACH_G3EVM
53 default "0x40000000" if MACH_G4EVM
54 default "0x40000000" if MACH_AP4EVB
55 default "0x00000000"
56 ---help---
57 Tweak this only when porting to a new machine which does not
58 already have a defconfig. Changing it from the known correct
59 value on any of the known systems will only lead to disaster.
60
61config MEMORY_SIZE
62 hex "Physical memory size"
63 default "0x08000000" if MACH_G3EVM
64 default "0x08000000" if MACH_G4EVM
65 default "0x10000000" if MACH_AP4EVB
66 default "0x04000000"
67 help
68 This sets the default memory size assumed by your kernel. It can
69 be overridden as normal by the 'mem=' argument on the kernel command
70 line.
71
72endmenu
73
74menu "Timer and clock configuration"
75
76config SH_TIMER_CMT
77 bool "CMT timer driver"
78 default y
79 help
80 This enables build of the CMT timer driver.
81
82endmenu
83
84endif
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
new file mode 100644
index 000000000000..6d385d371c33
--- /dev/null
+++ b/arch/arm/mach-shmobile/Makefile
@@ -0,0 +1,22 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Common objects
6obj-y := timer.o console.o
7
8# CPU objects
9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o intc-sh7367.o
10obj-$(CONFIG_ARCH_SH7377) += setup-sh7377.o clock-sh7367.o intc-sh7377.o
11obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7367.o intc-sh7372.o
12
13# Pinmux setup
14pfc-$(CONFIG_ARCH_SH7367) := pfc-sh7367.o
15pfc-$(CONFIG_ARCH_SH7377) := pfc-sh7377.o
16pfc-$(CONFIG_ARCH_SH7372) := pfc-sh7372.o
17obj-$(CONFIG_GENERIC_GPIO) += $(pfc-y)
18
19# Board objects
20obj-$(CONFIG_MACH_G3EVM) += board-g3evm.o
21obj-$(CONFIG_MACH_G4EVM) += board-g4evm.o
22obj-$(CONFIG_MACH_AP4EVB) += board-ap4evb.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
new file mode 100644
index 000000000000..1c08ee9de86a
--- /dev/null
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -0,0 +1,9 @@
1__ZRELADDR := $(shell /bin/bash -c 'printf "0x%08x" \
2 $$[$(CONFIG_MEMORY_START) + 0x8000]')
3
4 zreladdr-y := $(__ZRELADDR)
5
6# Unsupported legacy stuff
7#
8#params_phys-y (Instead: Pass atags pointer in r2)
9#initrd_phys-y (Instead: Use compiled-in initramfs)
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
new file mode 100644
index 000000000000..a0463d926447
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -0,0 +1,301 @@
1/*
2 * AP4EVB board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/io.h>
30#include <linux/smsc911x.h>
31#include <linux/gpio.h>
32#include <linux/input.h>
33#include <linux/input/sh_keysc.h>
34#include <mach/common.h>
35#include <mach/sh7372.h>
36#include <asm/mach-types.h>
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39
40/*
41 * Address Interface BusWidth note
42 * ------------------------------------------------------------------
43 * 0x0000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = ON
44 * 0x0800_0000 user area -
45 * 0x1000_0000 NOR Flash ROM (MCP) 16bit SW7 : bit1 = OFF
46 * 0x1400_0000 Ether (LAN9220) 16bit
47 * 0x1600_0000 user area - cannot use with NAND
48 * 0x1800_0000 user area -
49 * 0x1A00_0000 -
50 * 0x4000_0000 LPDDR2-SDRAM (POP) 32bit
51 */
52
53/*
54 * NOR Flash ROM
55 *
56 * SW1 | SW2 | SW7 | NOR Flash ROM
57 * bit1 | bit1 bit2 | bit1 | Memory allocation
58 * ------+------------+------+------------------
59 * OFF | ON OFF | ON | Area 0
60 * OFF | ON OFF | OFF | Area 4
61 */
62
63/*
64 * NAND Flash ROM
65 *
66 * SW1 | SW2 | SW7 | NAND Flash ROM
67 * bit1 | bit1 bit2 | bit2 | Memory allocation
68 * ------+------------+------+------------------
69 * OFF | ON OFF | ON | FCE 0
70 * OFF | ON OFF | OFF | FCE 1
71 */
72
73/*
74 * SMSC 9220
75 *
76 * SW1 SMSC 9220
77 * -----------------------
78 * ON access disable
79 * OFF access enable
80 */
81
82/*
83 * KEYSC
84 *
85 * SW43 KEYSC
86 * -------------------------
87 * ON enable
88 * OFF disable
89 */
90
91/* MTD */
92static struct mtd_partition nor_flash_partitions[] = {
93 {
94 .name = "loader",
95 .offset = 0x00000000,
96 .size = 512 * 1024,
97 },
98 {
99 .name = "bootenv",
100 .offset = MTDPART_OFS_APPEND,
101 .size = 512 * 1024,
102 },
103 {
104 .name = "kernel_ro",
105 .offset = MTDPART_OFS_APPEND,
106 .size = 8 * 1024 * 1024,
107 .mask_flags = MTD_WRITEABLE,
108 },
109 {
110 .name = "kernel",
111 .offset = MTDPART_OFS_APPEND,
112 .size = 8 * 1024 * 1024,
113 },
114 {
115 .name = "data",
116 .offset = MTDPART_OFS_APPEND,
117 .size = MTDPART_SIZ_FULL,
118 },
119};
120
121static struct physmap_flash_data nor_flash_data = {
122 .width = 2,
123 .parts = nor_flash_partitions,
124 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
125};
126
127static struct resource nor_flash_resources[] = {
128 [0] = {
129 .start = 0x00000000,
130 .end = 0x08000000 - 1,
131 .flags = IORESOURCE_MEM,
132 }
133};
134
135static struct platform_device nor_flash_device = {
136 .name = "physmap-flash",
137 .dev = {
138 .platform_data = &nor_flash_data,
139 },
140 .num_resources = ARRAY_SIZE(nor_flash_resources),
141 .resource = nor_flash_resources,
142};
143
144/* SMSC 9220 */
145static struct resource smc911x_resources[] = {
146 {
147 .start = 0x14000000,
148 .end = 0x16000000 - 1,
149 .flags = IORESOURCE_MEM,
150 }, {
151 .start = 6,
152 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
153 },
154};
155
156static struct smsc911x_platform_config smsc911x_info = {
157 .flags = SMSC911X_USE_16BIT | SMSC911X_SAVE_MAC_ADDRESS,
158 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
159 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
160};
161
162static struct platform_device smc911x_device = {
163 .name = "smsc911x",
164 .id = -1,
165 .num_resources = ARRAY_SIZE(smc911x_resources),
166 .resource = smc911x_resources,
167 .dev = {
168 .platform_data = &smsc911x_info,
169 },
170};
171
172/* KEYSC (Needs SW43 set to ON) */
173static struct sh_keysc_info keysc_info = {
174 .mode = SH_KEYSC_MODE_1,
175 .scan_timing = 3,
176 .delay = 2500,
177 .keycodes = {
178 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4,
179 KEY_5, KEY_6, KEY_7, KEY_8, KEY_9,
180 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E,
181 KEY_F, KEY_G, KEY_H, KEY_I, KEY_J,
182 KEY_K, KEY_L, KEY_M, KEY_N, KEY_O,
183 },
184};
185
186static struct resource keysc_resources[] = {
187 [0] = {
188 .name = "KEYSC",
189 .start = 0xe61b0000,
190 .end = 0xe61b0063,
191 .flags = IORESOURCE_MEM,
192 },
193 [1] = {
194 .start = 79,
195 .flags = IORESOURCE_IRQ,
196 },
197};
198
199static struct platform_device keysc_device = {
200 .name = "sh_keysc",
201 .id = 0, /* "keysc0" clock */
202 .num_resources = ARRAY_SIZE(keysc_resources),
203 .resource = keysc_resources,
204 .dev = {
205 .platform_data = &keysc_info,
206 },
207};
208
209static struct platform_device *ap4evb_devices[] __initdata = {
210 &nor_flash_device,
211 &smc911x_device,
212 &keysc_device,
213};
214
215static struct map_desc ap4evb_io_desc[] __initdata = {
216 /* create a 1:1 entity map for 0xe6xxxxxx
217 * used by CPGA, INTC and PFC.
218 */
219 {
220 .virtual = 0xe6000000,
221 .pfn = __phys_to_pfn(0xe6000000),
222 .length = 256 << 20,
223 .type = MT_DEVICE_NONSHARED
224 },
225};
226
227static void __init ap4evb_map_io(void)
228{
229 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
230
231 /* setup early devices, clocks and console here as well */
232 sh7372_add_early_devices();
233 sh7367_clock_init(); /* use g3 clocks for now */
234 shmobile_setup_console();
235}
236
237static void __init ap4evb_init(void)
238{
239 sh7372_pinmux_init();
240
241 /* enable SCIFA0 */
242 gpio_request(GPIO_FN_SCIFA0_TXD, NULL);
243 gpio_request(GPIO_FN_SCIFA0_RXD, NULL);
244
245 /* enable SMSC911X */
246 gpio_request(GPIO_FN_CS5A, NULL);
247 gpio_request(GPIO_FN_IRQ6_39, NULL);
248
249 /* enable LED 1 - 4 */
250 gpio_request(GPIO_PORT185, NULL);
251 gpio_request(GPIO_PORT186, NULL);
252 gpio_request(GPIO_PORT187, NULL);
253 gpio_request(GPIO_PORT188, NULL);
254 gpio_direction_output(GPIO_PORT185, 1);
255 gpio_direction_output(GPIO_PORT186, 1);
256 gpio_direction_output(GPIO_PORT187, 1);
257 gpio_direction_output(GPIO_PORT188, 1);
258 gpio_export(GPIO_PORT185, 0);
259 gpio_export(GPIO_PORT186, 0);
260 gpio_export(GPIO_PORT187, 0);
261 gpio_export(GPIO_PORT188, 0);
262
263 /* enable Debug switch (S6) */
264 gpio_request(GPIO_PORT32, NULL);
265 gpio_request(GPIO_PORT33, NULL);
266 gpio_request(GPIO_PORT34, NULL);
267 gpio_request(GPIO_PORT35, NULL);
268 gpio_direction_input(GPIO_PORT32);
269 gpio_direction_input(GPIO_PORT33);
270 gpio_direction_input(GPIO_PORT34);
271 gpio_direction_input(GPIO_PORT35);
272 gpio_export(GPIO_PORT32, 0);
273 gpio_export(GPIO_PORT33, 0);
274 gpio_export(GPIO_PORT34, 0);
275 gpio_export(GPIO_PORT35, 0);
276
277 /* enable KEYSC */
278 gpio_request(GPIO_FN_KEYOUT0, NULL);
279 gpio_request(GPIO_FN_KEYOUT1, NULL);
280 gpio_request(GPIO_FN_KEYOUT2, NULL);
281 gpio_request(GPIO_FN_KEYOUT3, NULL);
282 gpio_request(GPIO_FN_KEYOUT4, NULL);
283 gpio_request(GPIO_FN_KEYIN0_136, NULL);
284 gpio_request(GPIO_FN_KEYIN1_135, NULL);
285 gpio_request(GPIO_FN_KEYIN2_134, NULL);
286 gpio_request(GPIO_FN_KEYIN3_133, NULL);
287 gpio_request(GPIO_FN_KEYIN4, NULL);
288
289 sh7372_add_standard_devices();
290
291 platform_add_devices(ap4evb_devices, ARRAY_SIZE(ap4evb_devices));
292}
293
294MACHINE_START(AP4EVB, "ap4evb")
295 .phys_io = 0xe6000000,
296 .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc,
297 .map_io = ap4evb_map_io,
298 .init_irq = sh7372_init_irq,
299 .init_machine = ap4evb_init,
300 .timer = &shmobile_timer,
301MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
new file mode 100644
index 000000000000..f36c9a94d326
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -0,0 +1,211 @@
1/*
2 * G3EVM board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/usb/r8a66597.h>
30#include <linux/io.h>
31#include <linux/gpio.h>
32#include <mach/sh7367.h>
33#include <mach/common.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37
38static struct mtd_partition nor_flash_partitions[] = {
39 {
40 .name = "loader",
41 .offset = 0x00000000,
42 .size = 512 * 1024,
43 },
44 {
45 .name = "bootenv",
46 .offset = MTDPART_OFS_APPEND,
47 .size = 512 * 1024,
48 },
49 {
50 .name = "kernel_ro",
51 .offset = MTDPART_OFS_APPEND,
52 .size = 8 * 1024 * 1024,
53 .mask_flags = MTD_WRITEABLE,
54 },
55 {
56 .name = "kernel",
57 .offset = MTDPART_OFS_APPEND,
58 .size = 8 * 1024 * 1024,
59 },
60 {
61 .name = "data",
62 .offset = MTDPART_OFS_APPEND,
63 .size = MTDPART_SIZ_FULL,
64 },
65};
66
67static struct physmap_flash_data nor_flash_data = {
68 .width = 2,
69 .parts = nor_flash_partitions,
70 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
71};
72
73static struct resource nor_flash_resources[] = {
74 [0] = {
75 .start = 0x00000000,
76 .end = 0x08000000 - 1,
77 .flags = IORESOURCE_MEM,
78 }
79};
80
81static struct platform_device nor_flash_device = {
82 .name = "physmap-flash",
83 .dev = {
84 .platform_data = &nor_flash_data,
85 },
86 .num_resources = ARRAY_SIZE(nor_flash_resources),
87 .resource = nor_flash_resources,
88};
89
90/* USBHS */
91void usb_host_port_power(int port, int power)
92{
93 if (!power) /* only power-on supported for now */
94 return;
95
96 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
97 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
98}
99
100static struct r8a66597_platdata usb_host_data = {
101 .on_chip = 1,
102 .port_power = usb_host_port_power,
103};
104
105static struct resource usb_host_resources[] = {
106 [0] = {
107 .name = "USBHS",
108 .start = 0xe6890000,
109 .end = 0xe68900e5,
110 .flags = IORESOURCE_MEM,
111 },
112 [1] = {
113 .start = 65,
114 .flags = IORESOURCE_IRQ,
115 },
116};
117
118static struct platform_device usb_host_device = {
119 .name = "r8a66597_hcd",
120 .id = 0,
121 .dev = {
122 .platform_data = &usb_host_data,
123 .dma_mask = NULL,
124 .coherent_dma_mask = 0xffffffff,
125 },
126 .num_resources = ARRAY_SIZE(usb_host_resources),
127 .resource = usb_host_resources,
128};
129
130static struct platform_device *g3evm_devices[] __initdata = {
131 &nor_flash_device,
132 &usb_host_device,
133};
134
135static struct map_desc g3evm_io_desc[] __initdata = {
136 /* create a 1:1 entity map for 0xe6xxxxxx
137 * used by CPGA, INTC and PFC.
138 */
139 {
140 .virtual = 0xe6000000,
141 .pfn = __phys_to_pfn(0xe6000000),
142 .length = 256 << 20,
143 .type = MT_DEVICE_NONSHARED
144 },
145};
146
147static void __init g3evm_map_io(void)
148{
149 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
150
151 /* setup early devices, clocks and console here as well */
152 sh7367_add_early_devices();
153 sh7367_clock_init();
154 shmobile_setup_console();
155}
156
157static void __init g3evm_init(void)
158{
159 sh7367_pinmux_init();
160
161 /* Lit DS4 LED */
162 gpio_request(GPIO_PORT22, NULL);
163 gpio_direction_output(GPIO_PORT22, 1);
164 gpio_export(GPIO_PORT22, 0);
165
166 /* Lit DS8 LED */
167 gpio_request(GPIO_PORT23, NULL);
168 gpio_direction_output(GPIO_PORT23, 1);
169 gpio_export(GPIO_PORT23, 0);
170
171 /* Lit DS3 LED */
172 gpio_request(GPIO_PORT24, NULL);
173 gpio_direction_output(GPIO_PORT24, 1);
174 gpio_export(GPIO_PORT24, 0);
175
176 /* SCIFA1 */
177 gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
178 gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
179 gpio_request(GPIO_FN_SCIFA1_CTS, NULL);
180 gpio_request(GPIO_FN_SCIFA1_RTS, NULL);
181
182 /* USBHS */
183 gpio_request(GPIO_FN_VBUS0, NULL);
184 gpio_request(GPIO_FN_PWEN, NULL);
185 gpio_request(GPIO_FN_OVCN, NULL);
186 gpio_request(GPIO_FN_OVCN2, NULL);
187 gpio_request(GPIO_FN_EXTLP, NULL);
188 gpio_request(GPIO_FN_IDIN, NULL);
189
190 /* enable clock in SYMSTPCR2 */
191 __raw_writel(__raw_readl(0xe6158048) & ~(1 << 22), 0xe6158048);
192
193 /* setup USB phy */
194 __raw_writew(0x0300, 0xe605810a); /* USBCR1 */
195 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
196 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
197 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
198
199 sh7367_add_standard_devices();
200
201 platform_add_devices(g3evm_devices, ARRAY_SIZE(g3evm_devices));
202}
203
204MACHINE_START(G3EVM, "g3evm")
205 .phys_io = 0xe6000000,
206 .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc,
207 .map_io = g3evm_map_io,
208 .init_irq = sh7367_init_irq,
209 .init_machine = g3evm_init,
210 .timer = &shmobile_timer,
211MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
new file mode 100644
index 000000000000..5acd623f93e7
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -0,0 +1,211 @@
1/*
2 * G4EVM board support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/mtd/mtd.h>
27#include <linux/mtd/partitions.h>
28#include <linux/mtd/physmap.h>
29#include <linux/usb/r8a66597.h>
30#include <linux/io.h>
31#include <linux/gpio.h>
32#include <mach/sh7377.h>
33#include <mach/common.h>
34#include <asm/mach-types.h>
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37
38static struct mtd_partition nor_flash_partitions[] = {
39 {
40 .name = "loader",
41 .offset = 0x00000000,
42 .size = 512 * 1024,
43 },
44 {
45 .name = "bootenv",
46 .offset = MTDPART_OFS_APPEND,
47 .size = 512 * 1024,
48 },
49 {
50 .name = "kernel_ro",
51 .offset = MTDPART_OFS_APPEND,
52 .size = 8 * 1024 * 1024,
53 .mask_flags = MTD_WRITEABLE,
54 },
55 {
56 .name = "kernel",
57 .offset = MTDPART_OFS_APPEND,
58 .size = 8 * 1024 * 1024,
59 },
60 {
61 .name = "data",
62 .offset = MTDPART_OFS_APPEND,
63 .size = MTDPART_SIZ_FULL,
64 },
65};
66
67static struct physmap_flash_data nor_flash_data = {
68 .width = 2,
69 .parts = nor_flash_partitions,
70 .nr_parts = ARRAY_SIZE(nor_flash_partitions),
71};
72
73static struct resource nor_flash_resources[] = {
74 [0] = {
75 .start = 0x00000000,
76 .end = 0x08000000 - 1,
77 .flags = IORESOURCE_MEM,
78 }
79};
80
81static struct platform_device nor_flash_device = {
82 .name = "physmap-flash",
83 .dev = {
84 .platform_data = &nor_flash_data,
85 },
86 .num_resources = ARRAY_SIZE(nor_flash_resources),
87 .resource = nor_flash_resources,
88};
89
90/* USBHS */
91void usb_host_port_power(int port, int power)
92{
93 if (!power) /* only power-on supported for now */
94 return;
95
96 /* set VBOUT/PWEN and EXTLP0 in DVSTCTR */
97 __raw_writew(__raw_readw(0xe6890008) | 0x600, 0xe6890008);
98}
99
100static struct r8a66597_platdata usb_host_data = {
101 .on_chip = 1,
102 .port_power = usb_host_port_power,
103};
104
105static struct resource usb_host_resources[] = {
106 [0] = {
107 .name = "USBHS",
108 .start = 0xe6890000,
109 .end = 0xe68900e5,
110 .flags = IORESOURCE_MEM,
111 },
112 [1] = {
113 .start = 65,
114 .end = 65,
115 .flags = IORESOURCE_IRQ,
116 },
117};
118
119static struct platform_device usb_host_device = {
120 .name = "r8a66597_hcd",
121 .id = 0,
122 .dev = {
123 .platform_data = &usb_host_data,
124 .dma_mask = NULL,
125 .coherent_dma_mask = 0xffffffff,
126 },
127 .num_resources = ARRAY_SIZE(usb_host_resources),
128 .resource = usb_host_resources,
129};
130
131static struct platform_device *g4evm_devices[] __initdata = {
132 &nor_flash_device,
133 &usb_host_device,
134};
135
136static struct map_desc g4evm_io_desc[] __initdata = {
137 /* create a 1:1 entity map for 0xe6xxxxxx
138 * used by CPGA, INTC and PFC.
139 */
140 {
141 .virtual = 0xe6000000,
142 .pfn = __phys_to_pfn(0xe6000000),
143 .length = 256 << 20,
144 .type = MT_DEVICE_NONSHARED
145 },
146};
147
148static void __init g4evm_map_io(void)
149{
150 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
151
152 /* setup early devices, clocks and console here as well */
153 sh7377_add_early_devices();
154 sh7367_clock_init(); /* use g3 clocks for now */
155 shmobile_setup_console();
156}
157
158static void __init g4evm_init(void)
159{
160 sh7377_pinmux_init();
161
162 /* Lit DS14 LED */
163 gpio_request(GPIO_PORT109, NULL);
164 gpio_direction_output(GPIO_PORT109, 1);
165 gpio_export(GPIO_PORT109, 1);
166
167 /* Lit DS15 LED */
168 gpio_request(GPIO_PORT110, NULL);
169 gpio_direction_output(GPIO_PORT110, 1);
170 gpio_export(GPIO_PORT110, 1);
171
172 /* Lit DS16 LED */
173 gpio_request(GPIO_PORT112, NULL);
174 gpio_direction_output(GPIO_PORT112, 1);
175 gpio_export(GPIO_PORT112, 1);
176
177 /* Lit DS17 LED */
178 gpio_request(GPIO_PORT113, NULL);
179 gpio_direction_output(GPIO_PORT113, 1);
180 gpio_export(GPIO_PORT113, 1);
181
182 /* USBHS */
183 gpio_request(GPIO_FN_VBUS_0, NULL);
184 gpio_request(GPIO_FN_PWEN, NULL);
185 gpio_request(GPIO_FN_OVCN, NULL);
186 gpio_request(GPIO_FN_OVCN2, NULL);
187 gpio_request(GPIO_FN_EXTLP, NULL);
188 gpio_request(GPIO_FN_IDIN, NULL);
189
190 /* enable clock in SMSTPCR3 */
191 __raw_writel(__raw_readl(0xe615013c) & ~(1 << 22), 0xe615013c);
192
193 /* setup USB phy */
194 __raw_writew(0x0200, 0xe605810a); /* USBCR1 */
195 __raw_writew(0x00e0, 0xe60581c0); /* CPFCH */
196 __raw_writew(0x6010, 0xe60581c6); /* CGPOSR */
197 __raw_writew(0x8a0a, 0xe605810c); /* USBCR2 */
198
199 sh7377_add_standard_devices();
200
201 platform_add_devices(g4evm_devices, ARRAY_SIZE(g4evm_devices));
202}
203
204MACHINE_START(G4EVM, "g4evm")
205 .phys_io = 0xe6000000,
206 .io_pg_offst = ((0xe6000000) >> 18) & 0xfffc,
207 .map_io = g4evm_map_io,
208 .init_irq = sh7377_init_irq,
209 .init_machine = g4evm_init,
210 .timer = &shmobile_timer,
211MACHINE_END
diff --git a/arch/arm/mach-shmobile/clock-sh7367.c b/arch/arm/mach-shmobile/clock-sh7367.c
new file mode 100644
index 000000000000..58bd54e1113a
--- /dev/null
+++ b/arch/arm/mach-shmobile/clock-sh7367.c
@@ -0,0 +1,96 @@
1/*
2 * Preliminary clock framework support for sh7367
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/init.h>
20#include <linux/module.h>
21#include <linux/kernel.h>
22#include <linux/list.h>
23#include <linux/clk.h>
24
25struct clk {
26 const char *name;
27 unsigned long rate;
28};
29
30#include <asm/clkdev.h>
31
32int __clk_get(struct clk *clk)
33{
34 return 1;
35}
36EXPORT_SYMBOL(__clk_get);
37
38void __clk_put(struct clk *clk)
39{
40}
41EXPORT_SYMBOL(__clk_put);
42
43
44int clk_enable(struct clk *clk)
45{
46 return 0;
47}
48EXPORT_SYMBOL(clk_enable);
49
50void clk_disable(struct clk *clk)
51{
52}
53EXPORT_SYMBOL(clk_disable);
54
55unsigned long clk_get_rate(struct clk *clk)
56{
57 return clk ? clk->rate : 0;
58}
59EXPORT_SYMBOL(clk_get_rate);
60
61/* a static peripheral clock for now - enough to get sh-sci working */
62static struct clk peripheral_clk = {
63 .name = "peripheral_clk",
64 .rate = 48000000,
65};
66
67/* a static rclk for now - enough to get sh_cmt working */
68static struct clk r_clk = {
69 .name = "r_clk",
70 .rate = 32768,
71};
72
73/* a static usb0 for now - enough to get r8a66597 working */
74static struct clk usb0_clk = {
75 .name = "usb0",
76};
77
78static struct clk_lookup lookups[] = {
79 {
80 .clk = &peripheral_clk,
81 }, {
82 .clk = &r_clk,
83 }, {
84 .clk = &usb0_clk,
85 }
86};
87
88void __init sh7367_clock_init(void)
89{
90 int i;
91
92 for (i = 0; i < ARRAY_SIZE(lookups); i++) {
93 lookups[i].con_id = lookups[i].clk->name;
94 clkdev_add(&lookups[i]);
95 }
96}
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c
new file mode 100644
index 000000000000..9411a5bf4fd6
--- /dev/null
+++ b/arch/arm/mach-shmobile/console.c
@@ -0,0 +1,31 @@
1/*
2 * SH-Mobile Console
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <mach/common.h>
23#include <asm/mach/map.h>
24
25void __init shmobile_setup_console(void)
26{
27 parse_early_param();
28
29 /* Let earlyprintk output early console messages */
30 early_platform_driver_probe("earlyprintk", 1, 1);
31}
diff --git a/arch/arm/mach-shmobile/include/mach/clkdev.h b/arch/arm/mach-shmobile/include/mach/clkdev.h
new file mode 100644
index 000000000000..36d0163a857a
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/clkdev.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_CLKDEV_H
2#define __ASM_MACH_CLKDEV_H
3
4int __clk_get(struct clk *clk);
5void __clk_put(struct clk *clk);
6
7#endif /* __ASM_MACH_CLKDEV_H */
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
new file mode 100644
index 000000000000..57903605cc51
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -0,0 +1,23 @@
1#ifndef __ARCH_MACH_COMMON_H
2#define __ARCH_MACH_COMMON_H
3
4extern struct sys_timer shmobile_timer;
5extern void shmobile_setup_console(void);
6
7extern void sh7367_init_irq(void);
8extern void sh7367_add_early_devices(void);
9extern void sh7367_add_standard_devices(void);
10extern void sh7367_clock_init(void);
11extern void sh7367_pinmux_init(void);
12
13extern void sh7377_init_irq(void);
14extern void sh7377_add_early_devices(void);
15extern void sh7377_add_standard_devices(void);
16extern void sh7377_pinmux_init(void);
17
18extern void sh7372_init_irq(void);
19extern void sh7372_add_early_devices(void);
20extern void sh7372_add_standard_devices(void);
21extern void sh7372_pinmux_init(void);
22
23#endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/include/mach/dma.h b/arch/arm/mach-shmobile/include/mach/dma.h
new file mode 100644
index 000000000000..40a8c178f10d
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/dma.h
@@ -0,0 +1 @@
/* empty */
diff --git a/arch/arm/mach-shmobile/include/mach/entry-macro.S b/arch/arm/mach-shmobile/include/mach/entry-macro.S
new file mode 100644
index 000000000000..a285d13c7416
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/entry-macro.S
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2008 Renesas Solutions Corp.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17#include <mach/hardware.h>
18#include <mach/irqs.h>
19
20 .macro disable_fiq
21 .endm
22
23 .macro get_irqnr_preamble, base, tmp
24 ldr \base, =INTFLGA
25 .endm
26
27 .macro arch_ret_to_user, tmp1, tmp2
28 .endm
29
30 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
31 ldr \irqnr, [\base]
32 cmp \irqnr, #0
33 beq 1000f
34 /* intevt to irq number */
35 lsr \irqnr, \irqnr, #0x5
36 subs \irqnr, \irqnr, #16
37
381000:
39 .endm
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
new file mode 100644
index 000000000000..5bc6bd444d72
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -0,0 +1,48 @@
1/*
2 * Generic GPIO API and pinmux table support
3 *
4 * Copyright (c) 2008 Magnus Damm
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#ifndef __ASM_ARCH_GPIO_H
11#define __ASM_ARCH_GPIO_H
12
13#include <linux/kernel.h>
14#include <linux/errno.h>
15
16#define ARCH_NR_GPIOS 1024
17#include <linux/sh_pfc.h>
18
19#ifdef CONFIG_GPIOLIB
20
21static inline int gpio_get_value(unsigned gpio)
22{
23 return __gpio_get_value(gpio);
24}
25
26static inline void gpio_set_value(unsigned gpio, int value)
27{
28 __gpio_set_value(gpio, value);
29}
30
31static inline int gpio_cansleep(unsigned gpio)
32{
33 return __gpio_cansleep(gpio);
34}
35
36static inline int gpio_to_irq(unsigned gpio)
37{
38 return -ENOSYS;
39}
40
41static inline int irq_to_gpio(unsigned int irq)
42{
43 return -EINVAL;
44}
45
46#endif /* CONFIG_GPIOLIB */
47
48#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-shmobile/include/mach/hardware.h b/arch/arm/mach-shmobile/include/mach/hardware.h
new file mode 100644
index 000000000000..3f0ef194603e
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/hardware.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_HARDWARE_H
2#define __ASM_MACH_HARDWARE_H
3
4/* INTFLGA register - used by low level interrupt code in entry-macro.S */
5#define INTFLGA 0xe6980018
6
7#endif /* __ASM_MACH_HARDWARE_H */
diff --git a/arch/arm/mach-shmobile/include/mach/io.h b/arch/arm/mach-shmobile/include/mach/io.h
new file mode 100644
index 000000000000..7339fe46cb7c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/io.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_MACH_IO_H
2#define __ASM_MACH_IO_H
3
4#define IO_SPACE_LIMIT 0xffffffff
5
6#define __io(a) ((void __iomem *)(a))
7#define __mem_pci(a) (a)
8
9#endif /* __ASM_MACH_IO_H */
diff --git a/arch/arm/mach-shmobile/include/mach/irqs.h b/arch/arm/mach-shmobile/include/mach/irqs.h
new file mode 100644
index 000000000000..5179b72e1ee3
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/irqs.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_MACH_IRQS_H
2#define __ASM_MACH_IRQS_H
3
4#define NR_IRQS 512
5#define NR_IRQS_LEGACY 8
6
7#define evt2irq(evt) (((evt) >> 5) - 16)
8#define irq2evt(irq) (((irq) + 16) << 5)
9
10#endif /* __ASM_MACH_IRQS_H */
diff --git a/arch/arm/mach-shmobile/include/mach/memory.h b/arch/arm/mach-shmobile/include/mach/memory.h
new file mode 100644
index 000000000000..e188183f4dce
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/memory.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_MACH_MEMORY_H
2#define __ASM_MACH_MEMORY_H
3
4#define PHYS_OFFSET UL(CONFIG_MEMORY_START)
5#define MEM_SIZE UL(CONFIG_MEMORY_SIZE)
6
7#endif /* __ASM_MACH_MEMORY_H */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7367.h b/arch/arm/mach-shmobile/include/mach/sh7367.h
new file mode 100644
index 000000000000..52d0de686f68
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7367.h
@@ -0,0 +1,332 @@
1#ifndef __ASM_SH7367_H__
2#define __ASM_SH7367_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 /* 49-1 -> 49-6 (GPIO) */
10 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
11 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
12
13 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
14 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
15
16 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
17 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
18
19 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
20 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
21
22 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
23 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
24
25 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
26 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
27
28 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
29 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
30
31 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
32 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
33
34 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
35 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
36
37 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
38 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
39
40 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
41 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
42
43 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
44 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
45
46 GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
47 GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
48
49 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
50 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
51
52 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
53 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
54
55 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
56 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
57
58 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
59 GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
60
61 GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
62 GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
63
64 GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
65 GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
66
67 GPIO_PORT190, GPIO_PORT191, GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
68 GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
69
70 GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
71 GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
72
73 GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
74 GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
75
76 GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
77 GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
78
79 GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
80 GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
81
82 GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
83 GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
84
85 GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
86 GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
87
88 GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
89 GPIO_PORT265, GPIO_PORT266, GPIO_PORT267, GPIO_PORT268, GPIO_PORT269,
90
91 GPIO_PORT270, GPIO_PORT271, GPIO_PORT272,
92
93 /* Special Pull-up / Pull-down Functions */
94 GPIO_FN_PORT48_KEYIN0_PU, GPIO_FN_PORT49_KEYIN1_PU,
95 GPIO_FN_PORT50_KEYIN2_PU, GPIO_FN_PORT55_KEYIN3_PU,
96 GPIO_FN_PORT56_KEYIN4_PU, GPIO_FN_PORT57_KEYIN5_PU,
97 GPIO_FN_PORT58_KEYIN6_PU,
98
99 /* 49-1 (FN) */
100 GPIO_FN_VBUS0, GPIO_FN_CPORT0, GPIO_FN_CPORT1, GPIO_FN_CPORT2,
101 GPIO_FN_CPORT3, GPIO_FN_CPORT4, GPIO_FN_CPORT5, GPIO_FN_CPORT6,
102 GPIO_FN_CPORT7, GPIO_FN_CPORT8, GPIO_FN_CPORT9, GPIO_FN_CPORT10,
103 GPIO_FN_CPORT11, GPIO_FN_SIN2, GPIO_FN_CPORT12, GPIO_FN_XCTS2,
104 GPIO_FN_CPORT13, GPIO_FN_RFSPO4, GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
105 GPIO_FN_CPORT15, GPIO_FN_CPORT16, GPIO_FN_CPORT17, GPIO_FN_SOUT2,
106 GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_CPORT19, GPIO_FN_CPORT20,
107 GPIO_FN_RFSPO6, GPIO_FN_CPORT21, GPIO_FN_STATUS0, GPIO_FN_CPORT22,
108 GPIO_FN_STATUS1, GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
109 GPIO_FN_MPORT0, GPIO_FN_MPORT1, GPIO_FN_B_SYNLD1, GPIO_FN_B_SYNLD2,
110 GPIO_FN_XMAINPS, GPIO_FN_XDIVPS, GPIO_FN_XIDRST, GPIO_FN_IDCLK,
111 GPIO_FN_IDIO, GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD,
112 GPIO_FN_M02_BERDAT, GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
113 GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
114 GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
115
116 /* 49-2 (FN) */
117 GPIO_FN_HSU_IQ_AGC6, GPIO_FN_MFG2_IN2, GPIO_FN_MSIOF2_MCK0,
118 GPIO_FN_HSU_IQ_AGC5, GPIO_FN_MFG2_IN1, GPIO_FN_MSIOF2_MCK1,
119 GPIO_FN_HSU_IQ_AGC4, GPIO_FN_MSIOF2_RSYNC,
120 GPIO_FN_HSU_IQ_AGC3, GPIO_FN_MFG2_OUT1, GPIO_FN_MSIOF2_RSCK,
121 GPIO_FN_HSU_IQ_AGC2, GPIO_FN_PORT42_KEYOUT0,
122 GPIO_FN_HSU_IQ_AGC1, GPIO_FN_PORT43_KEYOUT1,
123 GPIO_FN_HSU_IQ_AGC0, GPIO_FN_PORT44_KEYOUT2,
124 GPIO_FN_HSU_IQ_AGC_ST, GPIO_FN_PORT45_KEYOUT3,
125 GPIO_FN_HSU_IQ_PDO, GPIO_FN_PORT46_KEYOUT4,
126 GPIO_FN_HSU_IQ_PYO, GPIO_FN_PORT47_KEYOUT5,
127 GPIO_FN_HSU_EN_TXMUX_G3MO, GPIO_FN_PORT48_KEYIN0,
128 GPIO_FN_HSU_I_TXMUX_G3MO, GPIO_FN_PORT49_KEYIN1,
129 GPIO_FN_HSU_Q_TXMUX_G3MO, GPIO_FN_PORT50_KEYIN2,
130 GPIO_FN_HSU_SYO, GPIO_FN_PORT51_MSIOF2_TSYNC,
131 GPIO_FN_HSU_SDO, GPIO_FN_PORT52_MSIOF2_TSCK,
132 GPIO_FN_HSU_TGTTI_G3MO, GPIO_FN_PORT53_MSIOF2_TXD,
133 GPIO_FN_B_TIME_STAMP, GPIO_FN_PORT54_MSIOF2_RXD,
134 GPIO_FN_HSU_SDI, GPIO_FN_PORT55_KEYIN3,
135 GPIO_FN_HSU_SCO, GPIO_FN_PORT56_KEYIN4,
136 GPIO_FN_HSU_DREQ, GPIO_FN_PORT57_KEYIN5,
137 GPIO_FN_HSU_DACK, GPIO_FN_PORT58_KEYIN6,
138 GPIO_FN_HSU_CLK61M, GPIO_FN_PORT59_MSIOF2_SS1,
139 GPIO_FN_HSU_XRST, GPIO_FN_PORT60_MSIOF2_SS2,
140 GPIO_FN_PCMCLKO, GPIO_FN_SYNC8KO, GPIO_FN_DNPCM_A, GPIO_FN_UPPCM_A,
141 GPIO_FN_XTALB1L,
142 GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
143 GPIO_FN_GPS_AGC2, GPIO_FN_SCIFA0_SCK,
144 GPIO_FN_GPS_AGC3, GPIO_FN_SCIFA0_TXD,
145 GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
146 GPIO_FN_GPS_PWRD, GPIO_FN_SCIFA0_CTS,
147 GPIO_FN_GPS_IM, GPIO_FN_GPS_IS, GPIO_FN_GPS_QM, GPIO_FN_GPS_QS,
148 GPIO_FN_SIUBOMC, GPIO_FN_TPU2TO0,
149 GPIO_FN_SIUCKB, GPIO_FN_TPU2TO1,
150 GPIO_FN_SIUBOLR, GPIO_FN_BBIF2_TSYNC, GPIO_FN_TPU2TO2,
151 GPIO_FN_SIUBOBT, GPIO_FN_BBIF2_TSCK, GPIO_FN_TPU2TO3,
152 GPIO_FN_SIUBOSLD, GPIO_FN_BBIF2_TXD, GPIO_FN_TPU3TO0,
153 GPIO_FN_SIUBILR, GPIO_FN_TPU3TO1,
154 GPIO_FN_SIUBIBT, GPIO_FN_TPU3TO2,
155 GPIO_FN_SIUBISLD, GPIO_FN_TPU3TO3,
156 GPIO_FN_NMI, GPIO_FN_TPU4TO0,
157 GPIO_FN_DNPCM_M, GPIO_FN_TPU4TO1, GPIO_FN_TPU4TO2, GPIO_FN_TPU4TO3,
158 GPIO_FN_IRQ_TMPB,
159 GPIO_FN_PWEN, GPIO_FN_MFG1_OUT1,
160 GPIO_FN_OVCN, GPIO_FN_MFG1_IN1,
161 GPIO_FN_OVCN2, GPIO_FN_MFG1_IN2,
162
163 /* 49-3 (FN) */
164 GPIO_FN_RFSPO1, GPIO_FN_RFSPO2, GPIO_FN_RFSPO3, GPIO_FN_PORT93_VIO_CKO2,
165 GPIO_FN_USBTERM, GPIO_FN_EXTLP, GPIO_FN_IDIN,
166 GPIO_FN_SCIFA5_CTS, GPIO_FN_MFG0_IN1,
167 GPIO_FN_SCIFA5_RTS, GPIO_FN_MFG0_IN2,
168 GPIO_FN_SCIFA5_RXD,
169 GPIO_FN_SCIFA5_TXD,
170 GPIO_FN_SCIFA5_SCK, GPIO_FN_MFG0_OUT1,
171 GPIO_FN_A0_EA0, GPIO_FN_BS,
172 GPIO_FN_A14_EA14, GPIO_FN_PORT102_KEYOUT0,
173 GPIO_FN_A15_EA15, GPIO_FN_PORT103_KEYOUT1, GPIO_FN_DV_CLKOL,
174 GPIO_FN_A16_EA16, GPIO_FN_PORT104_KEYOUT2,
175 GPIO_FN_DV_VSYNCL, GPIO_FN_MSIOF0_SS1,
176 GPIO_FN_A17_EA17, GPIO_FN_PORT105_KEYOUT3,
177 GPIO_FN_DV_HSYNCL, GPIO_FN_MSIOF0_TSYNC,
178 GPIO_FN_A18_EA18, GPIO_FN_PORT106_KEYOUT4,
179 GPIO_FN_DV_DL0, GPIO_FN_MSIOF0_TSCK,
180 GPIO_FN_A19_EA19, GPIO_FN_PORT107_KEYOUT5,
181 GPIO_FN_DV_DL1, GPIO_FN_MSIOF0_TXD,
182 GPIO_FN_A20_EA20, GPIO_FN_PORT108_KEYIN0,
183 GPIO_FN_DV_DL2, GPIO_FN_MSIOF0_RSCK,
184 GPIO_FN_A21_EA21, GPIO_FN_PORT109_KEYIN1,
185 GPIO_FN_DV_DL3, GPIO_FN_MSIOF0_RSYNC,
186 GPIO_FN_A22_EA22, GPIO_FN_PORT110_KEYIN2,
187 GPIO_FN_DV_DL4, GPIO_FN_MSIOF0_MCK0,
188 GPIO_FN_A23_EA23, GPIO_FN_PORT111_KEYIN3,
189 GPIO_FN_DV_DL5, GPIO_FN_MSIOF0_MCK1,
190 GPIO_FN_A24_EA24, GPIO_FN_PORT112_KEYIN4,
191 GPIO_FN_DV_DL6, GPIO_FN_MSIOF0_RXD,
192 GPIO_FN_A25_EA25, GPIO_FN_PORT113_KEYIN5,
193 GPIO_FN_DV_DL7, GPIO_FN_MSIOF0_SS2,
194 GPIO_FN_A26, GPIO_FN_PORT113_KEYIN6, GPIO_FN_DV_CLKIL,
195 GPIO_FN_D0_ED0_NAF0, GPIO_FN_D1_ED1_NAF1, GPIO_FN_D2_ED2_NAF2,
196 GPIO_FN_D3_ED3_NAF3, GPIO_FN_D4_ED4_NAF4, GPIO_FN_D5_ED5_NAF5,
197 GPIO_FN_D6_ED6_NAF6, GPIO_FN_D7_ED7_NAF7, GPIO_FN_D8_ED8_NAF8,
198 GPIO_FN_D9_ED9_NAF9, GPIO_FN_D10_ED10_NAF10, GPIO_FN_D11_ED11_NAF11,
199 GPIO_FN_D12_ED12_NAF12, GPIO_FN_D13_ED13_NAF13,
200 GPIO_FN_D14_ED14_NAF14, GPIO_FN_D15_ED15_NAF15,
201 GPIO_FN_CS4, GPIO_FN_CS5A, GPIO_FN_CS5B, GPIO_FN_FCE1,
202 GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_FCE0, GPIO_FN_CS6A,
203 GPIO_FN_DACK0, GPIO_FN_WAIT, GPIO_FN_DREQ0, GPIO_FN_RD_XRD,
204 GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_WE0_XWR0_FWE,
205 GPIO_FN_WE1_XWR1, GPIO_FN_FRB, GPIO_FN_CKO,
206 GPIO_FN_NBRSTOUT, GPIO_FN_NBRST,
207
208 /* 49-4 (FN) */
209 GPIO_FN_RFSPO0, GPIO_FN_PORT146_VIO_CKO2, GPIO_FN_TSTMD,
210 GPIO_FN_VIO_VD, GPIO_FN_VIO_HD,
211 GPIO_FN_VIO_D0, GPIO_FN_VIO_D1, GPIO_FN_VIO_D2,
212 GPIO_FN_VIO_D3, GPIO_FN_VIO_D4, GPIO_FN_VIO_D5,
213 GPIO_FN_VIO_D6, GPIO_FN_VIO_D7, GPIO_FN_VIO_D8,
214 GPIO_FN_VIO_D9, GPIO_FN_VIO_D10, GPIO_FN_VIO_D11,
215 GPIO_FN_VIO_D12, GPIO_FN_VIO_D13, GPIO_FN_VIO_D14,
216 GPIO_FN_VIO_D15, GPIO_FN_VIO_CLK, GPIO_FN_VIO_FIELD,
217 GPIO_FN_VIO_CKO,
218 GPIO_FN_MFG3_IN1, GPIO_FN_MFG3_IN2,
219 GPIO_FN_M9_SLCD_A01, GPIO_FN_MFG3_OUT1, GPIO_FN_TPU0TO0,
220 GPIO_FN_M10_SLCD_CK1, GPIO_FN_MFG4_IN1, GPIO_FN_TPU0TO1,
221 GPIO_FN_M11_SLCD_SO1, GPIO_FN_MFG4_IN2, GPIO_FN_TPU0TO2,
222 GPIO_FN_M12_SLCD_CE1, GPIO_FN_MFG4_OUT1, GPIO_FN_TPU0TO3,
223 GPIO_FN_LCDD0, GPIO_FN_PORT175_KEYOUT0, GPIO_FN_DV_D0,
224 GPIO_FN_SIUCKA, GPIO_FN_MFG0_OUT2,
225 GPIO_FN_LCDD1, GPIO_FN_PORT176_KEYOUT1, GPIO_FN_DV_D1,
226 GPIO_FN_SIUAOLR, GPIO_FN_BBIF2_TSYNC1,
227 GPIO_FN_LCDD2, GPIO_FN_PORT177_KEYOUT2, GPIO_FN_DV_D2,
228 GPIO_FN_SIUAOBT, GPIO_FN_BBIF2_TSCK1,
229 GPIO_FN_LCDD3, GPIO_FN_PORT178_KEYOUT3, GPIO_FN_DV_D3,
230 GPIO_FN_SIUAOSLD, GPIO_FN_BBIF2_TXD1,
231 GPIO_FN_LCDD4, GPIO_FN_PORT179_KEYOUT4, GPIO_FN_DV_D4,
232 GPIO_FN_SIUAISPD, GPIO_FN_MFG1_OUT2,
233 GPIO_FN_LCDD5, GPIO_FN_PORT180_KEYOUT5, GPIO_FN_DV_D5,
234 GPIO_FN_SIUAILR, GPIO_FN_MFG2_OUT2,
235 GPIO_FN_LCDD6, GPIO_FN_DV_D6,
236 GPIO_FN_SIUAIBT, GPIO_FN_MFG3_OUT2, GPIO_FN_XWR2,
237 GPIO_FN_LCDD7, GPIO_FN_DV_D7,
238 GPIO_FN_SIUAISLD, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
239 GPIO_FN_LCDD8, GPIO_FN_DV_D8, GPIO_FN_D16, GPIO_FN_ED16,
240 GPIO_FN_LCDD9, GPIO_FN_DV_D9, GPIO_FN_D17, GPIO_FN_ED17,
241 GPIO_FN_LCDD10, GPIO_FN_DV_D10, GPIO_FN_D18, GPIO_FN_ED18,
242 GPIO_FN_LCDD11, GPIO_FN_DV_D11, GPIO_FN_D19, GPIO_FN_ED19,
243 GPIO_FN_LCDD12, GPIO_FN_DV_D12, GPIO_FN_D20, GPIO_FN_ED20,
244 GPIO_FN_LCDD13, GPIO_FN_DV_D13, GPIO_FN_D21, GPIO_FN_ED21,
245 GPIO_FN_LCDD14, GPIO_FN_DV_D14, GPIO_FN_D22, GPIO_FN_ED22,
246 GPIO_FN_LCDD15, GPIO_FN_DV_D15, GPIO_FN_D23, GPIO_FN_ED23,
247 GPIO_FN_LCDD16, GPIO_FN_DV_HSYNC, GPIO_FN_D24, GPIO_FN_ED24,
248 GPIO_FN_LCDD17, GPIO_FN_DV_VSYNC, GPIO_FN_D25, GPIO_FN_ED25,
249 GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_MSIOF0L_TSCK,
250 GPIO_FN_D26, GPIO_FN_ED26,
251 GPIO_FN_LCDD19, GPIO_FN_MSIOF0L_TSYNC,
252 GPIO_FN_D27, GPIO_FN_ED27,
253 GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0,
254 GPIO_FN_D28, GPIO_FN_ED28,
255 GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1,
256 GPIO_FN_D29, GPIO_FN_ED29,
257 GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_SS1,
258 GPIO_FN_D30, GPIO_FN_ED30,
259 GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_SS2,
260 GPIO_FN_D31, GPIO_FN_ED31,
261 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_DV_CKO, GPIO_FN_SIUAOSPD,
262 GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_RSYNC,
263
264
265 /* 49-5 (FN) */
266 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
267 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_RSCK,
268 GPIO_FN_LCDCSYN, GPIO_FN_LCDCSYN2, GPIO_FN_DV_CKI,
269 GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_MSIOF0L_RXD,
270 GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_MSIOF0L_TXD,
271 GPIO_FN_VIO_DR0, GPIO_FN_VIO_DR1, GPIO_FN_VIO_DR2, GPIO_FN_VIO_DR3,
272 GPIO_FN_VIO_DR4, GPIO_FN_VIO_DR5, GPIO_FN_VIO_DR6, GPIO_FN_VIO_DR7,
273 GPIO_FN_VIO_VDR, GPIO_FN_VIO_HDR,
274 GPIO_FN_VIO_CLKR, GPIO_FN_VIO_CKOR,
275 GPIO_FN_SCIFA1_TXD, GPIO_FN_GPS_PGFA0,
276 GPIO_FN_SCIFA1_SCK, GPIO_FN_GPS_PGFA1,
277 GPIO_FN_SCIFA1_RTS, GPIO_FN_GPS_EPPSINMON,
278 GPIO_FN_SCIFA1_RXD, GPIO_FN_SCIFA1_CTS,
279 GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA1_TXD2, GPIO_FN_GPS_TXD,
280 GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA1_CTS2, GPIO_FN_I2C_SDA2,
281 GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA1_SCK2,
282 GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA1_RXD2, GPIO_FN_GPS_RXD,
283 GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA1_RTS2,
284 GPIO_FN_MSIOF1_RSYNC, GPIO_FN_I2C_SCL2,
285 GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
286 GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
287 GPIO_FN_MSIOF1_SS2,
288 GPIO_FN_PORT236_IROUT, GPIO_FN_IRDA_OUT,
289 GPIO_FN_IRDA_IN, GPIO_FN_IRDA_FIRSEL,
290 GPIO_FN_TPU1TO0, GPIO_FN_TS_SPSYNC3,
291 GPIO_FN_TPU1TO1, GPIO_FN_TS_SDAT3,
292 GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT241_MSIOF2_SS1,
293 GPIO_FN_TPU1TO3, GPIO_FN_PORT242_MSIOF2_TSCK,
294 GPIO_FN_M13_BSW, GPIO_FN_PORT243_MSIOF2_TSYNC,
295 GPIO_FN_M14_GSW, GPIO_FN_PORT244_MSIOF2_TXD,
296 GPIO_FN_PORT245_IROUT, GPIO_FN_M15_RSW,
297 GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1,
298 GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1,
299 GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT248_MSIOF2_SS2,
300 GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT249_MSIOF2_RXD,
301 GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
302 GPIO_FN_SDHICLK0, GPIO_FN_TCK2,
303 GPIO_FN_SDHICD0,
304 GPIO_FN_SDHID0_0, GPIO_FN_TMS2,
305 GPIO_FN_SDHID0_1, GPIO_FN_TDO2,
306 GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
307 GPIO_FN_SDHID0_3, GPIO_FN_RTCK2,
308
309 /* 49-6 (FN) */
310 GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
311 GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
312 GPIO_FN_SDHICLK1, GPIO_FN_TCK3,
313 GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2,
314 GPIO_FN_TS_SPSYNC2, GPIO_FN_TMS3,
315 GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_AO2,
316 GPIO_FN_TS_SDAT2, GPIO_FN_TDO3,
317 GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2,
318 GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
319 GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2,
320 GPIO_FN_TS_SCK2, GPIO_FN_RTCK3,
321 GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
322 GPIO_FN_SDHICLK2, GPIO_FN_SCIFB_SCK,
323 GPIO_FN_SDHID2_0, GPIO_FN_SCIFB_TXD,
324 GPIO_FN_SDHID2_1, GPIO_FN_SCIFB_CTS,
325 GPIO_FN_SDHID2_2, GPIO_FN_SCIFB_RXD,
326 GPIO_FN_SDHID2_3, GPIO_FN_SCIFB_RTS,
327 GPIO_FN_SDHICMD2,
328 GPIO_FN_RESETOUTS,
329 GPIO_FN_DIVLOCK,
330};
331
332#endif /* __ASM_SH7367_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
new file mode 100644
index 000000000000..dc34f00c56b8
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -0,0 +1,434 @@
1/*
2 * Copyright (C) 2010 Renesas Solutions Corp.
3 *
4 * Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __ASM_SH7372_H__
12#define __ASM_SH7372_H__
13
14/*
15 * Pin Function Controller:
16 * GPIO_FN_xx - GPIO used to select pin function
17 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
18 */
19enum {
20 /* PORT */
21 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
22 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
23
24 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
25 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
26
27 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
28 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
29
30 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
31 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
32
33 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
34 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
35
36 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
37 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
38
39 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
40 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
41
42 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
43 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
44
45 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
46 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
47
48 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
49 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
50
51 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
52 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
53
54 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
55 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118, GPIO_PORT119,
56
57 GPIO_PORT120, GPIO_PORT121, GPIO_PORT122, GPIO_PORT123, GPIO_PORT124,
58 GPIO_PORT125, GPIO_PORT126, GPIO_PORT127, GPIO_PORT128, GPIO_PORT129,
59
60 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
61 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
62
63 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
64 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
65
66 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
67 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
68
69 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
70 GPIO_PORT165, GPIO_PORT166, GPIO_PORT167, GPIO_PORT168, GPIO_PORT169,
71
72 GPIO_PORT170, GPIO_PORT171, GPIO_PORT172, GPIO_PORT173, GPIO_PORT174,
73 GPIO_PORT175, GPIO_PORT176, GPIO_PORT177, GPIO_PORT178, GPIO_PORT179,
74
75 GPIO_PORT180, GPIO_PORT181, GPIO_PORT182, GPIO_PORT183, GPIO_PORT184,
76 GPIO_PORT185, GPIO_PORT186, GPIO_PORT187, GPIO_PORT188, GPIO_PORT189,
77
78 GPIO_PORT190,
79
80 /* IRQ */
81 GPIO_FN_IRQ0_6, /* PORT 6 */
82 GPIO_FN_IRQ0_162, /* PORT 162 */
83 GPIO_FN_IRQ1, /* PORT 12 */
84 GPIO_FN_IRQ2_4, /* PORT 4 */
85 GPIO_FN_IRQ2_5, /* PORT 5 */
86 GPIO_FN_IRQ3_8, /* PORT 8 */
87 GPIO_FN_IRQ3_16, /* PORT 16 */
88 GPIO_FN_IRQ4_17, /* PORT 17 */
89 GPIO_FN_IRQ4_163, /* PORT 163 */
90 GPIO_FN_IRQ5, /* PORT 18 */
91 GPIO_FN_IRQ6_39, /* PORT 39 */
92 GPIO_FN_IRQ6_164, /* PORT 164 */
93 GPIO_FN_IRQ7_40, /* PORT 40 */
94 GPIO_FN_IRQ7_167, /* PORT 167 */
95 GPIO_FN_IRQ8_41, /* PORT 41 */
96 GPIO_FN_IRQ8_168, /* PORT 168 */
97 GPIO_FN_IRQ9_42, /* PORT 42 */
98 GPIO_FN_IRQ9_169, /* PORT 169 */
99 GPIO_FN_IRQ10, /* PORT 65 */
100 GPIO_FN_IRQ11, /* PORT 67 */
101 GPIO_FN_IRQ12_80, /* PORT 80 */
102 GPIO_FN_IRQ12_137, /* PORT 137 */
103 GPIO_FN_IRQ13_81, /* PORT 81 */
104 GPIO_FN_IRQ13_145, /* PORT 145 */
105 GPIO_FN_IRQ14_82, /* PORT 82 */
106 GPIO_FN_IRQ14_146, /* PORT 146 */
107 GPIO_FN_IRQ15_83, /* PORT 83 */
108 GPIO_FN_IRQ15_147, /* PORT 147 */
109 GPIO_FN_IRQ16_84, /* PORT 84 */
110 GPIO_FN_IRQ16_170, /* PORT 170 */
111 GPIO_FN_IRQ17, /* PORT 85 */
112 GPIO_FN_IRQ18, /* PORT 86 */
113 GPIO_FN_IRQ19, /* PORT 87 */
114 GPIO_FN_IRQ20, /* PORT 92 */
115 GPIO_FN_IRQ21, /* PORT 93 */
116 GPIO_FN_IRQ22, /* PORT 94 */
117 GPIO_FN_IRQ23, /* PORT 95 */
118 GPIO_FN_IRQ24, /* PORT 112 */
119 GPIO_FN_IRQ25, /* PORT 119 */
120 GPIO_FN_IRQ26_121, /* PORT 121 */
121 GPIO_FN_IRQ26_172, /* PORT 172 */
122 GPIO_FN_IRQ27_122, /* PORT 122 */
123 GPIO_FN_IRQ27_180, /* PORT 180 */
124 GPIO_FN_IRQ28_123, /* PORT 123 */
125 GPIO_FN_IRQ28_181, /* PORT 181 */
126 GPIO_FN_IRQ29_129, /* PORT 129 */
127 GPIO_FN_IRQ29_182, /* PORT 182 */
128 GPIO_FN_IRQ30_130, /* PORT 130 */
129 GPIO_FN_IRQ30_183, /* PORT 183 */
130 GPIO_FN_IRQ31_138, /* PORT 138 */
131 GPIO_FN_IRQ31_184, /* PORT 184 */
132
133 /*
134 * MSIOF0 (PORT 36, 37, 38, 39
135 * 40, 41, 42, 43, 44, 45)
136 */
137 GPIO_FN_MSIOF0_TSYNC, GPIO_FN_MSIOF0_TSCK,
138 GPIO_FN_MSIOF0_RXD, GPIO_FN_MSIOF0_RSCK,
139 GPIO_FN_MSIOF0_RSYNC, GPIO_FN_MSIOF0_MCK0,
140 GPIO_FN_MSIOF0_MCK1, GPIO_FN_MSIOF0_SS1,
141 GPIO_FN_MSIOF0_SS2, GPIO_FN_MSIOF0_TXD,
142
143 /*
144 * MSIOF1 (PORT 39, 40, 41, 42, 43, 44
145 * 84, 85, 86, 87, 88, 89, 90, 91, 92, 93)
146 */
147 GPIO_FN_MSIOF1_TSCK_39, GPIO_FN_MSIOF1_TSYNC_40,
148 GPIO_FN_MSIOF1_TSCK_88, GPIO_FN_MSIOF1_TSYNC_89,
149 GPIO_FN_MSIOF1_TXD_41, GPIO_FN_MSIOF1_RXD_42,
150 GPIO_FN_MSIOF1_TXD_90, GPIO_FN_MSIOF1_RXD_91,
151 GPIO_FN_MSIOF1_SS1_43, GPIO_FN_MSIOF1_SS2_44,
152 GPIO_FN_MSIOF1_SS1_92, GPIO_FN_MSIOF1_SS2_93,
153 GPIO_FN_MSIOF1_RSCK, GPIO_FN_MSIOF1_RSYNC,
154 GPIO_FN_MSIOF1_MCK0, GPIO_FN_MSIOF1_MCK1,
155
156 /*
157 * MSIOF2 (PORT 134, 135, 136, 137, 138, 139
158 * 148, 149, 150, 151)
159 */
160 GPIO_FN_MSIOF2_RSCK, GPIO_FN_MSIOF2_RSYNC,
161 GPIO_FN_MSIOF2_MCK0, GPIO_FN_MSIOF2_MCK1,
162 GPIO_FN_MSIOF2_SS1, GPIO_FN_MSIOF2_SS2,
163 GPIO_FN_MSIOF2_TSYNC, GPIO_FN_MSIOF2_TSCK,
164 GPIO_FN_MSIOF2_RXD, GPIO_FN_MSIOF2_TXD,
165
166 /* MSIOF3 (PORT 76, 77, 78, 79, 80, 81, 82, 83) */
167 GPIO_FN_BBIF1_RXD, GPIO_FN_BBIF1_TSYNC,
168 GPIO_FN_BBIF1_TSCK, GPIO_FN_BBIF1_TXD,
169 GPIO_FN_BBIF1_RSCK, GPIO_FN_BBIF1_RSYNC,
170 GPIO_FN_BBIF1_FLOW, GPIO_FN_BB_RX_FLOW_N,
171
172 /* MSIOF4 (PORT 0, 1, 2, 3) */
173 GPIO_FN_BBIF2_TSCK1, GPIO_FN_BBIF2_TSYNC1,
174 GPIO_FN_BBIF2_TXD1, GPIO_FN_BBIF2_RXD,
175
176 /* FSI (PORT 4, 5, 6, 7, 8, 9, 10, 11, 15) */
177 GPIO_FN_FSIACK, GPIO_FN_FSIBCK,
178 GPIO_FN_FSIAILR, GPIO_FN_FSIAIBT,
179 GPIO_FN_FSIAISLD, GPIO_FN_FSIAOMC,
180 GPIO_FN_FSIAOLR, GPIO_FN_FSIAOBT,
181 GPIO_FN_FSIAOSLD, GPIO_FN_FSIASPDIF_11,
182 GPIO_FN_FSIASPDIF_15,
183
184 /* FMSI (PORT 12, 13, 14, 15, 16, 17, 18, 65) */
185 GPIO_FN_FMSOCK, GPIO_FN_FMSOOLR,
186 GPIO_FN_FMSIOLR, GPIO_FN_FMSOOBT,
187 GPIO_FN_FMSIOBT, GPIO_FN_FMSOSLD,
188 GPIO_FN_FMSOILR, GPIO_FN_FMSIILR,
189 GPIO_FN_FMSOIBT, GPIO_FN_FMSIIBT,
190 GPIO_FN_FMSISLD, GPIO_FN_FMSICK,
191
192 /* SCIFA0 (PORT 152, 153, 156, 157, 158) */
193 GPIO_FN_SCIFA0_TXD, GPIO_FN_SCIFA0_RXD,
194 GPIO_FN_SCIFA0_SCK, GPIO_FN_SCIFA0_RTS,
195 GPIO_FN_SCIFA0_CTS,
196
197 /* SCIFA1 (PORT 154, 155, 159, 160, 161) */
198 GPIO_FN_SCIFA1_TXD, GPIO_FN_SCIFA1_RXD,
199 GPIO_FN_SCIFA1_SCK, GPIO_FN_SCIFA1_RTS,
200 GPIO_FN_SCIFA1_CTS,
201
202 /* SCIFA2 (PORT 94, 95, 96, 97, 98) */
203 GPIO_FN_SCIFA2_CTS1, GPIO_FN_SCIFA2_RTS1,
204 GPIO_FN_SCIFA2_TXD1, GPIO_FN_SCIFA2_RXD1,
205 GPIO_FN_SCIFA2_SCK1,
206
207 /* SCIFA3 (PORT 43, 44,
208 140, 141, 142, 143, 144) */
209 GPIO_FN_SCIFA3_CTS_43, GPIO_FN_SCIFA3_CTS_140,
210 GPIO_FN_SCIFA3_RTS_44, GPIO_FN_SCIFA3_RTS_141,
211 GPIO_FN_SCIFA3_SCK, GPIO_FN_SCIFA3_TXD,
212 GPIO_FN_SCIFA3_RXD,
213
214 /* SCIFA4 (PORT 5, 6) */
215 GPIO_FN_SCIFA4_RXD, GPIO_FN_SCIFA4_TXD,
216
217 /* SCIFA5 (PORT 8, 12) */
218 GPIO_FN_SCIFA5_RXD, GPIO_FN_SCIFA5_TXD,
219
220 /* SCIFB (PORT 162, 163, 164, 165, 166) */
221 GPIO_FN_SCIFB_SCK, GPIO_FN_SCIFB_RTS,
222 GPIO_FN_SCIFB_CTS, GPIO_FN_SCIFB_TXD,
223 GPIO_FN_SCIFB_RXD,
224
225 /*
226 * CEU (PORT 16, 17,
227 * 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
228 * 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
229 * 120)
230 */
231 GPIO_FN_VIO_HD, GPIO_FN_VIO_CKO1, GPIO_FN_VIO_CKO2,
232 GPIO_FN_VIO_VD, GPIO_FN_VIO_CLK, GPIO_FN_VIO_FIELD,
233 GPIO_FN_VIO_CKO,
234 GPIO_FN_VIO_D0, GPIO_FN_VIO_D1, GPIO_FN_VIO_D2,
235 GPIO_FN_VIO_D3, GPIO_FN_VIO_D4, GPIO_FN_VIO_D5,
236 GPIO_FN_VIO_D6, GPIO_FN_VIO_D7, GPIO_FN_VIO_D8,
237 GPIO_FN_VIO_D9, GPIO_FN_VIO_D10, GPIO_FN_VIO_D11,
238 GPIO_FN_VIO_D12, GPIO_FN_VIO_D13, GPIO_FN_VIO_D14,
239 GPIO_FN_VIO_D15,
240
241 /* USB0 (PORT 113, 114, 115, 116, 117, 167) */
242 GPIO_FN_IDIN_0, GPIO_FN_EXTLP_0,
243 GPIO_FN_OVCN2_0, GPIO_FN_PWEN_0,
244 GPIO_FN_OVCN_0, GPIO_FN_VBUS0_0,
245
246 /* USB1 (PORT 18, 113, 114, 115, 116, 117, 138, 162, 168) */
247 GPIO_FN_IDIN_1_18, GPIO_FN_IDIN_1_113,
248 GPIO_FN_PWEN_1_115, GPIO_FN_PWEN_1_138,
249 GPIO_FN_OVCN_1_114, GPIO_FN_OVCN_1_162,
250 GPIO_FN_EXTLP_1, GPIO_FN_OVCN2_1,
251 GPIO_FN_VBUS0_1,
252
253 /* GPIO (PORT 41, 42, 43, 44) */
254 GPIO_FN_GPI0, GPIO_FN_GPI1, GPIO_FN_GPO0, GPIO_FN_GPO1,
255
256 /*
257 * BSC (PORT 19,
258 * 20, 21, 22, 25, 26, 27, 28, 29,
259 * 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
260 * 40, 41, 42, 43, 44, 45,
261 * 62, 63, 64, 65, 66, 67,
262 * 71, 72, 74, 75)
263 */
264 GPIO_FN_BS, GPIO_FN_WE1,
265 GPIO_FN_CKO, GPIO_FN_WAIT, GPIO_FN_RDWR,
266
267 GPIO_FN_A0, GPIO_FN_A1, GPIO_FN_A2, GPIO_FN_A3,
268 GPIO_FN_A6, GPIO_FN_A7, GPIO_FN_A8, GPIO_FN_A9,
269 GPIO_FN_A10, GPIO_FN_A11, GPIO_FN_A12, GPIO_FN_A13,
270 GPIO_FN_A14, GPIO_FN_A15, GPIO_FN_A16, GPIO_FN_A17,
271 GPIO_FN_A18, GPIO_FN_A19, GPIO_FN_A20, GPIO_FN_A21,
272 GPIO_FN_A22, GPIO_FN_A23, GPIO_FN_A24, GPIO_FN_A25,
273 GPIO_FN_A26,
274
275 GPIO_FN_CS0, GPIO_FN_CS2, GPIO_FN_CS4,
276 GPIO_FN_CS5A, GPIO_FN_CS5B, GPIO_FN_CS6A,
277
278 /*
279 * BSC/FLCTL (PORT 23, 24,
280 * 46, 47, 48, 49,
281 * 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
282 * 60, 61, 69, 70)
283 */
284 GPIO_FN_RD_FSC, GPIO_FN_WE0_FWE,
285 GPIO_FN_A4_FOE, GPIO_FN_A5_FCDE,
286 GPIO_FN_D0_NAF0, GPIO_FN_D1_NAF1, GPIO_FN_D2_NAF2,
287 GPIO_FN_D3_NAF3, GPIO_FN_D4_NAF4, GPIO_FN_D5_NAF5,
288 GPIO_FN_D6_NAF6, GPIO_FN_D7_NAF7, GPIO_FN_D8_NAF8,
289 GPIO_FN_D9_NAF9, GPIO_FN_D10_NAF10, GPIO_FN_D11_NAF11,
290 GPIO_FN_D12_NAF12, GPIO_FN_D13_NAF13, GPIO_FN_D14_NAF14,
291 GPIO_FN_D15_NAF15,
292
293 /*
294 * MMCIF(1) (PORT 84, 85, 86, 87, 88, 89,
295 * 90, 91, 92, 99)
296 */
297 GPIO_FN_MMCD0_0, GPIO_FN_MMCD0_1, GPIO_FN_MMCD0_2,
298 GPIO_FN_MMCD0_3, GPIO_FN_MMCD0_4, GPIO_FN_MMCD0_5,
299 GPIO_FN_MMCD0_6, GPIO_FN_MMCD0_7,
300 GPIO_FN_MMCCMD0, GPIO_FN_MMCCLK0,
301
302 /* MMCIF(2) (PORT 54, 55, 56, 57, 58, 59, 60, 61, 66, 67) */
303 GPIO_FN_MMCD1_0, GPIO_FN_MMCD1_1, GPIO_FN_MMCD1_2,
304 GPIO_FN_MMCD1_3, GPIO_FN_MMCD1_4, GPIO_FN_MMCD1_5,
305 GPIO_FN_MMCD1_6, GPIO_FN_MMCD1_7,
306 GPIO_FN_MMCCLK1, GPIO_FN_MMCCMD1,
307
308 /* SPU2 (PORT 65) */
309 GPIO_FN_VINT_I,
310
311 /* FLCTL (PORT 66, 68, 73) */
312 GPIO_FN_FCE1, GPIO_FN_FCE0, GPIO_FN_FRB,
313
314 /* HSI (PORT 76, 77, 78, 79, 80, 81, 82, 83) */
315 GPIO_FN_GP_RX_FLAG, GPIO_FN_GP_RX_DATA, GPIO_FN_GP_TX_READY,
316 GPIO_FN_GP_RX_WAKE, GPIO_FN_MP_TX_FLAG, GPIO_FN_MP_TX_DATA,
317 GPIO_FN_MP_RX_READY, GPIO_FN_MP_TX_WAKE,
318
319 /*
320 * MFI (PORT 76, 77, 78, 79,
321 * 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
322 * 90, 91, 92, 93, 94, 95, 96, 97, 98, 99)
323 */
324 GPIO_FN_MFIv6, /* see MSEL4CR 6 */
325 GPIO_FN_MFIv4, /* see MSEL4CR 6 */
326
327 GPIO_FN_MEMC_CS0, GPIO_FN_MEMC_BUSCLK_MEMC_A0,
328 GPIO_FN_MEMC_CS1_MEMC_A1, GPIO_FN_MEMC_ADV_MEMC_DREQ0,
329 GPIO_FN_MEMC_WAIT_MEMC_DREQ1, GPIO_FN_MEMC_NOE,
330 GPIO_FN_MEMC_NWE, GPIO_FN_MEMC_INT,
331
332 GPIO_FN_MEMC_AD0, GPIO_FN_MEMC_AD1, GPIO_FN_MEMC_AD2,
333 GPIO_FN_MEMC_AD3, GPIO_FN_MEMC_AD4, GPIO_FN_MEMC_AD5,
334 GPIO_FN_MEMC_AD6, GPIO_FN_MEMC_AD7, GPIO_FN_MEMC_AD8,
335 GPIO_FN_MEMC_AD9, GPIO_FN_MEMC_AD10, GPIO_FN_MEMC_AD11,
336 GPIO_FN_MEMC_AD12, GPIO_FN_MEMC_AD13, GPIO_FN_MEMC_AD14,
337 GPIO_FN_MEMC_AD15,
338
339 /* SIM (PORT 94, 95, 98) */
340 GPIO_FN_SIM_RST, GPIO_FN_SIM_CLK, GPIO_FN_SIM_D,
341
342 /* TPU (PORT 93, 99, 112, 160, 161) */
343 GPIO_FN_TPU0TO0, GPIO_FN_TPU0TO1,
344 GPIO_FN_TPU0TO2_93, GPIO_FN_TPU0TO2_99,
345 GPIO_FN_TPU0TO3,
346
347 /* I2C2 (PORT 110, 111) */
348 GPIO_FN_I2C_SCL2, GPIO_FN_I2C_SDA2,
349
350 /* I2C3(1) (PORT 114, 115) */
351 GPIO_FN_I2C_SCL3, GPIO_FN_I2C_SDA3,
352
353 /* I2C3(2) (PORT 137, 145) */
354 GPIO_FN_I2C_SCL3S, GPIO_FN_I2C_SDA3S,
355
356 /* I2C4(2) (PORT 116, 117) */
357 GPIO_FN_I2C_SCL4, GPIO_FN_I2C_SDA4,
358
359 /* I2C4(2) (PORT 146, 147) */
360 GPIO_FN_I2C_SCL4S, GPIO_FN_I2C_SDA4S,
361
362 /*
363 * KEYSC (PORT 121, 122, 123, 124, 125, 126, 127, 128, 129,
364 * 130, 131, 132, 133, 134, 135, 136)
365 */
366 GPIO_FN_KEYOUT0, GPIO_FN_KEYIN0_121, GPIO_FN_KEYIN0_136,
367 GPIO_FN_KEYOUT1, GPIO_FN_KEYIN1_122, GPIO_FN_KEYIN1_135,
368 GPIO_FN_KEYOUT2, GPIO_FN_KEYIN2_123, GPIO_FN_KEYIN2_134,
369 GPIO_FN_KEYOUT3, GPIO_FN_KEYIN3_124, GPIO_FN_KEYIN3_133,
370 GPIO_FN_KEYOUT4, GPIO_FN_KEYIN4,
371 GPIO_FN_KEYOUT5, GPIO_FN_KEYIN5,
372 GPIO_FN_KEYOUT6, GPIO_FN_KEYIN6,
373 GPIO_FN_KEYOUT7, GPIO_FN_KEYIN7,
374
375 /*
376 * LCDC (PORT 121, 122, 123, 124, 125, 126, 127, 128, 129,
377 * 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
378 * 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
379 * 150, 151)
380 */
381 GPIO_FN_LCDC0_SELECT, /* LCDC 0 */
382 GPIO_FN_LCDC1_SELECT, /* LCDC 1 */
383 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDVSYN,
384 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_LCDRD,
385 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_LCDLCLK,
386 GPIO_FN_LCDDON,
387
388 GPIO_FN_LCDD0, GPIO_FN_LCDD1, GPIO_FN_LCDD2, GPIO_FN_LCDD3,
389 GPIO_FN_LCDD4, GPIO_FN_LCDD5, GPIO_FN_LCDD6, GPIO_FN_LCDD7,
390 GPIO_FN_LCDD8, GPIO_FN_LCDD9, GPIO_FN_LCDD10, GPIO_FN_LCDD11,
391 GPIO_FN_LCDD12, GPIO_FN_LCDD13, GPIO_FN_LCDD14, GPIO_FN_LCDD15,
392 GPIO_FN_LCDD16, GPIO_FN_LCDD17, GPIO_FN_LCDD18, GPIO_FN_LCDD19,
393 GPIO_FN_LCDD20, GPIO_FN_LCDD21, GPIO_FN_LCDD22, GPIO_FN_LCDD23,
394
395 /* IRDA (PORT 139, 140, 141, 142) */
396 GPIO_FN_IRDA_OUT, GPIO_FN_IRDA_IN, GPIO_FN_IRDA_FIRSEL,
397 GPIO_FN_IROUT_139, GPIO_FN_IROUT_140,
398
399 /* TSIF1 (PORT 156, 157, 158, 159) */
400 GPIO_FN_TS0_1SELECT, /* TSIF0 - 1 select */
401 GPIO_FN_TS0_2SELECT, /* TSIF0 - 2 select */
402 GPIO_FN_TS1_1SELECT, /* TSIF1 - 1 select */
403 GPIO_FN_TS1_2SELECT, /* TSIF1 - 2 select */
404
405 GPIO_FN_TS_SPSYNC1, GPIO_FN_TS_SDAT1,
406 GPIO_FN_TS_SDEN1, GPIO_FN_TS_SCK1,
407
408 /* TSIF2 (PORT 137, 145, 146, 147) */
409 GPIO_FN_TS_SPSYNC2, GPIO_FN_TS_SDAT2,
410 GPIO_FN_TS_SDEN2, GPIO_FN_TS_SCK2,
411
412 /* HDMI (PORT 169, 170) */
413 GPIO_FN_HDMI_HPD, GPIO_FN_HDMI_CEC,
414
415 /* SDHI0 (PORT 171, 172, 173, 174, 175, 176, 177, 178) */
416 GPIO_FN_SDHICLK0, GPIO_FN_SDHICD0,
417 GPIO_FN_SDHICMD0, GPIO_FN_SDHIWP0,
418 GPIO_FN_SDHID0_0, GPIO_FN_SDHID0_1,
419 GPIO_FN_SDHID0_2, GPIO_FN_SDHID0_3,
420
421 /* SDHI1 (PORT 179, 180, 181, 182, 183, 184) */
422 GPIO_FN_SDHICLK1, GPIO_FN_SDHICMD1, GPIO_FN_SDHID1_0,
423 GPIO_FN_SDHID1_1, GPIO_FN_SDHID1_2, GPIO_FN_SDHID1_3,
424
425 /* SDHI2 (PORT 185, 186, 187, 188, 189, 190) */
426 GPIO_FN_SDHICLK2, GPIO_FN_SDHICMD2, GPIO_FN_SDHID2_0,
427 GPIO_FN_SDHID2_1, GPIO_FN_SDHID2_2, GPIO_FN_SDHID2_3,
428
429 /* SDENC see MSEL4CR 19 */
430 GPIO_FN_SDENC_CPG,
431 GPIO_FN_SDENC_DV_CLKI,
432};
433
434#endif /* __ASM_SH7372_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/sh7377.h b/arch/arm/mach-shmobile/include/mach/sh7377.h
new file mode 100644
index 000000000000..f580e227dd1c
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/sh7377.h
@@ -0,0 +1,360 @@
1#ifndef __ASM_SH7377_H__
2#define __ASM_SH7377_H__
3
4/* Pin Function Controller:
5 * GPIO_FN_xx - GPIO used to select pin function
6 * GPIO_PORTxx - GPIO mapped to real I/O pin on CPU
7 */
8enum {
9 /* 55-1 -> 55-5 (GPIO) */
10 GPIO_PORT0, GPIO_PORT1, GPIO_PORT2, GPIO_PORT3, GPIO_PORT4,
11 GPIO_PORT5, GPIO_PORT6, GPIO_PORT7, GPIO_PORT8, GPIO_PORT9,
12
13 GPIO_PORT10, GPIO_PORT11, GPIO_PORT12, GPIO_PORT13, GPIO_PORT14,
14 GPIO_PORT15, GPIO_PORT16, GPIO_PORT17, GPIO_PORT18, GPIO_PORT19,
15
16 GPIO_PORT20, GPIO_PORT21, GPIO_PORT22, GPIO_PORT23, GPIO_PORT24,
17 GPIO_PORT25, GPIO_PORT26, GPIO_PORT27, GPIO_PORT28, GPIO_PORT29,
18
19 GPIO_PORT30, GPIO_PORT31, GPIO_PORT32, GPIO_PORT33, GPIO_PORT34,
20 GPIO_PORT35, GPIO_PORT36, GPIO_PORT37, GPIO_PORT38, GPIO_PORT39,
21
22 GPIO_PORT40, GPIO_PORT41, GPIO_PORT42, GPIO_PORT43, GPIO_PORT44,
23 GPIO_PORT45, GPIO_PORT46, GPIO_PORT47, GPIO_PORT48, GPIO_PORT49,
24
25 GPIO_PORT50, GPIO_PORT51, GPIO_PORT52, GPIO_PORT53, GPIO_PORT54,
26 GPIO_PORT55, GPIO_PORT56, GPIO_PORT57, GPIO_PORT58, GPIO_PORT59,
27
28 GPIO_PORT60, GPIO_PORT61, GPIO_PORT62, GPIO_PORT63, GPIO_PORT64,
29 GPIO_PORT65, GPIO_PORT66, GPIO_PORT67, GPIO_PORT68, GPIO_PORT69,
30
31 GPIO_PORT70, GPIO_PORT71, GPIO_PORT72, GPIO_PORT73, GPIO_PORT74,
32 GPIO_PORT75, GPIO_PORT76, GPIO_PORT77, GPIO_PORT78, GPIO_PORT79,
33
34 GPIO_PORT80, GPIO_PORT81, GPIO_PORT82, GPIO_PORT83, GPIO_PORT84,
35 GPIO_PORT85, GPIO_PORT86, GPIO_PORT87, GPIO_PORT88, GPIO_PORT89,
36
37 GPIO_PORT90, GPIO_PORT91, GPIO_PORT92, GPIO_PORT93, GPIO_PORT94,
38 GPIO_PORT95, GPIO_PORT96, GPIO_PORT97, GPIO_PORT98, GPIO_PORT99,
39
40 GPIO_PORT100, GPIO_PORT101, GPIO_PORT102, GPIO_PORT103, GPIO_PORT104,
41 GPIO_PORT105, GPIO_PORT106, GPIO_PORT107, GPIO_PORT108, GPIO_PORT109,
42
43 GPIO_PORT110, GPIO_PORT111, GPIO_PORT112, GPIO_PORT113, GPIO_PORT114,
44 GPIO_PORT115, GPIO_PORT116, GPIO_PORT117, GPIO_PORT118,
45
46 GPIO_PORT128, GPIO_PORT129,
47
48 GPIO_PORT130, GPIO_PORT131, GPIO_PORT132, GPIO_PORT133, GPIO_PORT134,
49 GPIO_PORT135, GPIO_PORT136, GPIO_PORT137, GPIO_PORT138, GPIO_PORT139,
50
51 GPIO_PORT140, GPIO_PORT141, GPIO_PORT142, GPIO_PORT143, GPIO_PORT144,
52 GPIO_PORT145, GPIO_PORT146, GPIO_PORT147, GPIO_PORT148, GPIO_PORT149,
53
54 GPIO_PORT150, GPIO_PORT151, GPIO_PORT152, GPIO_PORT153, GPIO_PORT154,
55 GPIO_PORT155, GPIO_PORT156, GPIO_PORT157, GPIO_PORT158, GPIO_PORT159,
56
57 GPIO_PORT160, GPIO_PORT161, GPIO_PORT162, GPIO_PORT163, GPIO_PORT164,
58
59 GPIO_PORT192, GPIO_PORT193, GPIO_PORT194,
60 GPIO_PORT195, GPIO_PORT196, GPIO_PORT197, GPIO_PORT198, GPIO_PORT199,
61
62 GPIO_PORT200, GPIO_PORT201, GPIO_PORT202, GPIO_PORT203, GPIO_PORT204,
63 GPIO_PORT205, GPIO_PORT206, GPIO_PORT207, GPIO_PORT208, GPIO_PORT209,
64
65 GPIO_PORT210, GPIO_PORT211, GPIO_PORT212, GPIO_PORT213, GPIO_PORT214,
66 GPIO_PORT215, GPIO_PORT216, GPIO_PORT217, GPIO_PORT218, GPIO_PORT219,
67
68 GPIO_PORT220, GPIO_PORT221, GPIO_PORT222, GPIO_PORT223, GPIO_PORT224,
69 GPIO_PORT225, GPIO_PORT226, GPIO_PORT227, GPIO_PORT228, GPIO_PORT229,
70
71 GPIO_PORT230, GPIO_PORT231, GPIO_PORT232, GPIO_PORT233, GPIO_PORT234,
72 GPIO_PORT235, GPIO_PORT236, GPIO_PORT237, GPIO_PORT238, GPIO_PORT239,
73
74 GPIO_PORT240, GPIO_PORT241, GPIO_PORT242, GPIO_PORT243, GPIO_PORT244,
75 GPIO_PORT245, GPIO_PORT246, GPIO_PORT247, GPIO_PORT248, GPIO_PORT249,
76
77 GPIO_PORT250, GPIO_PORT251, GPIO_PORT252, GPIO_PORT253, GPIO_PORT254,
78 GPIO_PORT255, GPIO_PORT256, GPIO_PORT257, GPIO_PORT258, GPIO_PORT259,
79
80 GPIO_PORT260, GPIO_PORT261, GPIO_PORT262, GPIO_PORT263, GPIO_PORT264,
81
82 /* Special Pull-up / Pull-down Functions */
83 GPIO_FN_PORT66_KEYIN0_PU, GPIO_FN_PORT67_KEYIN1_PU,
84 GPIO_FN_PORT68_KEYIN2_PU, GPIO_FN_PORT69_KEYIN3_PU,
85 GPIO_FN_PORT70_KEYIN4_PU, GPIO_FN_PORT71_KEYIN5_PU,
86 GPIO_FN_PORT72_KEYIN6_PU,
87
88 /* 55-1 (FN) */
89 GPIO_FN_VBUS_0,
90 GPIO_FN_CPORT0,
91 GPIO_FN_CPORT1,
92 GPIO_FN_CPORT2,
93 GPIO_FN_CPORT3,
94 GPIO_FN_CPORT4,
95 GPIO_FN_CPORT5,
96 GPIO_FN_CPORT6,
97 GPIO_FN_CPORT7,
98 GPIO_FN_CPORT8,
99 GPIO_FN_CPORT9,
100 GPIO_FN_CPORT10,
101 GPIO_FN_CPORT11, GPIO_FN_SIN2,
102 GPIO_FN_CPORT12, GPIO_FN_XCTS2,
103 GPIO_FN_CPORT13, GPIO_FN_RFSPO4,
104 GPIO_FN_CPORT14, GPIO_FN_RFSPO5,
105 GPIO_FN_CPORT15, GPIO_FN_SCIFA0_SCK, GPIO_FN_GPS_AGC2,
106 GPIO_FN_CPORT16, GPIO_FN_SCIFA0_TXD, GPIO_FN_GPS_AGC3,
107 GPIO_FN_CPORT17_IC_OE, GPIO_FN_SOUT2,
108 GPIO_FN_CPORT18, GPIO_FN_XRTS2, GPIO_FN_PORT19_VIO_CKO2,
109 GPIO_FN_CPORT19_MPORT1,
110 GPIO_FN_CPORT20, GPIO_FN_RFSPO6,
111 GPIO_FN_CPORT21, GPIO_FN_STATUS0,
112 GPIO_FN_CPORT22, GPIO_FN_STATUS1,
113 GPIO_FN_CPORT23, GPIO_FN_STATUS2, GPIO_FN_RFSPO7,
114 GPIO_FN_B_SYNLD1,
115 GPIO_FN_B_SYNLD2, GPIO_FN_SYSENMSK,
116 GPIO_FN_XMAINPS,
117 GPIO_FN_XDIVPS,
118 GPIO_FN_XIDRST,
119 GPIO_FN_IDCLK, GPIO_FN_IC_DP,
120 GPIO_FN_IDIO, GPIO_FN_IC_DM,
121 GPIO_FN_SOUT1, GPIO_FN_SCIFA4_TXD, GPIO_FN_M02_BERDAT,
122 GPIO_FN_SIN1, GPIO_FN_SCIFA4_RXD, GPIO_FN_XWUP,
123 GPIO_FN_XRTS1, GPIO_FN_SCIFA4_RTS, GPIO_FN_M03_BERCLK,
124 GPIO_FN_XCTS1, GPIO_FN_SCIFA4_CTS,
125 GPIO_FN_PCMCLKO,
126 GPIO_FN_SYNC8KO,
127
128 /* 55-2 (FN) */
129 GPIO_FN_DNPCM_A,
130 GPIO_FN_UPPCM_A,
131 GPIO_FN_VACK,
132 GPIO_FN_XTALB1L,
133 GPIO_FN_GPS_AGC1, GPIO_FN_SCIFA0_RTS,
134 GPIO_FN_GPS_AGC4, GPIO_FN_SCIFA0_RXD,
135 GPIO_FN_GPS_PWRDOWN, GPIO_FN_SCIFA0_CTS,
136 GPIO_FN_GPS_IM,
137 GPIO_FN_GPS_IS,
138 GPIO_FN_GPS_QM,
139 GPIO_FN_GPS_QS,
140 GPIO_FN_FMSOCK, GPIO_FN_PORT49_IRDA_OUT, GPIO_FN_PORT49_IROUT,
141 GPIO_FN_FMSOOLR, GPIO_FN_BBIF2_TSYNC2, GPIO_FN_TPU2TO2, GPIO_FN_IPORT3,
142 GPIO_FN_FMSIOLR,
143 GPIO_FN_FMSOOBT, GPIO_FN_BBIF2_TSCK2, GPIO_FN_TPU2TO3, GPIO_FN_OPORT1,
144 GPIO_FN_FMSIOBT,
145 GPIO_FN_FMSOSLD, GPIO_FN_BBIF2_TXD2, GPIO_FN_OPORT2,
146 GPIO_FN_FMSOILR, GPIO_FN_PORT53_IRDA_IN, GPIO_FN_TPU3TO3,
147 GPIO_FN_OPORT3, GPIO_FN_FMSIILR,
148 GPIO_FN_FMSOIBT, GPIO_FN_PORT54_IRDA_FIRSEL, GPIO_FN_TPU3TO2,
149 GPIO_FN_FMSIIBT,
150 GPIO_FN_FMSISLD, GPIO_FN_MFG0_OUT1, GPIO_FN_TPU0TO0,
151 GPIO_FN_A0_EA0, GPIO_FN_BS,
152 GPIO_FN_A12_EA12, GPIO_FN_PORT58_VIO_CKOR, GPIO_FN_TPU4TO2,
153 GPIO_FN_A13_EA13, GPIO_FN_PORT59_IROUT, GPIO_FN_MFG0_OUT2,
154 GPIO_FN_TPU0TO1,
155 GPIO_FN_A14_EA14, GPIO_FN_PORT60_KEYOUT5,
156 GPIO_FN_A15_EA15, GPIO_FN_PORT61_KEYOUT4,
157 GPIO_FN_A16_EA16, GPIO_FN_PORT62_KEYOUT3, GPIO_FN_MSIOF0_SS1,
158 GPIO_FN_A17_EA17, GPIO_FN_PORT63_KEYOUT2, GPIO_FN_MSIOF0_TSYNC,
159 GPIO_FN_A18_EA18, GPIO_FN_PORT64_KEYOUT1, GPIO_FN_MSIOF0_TSCK,
160 GPIO_FN_A19_EA19, GPIO_FN_PORT65_KEYOUT0, GPIO_FN_MSIOF0_TXD,
161 GPIO_FN_A20_EA20, GPIO_FN_PORT66_KEYIN0, GPIO_FN_MSIOF0_RSCK,
162 GPIO_FN_A21_EA21, GPIO_FN_PORT67_KEYIN1, GPIO_FN_MSIOF0_RSYNC,
163 GPIO_FN_A22_EA22, GPIO_FN_PORT68_KEYIN2, GPIO_FN_MSIOF0_MCK0,
164 GPIO_FN_A23_EA23, GPIO_FN_PORT69_KEYIN3, GPIO_FN_MSIOF0_MCK1,
165 GPIO_FN_A24_EA24, GPIO_FN_PORT70_KEYIN4, GPIO_FN_MSIOF0_RXD,
166 GPIO_FN_A25_EA25, GPIO_FN_PORT71_KEYIN5, GPIO_FN_MSIOF0_SS2,
167 GPIO_FN_A26, GPIO_FN_PORT72_KEYIN6,
168 GPIO_FN_D0_ED0_NAF0,
169 GPIO_FN_D1_ED1_NAF1,
170 GPIO_FN_D2_ED2_NAF2,
171 GPIO_FN_D3_ED3_NAF3,
172 GPIO_FN_D4_ED4_NAF4,
173 GPIO_FN_D5_ED5_NAF5,
174 GPIO_FN_D6_ED6_NAF6,
175 GPIO_FN_D7_ED7_NAF7,
176 GPIO_FN_D8_ED8_NAF8,
177 GPIO_FN_D9_ED9_NAF9,
178 GPIO_FN_D10_ED10_NAF10,
179 GPIO_FN_D11_ED11_NAF11,
180 GPIO_FN_D12_ED12_NAF12,
181 GPIO_FN_D13_ED13_NAF13,
182 GPIO_FN_D14_ED14_NAF14,
183 GPIO_FN_D15_ED15_NAF15,
184 GPIO_FN_CS4,
185 GPIO_FN_CS5A, GPIO_FN_FMSICK,
186 GPIO_FN_CS5B, GPIO_FN_FCE1,
187
188 /* 55-3 (FN) */
189 GPIO_FN_CS6B, GPIO_FN_XCS2, GPIO_FN_CS6A, GPIO_FN_DACK0,
190 GPIO_FN_FCE0,
191 GPIO_FN_WAIT, GPIO_FN_DREQ0,
192 GPIO_FN_RD_XRD,
193 GPIO_FN_WE0_XWR0_FWE,
194 GPIO_FN_WE1_XWR1,
195 GPIO_FN_FRB,
196 GPIO_FN_CKO,
197 GPIO_FN_NBRSTOUT,
198 GPIO_FN_NBRST,
199 GPIO_FN_GPS_EPPSIN,
200 GPIO_FN_LATCHPULSE,
201 GPIO_FN_LTESIGNAL,
202 GPIO_FN_LEGACYSTATE,
203 GPIO_FN_TCKON,
204 GPIO_FN_VIO_VD, GPIO_FN_PORT128_KEYOUT0, GPIO_FN_IPORT0,
205 GPIO_FN_VIO_HD, GPIO_FN_PORT129_KEYOUT1, GPIO_FN_IPORT1,
206 GPIO_FN_VIO_D0, GPIO_FN_PORT130_KEYOUT2, GPIO_FN_PORT130_MSIOF2_RXD,
207 GPIO_FN_VIO_D1, GPIO_FN_PORT131_KEYOUT3, GPIO_FN_PORT131_MSIOF2_SS1,
208 GPIO_FN_VIO_D2, GPIO_FN_PORT132_KEYOUT4, GPIO_FN_PORT132_MSIOF2_SS2,
209 GPIO_FN_VIO_D3, GPIO_FN_PORT133_KEYOUT5, GPIO_FN_PORT133_MSIOF2_TSYNC,
210 GPIO_FN_VIO_D4, GPIO_FN_PORT134_KEYIN0, GPIO_FN_PORT134_MSIOF2_TXD,
211 GPIO_FN_VIO_D5, GPIO_FN_PORT135_KEYIN1, GPIO_FN_PORT135_MSIOF2_TSCK,
212 GPIO_FN_VIO_D6, GPIO_FN_PORT136_KEYIN2,
213 GPIO_FN_VIO_D7, GPIO_FN_PORT137_KEYIN3,
214 GPIO_FN_VIO_D8, GPIO_FN_M9_SLCD_A01, GPIO_FN_PORT138_FSIAOMC,
215 GPIO_FN_VIO_D9, GPIO_FN_M10_SLCD_CK1, GPIO_FN_PORT139_FSIAOLR,
216 GPIO_FN_VIO_D10, GPIO_FN_M11_SLCD_SO1, GPIO_FN_TPU0TO2,
217 GPIO_FN_PORT140_FSIAOBT,
218 GPIO_FN_VIO_D11, GPIO_FN_M12_SLCD_CE1, GPIO_FN_TPU0TO3,
219 GPIO_FN_PORT141_FSIAOSLD,
220 GPIO_FN_VIO_D12, GPIO_FN_M13_BSW, GPIO_FN_PORT142_FSIACK,
221 GPIO_FN_VIO_D13, GPIO_FN_M14_GSW, GPIO_FN_PORT143_FSIAILR,
222 GPIO_FN_VIO_D14, GPIO_FN_M15_RSW, GPIO_FN_PORT144_FSIAIBT,
223 GPIO_FN_VIO_D15, GPIO_FN_TPU1TO3, GPIO_FN_PORT145_FSIAISLD,
224 GPIO_FN_VIO_CLK, GPIO_FN_PORT146_KEYIN4, GPIO_FN_IPORT2,
225 GPIO_FN_VIO_FIELD, GPIO_FN_PORT147_KEYIN5,
226 GPIO_FN_VIO_CKO, GPIO_FN_PORT148_KEYIN6,
227 GPIO_FN_A27, GPIO_FN_RDWR_XWE, GPIO_FN_MFG0_IN1,
228 GPIO_FN_MFG0_IN2,
229 GPIO_FN_TS_SPSYNC3, GPIO_FN_MSIOF2_RSCK,
230 GPIO_FN_TS_SDAT3, GPIO_FN_MSIOF2_RSYNC,
231 GPIO_FN_TPU1TO2, GPIO_FN_TS_SDEN3, GPIO_FN_PORT153_MSIOF2_SS1,
232 GPIO_FN_SOUT3, GPIO_FN_SCIFA2_TXD1, GPIO_FN_MSIOF2_MCK0,
233 GPIO_FN_SIN3, GPIO_FN_SCIFA2_RXD1, GPIO_FN_MSIOF2_MCK1,
234 GPIO_FN_XRTS3, GPIO_FN_SCIFA2_RTS1, GPIO_FN_PORT156_MSIOF2_SS2,
235 GPIO_FN_XCTS3, GPIO_FN_SCIFA2_CTS1, GPIO_FN_PORT157_MSIOF2_RXD,
236
237 /* 55-4 (FN) */
238 GPIO_FN_DINT, GPIO_FN_SCIFA2_SCK1, GPIO_FN_TS_SCK3,
239 GPIO_FN_PORT159_SCIFB_SCK, GPIO_FN_PORT159_SCIFA5_SCK, GPIO_FN_NMI,
240 GPIO_FN_PORT160_SCIFB_TXD, GPIO_FN_PORT160_SCIFA5_TXD, GPIO_FN_SOUT0,
241 GPIO_FN_PORT161_SCIFB_CTS, GPIO_FN_PORT161_SCIFA5_CTS, GPIO_FN_XCTS0,
242 GPIO_FN_MFG3_IN2,
243 GPIO_FN_PORT162_SCIFB_RXD, GPIO_FN_PORT162_SCIFA5_RXD, GPIO_FN_SIN0,
244 GPIO_FN_MFG3_IN1,
245 GPIO_FN_PORT163_SCIFB_RTS, GPIO_FN_PORT163_SCIFA5_RTS, GPIO_FN_XRTS0,
246 GPIO_FN_MFG3_OUT1,
247 GPIO_FN_TPU3TO0,
248 GPIO_FN_LCDD0, GPIO_FN_PORT192_KEYOUT0, GPIO_FN_EXT_CKI,
249 GPIO_FN_LCDD1, GPIO_FN_PORT193_KEYOUT1, GPIO_FN_PORT193_SCIFA5_CTS,
250 GPIO_FN_BBIF2_TSYNC1,
251 GPIO_FN_LCDD2, GPIO_FN_PORT194_KEYOUT2, GPIO_FN_PORT194_SCIFA5_RTS,
252 GPIO_FN_BBIF2_TSCK1,
253 GPIO_FN_LCDD3, GPIO_FN_PORT195_KEYOUT3, GPIO_FN_PORT195_SCIFA5_RXD,
254 GPIO_FN_BBIF2_TXD1,
255 GPIO_FN_LCDD4, GPIO_FN_PORT196_KEYOUT4, GPIO_FN_PORT196_SCIFA5_TXD,
256 GPIO_FN_LCDD5, GPIO_FN_PORT197_KEYOUT5, GPIO_FN_PORT197_SCIFA5_SCK,
257 GPIO_FN_MFG2_OUT2, GPIO_FN_TPU2TO1,
258 GPIO_FN_LCDD6, GPIO_FN_XWR2,
259 GPIO_FN_LCDD7, GPIO_FN_TPU4TO1, GPIO_FN_MFG4_OUT2, GPIO_FN_XWR3,
260 GPIO_FN_LCDD8, GPIO_FN_PORT200_KEYIN0, GPIO_FN_VIO_DR0, GPIO_FN_D16,
261 GPIO_FN_ED16,
262 GPIO_FN_LCDD9, GPIO_FN_PORT201_KEYIN1, GPIO_FN_VIO_DR1, GPIO_FN_D17,
263 GPIO_FN_ED17,
264 GPIO_FN_LCDD10, GPIO_FN_PORT202_KEYIN2, GPIO_FN_VIO_DR2, GPIO_FN_D18,
265 GPIO_FN_ED18,
266 GPIO_FN_LCDD11, GPIO_FN_PORT203_KEYIN3, GPIO_FN_VIO_DR3, GPIO_FN_D19,
267 GPIO_FN_ED19,
268 GPIO_FN_LCDD12, GPIO_FN_PORT204_KEYIN4, GPIO_FN_VIO_DR4, GPIO_FN_D20,
269 GPIO_FN_ED20,
270 GPIO_FN_LCDD13, GPIO_FN_PORT205_KEYIN5, GPIO_FN_VIO_DR5, GPIO_FN_D21,
271 GPIO_FN_ED21,
272 GPIO_FN_LCDD14, GPIO_FN_PORT206_KEYIN6, GPIO_FN_VIO_DR6, GPIO_FN_D22,
273 GPIO_FN_ED22,
274 GPIO_FN_LCDD15, GPIO_FN_PORT207_MSIOF0L_SS1, GPIO_FN_PORT207_KEYOUT0,
275 GPIO_FN_VIO_DR7,
276 GPIO_FN_D23, GPIO_FN_ED23,
277 GPIO_FN_LCDD16, GPIO_FN_PORT208_MSIOF0L_SS2, GPIO_FN_PORT208_KEYOUT1,
278 GPIO_FN_VIO_VDR,
279 GPIO_FN_D24, GPIO_FN_ED24,
280 GPIO_FN_LCDD17, GPIO_FN_PORT209_KEYOUT2, GPIO_FN_VIO_HDR, GPIO_FN_D25,
281 GPIO_FN_ED25,
282 GPIO_FN_LCDD18, GPIO_FN_DREQ2, GPIO_FN_PORT210_MSIOF0L_SS1, GPIO_FN_D26,
283 GPIO_FN_ED26,
284 GPIO_FN_LCDD19, GPIO_FN_PORT211_MSIOF0L_SS2, GPIO_FN_D27, GPIO_FN_ED27,
285 GPIO_FN_LCDD20, GPIO_FN_TS_SPSYNC1, GPIO_FN_MSIOF0L_MCK0, GPIO_FN_D28,
286 GPIO_FN_ED28,
287 GPIO_FN_LCDD21, GPIO_FN_TS_SDAT1, GPIO_FN_MSIOF0L_MCK1, GPIO_FN_D29,
288 GPIO_FN_ED29,
289 GPIO_FN_LCDD22, GPIO_FN_TS_SDEN1, GPIO_FN_MSIOF0L_RSCK, GPIO_FN_D30,
290 GPIO_FN_ED30,
291 GPIO_FN_LCDD23, GPIO_FN_TS_SCK1, GPIO_FN_MSIOF0L_RSYNC, GPIO_FN_D31,
292 GPIO_FN_ED31,
293 GPIO_FN_LCDDCK, GPIO_FN_LCDWR, GPIO_FN_PORT216_KEYOUT3,
294 GPIO_FN_VIO_CLKR,
295 GPIO_FN_LCDRD, GPIO_FN_DACK2, GPIO_FN_MSIOF0L_TSYNC,
296 GPIO_FN_LCDHSYN, GPIO_FN_LCDCS, GPIO_FN_LCDCS2, GPIO_FN_DACK3,
297 GPIO_FN_PORT218_VIO_CKOR, GPIO_FN_PORT218_KEYOUT4,
298 GPIO_FN_LCDDISP, GPIO_FN_LCDRS, GPIO_FN_DREQ3, GPIO_FN_MSIOF0L_TSCK,
299 GPIO_FN_LCDVSYN, GPIO_FN_LCDVSYN2, GPIO_FN_PORT220_KEYOUT5,
300 GPIO_FN_LCDLCLK, GPIO_FN_DREQ1, GPIO_FN_PWEN, GPIO_FN_MSIOF0L_RXD,
301 GPIO_FN_LCDDON, GPIO_FN_LCDDON2, GPIO_FN_DACK1, GPIO_FN_OVCN,
302 GPIO_FN_MSIOF0L_TXD,
303 GPIO_FN_SCIFA1_TXD, GPIO_FN_OVCN2,
304 GPIO_FN_EXTLP, GPIO_FN_SCIFA1_SCK, GPIO_FN_USBTERM,
305 GPIO_FN_PORT226_VIO_CKO2,
306 GPIO_FN_SCIFA1_RTS, GPIO_FN_IDIN,
307 GPIO_FN_SCIFA1_RXD,
308 GPIO_FN_SCIFA1_CTS, GPIO_FN_MFG1_IN1,
309 GPIO_FN_MSIOF1_TXD, GPIO_FN_SCIFA2_TXD2, GPIO_FN_PORT230_FSIAOMC,
310 GPIO_FN_MSIOF1_TSYNC, GPIO_FN_SCIFA2_CTS2, GPIO_FN_PORT231_FSIAOLR,
311 GPIO_FN_MSIOF1_TSCK, GPIO_FN_SCIFA2_SCK2, GPIO_FN_PORT232_FSIAOBT,
312 GPIO_FN_MSIOF1_RXD, GPIO_FN_SCIFA2_RXD2, GPIO_FN_GPS_VCOTRIG,
313 GPIO_FN_PORT233_FSIACK,
314 GPIO_FN_MSIOF1_RSCK, GPIO_FN_SCIFA2_RTS2, GPIO_FN_PORT234_FSIAOSLD,
315 GPIO_FN_MSIOF1_RSYNC, GPIO_FN_OPORT0, GPIO_FN_MFG1_IN2,
316 GPIO_FN_PORT235_FSIAILR,
317 GPIO_FN_MSIOF1_MCK0, GPIO_FN_I2C_SDA2, GPIO_FN_PORT236_FSIAIBT,
318 GPIO_FN_MSIOF1_MCK1, GPIO_FN_I2C_SCL2, GPIO_FN_PORT237_FSIAISLD,
319 GPIO_FN_MSIOF1_SS1, GPIO_FN_EDBGREQ3,
320
321 /* 55-5 (FN) */
322 GPIO_FN_MSIOF1_SS2,
323 GPIO_FN_SCIFA6_TXD,
324 GPIO_FN_PORT241_IRDA_OUT, GPIO_FN_PORT241_IROUT, GPIO_FN_MFG4_OUT1,
325 GPIO_FN_TPU4TO0,
326 GPIO_FN_PORT242_IRDA_IN, GPIO_FN_MFG4_IN2,
327 GPIO_FN_PORT243_IRDA_FIRSEL, GPIO_FN_PORT243_VIO_CKO2,
328 GPIO_FN_PORT244_SCIFA5_CTS, GPIO_FN_MFG2_IN1, GPIO_FN_PORT244_SCIFB_CTS,
329 GPIO_FN_PORT244_MSIOF2_RXD,
330 GPIO_FN_PORT245_SCIFA5_RTS, GPIO_FN_MFG2_IN2, GPIO_FN_PORT245_SCIFB_RTS,
331 GPIO_FN_PORT245_MSIOF2_TXD,
332 GPIO_FN_PORT246_SCIFA5_RXD, GPIO_FN_MFG1_OUT1,
333 GPIO_FN_PORT246_SCIFB_RXD, GPIO_FN_TPU1TO0,
334 GPIO_FN_PORT247_SCIFA5_TXD, GPIO_FN_MFG3_OUT2,
335 GPIO_FN_PORT247_SCIFB_TXD, GPIO_FN_TPU3TO1,
336 GPIO_FN_PORT248_SCIFA5_SCK, GPIO_FN_MFG2_OUT1,
337 GPIO_FN_PORT248_SCIFB_SCK, GPIO_FN_TPU2TO0,
338 GPIO_FN_PORT248_MSIOF2_TSCK,
339 GPIO_FN_PORT249_IROUT, GPIO_FN_MFG4_IN1, GPIO_FN_PORT249_MSIOF2_TSYNC,
340 GPIO_FN_SDHICLK0, GPIO_FN_TCK2_SWCLK_MC0,
341 GPIO_FN_SDHICD0,
342 GPIO_FN_SDHID0_0, GPIO_FN_TMS2_SWDIO_MC0,
343 GPIO_FN_SDHID0_1, GPIO_FN_TDO2_SWO0_MC0,
344 GPIO_FN_SDHID0_2, GPIO_FN_TDI2,
345 GPIO_FN_SDHID0_3, GPIO_FN_RTCK2_SWO1_MC0,
346 GPIO_FN_SDHICMD0, GPIO_FN_TRST2,
347 GPIO_FN_SDHIWP0, GPIO_FN_EDBGREQ2,
348 GPIO_FN_SDHICLK1, GPIO_FN_TCK3_SWCLK_MC1,
349 GPIO_FN_SDHID1_0, GPIO_FN_M11_SLCD_SO2, GPIO_FN_TS_SPSYNC2,
350 GPIO_FN_TMS3_SWDIO_MC1,
351 GPIO_FN_SDHID1_1, GPIO_FN_M9_SLCD_A02, GPIO_FN_TS_SDAT2,
352 GPIO_FN_TDO3_SWO0_MC1,
353 GPIO_FN_SDHID1_2, GPIO_FN_M10_SLCD_CK2, GPIO_FN_TS_SDEN2, GPIO_FN_TDI3,
354 GPIO_FN_SDHID1_3, GPIO_FN_M12_SLCD_CE2, GPIO_FN_TS_SCK2,
355 GPIO_FN_RTCK3_SWO1_MC1,
356 GPIO_FN_SDHICMD1, GPIO_FN_TRST3,
357 GPIO_FN_RESETOUTS,
358};
359
360#endif /* __ASM_SH7377_H__ */
diff --git a/arch/arm/mach-shmobile/include/mach/system.h b/arch/arm/mach-shmobile/include/mach/system.h
new file mode 100644
index 000000000000..76a687eeaa22
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/system.h
@@ -0,0 +1,14 @@
1#ifndef __ASM_ARCH_SYSTEM_H
2#define __ASM_ARCH_SYSTEM_H
3
4static inline void arch_idle(void)
5{
6 cpu_do_idle();
7}
8
9static inline void arch_reset(char mode, const char *cmd)
10{
11 cpu_reset(0);
12}
13
14#endif
diff --git a/arch/arm/mach-shmobile/include/mach/timex.h b/arch/arm/mach-shmobile/include/mach/timex.h
new file mode 100644
index 000000000000..ae0d8d825c23
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/timex.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_MACH_TIMEX_H
2#define __ASM_MACH_TIMEX_H
3
4#define CLOCK_TICK_RATE 1193180 /* unused i8253 PIT value */
5
6#endif /* __ASM_MACH_TIMEX_H */
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
new file mode 100644
index 000000000000..0bd7556b1387
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_MACH_UNCOMPRESS_H
2#define __ASM_MACH_UNCOMPRESS_H
3
4/*
5 * This does not append a newline
6 */
7static void putc(int c)
8{
9}
10
11static inline void flush(void)
12{
13}
14
15static void arch_decomp_setup(void)
16{
17}
18
19#define arch_decomp_wdog()
20
21#endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-shmobile/include/mach/vmalloc.h b/arch/arm/mach-shmobile/include/mach/vmalloc.h
new file mode 100644
index 000000000000..fb3c4f1ab252
--- /dev/null
+++ b/arch/arm/mach-shmobile/include/mach/vmalloc.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_MACH_VMALLOC_H
2#define __ASM_MACH_VMALLOC_H
3
4#define VMALLOC_END (PAGE_OFFSET + 0x24000000)
5
6#endif /* __ASM_MACH_VMALLOC_H */
diff --git a/arch/arm/mach-shmobile/intc-sh7367.c b/arch/arm/mach-shmobile/intc-sh7367.c
new file mode 100644
index 000000000000..6a547b47aabb
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7367.c
@@ -0,0 +1,270 @@
1/*
2 * sh7367 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30
31 /* interrupt sources INTCA */
32 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
33 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
34 DIRC,
35 CRYPT1_ERR, CRYPT2_STD,
36 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
37 ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMRX,
38 ETM11_ACQCMP, ETM11_FULL,
39 MFI_MFIM, MFI_MFIS,
40 BBIF1, BBIF2,
41 USBDMAC_USHDMI,
42 USBHS_USHI0, USBHS_USHI1,
43 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
44 KEYSC_KEY,
45 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
46 MSIOF2, MSIOF1,
47 SCIFA4, SCIFA5, SCIFB,
48 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
49 SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
50 SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, SDHI1_SDHI1I3,
51 MSU_MSU, MSU_MSU2,
52 IREM,
53 SIU,
54 SPU,
55 IRDA,
56 TPU0, TPU1, TPU2, TPU3, TPU4,
57 LCRC,
58 PINT1, PINT2,
59 TTI20,
60 MISTY,
61 DDM,
62 SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
63 RWDT0, RWDT1,
64 DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
65 DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
66 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
67 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
68 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
69 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
70
71 /* interrupt groups INTCA */
72 DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2,
73 ETM11, ARM11, USBHS, FLCTL, IIC1, SDHI0, SDHI1, SDHI2,
74};
75
76static struct intc_vect intca_vectors[] = {
77 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
78 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
79 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
80 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
81 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
82 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
83 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
84 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
85 INTC_VECT(DIRC, 0x0560),
86 INTC_VECT(CRYPT1_ERR, 0x05e0),
87 INTC_VECT(CRYPT2_STD, 0x0700),
88 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
89 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
90 INTC_VECT(ARM11_IRQPMU, 0x0800), INTC_VECT(ARM11_COMMTX, 0x0840),
91 INTC_VECT(ARM11_COMMRX, 0x0860),
92 INTC_VECT(ETM11_ACQCMP, 0x0880), INTC_VECT(ETM11_FULL, 0x08a0),
93 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
94 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
95 INTC_VECT(USBDMAC_USHDMI, 0x0a00),
96 INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
97 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
98 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
99 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
100 INTC_VECT(KEYSC_KEY, 0x0be0),
101 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
102 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
103 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
104 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
105 INTC_VECT(SCIFB, 0x0d60),
106 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
107 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
108 INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
109 INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
110 INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
111 INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), INTC_VECT(SDHI1_SDHI1I3, 0x0ee0),
112 INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
113 INTC_VECT(IREM, 0x0f60),
114 INTC_VECT(SIU, 0x0fa0),
115 INTC_VECT(SPU, 0x0fc0),
116 INTC_VECT(IRDA, 0x0480),
117 INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
118 INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
119 INTC_VECT(TPU4, 0x0520),
120 INTC_VECT(LCRC, 0x0540),
121 INTC_VECT(PINT1, 0x1000), INTC_VECT(PINT2, 0x1020),
122 INTC_VECT(TTI20, 0x1100),
123 INTC_VECT(MISTY, 0x1120),
124 INTC_VECT(DDM, 0x1140),
125 INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
126 INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
127 INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
128 INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
129 INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
130 INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
131 INTC_VECT(DMAC_2_DADERR, 0x20c0),
132 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
133 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
134 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
135 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
136 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
137 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
138 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
139 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
140};
141
142static struct intc_group intca_groups[] __initdata = {
143 INTC_GROUP(DMAC_1, DMAC_1_DEI0,
144 DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
145 INTC_GROUP(DMAC_2, DMAC_2_DEI4,
146 DMAC_2_DEI5, DMAC_2_DADERR),
147 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
148 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
149 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
150 DMAC2_2_DEI5, DMAC2_2_DADERR),
151 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
152 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
153 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
154 DMAC3_2_DEI5, DMAC3_2_DADERR),
155 INTC_GROUP(ETM11, ETM11_ACQCMP, ETM11_FULL),
156 INTC_GROUP(ARM11, ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMTX),
157 INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
158 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
159 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
160 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
161 INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
162 SDHI0_SDHI0I2, SDHI0_SDHI0I3),
163 INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
164 SDHI1_SDHI1I2, SDHI1_SDHI1I3),
165 INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
166 SDHI2_SDHI2I2, SDHI2_SDHI2I3),
167};
168
169static struct intc_mask_reg intca_mask_registers[] = {
170 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
171 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
172 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
173 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
174 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
175 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
176 ARM11_IRQPMU, 0, ARM11_COMMTX, ARM11_COMMRX } },
177 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
178 { CRYPT1_ERR, CRYPT2_STD, DIRC, 0,
179 DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
180 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
181 { PINT1, PINT2, 0, 0,
182 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
183 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
184 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
185 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
186 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
187 { DDM, 0, 0, 0,
188 0, 0, ETM11_FULL, ETM11_ACQCMP } },
189 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
190 { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
191 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
192 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
193 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
194 0, 0, MSIOF2, 0 } },
195 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
196 { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
197 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
198 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
199 { SDHI1_SDHI1I3, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
200 TTI20, USBDMAC_USHDMI, SPU, SIU } },
201 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
202 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
203 CMT2, USBHS_USHI1, USBHS_USHI0, 0 } },
204 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
205 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
206 0, 0, 0, 0 } },
207 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
208 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
209 LCRC, MSU_MSU2, IREM, MSU_MSU } },
210 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
211 { 0, 0, TPU0, TPU1,
212 TPU2, TPU3, TPU4, 0 } },
213 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
214 { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
215 MISTY, CMT3, RWDT1, RWDT0 } },
216};
217
218static struct intc_prio_reg intca_prio_registers[] = {
219 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
220 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
221 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
222 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
223
224 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
225 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, ETM11, BBIF1, BBIF2 } },
226 { 0xe6940008, 0, 16, 4, /* IPRCA */ { CRYPT1_ERR, CRYPT2_STD,
227 CMT1_CMT11, ARM11 } },
228 { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINT1, PINT2,
229 CMT1_CMT12, TPU4 } },
230 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
231 MFI_MFIM, USBHS } },
232 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
233 0, CMT1_CMT10 } },
234 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
235 SCIFA2, SCIFA3 } },
236 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
237 FLCTL, SDHI0 } },
238 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
239 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, SIU, TTI20 } },
240 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IREM, SDHI1 } },
241 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
242 { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
243 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, SPU, DDM } },
244 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
245};
246
247static struct intc_sense_reg intca_sense_registers[] __initdata = {
248 { 0xe6900000, 16, 2, /* ICR1A */
249 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
250 { 0xe6900004, 16, 2, /* ICR2A */
251 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
252};
253
254static struct intc_mask_reg intca_ack_registers[] __initdata = {
255 { 0xe6900020, 0, 8, /* INTREQ00A */
256 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
257 { 0xe6900024, 0, 8, /* INTREQ10A */
258 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
259};
260
261static DECLARE_INTC_DESC_ACK(intca_desc, "sh7367-intca",
262 intca_vectors, intca_groups,
263 intca_mask_registers, intca_prio_registers,
264 intca_sense_registers, intca_ack_registers);
265
266void __init sh7367_init_irq(void)
267{
268 /* INTCA */
269 register_intc_controller(&intca_desc);
270}
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c
new file mode 100644
index 000000000000..c57a923f97a6
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7372.c
@@ -0,0 +1,369 @@
1/*
2 * sh7372 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30
31 /* interrupt sources INTCA */
32 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
33 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
34 IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
35 IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
36 DIRC,
37 CRYPT_STD,
38 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
39 AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
40 MFI_MFIM, MFI_MFIS,
41 BBIF1, BBIF2,
42 USBHSDMAC0_USHDMI,
43 _3DG_SGX540,
44 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
45 KEYSC_KEY,
46 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
47 MSIOF2, MSIOF1,
48 SCIFA4, SCIFA5, SCIFB,
49 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
50 SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
51 SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2,
52 IRREM,
53 IRDA,
54 TPU0,
55 TTI20,
56 DDM,
57 SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
58 RWDT0,
59 DMAC1_1_DEI0, DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3,
60 DMAC1_2_DEI4, DMAC1_2_DEI5, DMAC1_2_DADERR,
61 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
62 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
63 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
64 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
65 SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
66 HDMI,
67 SPU2_SPU0, SPU2_SPU1,
68 FSI, FMSI,
69 MIPI_HSI,
70 IPMMU_IPMMUD,
71 CEC_1, CEC_2,
72 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
73 MFIS2,
74 CPORTR2S,
75 CMT14, CMT15,
76 MMC_MMC_ERR, MMC_MMC_NOR,
77 IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
78 IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3,
79 USB0_USB0I1, USB0_USB0I0,
80 USB1_USB1I1, USB1_USB1I0,
81 USBHSDMAC1_USHDMI,
82
83 /* interrupt groups INTCA */
84 DMAC1_1, DMAC1_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
85 AP_ARM1, AP_ARM2, SPU2, FLCTL, IIC1, SDHI0, SDHI1, SDHI2
86};
87
88static struct intc_vect intca_vectors[] __initdata = {
89 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
90 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
91 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
92 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
93 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
94 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
95 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
96 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
97 INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
98 INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
99 INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0),
100 INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
101 INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
102 INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
103 INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
104 INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
105 INTC_VECT(DIRC, 0x0560),
106 INTC_VECT(CRYPT_STD, 0x0700),
107 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
108 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
109 INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
110 INTC_VECT(AP_ARM_COMMRX, 0x0860),
111 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
112 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
113 INTC_VECT(USBHSDMAC0_USHDMI, 0x0a00),
114 INTC_VECT(_3DG_SGX540, 0x0a60),
115 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
116 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
117 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
118 INTC_VECT(KEYSC_KEY, 0x0be0),
119 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
120 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
121 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
122 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
123 INTC_VECT(SCIFB, 0x0d60),
124 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
125 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
126 INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
127 INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
128 INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
129 INTC_VECT(SDHI1_SDHI1I2, 0x0ec0),
130 INTC_VECT(IRREM, 0x0f60),
131 INTC_VECT(IRDA, 0x0480),
132 INTC_VECT(TPU0, 0x04a0),
133 INTC_VECT(TTI20, 0x1100),
134 INTC_VECT(DDM, 0x1140),
135 INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
136 INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
137 INTC_VECT(RWDT0, 0x1280),
138 INTC_VECT(DMAC1_1_DEI0, 0x2000), INTC_VECT(DMAC1_1_DEI1, 0x2020),
139 INTC_VECT(DMAC1_1_DEI2, 0x2040), INTC_VECT(DMAC1_1_DEI3, 0x2060),
140 INTC_VECT(DMAC1_2_DEI4, 0x2080), INTC_VECT(DMAC1_2_DEI5, 0x20a0),
141 INTC_VECT(DMAC1_2_DADERR, 0x20c0),
142 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
143 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
144 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
145 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
146 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
147 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
148 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
149 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
150 INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1320),
151 INTC_VECT(SHWYSTAT_COM, 0x1340),
152 INTC_VECT(HDMI, 0x17e0),
153 INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
154 INTC_VECT(FSI, 0x1840),
155 INTC_VECT(FMSI, 0x1860),
156 INTC_VECT(MIPI_HSI, 0x18e0),
157 INTC_VECT(IPMMU_IPMMUD, 0x1920),
158 INTC_VECT(CEC_1, 0x1940), INTC_VECT(CEC_2, 0x1960),
159 INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
160 INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
161 INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
162 INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
163 INTC_VECT(MFIS2, 0x1a00),
164 INTC_VECT(CPORTR2S, 0x1a20),
165 INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
166 INTC_VECT(MMC_MMC_ERR, 0x1ac0), INTC_VECT(MMC_MMC_NOR, 0x1ae0),
167 INTC_VECT(IIC4_ALI4, 0x1b00), INTC_VECT(IIC4_TACKI4, 0x1b20),
168 INTC_VECT(IIC4_WAITI4, 0x1b40), INTC_VECT(IIC4_DTEI4, 0x1b60),
169 INTC_VECT(IIC3_ALI3, 0x1b80), INTC_VECT(IIC3_TACKI3, 0x1ba0),
170 INTC_VECT(IIC3_WAITI3, 0x1bc0), INTC_VECT(IIC3_DTEI3, 0x1be0),
171 INTC_VECT(USB0_USB0I1, 0x1c80), INTC_VECT(USB0_USB0I0, 0x1ca0),
172 INTC_VECT(USB1_USB1I1, 0x1cc0), INTC_VECT(USB1_USB1I0, 0x1ce0),
173 INTC_VECT(USBHSDMAC1_USHDMI, 0x1d00),
174};
175
176static struct intc_group intca_groups[] __initdata = {
177 INTC_GROUP(DMAC1_1, DMAC1_1_DEI0,
178 DMAC1_1_DEI1, DMAC1_1_DEI2, DMAC1_1_DEI3),
179 INTC_GROUP(DMAC1_2, DMAC1_2_DEI4,
180 DMAC1_2_DEI5, DMAC1_2_DADERR),
181 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
182 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
183 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
184 DMAC2_2_DEI5, DMAC2_2_DADERR),
185 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
186 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
187 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
188 DMAC3_2_DEI5, DMAC3_2_DADERR),
189 INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX),
190 INTC_GROUP(AP_ARM2, AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
191 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ),
192 INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
193 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
194 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
195 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
196 INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
197 SDHI0_SDHI0I2, SDHI0_SDHI0I3),
198 INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
199 SDHI1_SDHI1I2),
200 INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
201 SDHI2_SDHI2I2, SDHI2_SDHI2I3),
202 INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
203};
204
205static struct intc_mask_reg intca_mask_registers[] __initdata = {
206 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
207 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
208 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
209 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
210 { 0xe6900048, 0xe6900068, 8, /* INTMSK20A / INTMSKCLR20A */
211 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
212 { 0xe690004c, 0xe690006c, 8, /* INTMSK30A / INTMSKCLR30A */
213 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
214
215 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
216 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
217 AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
218 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
219 { 0, CRYPT_STD, DIRC, 0,
220 DMAC1_1_DEI3, DMAC1_1_DEI2, DMAC1_1_DEI1, DMAC1_1_DEI0 } },
221 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
222 { 0, 0, 0, 0,
223 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
224 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
225 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
226 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
227 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
228 { DDM, 0, 0, 0,
229 0, 0, 0, 0 } },
230 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
231 { KEYSC_KEY, DMAC1_2_DADERR, DMAC1_2_DEI5, DMAC1_2_DEI4,
232 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
233 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
234 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
235 0, 0, MSIOF2, 0 } },
236 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
237 { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
238 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
239 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
240 { 0, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
241 TTI20, USBHSDMAC0_USHDMI, 0, 0 } },
242 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
243 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
244 CMT2, 0, 0, _3DG_SGX540 } },
245 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
246 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
247 0, 0, 0, 0 } },
248 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
249 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
250 0, 0, IRREM, 0 } },
251 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
252 { 0, 0, TPU0, 0,
253 0, 0, 0, 0 } },
254 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
255 { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
256 0, CMT3, 0, RWDT0 } },
257 { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
258 { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
259 0, 0, 0, 0 } },
260 { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
261 { 0, 0, 0, 0,
262 0, 0, 0, HDMI } },
263 { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
264 { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
265 0, 0, 0, MIPI_HSI } },
266 { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
267 { 0, IPMMU_IPMMUD, CEC_1, CEC_2,
268 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
269 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
270 { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
271 { MFIS2, CPORTR2S, CMT14, CMT15,
272 0, 0, MMC_MMC_ERR, MMC_MMC_NOR } },
273 { 0xe69500a0, 0xe69500e0, 8, /* IMR8A3 / IMCR8A3 */
274 { IIC4_ALI4, IIC4_TACKI4, IIC4_WAITI4, IIC4_DTEI4,
275 IIC3_ALI3, IIC3_TACKI3, IIC3_WAITI3, IIC3_DTEI3 } },
276 { 0xe69500a4, 0xe69500e4, 8, /* IMR9A3 / IMCR9A3 */
277 { 0, 0, 0, 0,
278 USB0_USB0I1, USB0_USB0I0, USB1_USB1I1, USB1_USB1I0 } },
279 { 0xe69500a8, 0xe69500e8, 8, /* IMR10A3 / IMCR10A3 */
280 { USBHSDMAC1_USHDMI, 0, 0, 0,
281 0, 0, 0, 0 } },
282};
283
284static struct intc_prio_reg intca_prio_registers[] __initdata = {
285 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
286 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
287 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
288 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
289 { 0xe6900018, 0, 32, 4, /* INTPRI20A */
290 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
291 { 0xe690001c, 0, 32, 4, /* INTPRI30A */
292 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
293
294 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, 0 } },
295 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
296 { 0xe6940008, 0, 16, 4, /* IPRCA */ { 0, CRYPT_STD,
297 CMT1_CMT11, AP_ARM1 } },
298 { 0xe694000c, 0, 16, 4, /* IPRDA */ { 0, 0,
299 CMT1_CMT12, 0 } },
300 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC1_1, MFI_MFIS,
301 MFI_MFIM, 0 } },
302 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC1_2,
303 _3DG_SGX540, CMT1_CMT10 } },
304 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
305 SCIFA2, SCIFA3 } },
306 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBHSDMAC0_USHDMI,
307 FLCTL, SDHI0 } },
308 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4,
309 0/* MSU */, IIC1 } },
310 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2,
311 0/* MSUG */, TTI20 } },
312 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
313 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, 0, 0, 0 } },
314 { 0xe6940030, 0, 16, 4, /* IPRMA */ { 0, CMT3, 0, RWDT0 } },
315 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
316 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
317 { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
318 { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { 0, 0, 0, HDMI } },
319 { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
320 { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { 0, 0, 0, MIPI_HSI } },
321 { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUD, 0,
322 CEC_1, CEC_2 } },
323 { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
324 { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
325 CMT14, CMT15 } },
326 { 0xe694003c, 0, 16, 4, /* IPRPA3 */ { 0, 0,
327 MMC_MMC_ERR, MMC_MMC_NOR } },
328 { 0xe6940040, 0, 16, 4, /* IPRQA3 */ { IIC4_ALI4, IIC4_TACKI4,
329 IIC4_WAITI4, IIC4_DTEI4 } },
330 { 0xe6940044, 0, 16, 4, /* IPRRA3 */ { IIC3_ALI3, IIC3_TACKI3,
331 IIC3_WAITI3, IIC3_DTEI3 } },
332 { 0xe6940048, 0, 16, 4, /* IPRSA3 */ { 0/*ERI*/, 0/*RXI*/,
333 0/*TXI*/, 0/*TEI*/} },
334 { 0xe694004c, 0, 16, 4, /* IPRTA3 */ { USB0_USB0I1, USB0_USB0I0,
335 USB1_USB1I1, USB1_USB1I0 } },
336 { 0xe6940050, 0, 16, 4, /* IPRUA3 */ { USBHSDMAC1_USHDMI, 0, 0, 0 } },
337};
338
339static struct intc_sense_reg intca_sense_registers[] __initdata = {
340 { 0xe6900000, 32, 4, /* ICR1A */
341 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
342 { 0xe6900004, 32, 4, /* ICR2A */
343 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
344 { 0xe6900008, 32, 4, /* ICR3A */
345 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
346 { 0xe690000c, 32, 4, /* ICR4A */
347 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
348};
349
350static struct intc_mask_reg intca_ack_registers[] __initdata = {
351 { 0xe6900020, 0, 8, /* INTREQ00A */
352 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
353 { 0xe6900024, 0, 8, /* INTREQ10A */
354 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
355 { 0xe6900028, 0, 8, /* INTREQ20A */
356 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
357 { 0xe690002c, 0, 8, /* INTREQ30A */
358 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
359};
360
361static DECLARE_INTC_DESC_ACK(intca_desc, "sh7372-intca",
362 intca_vectors, intca_groups,
363 intca_mask_registers, intca_prio_registers,
364 intca_sense_registers, intca_ack_registers);
365
366void __init sh7372_init_irq(void)
367{
368 register_intc_controller(&intca_desc);
369}
diff --git a/arch/arm/mach-shmobile/intc-sh7377.c b/arch/arm/mach-shmobile/intc-sh7377.c
new file mode 100644
index 000000000000..125021cfba5c
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7377.c
@@ -0,0 +1,350 @@
1/*
2 * sh7377 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30
31 /* interrupt sources INTCA */
32 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
33 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
34 IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A,
35 IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A,
36 DIRC,
37 _2DG,
38 CRYPT_STD,
39 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
40 AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMRX,
41 MFI_MFIM, MFI_MFIS,
42 BBIF1, BBIF2,
43 USBDMAC_USHDMI,
44 USBHS_USHI0, USBHS_USHI1,
45 _3DG_SGX540,
46 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
47 KEYSC_KEY,
48 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
49 MSIOF2, MSIOF1,
50 SCIFA4, SCIFA5, SCIFB,
51 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
52 SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
53 SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, SDHI1_SDHI1I3,
54 MSU_MSU, MSU_MSU2,
55 IRREM,
56 MSUG,
57 IRDA,
58 TPU0, TPU1, TPU2, TPU3, TPU4,
59 LCRC,
60 PINTCA_PINT1, PINTCA_PINT2,
61 TTI20,
62 MISTY,
63 DDM,
64 RWDT0, RWDT1,
65 DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
66 DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
67 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
68 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
69 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
70 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
71 SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM,
72 ICUSB_ICUSB0, ICUSB_ICUSB1,
73 ICUDMC_ICUDMC1, ICUDMC_ICUDMC2,
74 SPU2_SPU0, SPU2_SPU1,
75 FSI,
76 FMSI,
77 SCUV,
78 IPMMU_IPMMUB,
79 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ, AP_ARM_DMAIRQ, AP_ARM_DMASIRQ,
80 MFIS2,
81 CPORTR2S,
82 CMT14, CMT15,
83 SCIFA6,
84
85 /* interrupt groups INTCA */
86 DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2, SHWYSTAT,
87 AP_ARM1, AP_ARM2, USBHS, SPU2, FLCTL, IIC1, SDHI0, SDHI1,
88 ICUSB, ICUDMC
89};
90
91static struct intc_vect intca_vectors[] = {
92 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
93 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
94 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
95 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
96 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
97 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
98 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
99 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
100 INTC_VECT(IRQ16A, 0x3200), INTC_VECT(IRQ17A, 0x3220),
101 INTC_VECT(IRQ18A, 0x3240), INTC_VECT(IRQ19A, 0x3260),
102 INTC_VECT(IRQ20A, 0x3280), INTC_VECT(IRQ31A, 0x32a0),
103 INTC_VECT(IRQ22A, 0x32c0), INTC_VECT(IRQ23A, 0x32e0),
104 INTC_VECT(IRQ24A, 0x3300), INTC_VECT(IRQ25A, 0x3320),
105 INTC_VECT(IRQ26A, 0x3340), INTC_VECT(IRQ27A, 0x3360),
106 INTC_VECT(IRQ28A, 0x3380), INTC_VECT(IRQ29A, 0x33a0),
107 INTC_VECT(IRQ30A, 0x33c0), INTC_VECT(IRQ31A, 0x33e0),
108 INTC_VECT(DIRC, 0x0560),
109 INTC_VECT(_2DG, 0x05e0),
110 INTC_VECT(CRYPT_STD, 0x0700),
111 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
112 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
113 INTC_VECT(AP_ARM_IRQPMU, 0x0800), INTC_VECT(AP_ARM_COMMTX, 0x0840),
114 INTC_VECT(AP_ARM_COMMRX, 0x0860),
115 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
116 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
117 INTC_VECT(USBDMAC_USHDMI, 0x0a00),
118 INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
119 INTC_VECT(_3DG_SGX540, 0x0a60),
120 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
121 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
122 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
123 INTC_VECT(KEYSC_KEY, 0x0be0),
124 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
125 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
126 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
127 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
128 INTC_VECT(SCIFB, 0x0d60),
129 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
130 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
131 INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
132 INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
133 INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
134 INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), INTC_VECT(SDHI1_SDHI1I3, 0x0ee0),
135 INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
136 INTC_VECT(IRREM, 0x0f60),
137 INTC_VECT(MSUG, 0x0fa0),
138 INTC_VECT(IRDA, 0x0480),
139 INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
140 INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
141 INTC_VECT(TPU4, 0x0520),
142 INTC_VECT(LCRC, 0x0540),
143 INTC_VECT(PINTCA_PINT1, 0x1000), INTC_VECT(PINTCA_PINT2, 0x1020),
144 INTC_VECT(TTI20, 0x1100),
145 INTC_VECT(MISTY, 0x1120),
146 INTC_VECT(DDM, 0x1140),
147 INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
148 INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
149 INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
150 INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
151 INTC_VECT(DMAC_2_DADERR, 0x20c0),
152 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
153 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
154 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
155 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
156 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
157 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
158 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
159 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
160 INTC_VECT(SHWYSTAT_RT, 0x1300), INTC_VECT(SHWYSTAT_HS, 0x1d20),
161 INTC_VECT(SHWYSTAT_COM, 0x1340),
162 INTC_VECT(ICUSB_ICUSB0, 0x1700), INTC_VECT(ICUSB_ICUSB1, 0x1720),
163 INTC_VECT(ICUDMC_ICUDMC1, 0x1780), INTC_VECT(ICUDMC_ICUDMC2, 0x17a0),
164 INTC_VECT(SPU2_SPU0, 0x1800), INTC_VECT(SPU2_SPU1, 0x1820),
165 INTC_VECT(FSI, 0x1840),
166 INTC_VECT(FMSI, 0x1860),
167 INTC_VECT(SCUV, 0x1880),
168 INTC_VECT(IPMMU_IPMMUB, 0x1900),
169 INTC_VECT(AP_ARM_CTIIRQ, 0x1980),
170 INTC_VECT(AP_ARM_DMAEXTERRIRQ, 0x19a0),
171 INTC_VECT(AP_ARM_DMAIRQ, 0x19c0),
172 INTC_VECT(AP_ARM_DMASIRQ, 0x19e0),
173 INTC_VECT(MFIS2, 0x1a00),
174 INTC_VECT(CPORTR2S, 0x1a20),
175 INTC_VECT(CMT14, 0x1a40), INTC_VECT(CMT15, 0x1a60),
176 INTC_VECT(SCIFA6, 0x1a80),
177};
178
179static struct intc_group intca_groups[] __initdata = {
180 INTC_GROUP(DMAC_1, DMAC_1_DEI0,
181 DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
182 INTC_GROUP(DMAC_2, DMAC_2_DEI4,
183 DMAC_2_DEI5, DMAC_2_DADERR),
184 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
185 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
186 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
187 DMAC2_2_DEI5, DMAC2_2_DADERR),
188 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
189 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
190 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
191 DMAC3_2_DEI5, DMAC3_2_DADERR),
192 INTC_GROUP(AP_ARM1, AP_ARM_IRQPMU, AP_ARM_COMMTX, AP_ARM_COMMTX),
193 INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
194 INTC_GROUP(SPU2, SPU2_SPU0, SPU2_SPU1),
195 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
196 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
197 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
198 INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
199 SDHI0_SDHI0I2, SDHI0_SDHI0I3),
200 INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
201 SDHI1_SDHI1I2, SDHI1_SDHI1I3),
202 INTC_GROUP(SHWYSTAT, SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM),
203 INTC_GROUP(ICUSB, ICUSB_ICUSB0, ICUSB_ICUSB1),
204 INTC_GROUP(ICUDMC, ICUDMC_ICUDMC1, ICUDMC_ICUDMC2),
205};
206
207static struct intc_mask_reg intca_mask_registers[] = {
208 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
209 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
210 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
211 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
212 { 0xe6900048, 0xe6900068, 8, /* INTMSK20A / INTMSKCLR20A */
213 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
214 { 0xe690004c, 0xe690006c, 8, /* INTMSK30A / INTMSKCLR30A */
215 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
216
217 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
218 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
219 AP_ARM_IRQPMU, 0, AP_ARM_COMMTX, AP_ARM_COMMRX } },
220 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
221 { _2DG, CRYPT_STD, DIRC, 0,
222 DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
223 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
224 { PINTCA_PINT1, PINTCA_PINT2, 0, 0,
225 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
226 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
227 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
228 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
229 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
230 { DDM, 0, 0, 0,
231 0, 0, 0, 0 } },
232 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
233 { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
234 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
235 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
236 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
237 0, 0, MSIOF2, 0 } },
238 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
239 { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
240 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
241 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
242 { SDHI1_SDHI1I3, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
243 TTI20, USBDMAC_USHDMI, 0, MSUG } },
244 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
245 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
246 CMT2, USBHS_USHI1, USBHS_USHI0, _3DG_SGX540 } },
247 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
248 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
249 0, 0, 0, 0 } },
250 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
251 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
252 LCRC, MSU_MSU2, IRREM, MSU_MSU } },
253 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
254 { 0, 0, TPU0, TPU1,
255 TPU2, TPU3, TPU4, 0 } },
256 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
257 { 0, 0, 0, 0,
258 MISTY, CMT3, RWDT1, RWDT0 } },
259 { 0xe6950080, 0xe69500c0, 8, /* IMR0A3 / IMCR0A3 */
260 { SHWYSTAT_RT, SHWYSTAT_HS, SHWYSTAT_COM, 0,
261 0, 0, 0, 0 } },
262 { 0xe6950090, 0xe69500d0, 8, /* IMR4A3 / IMCR4A3 */
263 { ICUSB_ICUSB0, ICUSB_ICUSB1, 0, 0,
264 ICUDMC_ICUDMC1, ICUDMC_ICUDMC2, 0, 0 } },
265 { 0xe6950094, 0xe69500d4, 8, /* IMR5A3 / IMCR5A3 */
266 { SPU2_SPU0, SPU2_SPU1, FSI, FMSI,
267 SCUV, 0, 0, 0 } },
268 { 0xe6950098, 0xe69500d8, 8, /* IMR6A3 / IMCR6A3 */
269 { IPMMU_IPMMUB, 0, 0, 0,
270 AP_ARM_CTIIRQ, AP_ARM_DMAEXTERRIRQ,
271 AP_ARM_DMAIRQ, AP_ARM_DMASIRQ } },
272 { 0xe695009c, 0xe69500dc, 8, /* IMR7A3 / IMCR7A3 */
273 { MFIS2, CPORTR2S, CMT14, CMT15,
274 SCIFA6, 0, 0, 0 } },
275};
276
277static struct intc_prio_reg intca_prio_registers[] = {
278 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
279 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
280 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
281 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
282 { 0xe6900018, 0, 32, 4, /* INTPRI10A */
283 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
284 { 0xe690001c, 0, 32, 4, /* INTPRI30A */
285 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
286
287 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
288 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, 0, BBIF1, BBIF2 } },
289 { 0xe6940008, 0, 16, 4, /* IPRCA */ { _2DG, CRYPT_STD,
290 CMT1_CMT11, AP_ARM1 } },
291 { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINTCA_PINT1, PINTCA_PINT2,
292 CMT1_CMT12, TPU4 } },
293 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
294 MFI_MFIM, USBHS } },
295 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
296 _3DG_SGX540, CMT1_CMT10 } },
297 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
298 SCIFA2, SCIFA3 } },
299 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
300 FLCTL, SDHI0 } },
301 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
302 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, MSUG, TTI20 } },
303 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IRREM, SDHI1 } },
304 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
305 { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
306 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, 0, DDM } },
307 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, 0 } },
308 { 0xe6950000, 0, 16, 4, /* IPRAA3 */ { SHWYSTAT, 0, 0, 0 } },
309 { 0xe6950020, 0, 16, 4, /* IPRIA3 */ { ICUSB, 0, 0, 0 } },
310 { 0xe6950024, 0, 16, 4, /* IPRJA3 */ { ICUDMC, 0, 0, 0 } },
311 { 0xe6950028, 0, 16, 4, /* IPRKA3 */ { SPU2, 0, FSI, FMSI } },
312 { 0xe695002c, 0, 16, 4, /* IPRLA3 */ { SCUV, 0, 0, 0 } },
313 { 0xe6950030, 0, 16, 4, /* IPRMA3 */ { IPMMU_IPMMUB, 0, 0, 0 } },
314 { 0xe6950034, 0, 16, 4, /* IPRNA3 */ { AP_ARM2, 0, 0, 0 } },
315 { 0xe6950038, 0, 16, 4, /* IPROA3 */ { MFIS2, CPORTR2S,
316 CMT14, CMT15 } },
317 { 0xe694003c, 0, 16, 4, /* IPRPA3 */ { SCIFA6, 0, 0, 0 } },
318};
319
320static struct intc_sense_reg intca_sense_registers[] __initdata = {
321 { 0xe6900000, 16, 2, /* ICR1A */
322 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
323 { 0xe6900004, 16, 2, /* ICR2A */
324 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
325 { 0xe6900008, 16, 2, /* ICR3A */
326 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
327 { 0xe690000c, 16, 2, /* ICR4A */
328 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
329};
330
331static struct intc_mask_reg intca_ack_registers[] __initdata = {
332 { 0xe6900020, 0, 8, /* INTREQ00A */
333 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
334 { 0xe6900024, 0, 8, /* INTREQ10A */
335 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
336 { 0xe6900028, 0, 8, /* INTREQ20A */
337 { IRQ16A, IRQ17A, IRQ18A, IRQ19A, IRQ20A, IRQ21A, IRQ22A, IRQ23A } },
338 { 0xe690002c, 0, 8, /* INTREQ30A */
339 { IRQ24A, IRQ25A, IRQ26A, IRQ27A, IRQ28A, IRQ29A, IRQ30A, IRQ31A } },
340};
341
342static DECLARE_INTC_DESC_ACK(intca_desc, "sh7377-intca",
343 intca_vectors, intca_groups,
344 intca_mask_registers, intca_prio_registers,
345 intca_sense_registers, intca_ack_registers);
346
347void __init sh7377_init_irq(void)
348{
349 register_intc_controller(&intca_desc);
350}
diff --git a/arch/arm/mach-shmobile/pfc-sh7367.c b/arch/arm/mach-shmobile/pfc-sh7367.c
new file mode 100644
index 000000000000..128555e76e43
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7367.c
@@ -0,0 +1,1801 @@
1/*
2 * sh7367 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/init.h>
20#include <linux/kernel.h>
21#include <linux/gpio.h>
22#include <mach/sh7367.h>
23
24#define _1(fn, pfx, sfx) fn(pfx, sfx)
25
26#define _10(fn, pfx, sfx) \
27 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
28 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
29 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
30 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
31 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
32
33#define _90(fn, pfx, sfx) \
34 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
35 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
36 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
37 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
38 _10(fn, pfx##9, sfx)
39
40#define _273(fn, pfx, sfx) \
41 _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
42 _10(fn, pfx##10, sfx), _90(fn, pfx##1, sfx), \
43 _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
44 _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
45 _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
46 _10(fn, pfx##26, sfx), _1(fn, pfx##270, sfx), \
47 _1(fn, pfx##271, sfx), _1(fn, pfx##272, sfx)
48
49#define _PORT(pfx, sfx) pfx##_##sfx
50#define PORT_273(str) _273(_PORT, PORT, str)
51
52enum {
53 PINMUX_RESERVED = 0,
54
55 PINMUX_DATA_BEGIN,
56 PORT_273(DATA), /* PORT0_DATA -> PORT272_DATA */
57 PINMUX_DATA_END,
58
59 PINMUX_INPUT_BEGIN,
60 PORT_273(IN), /* PORT0_IN -> PORT272_IN */
61 PINMUX_INPUT_END,
62
63 PINMUX_INPUT_PULLUP_BEGIN,
64 PORT_273(IN_PU), /* PORT0_IN_PU -> PORT272_IN_PU */
65 PINMUX_INPUT_PULLUP_END,
66
67 PINMUX_INPUT_PULLDOWN_BEGIN,
68 PORT_273(IN_PD), /* PORT0_IN_PD -> PORT272_IN_PD */
69 PINMUX_INPUT_PULLDOWN_END,
70
71 PINMUX_OUTPUT_BEGIN,
72 PORT_273(OUT), /* PORT0_OUT -> PORT272_OUT */
73 PINMUX_OUTPUT_END,
74
75 PINMUX_FUNCTION_BEGIN,
76 PORT_273(FN_IN), /* PORT0_FN_IN -> PORT272_FN_IN */
77 PORT_273(FN_OUT), /* PORT0_FN_OUT -> PORT272_FN_OUT */
78 PORT_273(FN0), /* PORT0_FN0 -> PORT272_FN0 */
79 PORT_273(FN1), /* PORT0_FN1 -> PORT272_FN1 */
80 PORT_273(FN2), /* PORT0_FN2 -> PORT272_FN2 */
81 PORT_273(FN3), /* PORT0_FN3 -> PORT272_FN3 */
82 PORT_273(FN4), /* PORT0_FN4 -> PORT272_FN4 */
83 PORT_273(FN5), /* PORT0_FN5 -> PORT272_FN5 */
84 PORT_273(FN6), /* PORT0_FN6 -> PORT272_FN6 */
85 PORT_273(FN7), /* PORT0_FN7 -> PORT272_FN7 */
86
87 MSELBCR_MSEL2_1, MSELBCR_MSEL2_0,
88 PINMUX_FUNCTION_END,
89
90 PINMUX_MARK_BEGIN,
91 /* Special Pull-up / Pull-down Functions */
92 PORT48_KEYIN0_PU_MARK, PORT49_KEYIN1_PU_MARK,
93 PORT50_KEYIN2_PU_MARK, PORT55_KEYIN3_PU_MARK,
94 PORT56_KEYIN4_PU_MARK, PORT57_KEYIN5_PU_MARK,
95 PORT58_KEYIN6_PU_MARK,
96
97 /* 49-1 */
98 VBUS0_MARK, CPORT0_MARK, CPORT1_MARK, CPORT2_MARK,
99 CPORT3_MARK, CPORT4_MARK, CPORT5_MARK, CPORT6_MARK,
100 CPORT7_MARK, CPORT8_MARK, CPORT9_MARK, CPORT10_MARK,
101 CPORT11_MARK, SIN2_MARK, CPORT12_MARK, XCTS2_MARK,
102 CPORT13_MARK, RFSPO4_MARK, CPORT14_MARK, RFSPO5_MARK,
103 CPORT15_MARK, CPORT16_MARK, CPORT17_MARK, SOUT2_MARK,
104 CPORT18_MARK, XRTS2_MARK, CPORT19_MARK, CPORT20_MARK,
105 RFSPO6_MARK, CPORT21_MARK, STATUS0_MARK, CPORT22_MARK,
106 STATUS1_MARK, CPORT23_MARK, STATUS2_MARK, RFSPO7_MARK,
107 MPORT0_MARK, MPORT1_MARK, B_SYNLD1_MARK, B_SYNLD2_MARK,
108 XMAINPS_MARK, XDIVPS_MARK, XIDRST_MARK, IDCLK_MARK,
109 IDIO_MARK, SOUT1_MARK, SCIFA4_TXD_MARK,
110 M02_BERDAT_MARK, SIN1_MARK, SCIFA4_RXD_MARK, XWUP_MARK,
111 XRTS1_MARK, SCIFA4_RTS_MARK, M03_BERCLK_MARK,
112 XCTS1_MARK, SCIFA4_CTS_MARK,
113
114 /* 49-2 */
115 HSU_IQ_AGC6_MARK, MFG2_IN2_MARK, MSIOF2_MCK0_MARK,
116 HSU_IQ_AGC5_MARK, MFG2_IN1_MARK, MSIOF2_MCK1_MARK,
117 HSU_IQ_AGC4_MARK, MSIOF2_RSYNC_MARK,
118 HSU_IQ_AGC3_MARK, MFG2_OUT1_MARK, MSIOF2_RSCK_MARK,
119 HSU_IQ_AGC2_MARK, PORT42_KEYOUT0_MARK,
120 HSU_IQ_AGC1_MARK, PORT43_KEYOUT1_MARK,
121 HSU_IQ_AGC0_MARK, PORT44_KEYOUT2_MARK,
122 HSU_IQ_AGC_ST_MARK, PORT45_KEYOUT3_MARK,
123 HSU_IQ_PDO_MARK, PORT46_KEYOUT4_MARK,
124 HSU_IQ_PYO_MARK, PORT47_KEYOUT5_MARK,
125 HSU_EN_TXMUX_G3MO_MARK, PORT48_KEYIN0_MARK,
126 HSU_I_TXMUX_G3MO_MARK, PORT49_KEYIN1_MARK,
127 HSU_Q_TXMUX_G3MO_MARK, PORT50_KEYIN2_MARK,
128 HSU_SYO_MARK, PORT51_MSIOF2_TSYNC_MARK,
129 HSU_SDO_MARK, PORT52_MSIOF2_TSCK_MARK,
130 HSU_TGTTI_G3MO_MARK, PORT53_MSIOF2_TXD_MARK,
131 B_TIME_STAMP_MARK, PORT54_MSIOF2_RXD_MARK,
132 HSU_SDI_MARK, PORT55_KEYIN3_MARK,
133 HSU_SCO_MARK, PORT56_KEYIN4_MARK,
134 HSU_DREQ_MARK, PORT57_KEYIN5_MARK,
135 HSU_DACK_MARK, PORT58_KEYIN6_MARK,
136 HSU_CLK61M_MARK, PORT59_MSIOF2_SS1_MARK,
137 HSU_XRST_MARK, PORT60_MSIOF2_SS2_MARK,
138 PCMCLKO_MARK, SYNC8KO_MARK, DNPCM_A_MARK, UPPCM_A_MARK,
139 XTALB1L_MARK,
140 GPS_AGC1_MARK, SCIFA0_RTS_MARK,
141 GPS_AGC2_MARK, SCIFA0_SCK_MARK,
142 GPS_AGC3_MARK, SCIFA0_TXD_MARK,
143 GPS_AGC4_MARK, SCIFA0_RXD_MARK,
144 GPS_PWRD_MARK, SCIFA0_CTS_MARK,
145 GPS_IM_MARK, GPS_IS_MARK, GPS_QM_MARK, GPS_QS_MARK,
146 SIUBOMC_MARK, TPU2TO0_MARK,
147 SIUCKB_MARK, TPU2TO1_MARK,
148 SIUBOLR_MARK, BBIF2_TSYNC_MARK, TPU2TO2_MARK,
149 SIUBOBT_MARK, BBIF2_TSCK_MARK, TPU2TO3_MARK,
150 SIUBOSLD_MARK, BBIF2_TXD_MARK, TPU3TO0_MARK,
151 SIUBILR_MARK, TPU3TO1_MARK,
152 SIUBIBT_MARK, TPU3TO2_MARK,
153 SIUBISLD_MARK, TPU3TO3_MARK,
154 NMI_MARK, TPU4TO0_MARK,
155 DNPCM_M_MARK, TPU4TO1_MARK, TPU4TO2_MARK, TPU4TO3_MARK,
156 IRQ_TMPB_MARK,
157 PWEN_MARK, MFG1_OUT1_MARK,
158 OVCN_MARK, MFG1_IN1_MARK,
159 OVCN2_MARK, MFG1_IN2_MARK,
160
161 /* 49-3 */
162 RFSPO1_MARK, RFSPO2_MARK, RFSPO3_MARK, PORT93_VIO_CKO2_MARK,
163 USBTERM_MARK, EXTLP_MARK, IDIN_MARK,
164 SCIFA5_CTS_MARK, MFG0_IN1_MARK,
165 SCIFA5_RTS_MARK, MFG0_IN2_MARK,
166 SCIFA5_RXD_MARK,
167 SCIFA5_TXD_MARK,
168 SCIFA5_SCK_MARK, MFG0_OUT1_MARK,
169 A0_EA0_MARK, BS_MARK,
170 A14_EA14_MARK, PORT102_KEYOUT0_MARK,
171 A15_EA15_MARK, PORT103_KEYOUT1_MARK, DV_CLKOL_MARK,
172 A16_EA16_MARK, PORT104_KEYOUT2_MARK,
173 DV_VSYNCL_MARK, MSIOF0_SS1_MARK,
174 A17_EA17_MARK, PORT105_KEYOUT3_MARK,
175 DV_HSYNCL_MARK, MSIOF0_TSYNC_MARK,
176 A18_EA18_MARK, PORT106_KEYOUT4_MARK,
177 DV_DL0_MARK, MSIOF0_TSCK_MARK,
178 A19_EA19_MARK, PORT107_KEYOUT5_MARK,
179 DV_DL1_MARK, MSIOF0_TXD_MARK,
180 A20_EA20_MARK, PORT108_KEYIN0_MARK,
181 DV_DL2_MARK, MSIOF0_RSCK_MARK,
182 A21_EA21_MARK, PORT109_KEYIN1_MARK,
183 DV_DL3_MARK, MSIOF0_RSYNC_MARK,
184 A22_EA22_MARK, PORT110_KEYIN2_MARK,
185 DV_DL4_MARK, MSIOF0_MCK0_MARK,
186 A23_EA23_MARK, PORT111_KEYIN3_MARK,
187 DV_DL5_MARK, MSIOF0_MCK1_MARK,
188 A24_EA24_MARK, PORT112_KEYIN4_MARK,
189 DV_DL6_MARK, MSIOF0_RXD_MARK,
190 A25_EA25_MARK, PORT113_KEYIN5_MARK,
191 DV_DL7_MARK, MSIOF0_SS2_MARK,
192 A26_MARK, PORT113_KEYIN6_MARK, DV_CLKIL_MARK,
193 D0_ED0_NAF0_MARK, D1_ED1_NAF1_MARK, D2_ED2_NAF2_MARK,
194 D3_ED3_NAF3_MARK, D4_ED4_NAF4_MARK, D5_ED5_NAF5_MARK,
195 D6_ED6_NAF6_MARK, D7_ED7_NAF7_MARK, D8_ED8_NAF8_MARK,
196 D9_ED9_NAF9_MARK, D10_ED10_NAF10_MARK, D11_ED11_NAF11_MARK,
197 D12_ED12_NAF12_MARK, D13_ED13_NAF13_MARK,
198 D14_ED14_NAF14_MARK, D15_ED15_NAF15_MARK,
199 CS4_MARK, CS5A_MARK, CS5B_MARK, FCE1_MARK,
200 CS6B_MARK, XCS2_MARK, FCE0_MARK, CS6A_MARK,
201 DACK0_MARK, WAIT_MARK, DREQ0_MARK, RD_XRD_MARK,
202 A27_MARK, RDWR_XWE_MARK, WE0_XWR0_FWE_MARK,
203 WE1_XWR1_MARK, FRB_MARK, CKO_MARK,
204 NBRSTOUT_MARK, NBRST_MARK,
205
206 /* 49-4 */
207 RFSPO0_MARK, PORT146_VIO_CKO2_MARK, TSTMD_MARK,
208 VIO_VD_MARK, VIO_HD_MARK,
209 VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK,
210 VIO_D3_MARK, VIO_D4_MARK, VIO_D5_MARK,
211 VIO_D6_MARK, VIO_D7_MARK, VIO_D8_MARK,
212 VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
213 VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK,
214 VIO_D15_MARK, VIO_CLK_MARK, VIO_FIELD_MARK,
215 VIO_CKO_MARK,
216 MFG3_IN1_MARK, MFG3_IN2_MARK,
217 M9_SLCD_A01_MARK, MFG3_OUT1_MARK, TPU0TO0_MARK,
218 M10_SLCD_CK1_MARK, MFG4_IN1_MARK, TPU0TO1_MARK,
219 M11_SLCD_SO1_MARK, MFG4_IN2_MARK, TPU0TO2_MARK,
220 M12_SLCD_CE1_MARK, MFG4_OUT1_MARK, TPU0TO3_MARK,
221 LCDD0_MARK, PORT175_KEYOUT0_MARK, DV_D0_MARK,
222 SIUCKA_MARK, MFG0_OUT2_MARK,
223 LCDD1_MARK, PORT176_KEYOUT1_MARK, DV_D1_MARK,
224 SIUAOLR_MARK, BBIF2_TSYNC1_MARK,
225 LCDD2_MARK, PORT177_KEYOUT2_MARK, DV_D2_MARK,
226 SIUAOBT_MARK, BBIF2_TSCK1_MARK,
227 LCDD3_MARK, PORT178_KEYOUT3_MARK, DV_D3_MARK,
228 SIUAOSLD_MARK, BBIF2_TXD1_MARK,
229 LCDD4_MARK, PORT179_KEYOUT4_MARK, DV_D4_MARK,
230 SIUAISPD_MARK, MFG1_OUT2_MARK,
231 LCDD5_MARK, PORT180_KEYOUT5_MARK, DV_D5_MARK,
232 SIUAILR_MARK, MFG2_OUT2_MARK,
233 LCDD6_MARK, DV_D6_MARK,
234 SIUAIBT_MARK, MFG3_OUT2_MARK, XWR2_MARK,
235 LCDD7_MARK, DV_D7_MARK,
236 SIUAISLD_MARK, MFG4_OUT2_MARK, XWR3_MARK,
237 LCDD8_MARK, DV_D8_MARK, D16_MARK, ED16_MARK,
238 LCDD9_MARK, DV_D9_MARK, D17_MARK, ED17_MARK,
239 LCDD10_MARK, DV_D10_MARK, D18_MARK, ED18_MARK,
240 LCDD11_MARK, DV_D11_MARK, D19_MARK, ED19_MARK,
241 LCDD12_MARK, DV_D12_MARK, D20_MARK, ED20_MARK,
242 LCDD13_MARK, DV_D13_MARK, D21_MARK, ED21_MARK,
243 LCDD14_MARK, DV_D14_MARK, D22_MARK, ED22_MARK,
244 LCDD15_MARK, DV_D15_MARK, D23_MARK, ED23_MARK,
245 LCDD16_MARK, DV_HSYNC_MARK, D24_MARK, ED24_MARK,
246 LCDD17_MARK, DV_VSYNC_MARK, D25_MARK, ED25_MARK,
247 LCDD18_MARK, DREQ2_MARK, MSIOF0L_TSCK_MARK,
248 D26_MARK, ED26_MARK,
249 LCDD19_MARK, MSIOF0L_TSYNC_MARK,
250 D27_MARK, ED27_MARK,
251 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK,
252 D28_MARK, ED28_MARK,
253 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK,
254 D29_MARK, ED29_MARK,
255 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_SS1_MARK,
256 D30_MARK, ED30_MARK,
257 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_SS2_MARK,
258 D31_MARK, ED31_MARK,
259 LCDDCK_MARK, LCDWR_MARK, DV_CKO_MARK, SIUAOSPD_MARK,
260 LCDRD_MARK, DACK2_MARK, MSIOF0L_RSYNC_MARK,
261
262 /* 49-5 */
263 LCDHSYN_MARK, LCDCS_MARK, LCDCS2_MARK, DACK3_MARK,
264 LCDDISP_MARK, LCDRS_MARK, DREQ3_MARK, MSIOF0L_RSCK_MARK,
265 LCDCSYN_MARK, LCDCSYN2_MARK, DV_CKI_MARK,
266 LCDLCLK_MARK, DREQ1_MARK, MSIOF0L_RXD_MARK,
267 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, MSIOF0L_TXD_MARK,
268 VIO_DR0_MARK, VIO_DR1_MARK, VIO_DR2_MARK, VIO_DR3_MARK,
269 VIO_DR4_MARK, VIO_DR5_MARK, VIO_DR6_MARK, VIO_DR7_MARK,
270 VIO_VDR_MARK, VIO_HDR_MARK,
271 VIO_CLKR_MARK, VIO_CKOR_MARK,
272 SCIFA1_TXD_MARK, GPS_PGFA0_MARK,
273 SCIFA1_SCK_MARK, GPS_PGFA1_MARK,
274 SCIFA1_RTS_MARK, GPS_EPPSINMON_MARK,
275 SCIFA1_RXD_MARK, SCIFA1_CTS_MARK,
276 MSIOF1_TXD_MARK, SCIFA1_TXD2_MARK, GPS_TXD_MARK,
277 MSIOF1_TSYNC_MARK, SCIFA1_CTS2_MARK, I2C_SDA2_MARK,
278 MSIOF1_TSCK_MARK, SCIFA1_SCK2_MARK,
279 MSIOF1_RXD_MARK, SCIFA1_RXD2_MARK, GPS_RXD_MARK,
280 MSIOF1_RSCK_MARK, SCIFA1_RTS2_MARK,
281 MSIOF1_RSYNC_MARK, I2C_SCL2_MARK,
282 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
283 MSIOF1_SS1_MARK, EDBGREQ3_MARK,
284 MSIOF1_SS2_MARK,
285 PORT236_IROUT_MARK, IRDA_OUT_MARK,
286 IRDA_IN_MARK, IRDA_FIRSEL_MARK,
287 TPU1TO0_MARK, TS_SPSYNC3_MARK,
288 TPU1TO1_MARK, TS_SDAT3_MARK,
289 TPU1TO2_MARK, TS_SDEN3_MARK, PORT241_MSIOF2_SS1_MARK,
290 TPU1TO3_MARK, PORT242_MSIOF2_TSCK_MARK,
291 M13_BSW_MARK, PORT243_MSIOF2_TSYNC_MARK,
292 M14_GSW_MARK, PORT244_MSIOF2_TXD_MARK,
293 PORT245_IROUT_MARK, M15_RSW_MARK,
294 SOUT3_MARK, SCIFA2_TXD1_MARK,
295 SIN3_MARK, SCIFA2_RXD1_MARK,
296 XRTS3_MARK, SCIFA2_RTS1_MARK, PORT248_MSIOF2_SS2_MARK,
297 XCTS3_MARK, SCIFA2_CTS1_MARK, PORT249_MSIOF2_RXD_MARK,
298 DINT_MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
299 SDHICLK0_MARK, TCK2_MARK,
300 SDHICD0_MARK,
301 SDHID0_0_MARK, TMS2_MARK,
302 SDHID0_1_MARK, TDO2_MARK,
303 SDHID0_2_MARK, TDI2_MARK,
304 SDHID0_3_MARK, RTCK2_MARK,
305
306 /* 49-6 */
307 SDHICMD0_MARK, TRST2_MARK,
308 SDHIWP0_MARK, EDBGREQ2_MARK,
309 SDHICLK1_MARK, TCK3_MARK,
310 SDHID1_0_MARK, M11_SLCD_SO2_MARK,
311 TS_SPSYNC2_MARK, TMS3_MARK,
312 SDHID1_1_MARK, M9_SLCD_AO2_MARK,
313 TS_SDAT2_MARK, TDO3_MARK,
314 SDHID1_2_MARK, M10_SLCD_CK2_MARK,
315 TS_SDEN2_MARK, TDI3_MARK,
316 SDHID1_3_MARK, M12_SLCD_CE2_MARK,
317 TS_SCK2_MARK, RTCK3_MARK,
318 SDHICMD1_MARK, TRST3_MARK,
319 SDHICLK2_MARK, SCIFB_SCK_MARK,
320 SDHID2_0_MARK, SCIFB_TXD_MARK,
321 SDHID2_1_MARK, SCIFB_CTS_MARK,
322 SDHID2_2_MARK, SCIFB_RXD_MARK,
323 SDHID2_3_MARK, SCIFB_RTS_MARK,
324 SDHICMD2_MARK,
325 RESETOUTS_MARK,
326 DIVLOCK_MARK,
327 PINMUX_MARK_END,
328};
329
330#define PORT_DATA_I(nr) \
331 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
332
333#define PORT_DATA_I_PD(nr) \
334 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
335 PORT##nr##_IN, PORT##nr##_IN_PD)
336
337#define PORT_DATA_I_PU(nr) \
338 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
339 PORT##nr##_IN, PORT##nr##_IN_PU)
340
341#define PORT_DATA_I_PU_PD(nr) \
342 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
343 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
344
345#define PORT_DATA_O(nr) \
346 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
347
348#define PORT_DATA_IO(nr) \
349 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
350 PORT##nr##_IN)
351
352#define PORT_DATA_IO_PD(nr) \
353 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
354 PORT##nr##_IN, PORT##nr##_IN_PD)
355
356#define PORT_DATA_IO_PU(nr) \
357 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
358 PORT##nr##_IN, PORT##nr##_IN_PU)
359
360#define PORT_DATA_IO_PU_PD(nr) \
361 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
362 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
363
364
365static pinmux_enum_t pinmux_data[] = {
366
367 /* specify valid pin states for each pin in GPIO mode */
368
369 /* 49-1 (GPIO) */
370 PORT_DATA_I_PD(0),
371 PORT_DATA_I_PU(1), PORT_DATA_I_PU(2), PORT_DATA_I_PU(3),
372 PORT_DATA_I_PU(4), PORT_DATA_I_PU(5), PORT_DATA_I_PU(6),
373 PORT_DATA_I_PU(7), PORT_DATA_I_PU(8), PORT_DATA_I_PU(9),
374 PORT_DATA_I_PU(10), PORT_DATA_I_PU(11), PORT_DATA_I_PU(12),
375 PORT_DATA_I_PU(13),
376 PORT_DATA_IO_PU_PD(14), PORT_DATA_IO_PU_PD(15),
377 PORT_DATA_O(16), PORT_DATA_O(17), PORT_DATA_O(18), PORT_DATA_O(19),
378 PORT_DATA_O(20), PORT_DATA_O(21), PORT_DATA_O(22), PORT_DATA_O(23),
379 PORT_DATA_O(24), PORT_DATA_O(25), PORT_DATA_O(26),
380 PORT_DATA_I_PD(27), PORT_DATA_I_PD(28),
381 PORT_DATA_O(29), PORT_DATA_O(30), PORT_DATA_O(31), PORT_DATA_O(32),
382 PORT_DATA_IO_PU(33),
383 PORT_DATA_O(34),
384 PORT_DATA_I_PU(35),
385 PORT_DATA_O(36),
386 PORT_DATA_I_PU_PD(37),
387
388 /* 49-2 (GPIO) */
389 PORT_DATA_IO_PU_PD(38),
390 PORT_DATA_IO_PD(39), PORT_DATA_IO_PD(40), PORT_DATA_IO_PD(41),
391 PORT_DATA_O(42), PORT_DATA_O(43), PORT_DATA_O(44), PORT_DATA_O(45),
392 PORT_DATA_O(46), PORT_DATA_O(47),
393 PORT_DATA_I_PU_PD(48), PORT_DATA_I_PU_PD(49), PORT_DATA_I_PU_PD(50),
394 PORT_DATA_IO_PD(51), PORT_DATA_IO_PD(52),
395 PORT_DATA_O(53),
396 PORT_DATA_IO_PD(54),
397 PORT_DATA_I_PU_PD(55),
398 PORT_DATA_IO_PU_PD(56),
399 PORT_DATA_I_PU_PD(57),
400 PORT_DATA_IO_PU_PD(58),
401 PORT_DATA_O(59), PORT_DATA_O(60), PORT_DATA_O(61), PORT_DATA_O(62),
402 PORT_DATA_O(63),
403 PORT_DATA_I_PU(64),
404 PORT_DATA_O(65), PORT_DATA_O(66), PORT_DATA_O(67), PORT_DATA_O(68),
405 PORT_DATA_IO_PD(69), PORT_DATA_IO_PD(70),
406 PORT_DATA_I_PD(71), PORT_DATA_I_PD(72), PORT_DATA_I_PD(73),
407 PORT_DATA_I_PD(74),
408 PORT_DATA_IO_PU_PD(75), PORT_DATA_IO_PU_PD(76),
409 PORT_DATA_IO_PD(77), PORT_DATA_IO_PD(78),
410 PORT_DATA_O(79),
411 PORT_DATA_IO_PD(80), PORT_DATA_IO_PD(81), PORT_DATA_IO_PD(82),
412 PORT_DATA_IO_PU_PD(83), PORT_DATA_IO_PU_PD(84),
413 PORT_DATA_IO_PU_PD(85), PORT_DATA_IO_PU_PD(86),
414 PORT_DATA_I_PD(87),
415 PORT_DATA_IO_PU_PD(88),
416 PORT_DATA_I_PU_PD(89), PORT_DATA_I_PU_PD(90),
417
418 /* 49-3 (GPIO) */
419 PORT_DATA_O(91), PORT_DATA_O(92), PORT_DATA_O(93), PORT_DATA_O(94),
420 PORT_DATA_I_PU_PD(95),
421 PORT_DATA_IO_PU_PD(96), PORT_DATA_IO_PU_PD(97), PORT_DATA_IO_PU_PD(98),
422 PORT_DATA_IO_PU_PD(99), PORT_DATA_IO_PU_PD(100),
423 PORT_DATA_IO(101), PORT_DATA_IO(102), PORT_DATA_IO(103),
424 PORT_DATA_IO_PD(104), PORT_DATA_IO_PD(105), PORT_DATA_IO_PD(106),
425 PORT_DATA_IO_PD(107),
426 PORT_DATA_IO_PU_PD(108), PORT_DATA_IO_PU_PD(109),
427 PORT_DATA_IO_PU_PD(110), PORT_DATA_IO_PU_PD(111),
428 PORT_DATA_IO_PU_PD(112), PORT_DATA_IO_PU_PD(113),
429 PORT_DATA_IO_PU_PD(114),
430 PORT_DATA_IO_PU(115), PORT_DATA_IO_PU(116), PORT_DATA_IO_PU(117),
431 PORT_DATA_IO_PU(118), PORT_DATA_IO_PU(119), PORT_DATA_IO_PU(120),
432 PORT_DATA_IO_PU(121), PORT_DATA_IO_PU(122), PORT_DATA_IO_PU(123),
433 PORT_DATA_IO_PU(124), PORT_DATA_IO_PU(125), PORT_DATA_IO_PU(126),
434 PORT_DATA_IO_PU(127), PORT_DATA_IO_PU(128), PORT_DATA_IO_PU(129),
435 PORT_DATA_IO_PU(130),
436 PORT_DATA_O(131), PORT_DATA_O(132), PORT_DATA_O(133),
437 PORT_DATA_IO_PU(134),
438 PORT_DATA_O(135), PORT_DATA_O(136),
439 PORT_DATA_I_PU_PD(137),
440 PORT_DATA_IO(138),
441 PORT_DATA_IO_PU_PD(139),
442 PORT_DATA_IO(140), PORT_DATA_IO(141),
443 PORT_DATA_I_PU(142),
444 PORT_DATA_O(143), PORT_DATA_O(144),
445 PORT_DATA_I_PU(145),
446
447 /* 49-4 (GPIO) */
448 PORT_DATA_O(146),
449 PORT_DATA_I_PU_PD(147),
450 PORT_DATA_I_PD(148), PORT_DATA_I_PD(149),
451 PORT_DATA_IO_PD(150), PORT_DATA_IO_PD(151), PORT_DATA_IO_PD(152),
452 PORT_DATA_IO_PD(153), PORT_DATA_IO_PD(154), PORT_DATA_IO_PD(155),
453 PORT_DATA_IO_PD(156), PORT_DATA_IO_PD(157), PORT_DATA_IO_PD(158),
454 PORT_DATA_IO_PD(159), PORT_DATA_IO_PD(160), PORT_DATA_IO_PD(161),
455 PORT_DATA_IO_PD(162), PORT_DATA_IO_PD(163), PORT_DATA_IO_PD(164),
456 PORT_DATA_IO_PD(165), PORT_DATA_IO_PD(166),
457 PORT_DATA_IO_PU_PD(167),
458 PORT_DATA_O(168),
459 PORT_DATA_I_PD(169), PORT_DATA_I_PD(170),
460 PORT_DATA_O(171),
461 PORT_DATA_IO_PD(172), PORT_DATA_IO_PD(173),
462 PORT_DATA_O(174),
463 PORT_DATA_IO_PD(175), PORT_DATA_IO_PD(176), PORT_DATA_IO_PD(177),
464 PORT_DATA_IO_PD(178), PORT_DATA_IO_PD(179), PORT_DATA_IO_PD(180),
465 PORT_DATA_IO_PD(181), PORT_DATA_IO_PD(182), PORT_DATA_IO_PD(183),
466 PORT_DATA_IO_PD(184), PORT_DATA_IO_PD(185), PORT_DATA_IO_PD(186),
467 PORT_DATA_IO_PD(187), PORT_DATA_IO_PD(188), PORT_DATA_IO_PD(189),
468 PORT_DATA_IO_PD(190), PORT_DATA_IO_PD(191), PORT_DATA_IO_PD(192),
469 PORT_DATA_IO_PD(193), PORT_DATA_IO_PD(194), PORT_DATA_IO_PD(195),
470 PORT_DATA_IO_PD(196), PORT_DATA_IO_PD(197), PORT_DATA_IO_PD(198),
471 PORT_DATA_O(199),
472 PORT_DATA_IO_PD(200),
473
474 /* 49-5 (GPIO) */
475 PORT_DATA_O(201),
476 PORT_DATA_IO_PD(202), PORT_DATA_IO_PD(203),
477 PORT_DATA_I(204),
478 PORT_DATA_O(205),
479 PORT_DATA_IO_PD(206), PORT_DATA_IO_PD(207), PORT_DATA_IO_PD(208),
480 PORT_DATA_IO_PD(209), PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
481 PORT_DATA_IO_PD(212), PORT_DATA_IO_PD(213), PORT_DATA_IO_PD(214),
482 PORT_DATA_IO_PD(215), PORT_DATA_IO_PD(216),
483 PORT_DATA_O(217),
484 PORT_DATA_I_PU_PD(218), PORT_DATA_I_PU_PD(219),
485 PORT_DATA_O(220), PORT_DATA_O(221), PORT_DATA_O(222),
486 PORT_DATA_I_PD(223),
487 PORT_DATA_I_PU_PD(224),
488 PORT_DATA_O(225),
489 PORT_DATA_IO_PD(226),
490 PORT_DATA_IO_PU_PD(227),
491 PORT_DATA_I_PD(228),
492 PORT_DATA_IO_PD(229), PORT_DATA_IO_PD(230),
493 PORT_DATA_I_PU_PD(231), PORT_DATA_I_PU_PD(232),
494 PORT_DATA_IO_PU_PD(233), PORT_DATA_IO_PU_PD(234),
495 PORT_DATA_I_PU_PD(235),
496 PORT_DATA_O(236),
497 PORT_DATA_I_PD(237),
498 PORT_DATA_IO_PU_PD(238), PORT_DATA_IO_PU_PD(239),
499 PORT_DATA_IO_PD(240), PORT_DATA_IO_PD(241),
500 PORT_DATA_IO_PD(242), PORT_DATA_IO_PD(243),
501 PORT_DATA_O(244),
502 PORT_DATA_IO_PU_PD(245),
503 PORT_DATA_O(246),
504 PORT_DATA_I_PD(247),
505 PORT_DATA_IO_PU_PD(248),
506 PORT_DATA_I_PU_PD(249),
507 PORT_DATA_IO_PD(250), PORT_DATA_IO_PD(251),
508 PORT_DATA_IO_PU_PD(252), PORT_DATA_IO_PU_PD(253),
509 PORT_DATA_IO_PU_PD(254), PORT_DATA_IO_PU_PD(255),
510 PORT_DATA_IO_PU_PD(256),
511
512 /* 49-6 (GPIO) */
513 PORT_DATA_IO_PU_PD(257), PORT_DATA_IO_PU_PD(258),
514 PORT_DATA_IO_PD(259),
515 PORT_DATA_IO_PU(260), PORT_DATA_IO_PU(261), PORT_DATA_IO_PU(262),
516 PORT_DATA_IO_PU(263), PORT_DATA_IO_PU(264),
517 PORT_DATA_O(265),
518 PORT_DATA_IO_PU(266), PORT_DATA_IO_PU(267), PORT_DATA_IO_PU(268),
519 PORT_DATA_IO_PU(269), PORT_DATA_IO_PU(270),
520 PORT_DATA_O(271),
521 PORT_DATA_I_PD(272),
522
523 /* Special Pull-up / Pull-down Functions */
524 PINMUX_DATA(PORT48_KEYIN0_PU_MARK, MSELBCR_MSEL2_1,
525 PORT48_FN2, PORT48_IN_PU),
526 PINMUX_DATA(PORT49_KEYIN1_PU_MARK, MSELBCR_MSEL2_1,
527 PORT49_FN2, PORT49_IN_PU),
528 PINMUX_DATA(PORT50_KEYIN2_PU_MARK, MSELBCR_MSEL2_1,
529 PORT50_FN2, PORT50_IN_PU),
530 PINMUX_DATA(PORT55_KEYIN3_PU_MARK, MSELBCR_MSEL2_1,
531 PORT55_FN2, PORT55_IN_PU),
532 PINMUX_DATA(PORT56_KEYIN4_PU_MARK, MSELBCR_MSEL2_1,
533 PORT56_FN2, PORT56_IN_PU),
534 PINMUX_DATA(PORT57_KEYIN5_PU_MARK, MSELBCR_MSEL2_1,
535 PORT57_FN2, PORT57_IN_PU),
536 PINMUX_DATA(PORT58_KEYIN6_PU_MARK, MSELBCR_MSEL2_1,
537 PORT58_FN2, PORT58_IN_PU),
538
539 /* 49-1 (FN) */
540 PINMUX_DATA(VBUS0_MARK, PORT0_FN1),
541 PINMUX_DATA(CPORT0_MARK, PORT1_FN1),
542 PINMUX_DATA(CPORT1_MARK, PORT2_FN1),
543 PINMUX_DATA(CPORT2_MARK, PORT3_FN1),
544 PINMUX_DATA(CPORT3_MARK, PORT4_FN1),
545 PINMUX_DATA(CPORT4_MARK, PORT5_FN1),
546 PINMUX_DATA(CPORT5_MARK, PORT6_FN1),
547 PINMUX_DATA(CPORT6_MARK, PORT7_FN1),
548 PINMUX_DATA(CPORT7_MARK, PORT8_FN1),
549 PINMUX_DATA(CPORT8_MARK, PORT9_FN1),
550 PINMUX_DATA(CPORT9_MARK, PORT10_FN1),
551 PINMUX_DATA(CPORT10_MARK, PORT11_FN1),
552 PINMUX_DATA(CPORT11_MARK, PORT12_FN1),
553 PINMUX_DATA(SIN2_MARK, PORT12_FN2),
554 PINMUX_DATA(CPORT12_MARK, PORT13_FN1),
555 PINMUX_DATA(XCTS2_MARK, PORT13_FN2),
556 PINMUX_DATA(CPORT13_MARK, PORT14_FN1),
557 PINMUX_DATA(RFSPO4_MARK, PORT14_FN2),
558 PINMUX_DATA(CPORT14_MARK, PORT15_FN1),
559 PINMUX_DATA(RFSPO5_MARK, PORT15_FN2),
560 PINMUX_DATA(CPORT15_MARK, PORT16_FN1),
561 PINMUX_DATA(CPORT16_MARK, PORT17_FN1),
562 PINMUX_DATA(CPORT17_MARK, PORT18_FN1),
563 PINMUX_DATA(SOUT2_MARK, PORT18_FN2),
564 PINMUX_DATA(CPORT18_MARK, PORT19_FN1),
565 PINMUX_DATA(XRTS2_MARK, PORT19_FN1),
566 PINMUX_DATA(CPORT19_MARK, PORT20_FN1),
567 PINMUX_DATA(CPORT20_MARK, PORT21_FN1),
568 PINMUX_DATA(RFSPO6_MARK, PORT21_FN2),
569 PINMUX_DATA(CPORT21_MARK, PORT22_FN1),
570 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
571 PINMUX_DATA(CPORT22_MARK, PORT23_FN1),
572 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
573 PINMUX_DATA(CPORT23_MARK, PORT24_FN1),
574 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
575 PINMUX_DATA(RFSPO7_MARK, PORT24_FN3),
576 PINMUX_DATA(MPORT0_MARK, PORT25_FN1),
577 PINMUX_DATA(MPORT1_MARK, PORT26_FN1),
578 PINMUX_DATA(B_SYNLD1_MARK, PORT27_FN1),
579 PINMUX_DATA(B_SYNLD2_MARK, PORT28_FN1),
580 PINMUX_DATA(XMAINPS_MARK, PORT29_FN1),
581 PINMUX_DATA(XDIVPS_MARK, PORT30_FN1),
582 PINMUX_DATA(XIDRST_MARK, PORT31_FN1),
583 PINMUX_DATA(IDCLK_MARK, PORT32_FN1),
584 PINMUX_DATA(IDIO_MARK, PORT33_FN1),
585 PINMUX_DATA(SOUT1_MARK, PORT34_FN1),
586 PINMUX_DATA(SCIFA4_TXD_MARK, PORT34_FN2),
587 PINMUX_DATA(M02_BERDAT_MARK, PORT34_FN3),
588 PINMUX_DATA(SIN1_MARK, PORT35_FN1),
589 PINMUX_DATA(SCIFA4_RXD_MARK, PORT35_FN2),
590 PINMUX_DATA(XWUP_MARK, PORT35_FN3),
591 PINMUX_DATA(XRTS1_MARK, PORT36_FN1),
592 PINMUX_DATA(SCIFA4_RTS_MARK, PORT36_FN2),
593 PINMUX_DATA(M03_BERCLK_MARK, PORT36_FN3),
594 PINMUX_DATA(XCTS1_MARK, PORT37_FN1),
595 PINMUX_DATA(SCIFA4_CTS_MARK, PORT37_FN2),
596
597 /* 49-2 (FN) */
598 PINMUX_DATA(HSU_IQ_AGC6_MARK, PORT38_FN1),
599 PINMUX_DATA(MFG2_IN2_MARK, PORT38_FN2),
600 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT38_FN3),
601 PINMUX_DATA(HSU_IQ_AGC5_MARK, PORT39_FN1),
602 PINMUX_DATA(MFG2_IN1_MARK, PORT39_FN2),
603 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT39_FN3),
604 PINMUX_DATA(HSU_IQ_AGC4_MARK, PORT40_FN1),
605 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT40_FN3),
606 PINMUX_DATA(HSU_IQ_AGC3_MARK, PORT41_FN1),
607 PINMUX_DATA(MFG2_OUT1_MARK, PORT41_FN2),
608 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT41_FN3),
609 PINMUX_DATA(HSU_IQ_AGC2_MARK, PORT42_FN1),
610 PINMUX_DATA(PORT42_KEYOUT0_MARK, MSELBCR_MSEL2_1, PORT42_FN2),
611 PINMUX_DATA(HSU_IQ_AGC1_MARK, PORT43_FN1),
612 PINMUX_DATA(PORT43_KEYOUT1_MARK, MSELBCR_MSEL2_1, PORT43_FN2),
613 PINMUX_DATA(HSU_IQ_AGC0_MARK, PORT44_FN1),
614 PINMUX_DATA(PORT44_KEYOUT2_MARK, MSELBCR_MSEL2_1, PORT44_FN2),
615 PINMUX_DATA(HSU_IQ_AGC_ST_MARK, PORT45_FN1),
616 PINMUX_DATA(PORT45_KEYOUT3_MARK, MSELBCR_MSEL2_1, PORT45_FN2),
617 PINMUX_DATA(HSU_IQ_PDO_MARK, PORT46_FN1),
618 PINMUX_DATA(PORT46_KEYOUT4_MARK, MSELBCR_MSEL2_1, PORT46_FN2),
619 PINMUX_DATA(HSU_IQ_PYO_MARK, PORT47_FN1),
620 PINMUX_DATA(PORT47_KEYOUT5_MARK, MSELBCR_MSEL2_1, PORT47_FN2),
621 PINMUX_DATA(HSU_EN_TXMUX_G3MO_MARK, PORT48_FN1),
622 PINMUX_DATA(PORT48_KEYIN0_MARK, MSELBCR_MSEL2_1, PORT48_FN2),
623 PINMUX_DATA(HSU_I_TXMUX_G3MO_MARK, PORT49_FN1),
624 PINMUX_DATA(PORT49_KEYIN1_MARK, MSELBCR_MSEL2_1, PORT49_FN2),
625 PINMUX_DATA(HSU_Q_TXMUX_G3MO_MARK, PORT50_FN1),
626 PINMUX_DATA(PORT50_KEYIN2_MARK, MSELBCR_MSEL2_1, PORT50_FN2),
627 PINMUX_DATA(HSU_SYO_MARK, PORT51_FN1),
628 PINMUX_DATA(PORT51_MSIOF2_TSYNC_MARK, PORT51_FN2),
629 PINMUX_DATA(HSU_SDO_MARK, PORT52_FN1),
630 PINMUX_DATA(PORT52_MSIOF2_TSCK_MARK, PORT52_FN2),
631 PINMUX_DATA(HSU_TGTTI_G3MO_MARK, PORT53_FN1),
632 PINMUX_DATA(PORT53_MSIOF2_TXD_MARK, PORT53_FN2),
633 PINMUX_DATA(B_TIME_STAMP_MARK, PORT54_FN1),
634 PINMUX_DATA(PORT54_MSIOF2_RXD_MARK, PORT54_FN2),
635 PINMUX_DATA(HSU_SDI_MARK, PORT55_FN1),
636 PINMUX_DATA(PORT55_KEYIN3_MARK, MSELBCR_MSEL2_1, PORT55_FN2),
637 PINMUX_DATA(HSU_SCO_MARK, PORT56_FN1),
638 PINMUX_DATA(PORT56_KEYIN4_MARK, MSELBCR_MSEL2_1, PORT56_FN2),
639 PINMUX_DATA(HSU_DREQ_MARK, PORT57_FN1),
640 PINMUX_DATA(PORT57_KEYIN5_MARK, MSELBCR_MSEL2_1, PORT57_FN2),
641 PINMUX_DATA(HSU_DACK_MARK, PORT58_FN1),
642 PINMUX_DATA(PORT58_KEYIN6_MARK, MSELBCR_MSEL2_1, PORT58_FN2),
643 PINMUX_DATA(HSU_CLK61M_MARK, PORT59_FN1),
644 PINMUX_DATA(PORT59_MSIOF2_SS1_MARK, PORT59_FN2),
645 PINMUX_DATA(HSU_XRST_MARK, PORT60_FN1),
646 PINMUX_DATA(PORT60_MSIOF2_SS2_MARK, PORT60_FN2),
647 PINMUX_DATA(PCMCLKO_MARK, PORT61_FN1),
648 PINMUX_DATA(SYNC8KO_MARK, PORT62_FN1),
649 PINMUX_DATA(DNPCM_A_MARK, PORT63_FN1),
650 PINMUX_DATA(UPPCM_A_MARK, PORT64_FN1),
651 PINMUX_DATA(XTALB1L_MARK, PORT65_FN1),
652 PINMUX_DATA(GPS_AGC1_MARK, PORT66_FN1),
653 PINMUX_DATA(SCIFA0_RTS_MARK, PORT66_FN2),
654 PINMUX_DATA(GPS_AGC2_MARK, PORT67_FN1),
655 PINMUX_DATA(SCIFA0_SCK_MARK, PORT67_FN2),
656 PINMUX_DATA(GPS_AGC3_MARK, PORT68_FN1),
657 PINMUX_DATA(SCIFA0_TXD_MARK, PORT68_FN2),
658 PINMUX_DATA(GPS_AGC4_MARK, PORT69_FN1),
659 PINMUX_DATA(SCIFA0_RXD_MARK, PORT69_FN2),
660 PINMUX_DATA(GPS_PWRD_MARK, PORT70_FN1),
661 PINMUX_DATA(SCIFA0_CTS_MARK, PORT70_FN2),
662 PINMUX_DATA(GPS_IM_MARK, PORT71_FN1),
663 PINMUX_DATA(GPS_IS_MARK, PORT72_FN1),
664 PINMUX_DATA(GPS_QM_MARK, PORT73_FN1),
665 PINMUX_DATA(GPS_QS_MARK, PORT74_FN1),
666 PINMUX_DATA(SIUBOMC_MARK, PORT75_FN1),
667 PINMUX_DATA(TPU2TO0_MARK, PORT75_FN3),
668 PINMUX_DATA(SIUCKB_MARK, PORT76_FN1),
669 PINMUX_DATA(TPU2TO1_MARK, PORT76_FN3),
670 PINMUX_DATA(SIUBOLR_MARK, PORT77_FN1),
671 PINMUX_DATA(BBIF2_TSYNC_MARK, PORT77_FN2),
672 PINMUX_DATA(TPU2TO2_MARK, PORT77_FN3),
673 PINMUX_DATA(SIUBOBT_MARK, PORT78_FN1),
674 PINMUX_DATA(BBIF2_TSCK_MARK, PORT78_FN2),
675 PINMUX_DATA(TPU2TO3_MARK, PORT78_FN3),
676 PINMUX_DATA(SIUBOSLD_MARK, PORT79_FN1),
677 PINMUX_DATA(BBIF2_TXD_MARK, PORT79_FN2),
678 PINMUX_DATA(TPU3TO0_MARK, PORT79_FN3),
679 PINMUX_DATA(SIUBILR_MARK, PORT80_FN1),
680 PINMUX_DATA(TPU3TO1_MARK, PORT80_FN3),
681 PINMUX_DATA(SIUBIBT_MARK, PORT81_FN1),
682 PINMUX_DATA(TPU3TO2_MARK, PORT81_FN3),
683 PINMUX_DATA(SIUBISLD_MARK, PORT82_FN1),
684 PINMUX_DATA(TPU3TO3_MARK, PORT82_FN3),
685 PINMUX_DATA(NMI_MARK, PORT83_FN1),
686 PINMUX_DATA(TPU4TO0_MARK, PORT83_FN3),
687 PINMUX_DATA(DNPCM_M_MARK, PORT84_FN1),
688 PINMUX_DATA(TPU4TO1_MARK, PORT84_FN3),
689 PINMUX_DATA(TPU4TO2_MARK, PORT85_FN3),
690 PINMUX_DATA(TPU4TO3_MARK, PORT86_FN3),
691 PINMUX_DATA(IRQ_TMPB_MARK, PORT87_FN1),
692 PINMUX_DATA(PWEN_MARK, PORT88_FN1),
693 PINMUX_DATA(MFG1_OUT1_MARK, PORT88_FN2),
694 PINMUX_DATA(OVCN_MARK, PORT89_FN1),
695 PINMUX_DATA(MFG1_IN1_MARK, PORT89_FN2),
696 PINMUX_DATA(OVCN2_MARK, PORT90_FN1),
697 PINMUX_DATA(MFG1_IN2_MARK, PORT90_FN2),
698
699 /* 49-3 (FN) */
700 PINMUX_DATA(RFSPO1_MARK, PORT91_FN1),
701 PINMUX_DATA(RFSPO2_MARK, PORT92_FN1),
702 PINMUX_DATA(RFSPO3_MARK, PORT93_FN1),
703 PINMUX_DATA(PORT93_VIO_CKO2_MARK, PORT93_FN2),
704 PINMUX_DATA(USBTERM_MARK, PORT94_FN1),
705 PINMUX_DATA(EXTLP_MARK, PORT94_FN2),
706 PINMUX_DATA(IDIN_MARK, PORT95_FN1),
707 PINMUX_DATA(SCIFA5_CTS_MARK, PORT96_FN1),
708 PINMUX_DATA(MFG0_IN1_MARK, PORT96_FN2),
709 PINMUX_DATA(SCIFA5_RTS_MARK, PORT97_FN1),
710 PINMUX_DATA(MFG0_IN2_MARK, PORT97_FN2),
711 PINMUX_DATA(SCIFA5_RXD_MARK, PORT98_FN1),
712 PINMUX_DATA(SCIFA5_TXD_MARK, PORT99_FN1),
713 PINMUX_DATA(SCIFA5_SCK_MARK, PORT100_FN1),
714 PINMUX_DATA(MFG0_OUT1_MARK, PORT100_FN2),
715 PINMUX_DATA(A0_EA0_MARK, PORT101_FN1),
716 PINMUX_DATA(BS_MARK, PORT101_FN2),
717 PINMUX_DATA(A14_EA14_MARK, PORT102_FN1),
718 PINMUX_DATA(PORT102_KEYOUT0_MARK, MSELBCR_MSEL2_0, PORT102_FN2),
719 PINMUX_DATA(A15_EA15_MARK, PORT103_FN1),
720 PINMUX_DATA(PORT103_KEYOUT1_MARK, MSELBCR_MSEL2_0, PORT103_FN2),
721 PINMUX_DATA(DV_CLKOL_MARK, PORT103_FN3),
722 PINMUX_DATA(A16_EA16_MARK, PORT104_FN1),
723 PINMUX_DATA(PORT104_KEYOUT2_MARK, MSELBCR_MSEL2_0, PORT104_FN2),
724 PINMUX_DATA(DV_VSYNCL_MARK, PORT104_FN3),
725 PINMUX_DATA(MSIOF0_SS1_MARK, PORT104_FN4),
726 PINMUX_DATA(A17_EA17_MARK, PORT105_FN1),
727 PINMUX_DATA(PORT105_KEYOUT3_MARK, MSELBCR_MSEL2_0, PORT105_FN2),
728 PINMUX_DATA(DV_HSYNCL_MARK, PORT105_FN3),
729 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT105_FN4),
730 PINMUX_DATA(A18_EA18_MARK, PORT106_FN1),
731 PINMUX_DATA(PORT106_KEYOUT4_MARK, MSELBCR_MSEL2_0, PORT106_FN2),
732 PINMUX_DATA(DV_DL0_MARK, PORT106_FN3),
733 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT106_FN4),
734 PINMUX_DATA(A19_EA19_MARK, PORT107_FN1),
735 PINMUX_DATA(PORT107_KEYOUT5_MARK, MSELBCR_MSEL2_0, PORT107_FN2),
736 PINMUX_DATA(DV_DL1_MARK, PORT107_FN3),
737 PINMUX_DATA(MSIOF0_TXD_MARK, PORT107_FN4),
738 PINMUX_DATA(A20_EA20_MARK, PORT108_FN1),
739 PINMUX_DATA(PORT108_KEYIN0_MARK, MSELBCR_MSEL2_0, PORT108_FN2),
740 PINMUX_DATA(DV_DL2_MARK, PORT108_FN3),
741 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT108_FN4),
742 PINMUX_DATA(A21_EA21_MARK, PORT109_FN1),
743 PINMUX_DATA(PORT109_KEYIN1_MARK, MSELBCR_MSEL2_0, PORT109_FN2),
744 PINMUX_DATA(DV_DL3_MARK, PORT109_FN3),
745 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT109_FN4),
746 PINMUX_DATA(A22_EA22_MARK, PORT110_FN1),
747 PINMUX_DATA(PORT110_KEYIN2_MARK, MSELBCR_MSEL2_0, PORT110_FN2),
748 PINMUX_DATA(DV_DL4_MARK, PORT110_FN3),
749 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT110_FN4),
750 PINMUX_DATA(A23_EA23_MARK, PORT111_FN1),
751 PINMUX_DATA(PORT111_KEYIN3_MARK, MSELBCR_MSEL2_0, PORT111_FN2),
752 PINMUX_DATA(DV_DL5_MARK, PORT111_FN3),
753 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT111_FN4),
754 PINMUX_DATA(A24_EA24_MARK, PORT112_FN1),
755 PINMUX_DATA(PORT112_KEYIN4_MARK, MSELBCR_MSEL2_0, PORT112_FN2),
756 PINMUX_DATA(DV_DL6_MARK, PORT112_FN3),
757 PINMUX_DATA(MSIOF0_RXD_MARK, PORT112_FN4),
758 PINMUX_DATA(A25_EA25_MARK, PORT113_FN1),
759 PINMUX_DATA(PORT113_KEYIN5_MARK, MSELBCR_MSEL2_0, PORT113_FN2),
760 PINMUX_DATA(DV_DL7_MARK, PORT113_FN3),
761 PINMUX_DATA(MSIOF0_SS2_MARK, PORT113_FN4),
762 PINMUX_DATA(A26_MARK, PORT114_FN1),
763 PINMUX_DATA(PORT113_KEYIN6_MARK, MSELBCR_MSEL2_0, PORT114_FN2),
764 PINMUX_DATA(DV_CLKIL_MARK, PORT114_FN3),
765 PINMUX_DATA(D0_ED0_NAF0_MARK, PORT115_FN1),
766 PINMUX_DATA(D1_ED1_NAF1_MARK, PORT116_FN1),
767 PINMUX_DATA(D2_ED2_NAF2_MARK, PORT117_FN1),
768 PINMUX_DATA(D3_ED3_NAF3_MARK, PORT118_FN1),
769 PINMUX_DATA(D4_ED4_NAF4_MARK, PORT119_FN1),
770 PINMUX_DATA(D5_ED5_NAF5_MARK, PORT120_FN1),
771 PINMUX_DATA(D6_ED6_NAF6_MARK, PORT121_FN1),
772 PINMUX_DATA(D7_ED7_NAF7_MARK, PORT122_FN1),
773 PINMUX_DATA(D8_ED8_NAF8_MARK, PORT123_FN1),
774 PINMUX_DATA(D9_ED9_NAF9_MARK, PORT124_FN1),
775 PINMUX_DATA(D10_ED10_NAF10_MARK, PORT125_FN1),
776 PINMUX_DATA(D11_ED11_NAF11_MARK, PORT126_FN1),
777 PINMUX_DATA(D12_ED12_NAF12_MARK, PORT127_FN1),
778 PINMUX_DATA(D13_ED13_NAF13_MARK, PORT128_FN1),
779 PINMUX_DATA(D14_ED14_NAF14_MARK, PORT129_FN1),
780 PINMUX_DATA(D15_ED15_NAF15_MARK, PORT130_FN1),
781 PINMUX_DATA(CS4_MARK, PORT131_FN1),
782 PINMUX_DATA(CS5A_MARK, PORT132_FN1),
783 PINMUX_DATA(CS5B_MARK, PORT133_FN1),
784 PINMUX_DATA(FCE1_MARK, PORT133_FN2),
785 PINMUX_DATA(CS6B_MARK, PORT134_FN1),
786 PINMUX_DATA(XCS2_MARK, PORT134_FN2),
787 PINMUX_DATA(FCE0_MARK, PORT135_FN1),
788 PINMUX_DATA(CS6A_MARK, PORT136_FN1),
789 PINMUX_DATA(DACK0_MARK, PORT136_FN2),
790 PINMUX_DATA(WAIT_MARK, PORT137_FN1),
791 PINMUX_DATA(DREQ0_MARK, PORT137_FN2),
792 PINMUX_DATA(RD_XRD_MARK, PORT138_FN1),
793 PINMUX_DATA(A27_MARK, PORT139_FN1),
794 PINMUX_DATA(RDWR_XWE_MARK, PORT139_FN2),
795 PINMUX_DATA(WE0_XWR0_FWE_MARK, PORT140_FN1),
796 PINMUX_DATA(WE1_XWR1_MARK, PORT141_FN1),
797 PINMUX_DATA(FRB_MARK, PORT142_FN1),
798 PINMUX_DATA(CKO_MARK, PORT143_FN1),
799 PINMUX_DATA(NBRSTOUT_MARK, PORT144_FN1),
800 PINMUX_DATA(NBRST_MARK, PORT145_FN1),
801
802 /* 49-4 (FN) */
803 PINMUX_DATA(RFSPO0_MARK, PORT146_FN1),
804 PINMUX_DATA(PORT146_VIO_CKO2_MARK, PORT146_FN2),
805 PINMUX_DATA(TSTMD_MARK, PORT147_FN1),
806 PINMUX_DATA(VIO_VD_MARK, PORT148_FN1),
807 PINMUX_DATA(VIO_HD_MARK, PORT149_FN1),
808 PINMUX_DATA(VIO_D0_MARK, PORT150_FN1),
809 PINMUX_DATA(VIO_D1_MARK, PORT151_FN1),
810 PINMUX_DATA(VIO_D2_MARK, PORT152_FN1),
811 PINMUX_DATA(VIO_D3_MARK, PORT153_FN1),
812 PINMUX_DATA(VIO_D4_MARK, PORT154_FN1),
813 PINMUX_DATA(VIO_D5_MARK, PORT155_FN1),
814 PINMUX_DATA(VIO_D6_MARK, PORT156_FN1),
815 PINMUX_DATA(VIO_D7_MARK, PORT157_FN1),
816 PINMUX_DATA(VIO_D8_MARK, PORT158_FN1),
817 PINMUX_DATA(VIO_D9_MARK, PORT159_FN1),
818 PINMUX_DATA(VIO_D10_MARK, PORT160_FN1),
819 PINMUX_DATA(VIO_D11_MARK, PORT161_FN1),
820 PINMUX_DATA(VIO_D12_MARK, PORT162_FN1),
821 PINMUX_DATA(VIO_D13_MARK, PORT163_FN1),
822 PINMUX_DATA(VIO_D14_MARK, PORT164_FN1),
823 PINMUX_DATA(VIO_D15_MARK, PORT165_FN1),
824 PINMUX_DATA(VIO_CLK_MARK, PORT166_FN1),
825 PINMUX_DATA(VIO_FIELD_MARK, PORT167_FN1),
826 PINMUX_DATA(VIO_CKO_MARK, PORT168_FN1),
827 PINMUX_DATA(MFG3_IN1_MARK, PORT169_FN2),
828 PINMUX_DATA(MFG3_IN2_MARK, PORT170_FN2),
829 PINMUX_DATA(M9_SLCD_A01_MARK, PORT171_FN1),
830 PINMUX_DATA(MFG3_OUT1_MARK, PORT171_FN2),
831 PINMUX_DATA(TPU0TO0_MARK, PORT171_FN3),
832 PINMUX_DATA(M10_SLCD_CK1_MARK, PORT172_FN1),
833 PINMUX_DATA(MFG4_IN1_MARK, PORT172_FN2),
834 PINMUX_DATA(TPU0TO1_MARK, PORT172_FN3),
835 PINMUX_DATA(M11_SLCD_SO1_MARK, PORT173_FN1),
836 PINMUX_DATA(MFG4_IN2_MARK, PORT173_FN2),
837 PINMUX_DATA(TPU0TO2_MARK, PORT173_FN3),
838 PINMUX_DATA(M12_SLCD_CE1_MARK, PORT174_FN1),
839 PINMUX_DATA(MFG4_OUT1_MARK, PORT174_FN2),
840 PINMUX_DATA(TPU0TO3_MARK, PORT174_FN3),
841 PINMUX_DATA(LCDD0_MARK, PORT175_FN1),
842 PINMUX_DATA(PORT175_KEYOUT0_MARK, PORT175_FN2),
843 PINMUX_DATA(DV_D0_MARK, PORT175_FN3),
844 PINMUX_DATA(SIUCKA_MARK, PORT175_FN4),
845 PINMUX_DATA(MFG0_OUT2_MARK, PORT175_FN5),
846 PINMUX_DATA(LCDD1_MARK, PORT176_FN1),
847 PINMUX_DATA(PORT176_KEYOUT1_MARK, PORT176_FN2),
848 PINMUX_DATA(DV_D1_MARK, PORT176_FN3),
849 PINMUX_DATA(SIUAOLR_MARK, PORT176_FN4),
850 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT176_FN5),
851 PINMUX_DATA(LCDD2_MARK, PORT177_FN1),
852 PINMUX_DATA(PORT177_KEYOUT2_MARK, PORT177_FN2),
853 PINMUX_DATA(DV_D2_MARK, PORT177_FN3),
854 PINMUX_DATA(SIUAOBT_MARK, PORT177_FN4),
855 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT177_FN5),
856 PINMUX_DATA(LCDD3_MARK, PORT178_FN1),
857 PINMUX_DATA(PORT178_KEYOUT3_MARK, PORT178_FN2),
858 PINMUX_DATA(DV_D3_MARK, PORT178_FN3),
859 PINMUX_DATA(SIUAOSLD_MARK, PORT178_FN4),
860 PINMUX_DATA(BBIF2_TXD1_MARK, PORT178_FN5),
861 PINMUX_DATA(LCDD4_MARK, PORT179_FN1),
862 PINMUX_DATA(PORT179_KEYOUT4_MARK, PORT179_FN2),
863 PINMUX_DATA(DV_D4_MARK, PORT179_FN3),
864 PINMUX_DATA(SIUAISPD_MARK, PORT179_FN4),
865 PINMUX_DATA(MFG1_OUT2_MARK, PORT179_FN5),
866 PINMUX_DATA(LCDD5_MARK, PORT180_FN1),
867 PINMUX_DATA(PORT180_KEYOUT5_MARK, PORT180_FN2),
868 PINMUX_DATA(DV_D5_MARK, PORT180_FN3),
869 PINMUX_DATA(SIUAILR_MARK, PORT180_FN4),
870 PINMUX_DATA(MFG2_OUT2_MARK, PORT180_FN5),
871 PINMUX_DATA(LCDD6_MARK, PORT181_FN1),
872 PINMUX_DATA(DV_D6_MARK, PORT181_FN3),
873 PINMUX_DATA(SIUAIBT_MARK, PORT181_FN4),
874 PINMUX_DATA(MFG3_OUT2_MARK, PORT181_FN5),
875 PINMUX_DATA(XWR2_MARK, PORT181_FN7),
876 PINMUX_DATA(LCDD7_MARK, PORT182_FN1),
877 PINMUX_DATA(DV_D7_MARK, PORT182_FN3),
878 PINMUX_DATA(SIUAISLD_MARK, PORT182_FN4),
879 PINMUX_DATA(MFG4_OUT2_MARK, PORT182_FN5),
880 PINMUX_DATA(XWR3_MARK, PORT182_FN7),
881 PINMUX_DATA(LCDD8_MARK, PORT183_FN1),
882 PINMUX_DATA(DV_D8_MARK, PORT183_FN3),
883 PINMUX_DATA(D16_MARK, PORT183_FN6),
884 PINMUX_DATA(ED16_MARK, PORT183_FN7),
885 PINMUX_DATA(LCDD9_MARK, PORT184_FN1),
886 PINMUX_DATA(DV_D9_MARK, PORT184_FN3),
887 PINMUX_DATA(D17_MARK, PORT184_FN6),
888 PINMUX_DATA(ED17_MARK, PORT184_FN7),
889 PINMUX_DATA(LCDD10_MARK, PORT185_FN1),
890 PINMUX_DATA(DV_D10_MARK, PORT185_FN3),
891 PINMUX_DATA(D18_MARK, PORT185_FN6),
892 PINMUX_DATA(ED18_MARK, PORT185_FN7),
893 PINMUX_DATA(LCDD11_MARK, PORT186_FN1),
894 PINMUX_DATA(DV_D11_MARK, PORT186_FN3),
895 PINMUX_DATA(D19_MARK, PORT186_FN6),
896 PINMUX_DATA(ED19_MARK, PORT186_FN7),
897 PINMUX_DATA(LCDD12_MARK, PORT187_FN1),
898 PINMUX_DATA(DV_D12_MARK, PORT187_FN3),
899 PINMUX_DATA(D20_MARK, PORT187_FN6),
900 PINMUX_DATA(ED20_MARK, PORT187_FN7),
901 PINMUX_DATA(LCDD13_MARK, PORT188_FN1),
902 PINMUX_DATA(DV_D13_MARK, PORT188_FN3),
903 PINMUX_DATA(D21_MARK, PORT188_FN6),
904 PINMUX_DATA(ED21_MARK, PORT188_FN7),
905 PINMUX_DATA(LCDD14_MARK, PORT189_FN1),
906 PINMUX_DATA(DV_D14_MARK, PORT189_FN3),
907 PINMUX_DATA(D22_MARK, PORT189_FN6),
908 PINMUX_DATA(ED22_MARK, PORT189_FN7),
909 PINMUX_DATA(LCDD15_MARK, PORT190_FN1),
910 PINMUX_DATA(DV_D15_MARK, PORT190_FN3),
911 PINMUX_DATA(D23_MARK, PORT190_FN6),
912 PINMUX_DATA(ED23_MARK, PORT190_FN7),
913 PINMUX_DATA(LCDD16_MARK, PORT191_FN1),
914 PINMUX_DATA(DV_HSYNC_MARK, PORT191_FN3),
915 PINMUX_DATA(D24_MARK, PORT191_FN6),
916 PINMUX_DATA(ED24_MARK, PORT191_FN7),
917 PINMUX_DATA(LCDD17_MARK, PORT192_FN1),
918 PINMUX_DATA(DV_VSYNC_MARK, PORT192_FN3),
919 PINMUX_DATA(D25_MARK, PORT192_FN6),
920 PINMUX_DATA(ED25_MARK, PORT192_FN7),
921 PINMUX_DATA(LCDD18_MARK, PORT193_FN1),
922 PINMUX_DATA(DREQ2_MARK, PORT193_FN2),
923 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT193_FN5),
924 PINMUX_DATA(D26_MARK, PORT193_FN6),
925 PINMUX_DATA(ED26_MARK, PORT193_FN7),
926 PINMUX_DATA(LCDD19_MARK, PORT194_FN1),
927 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT194_FN5),
928 PINMUX_DATA(D27_MARK, PORT194_FN6),
929 PINMUX_DATA(ED27_MARK, PORT194_FN7),
930 PINMUX_DATA(LCDD20_MARK, PORT195_FN1),
931 PINMUX_DATA(TS_SPSYNC1_MARK, PORT195_FN2),
932 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT195_FN5),
933 PINMUX_DATA(D28_MARK, PORT195_FN6),
934 PINMUX_DATA(ED28_MARK, PORT195_FN7),
935 PINMUX_DATA(LCDD21_MARK, PORT196_FN1),
936 PINMUX_DATA(TS_SDAT1_MARK, PORT196_FN2),
937 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT196_FN5),
938 PINMUX_DATA(D29_MARK, PORT196_FN6),
939 PINMUX_DATA(ED29_MARK, PORT196_FN7),
940 PINMUX_DATA(LCDD22_MARK, PORT197_FN1),
941 PINMUX_DATA(TS_SDEN1_MARK, PORT197_FN2),
942 PINMUX_DATA(MSIOF0L_SS1_MARK, PORT197_FN5),
943 PINMUX_DATA(D30_MARK, PORT197_FN6),
944 PINMUX_DATA(ED30_MARK, PORT197_FN7),
945 PINMUX_DATA(LCDD23_MARK, PORT198_FN1),
946 PINMUX_DATA(TS_SCK1_MARK, PORT198_FN2),
947 PINMUX_DATA(MSIOF0L_SS2_MARK, PORT198_FN5),
948 PINMUX_DATA(D31_MARK, PORT198_FN6),
949 PINMUX_DATA(ED31_MARK, PORT198_FN7),
950 PINMUX_DATA(LCDDCK_MARK, PORT199_FN1),
951 PINMUX_DATA(LCDWR_MARK, PORT199_FN2),
952 PINMUX_DATA(DV_CKO_MARK, PORT199_FN3),
953 PINMUX_DATA(SIUAOSPD_MARK, PORT199_FN4),
954 PINMUX_DATA(LCDRD_MARK, PORT200_FN1),
955 PINMUX_DATA(DACK2_MARK, PORT200_FN2),
956 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT200_FN5),
957
958 /* 49-5 (FN) */
959 PINMUX_DATA(LCDHSYN_MARK, PORT201_FN1),
960 PINMUX_DATA(LCDCS_MARK, PORT201_FN2),
961 PINMUX_DATA(LCDCS2_MARK, PORT201_FN3),
962 PINMUX_DATA(DACK3_MARK, PORT201_FN4),
963 PINMUX_DATA(LCDDISP_MARK, PORT202_FN1),
964 PINMUX_DATA(LCDRS_MARK, PORT202_FN2),
965 PINMUX_DATA(DREQ3_MARK, PORT202_FN4),
966 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT202_FN5),
967 PINMUX_DATA(LCDCSYN_MARK, PORT203_FN1),
968 PINMUX_DATA(LCDCSYN2_MARK, PORT203_FN2),
969 PINMUX_DATA(DV_CKI_MARK, PORT203_FN3),
970 PINMUX_DATA(LCDLCLK_MARK, PORT204_FN1),
971 PINMUX_DATA(DREQ1_MARK, PORT204_FN3),
972 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT204_FN5),
973 PINMUX_DATA(LCDDON_MARK, PORT205_FN1),
974 PINMUX_DATA(LCDDON2_MARK, PORT205_FN2),
975 PINMUX_DATA(DACK1_MARK, PORT205_FN3),
976 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT205_FN5),
977 PINMUX_DATA(VIO_DR0_MARK, PORT206_FN1),
978 PINMUX_DATA(VIO_DR1_MARK, PORT207_FN1),
979 PINMUX_DATA(VIO_DR2_MARK, PORT208_FN1),
980 PINMUX_DATA(VIO_DR3_MARK, PORT209_FN1),
981 PINMUX_DATA(VIO_DR4_MARK, PORT210_FN1),
982 PINMUX_DATA(VIO_DR5_MARK, PORT211_FN1),
983 PINMUX_DATA(VIO_DR6_MARK, PORT212_FN1),
984 PINMUX_DATA(VIO_DR7_MARK, PORT213_FN1),
985 PINMUX_DATA(VIO_VDR_MARK, PORT214_FN1),
986 PINMUX_DATA(VIO_HDR_MARK, PORT215_FN1),
987 PINMUX_DATA(VIO_CLKR_MARK, PORT216_FN1),
988 PINMUX_DATA(VIO_CKOR_MARK, PORT217_FN1),
989 PINMUX_DATA(SCIFA1_TXD_MARK, PORT220_FN2),
990 PINMUX_DATA(GPS_PGFA0_MARK, PORT220_FN3),
991 PINMUX_DATA(SCIFA1_SCK_MARK, PORT221_FN2),
992 PINMUX_DATA(GPS_PGFA1_MARK, PORT221_FN3),
993 PINMUX_DATA(SCIFA1_RTS_MARK, PORT222_FN2),
994 PINMUX_DATA(GPS_EPPSINMON_MARK, PORT222_FN3),
995 PINMUX_DATA(SCIFA1_RXD_MARK, PORT223_FN2),
996 PINMUX_DATA(SCIFA1_CTS_MARK, PORT224_FN2),
997 PINMUX_DATA(MSIOF1_TXD_MARK, PORT225_FN1),
998 PINMUX_DATA(SCIFA1_TXD2_MARK, PORT225_FN2),
999 PINMUX_DATA(GPS_TXD_MARK, PORT225_FN3),
1000 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT226_FN1),
1001 PINMUX_DATA(SCIFA1_CTS2_MARK, PORT226_FN2),
1002 PINMUX_DATA(I2C_SDA2_MARK, PORT226_FN3),
1003 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT227_FN1),
1004 PINMUX_DATA(SCIFA1_SCK2_MARK, PORT227_FN2),
1005 PINMUX_DATA(MSIOF1_RXD_MARK, PORT228_FN1),
1006 PINMUX_DATA(SCIFA1_RXD2_MARK, PORT228_FN2),
1007 PINMUX_DATA(GPS_RXD_MARK, PORT228_FN3),
1008 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT229_FN1),
1009 PINMUX_DATA(SCIFA1_RTS2_MARK, PORT229_FN2),
1010 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT230_FN1),
1011 PINMUX_DATA(I2C_SCL2_MARK, PORT230_FN3),
1012 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT231_FN1),
1013 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT232_FN1),
1014 PINMUX_DATA(MSIOF1_SS1_MARK, PORT233_FN1),
1015 PINMUX_DATA(EDBGREQ3_MARK, PORT233_FN2),
1016 PINMUX_DATA(MSIOF1_SS2_MARK, PORT234_FN1),
1017 PINMUX_DATA(PORT236_IROUT_MARK, PORT236_FN1),
1018 PINMUX_DATA(IRDA_OUT_MARK, PORT236_FN2),
1019 PINMUX_DATA(IRDA_IN_MARK, PORT237_FN2),
1020 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT238_FN1),
1021 PINMUX_DATA(TPU1TO0_MARK, PORT239_FN3),
1022 PINMUX_DATA(TS_SPSYNC3_MARK, PORT239_FN4),
1023 PINMUX_DATA(TPU1TO1_MARK, PORT240_FN3),
1024 PINMUX_DATA(TS_SDAT3_MARK, PORT240_FN4),
1025 PINMUX_DATA(TPU1TO2_MARK, PORT241_FN3),
1026 PINMUX_DATA(TS_SDEN3_MARK, PORT241_FN4),
1027 PINMUX_DATA(PORT241_MSIOF2_SS1_MARK, PORT241_FN5),
1028 PINMUX_DATA(TPU1TO3_MARK, PORT242_FN3),
1029 PINMUX_DATA(PORT242_MSIOF2_TSCK_MARK, PORT242_FN5),
1030 PINMUX_DATA(M13_BSW_MARK, PORT243_FN2),
1031 PINMUX_DATA(PORT243_MSIOF2_TSYNC_MARK, PORT243_FN5),
1032 PINMUX_DATA(M14_GSW_MARK, PORT244_FN2),
1033 PINMUX_DATA(PORT244_MSIOF2_TXD_MARK, PORT244_FN5),
1034 PINMUX_DATA(PORT245_IROUT_MARK, PORT245_FN1),
1035 PINMUX_DATA(M15_RSW_MARK, PORT245_FN2),
1036 PINMUX_DATA(SOUT3_MARK, PORT246_FN1),
1037 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT246_FN2),
1038 PINMUX_DATA(SIN3_MARK, PORT247_FN1),
1039 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT247_FN2),
1040 PINMUX_DATA(XRTS3_MARK, PORT248_FN1),
1041 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT248_FN2),
1042 PINMUX_DATA(PORT248_MSIOF2_SS2_MARK, PORT248_FN5),
1043 PINMUX_DATA(XCTS3_MARK, PORT249_FN1),
1044 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT249_FN2),
1045 PINMUX_DATA(PORT249_MSIOF2_RXD_MARK, PORT249_FN5),
1046 PINMUX_DATA(DINT_MARK, PORT250_FN1),
1047 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT250_FN2),
1048 PINMUX_DATA(TS_SCK3_MARK, PORT250_FN4),
1049 PINMUX_DATA(SDHICLK0_MARK, PORT251_FN1),
1050 PINMUX_DATA(TCK2_MARK, PORT251_FN2),
1051 PINMUX_DATA(SDHICD0_MARK, PORT252_FN1),
1052 PINMUX_DATA(SDHID0_0_MARK, PORT253_FN1),
1053 PINMUX_DATA(TMS2_MARK, PORT253_FN2),
1054 PINMUX_DATA(SDHID0_1_MARK, PORT254_FN1),
1055 PINMUX_DATA(TDO2_MARK, PORT254_FN2),
1056 PINMUX_DATA(SDHID0_2_MARK, PORT255_FN1),
1057 PINMUX_DATA(TDI2_MARK, PORT255_FN2),
1058 PINMUX_DATA(SDHID0_3_MARK, PORT256_FN1),
1059 PINMUX_DATA(RTCK2_MARK, PORT256_FN2),
1060
1061 /* 49-6 (FN) */
1062 PINMUX_DATA(SDHICMD0_MARK, PORT257_FN1),
1063 PINMUX_DATA(TRST2_MARK, PORT257_FN2),
1064 PINMUX_DATA(SDHIWP0_MARK, PORT258_FN1),
1065 PINMUX_DATA(EDBGREQ2_MARK, PORT258_FN2),
1066 PINMUX_DATA(SDHICLK1_MARK, PORT259_FN1),
1067 PINMUX_DATA(TCK3_MARK, PORT259_FN4),
1068 PINMUX_DATA(SDHID1_0_MARK, PORT260_FN1),
1069 PINMUX_DATA(M11_SLCD_SO2_MARK, PORT260_FN2),
1070 PINMUX_DATA(TS_SPSYNC2_MARK, PORT260_FN3),
1071 PINMUX_DATA(TMS3_MARK, PORT260_FN4),
1072 PINMUX_DATA(SDHID1_1_MARK, PORT261_FN1),
1073 PINMUX_DATA(M9_SLCD_AO2_MARK, PORT261_FN2),
1074 PINMUX_DATA(TS_SDAT2_MARK, PORT261_FN3),
1075 PINMUX_DATA(TDO3_MARK, PORT261_FN4),
1076 PINMUX_DATA(SDHID1_2_MARK, PORT262_FN1),
1077 PINMUX_DATA(M10_SLCD_CK2_MARK, PORT262_FN2),
1078 PINMUX_DATA(TS_SDEN2_MARK, PORT262_FN3),
1079 PINMUX_DATA(TDI3_MARK, PORT262_FN4),
1080 PINMUX_DATA(SDHID1_3_MARK, PORT263_FN1),
1081 PINMUX_DATA(M12_SLCD_CE2_MARK, PORT263_FN2),
1082 PINMUX_DATA(TS_SCK2_MARK, PORT263_FN3),
1083 PINMUX_DATA(RTCK3_MARK, PORT263_FN4),
1084 PINMUX_DATA(SDHICMD1_MARK, PORT264_FN1),
1085 PINMUX_DATA(TRST3_MARK, PORT264_FN4),
1086 PINMUX_DATA(SDHICLK2_MARK, PORT265_FN1),
1087 PINMUX_DATA(SCIFB_SCK_MARK, PORT265_FN2),
1088 PINMUX_DATA(SDHID2_0_MARK, PORT266_FN1),
1089 PINMUX_DATA(SCIFB_TXD_MARK, PORT266_FN2),
1090 PINMUX_DATA(SDHID2_1_MARK, PORT267_FN1),
1091 PINMUX_DATA(SCIFB_CTS_MARK, PORT267_FN2),
1092 PINMUX_DATA(SDHID2_2_MARK, PORT268_FN1),
1093 PINMUX_DATA(SCIFB_RXD_MARK, PORT268_FN2),
1094 PINMUX_DATA(SDHID2_3_MARK, PORT269_FN1),
1095 PINMUX_DATA(SCIFB_RTS_MARK, PORT269_FN2),
1096 PINMUX_DATA(SDHICMD2_MARK, PORT270_FN1),
1097 PINMUX_DATA(RESETOUTS_MARK, PORT271_FN1),
1098 PINMUX_DATA(DIVLOCK_MARK, PORT272_FN1),
1099};
1100
1101#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
1102#define GPIO_PORT_273() _273(_GPIO_PORT, , unused)
1103#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
1104
1105static struct pinmux_gpio pinmux_gpios[] = {
1106 /* 49-1 -> 49-6 (GPIO) */
1107 GPIO_PORT_273(),
1108
1109 /* Special Pull-up / Pull-down Functions */
1110 GPIO_FN(PORT48_KEYIN0_PU), GPIO_FN(PORT49_KEYIN1_PU),
1111 GPIO_FN(PORT50_KEYIN2_PU), GPIO_FN(PORT55_KEYIN3_PU),
1112 GPIO_FN(PORT56_KEYIN4_PU), GPIO_FN(PORT57_KEYIN5_PU),
1113 GPIO_FN(PORT58_KEYIN6_PU),
1114
1115 /* 49-1 (FN) */
1116 GPIO_FN(VBUS0), GPIO_FN(CPORT0), GPIO_FN(CPORT1), GPIO_FN(CPORT2),
1117 GPIO_FN(CPORT3), GPIO_FN(CPORT4), GPIO_FN(CPORT5), GPIO_FN(CPORT6),
1118 GPIO_FN(CPORT7), GPIO_FN(CPORT8), GPIO_FN(CPORT9), GPIO_FN(CPORT10),
1119 GPIO_FN(CPORT11), GPIO_FN(SIN2), GPIO_FN(CPORT12), GPIO_FN(XCTS2),
1120 GPIO_FN(CPORT13), GPIO_FN(RFSPO4), GPIO_FN(CPORT14), GPIO_FN(RFSPO5),
1121 GPIO_FN(CPORT15), GPIO_FN(CPORT16), GPIO_FN(CPORT17), GPIO_FN(SOUT2),
1122 GPIO_FN(CPORT18), GPIO_FN(XRTS2), GPIO_FN(CPORT19), GPIO_FN(CPORT20),
1123 GPIO_FN(RFSPO6), GPIO_FN(CPORT21), GPIO_FN(STATUS0), GPIO_FN(CPORT22),
1124 GPIO_FN(STATUS1), GPIO_FN(CPORT23), GPIO_FN(STATUS2), GPIO_FN(RFSPO7),
1125 GPIO_FN(MPORT0), GPIO_FN(MPORT1), GPIO_FN(B_SYNLD1), GPIO_FN(B_SYNLD2),
1126 GPIO_FN(XMAINPS), GPIO_FN(XDIVPS), GPIO_FN(XIDRST), GPIO_FN(IDCLK),
1127 GPIO_FN(IDIO), GPIO_FN(SOUT1), GPIO_FN(SCIFA4_TXD),
1128 GPIO_FN(M02_BERDAT), GPIO_FN(SIN1), GPIO_FN(SCIFA4_RXD), GPIO_FN(XWUP),
1129 GPIO_FN(XRTS1), GPIO_FN(SCIFA4_RTS), GPIO_FN(M03_BERCLK),
1130 GPIO_FN(XCTS1), GPIO_FN(SCIFA4_CTS),
1131
1132 /* 49-2 (FN) */
1133 GPIO_FN(HSU_IQ_AGC6), GPIO_FN(MFG2_IN2), GPIO_FN(MSIOF2_MCK0),
1134 GPIO_FN(HSU_IQ_AGC5), GPIO_FN(MFG2_IN1), GPIO_FN(MSIOF2_MCK1),
1135 GPIO_FN(HSU_IQ_AGC4), GPIO_FN(MSIOF2_RSYNC),
1136 GPIO_FN(HSU_IQ_AGC3), GPIO_FN(MFG2_OUT1), GPIO_FN(MSIOF2_RSCK),
1137 GPIO_FN(HSU_IQ_AGC2), GPIO_FN(PORT42_KEYOUT0),
1138 GPIO_FN(HSU_IQ_AGC1), GPIO_FN(PORT43_KEYOUT1),
1139 GPIO_FN(HSU_IQ_AGC0), GPIO_FN(PORT44_KEYOUT2),
1140 GPIO_FN(HSU_IQ_AGC_ST), GPIO_FN(PORT45_KEYOUT3),
1141 GPIO_FN(HSU_IQ_PDO), GPIO_FN(PORT46_KEYOUT4),
1142 GPIO_FN(HSU_IQ_PYO), GPIO_FN(PORT47_KEYOUT5),
1143 GPIO_FN(HSU_EN_TXMUX_G3MO), GPIO_FN(PORT48_KEYIN0),
1144 GPIO_FN(HSU_I_TXMUX_G3MO), GPIO_FN(PORT49_KEYIN1),
1145 GPIO_FN(HSU_Q_TXMUX_G3MO), GPIO_FN(PORT50_KEYIN2),
1146 GPIO_FN(HSU_SYO), GPIO_FN(PORT51_MSIOF2_TSYNC),
1147 GPIO_FN(HSU_SDO), GPIO_FN(PORT52_MSIOF2_TSCK),
1148 GPIO_FN(HSU_TGTTI_G3MO), GPIO_FN(PORT53_MSIOF2_TXD),
1149 GPIO_FN(B_TIME_STAMP), GPIO_FN(PORT54_MSIOF2_RXD),
1150 GPIO_FN(HSU_SDI), GPIO_FN(PORT55_KEYIN3),
1151 GPIO_FN(HSU_SCO), GPIO_FN(PORT56_KEYIN4),
1152 GPIO_FN(HSU_DREQ), GPIO_FN(PORT57_KEYIN5),
1153 GPIO_FN(HSU_DACK), GPIO_FN(PORT58_KEYIN6),
1154 GPIO_FN(HSU_CLK61M), GPIO_FN(PORT59_MSIOF2_SS1),
1155 GPIO_FN(HSU_XRST), GPIO_FN(PORT60_MSIOF2_SS2),
1156 GPIO_FN(PCMCLKO), GPIO_FN(SYNC8KO), GPIO_FN(DNPCM_A), GPIO_FN(UPPCM_A),
1157 GPIO_FN(XTALB1L),
1158 GPIO_FN(GPS_AGC1), GPIO_FN(SCIFA0_RTS),
1159 GPIO_FN(GPS_AGC2), GPIO_FN(SCIFA0_SCK),
1160 GPIO_FN(GPS_AGC3), GPIO_FN(SCIFA0_TXD),
1161 GPIO_FN(GPS_AGC4), GPIO_FN(SCIFA0_RXD),
1162 GPIO_FN(GPS_PWRD), GPIO_FN(SCIFA0_CTS),
1163 GPIO_FN(GPS_IM), GPIO_FN(GPS_IS), GPIO_FN(GPS_QM), GPIO_FN(GPS_QS),
1164 GPIO_FN(SIUBOMC), GPIO_FN(TPU2TO0),
1165 GPIO_FN(SIUCKB), GPIO_FN(TPU2TO1),
1166 GPIO_FN(SIUBOLR), GPIO_FN(BBIF2_TSYNC), GPIO_FN(TPU2TO2),
1167 GPIO_FN(SIUBOBT), GPIO_FN(BBIF2_TSCK), GPIO_FN(TPU2TO3),
1168 GPIO_FN(SIUBOSLD), GPIO_FN(BBIF2_TXD), GPIO_FN(TPU3TO0),
1169 GPIO_FN(SIUBILR), GPIO_FN(TPU3TO1),
1170 GPIO_FN(SIUBIBT), GPIO_FN(TPU3TO2),
1171 GPIO_FN(SIUBISLD), GPIO_FN(TPU3TO3),
1172 GPIO_FN(NMI), GPIO_FN(TPU4TO0),
1173 GPIO_FN(DNPCM_M), GPIO_FN(TPU4TO1), GPIO_FN(TPU4TO2), GPIO_FN(TPU4TO3),
1174 GPIO_FN(IRQ_TMPB),
1175 GPIO_FN(PWEN), GPIO_FN(MFG1_OUT1),
1176 GPIO_FN(OVCN), GPIO_FN(MFG1_IN1),
1177 GPIO_FN(OVCN2), GPIO_FN(MFG1_IN2),
1178
1179 /* 49-3 (FN) */
1180 GPIO_FN(RFSPO1), GPIO_FN(RFSPO2), GPIO_FN(RFSPO3),
1181 GPIO_FN(PORT93_VIO_CKO2),
1182 GPIO_FN(USBTERM), GPIO_FN(EXTLP), GPIO_FN(IDIN),
1183 GPIO_FN(SCIFA5_CTS), GPIO_FN(MFG0_IN1),
1184 GPIO_FN(SCIFA5_RTS), GPIO_FN(MFG0_IN2),
1185 GPIO_FN(SCIFA5_RXD),
1186 GPIO_FN(SCIFA5_TXD),
1187 GPIO_FN(SCIFA5_SCK), GPIO_FN(MFG0_OUT1),
1188 GPIO_FN(A0_EA0), GPIO_FN(BS),
1189 GPIO_FN(A14_EA14), GPIO_FN(PORT102_KEYOUT0),
1190 GPIO_FN(A15_EA15), GPIO_FN(PORT103_KEYOUT1), GPIO_FN(DV_CLKOL),
1191 GPIO_FN(A16_EA16), GPIO_FN(PORT104_KEYOUT2),
1192 GPIO_FN(DV_VSYNCL), GPIO_FN(MSIOF0_SS1),
1193 GPIO_FN(A17_EA17), GPIO_FN(PORT105_KEYOUT3),
1194 GPIO_FN(DV_HSYNCL), GPIO_FN(MSIOF0_TSYNC),
1195 GPIO_FN(A18_EA18), GPIO_FN(PORT106_KEYOUT4),
1196 GPIO_FN(DV_DL0), GPIO_FN(MSIOF0_TSCK),
1197 GPIO_FN(A19_EA19), GPIO_FN(PORT107_KEYOUT5),
1198 GPIO_FN(DV_DL1), GPIO_FN(MSIOF0_TXD),
1199 GPIO_FN(A20_EA20), GPIO_FN(PORT108_KEYIN0),
1200 GPIO_FN(DV_DL2), GPIO_FN(MSIOF0_RSCK),
1201 GPIO_FN(A21_EA21), GPIO_FN(PORT109_KEYIN1),
1202 GPIO_FN(DV_DL3), GPIO_FN(MSIOF0_RSYNC),
1203 GPIO_FN(A22_EA22), GPIO_FN(PORT110_KEYIN2),
1204 GPIO_FN(DV_DL4), GPIO_FN(MSIOF0_MCK0),
1205 GPIO_FN(A23_EA23), GPIO_FN(PORT111_KEYIN3),
1206 GPIO_FN(DV_DL5), GPIO_FN(MSIOF0_MCK1),
1207 GPIO_FN(A24_EA24), GPIO_FN(PORT112_KEYIN4),
1208 GPIO_FN(DV_DL6), GPIO_FN(MSIOF0_RXD),
1209 GPIO_FN(A25_EA25), GPIO_FN(PORT113_KEYIN5),
1210 GPIO_FN(DV_DL7), GPIO_FN(MSIOF0_SS2),
1211 GPIO_FN(A26), GPIO_FN(PORT113_KEYIN6), GPIO_FN(DV_CLKIL),
1212 GPIO_FN(D0_ED0_NAF0), GPIO_FN(D1_ED1_NAF1), GPIO_FN(D2_ED2_NAF2),
1213 GPIO_FN(D3_ED3_NAF3), GPIO_FN(D4_ED4_NAF4), GPIO_FN(D5_ED5_NAF5),
1214 GPIO_FN(D6_ED6_NAF6), GPIO_FN(D7_ED7_NAF7), GPIO_FN(D8_ED8_NAF8),
1215 GPIO_FN(D9_ED9_NAF9), GPIO_FN(D10_ED10_NAF10), GPIO_FN(D11_ED11_NAF11),
1216 GPIO_FN(D12_ED12_NAF12), GPIO_FN(D13_ED13_NAF13),
1217 GPIO_FN(D14_ED14_NAF14), GPIO_FN(D15_ED15_NAF15),
1218 GPIO_FN(CS4), GPIO_FN(CS5A), GPIO_FN(CS5B), GPIO_FN(FCE1),
1219 GPIO_FN(CS6B), GPIO_FN(XCS2), GPIO_FN(FCE0), GPIO_FN(CS6A),
1220 GPIO_FN(DACK0), GPIO_FN(WAIT), GPIO_FN(DREQ0), GPIO_FN(RD_XRD),
1221 GPIO_FN(A27), GPIO_FN(RDWR_XWE), GPIO_FN(WE0_XWR0_FWE),
1222 GPIO_FN(WE1_XWR1), GPIO_FN(FRB), GPIO_FN(CKO),
1223 GPIO_FN(NBRSTOUT), GPIO_FN(NBRST),
1224
1225 /* 49-4 (FN) */
1226 GPIO_FN(RFSPO0), GPIO_FN(PORT146_VIO_CKO2), GPIO_FN(TSTMD),
1227 GPIO_FN(VIO_VD), GPIO_FN(VIO_HD),
1228 GPIO_FN(VIO_D0), GPIO_FN(VIO_D1), GPIO_FN(VIO_D2),
1229 GPIO_FN(VIO_D3), GPIO_FN(VIO_D4), GPIO_FN(VIO_D5),
1230 GPIO_FN(VIO_D6), GPIO_FN(VIO_D7), GPIO_FN(VIO_D8),
1231 GPIO_FN(VIO_D9), GPIO_FN(VIO_D10), GPIO_FN(VIO_D11),
1232 GPIO_FN(VIO_D12), GPIO_FN(VIO_D13), GPIO_FN(VIO_D14),
1233 GPIO_FN(VIO_D15), GPIO_FN(VIO_CLK), GPIO_FN(VIO_FIELD),
1234 GPIO_FN(VIO_CKO),
1235 GPIO_FN(MFG3_IN1), GPIO_FN(MFG3_IN2),
1236 GPIO_FN(M9_SLCD_A01), GPIO_FN(MFG3_OUT1), GPIO_FN(TPU0TO0),
1237 GPIO_FN(M10_SLCD_CK1), GPIO_FN(MFG4_IN1), GPIO_FN(TPU0TO1),
1238 GPIO_FN(M11_SLCD_SO1), GPIO_FN(MFG4_IN2), GPIO_FN(TPU0TO2),
1239 GPIO_FN(M12_SLCD_CE1), GPIO_FN(MFG4_OUT1), GPIO_FN(TPU0TO3),
1240 GPIO_FN(LCDD0), GPIO_FN(PORT175_KEYOUT0), GPIO_FN(DV_D0),
1241 GPIO_FN(SIUCKA), GPIO_FN(MFG0_OUT2),
1242 GPIO_FN(LCDD1), GPIO_FN(PORT176_KEYOUT1), GPIO_FN(DV_D1),
1243 GPIO_FN(SIUAOLR), GPIO_FN(BBIF2_TSYNC1),
1244 GPIO_FN(LCDD2), GPIO_FN(PORT177_KEYOUT2), GPIO_FN(DV_D2),
1245 GPIO_FN(SIUAOBT), GPIO_FN(BBIF2_TSCK1),
1246 GPIO_FN(LCDD3), GPIO_FN(PORT178_KEYOUT3), GPIO_FN(DV_D3),
1247 GPIO_FN(SIUAOSLD), GPIO_FN(BBIF2_TXD1),
1248 GPIO_FN(LCDD4), GPIO_FN(PORT179_KEYOUT4), GPIO_FN(DV_D4),
1249 GPIO_FN(SIUAISPD), GPIO_FN(MFG1_OUT2),
1250 GPIO_FN(LCDD5), GPIO_FN(PORT180_KEYOUT5), GPIO_FN(DV_D5),
1251 GPIO_FN(SIUAILR), GPIO_FN(MFG2_OUT2),
1252 GPIO_FN(LCDD6), GPIO_FN(DV_D6),
1253 GPIO_FN(SIUAIBT), GPIO_FN(MFG3_OUT2), GPIO_FN(XWR2),
1254 GPIO_FN(LCDD7), GPIO_FN(DV_D7),
1255 GPIO_FN(SIUAISLD), GPIO_FN(MFG4_OUT2), GPIO_FN(XWR3),
1256 GPIO_FN(LCDD8), GPIO_FN(DV_D8), GPIO_FN(D16), GPIO_FN(ED16),
1257 GPIO_FN(LCDD9), GPIO_FN(DV_D9), GPIO_FN(D17), GPIO_FN(ED17),
1258 GPIO_FN(LCDD10), GPIO_FN(DV_D10), GPIO_FN(D18), GPIO_FN(ED18),
1259 GPIO_FN(LCDD11), GPIO_FN(DV_D11), GPIO_FN(D19), GPIO_FN(ED19),
1260 GPIO_FN(LCDD12), GPIO_FN(DV_D12), GPIO_FN(D20), GPIO_FN(ED20),
1261 GPIO_FN(LCDD13), GPIO_FN(DV_D13), GPIO_FN(D21), GPIO_FN(ED21),
1262 GPIO_FN(LCDD14), GPIO_FN(DV_D14), GPIO_FN(D22), GPIO_FN(ED22),
1263 GPIO_FN(LCDD15), GPIO_FN(DV_D15), GPIO_FN(D23), GPIO_FN(ED23),
1264 GPIO_FN(LCDD16), GPIO_FN(DV_HSYNC), GPIO_FN(D24), GPIO_FN(ED24),
1265 GPIO_FN(LCDD17), GPIO_FN(DV_VSYNC), GPIO_FN(D25), GPIO_FN(ED25),
1266 GPIO_FN(LCDD18), GPIO_FN(DREQ2), GPIO_FN(MSIOF0L_TSCK),
1267 GPIO_FN(D26), GPIO_FN(ED26),
1268 GPIO_FN(LCDD19), GPIO_FN(MSIOF0L_TSYNC),
1269 GPIO_FN(D27), GPIO_FN(ED27),
1270 GPIO_FN(LCDD20), GPIO_FN(TS_SPSYNC1), GPIO_FN(MSIOF0L_MCK0),
1271 GPIO_FN(D28), GPIO_FN(ED28),
1272 GPIO_FN(LCDD21), GPIO_FN(TS_SDAT1), GPIO_FN(MSIOF0L_MCK1),
1273 GPIO_FN(D29), GPIO_FN(ED29),
1274 GPIO_FN(LCDD22), GPIO_FN(TS_SDEN1), GPIO_FN(MSIOF0L_SS1),
1275 GPIO_FN(D30), GPIO_FN(ED30),
1276 GPIO_FN(LCDD23), GPIO_FN(TS_SCK1), GPIO_FN(MSIOF0L_SS2),
1277 GPIO_FN(D31), GPIO_FN(ED31),
1278 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(DV_CKO), GPIO_FN(SIUAOSPD),
1279 GPIO_FN(LCDRD), GPIO_FN(DACK2), GPIO_FN(MSIOF0L_RSYNC),
1280
1281 /* 49-5 (FN) */
1282 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDCS2), GPIO_FN(DACK3),
1283 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(DREQ3), GPIO_FN(MSIOF0L_RSCK),
1284 GPIO_FN(LCDCSYN), GPIO_FN(LCDCSYN2), GPIO_FN(DV_CKI),
1285 GPIO_FN(LCDLCLK), GPIO_FN(DREQ1), GPIO_FN(MSIOF0L_RXD),
1286 GPIO_FN(LCDDON), GPIO_FN(LCDDON2), GPIO_FN(DACK1), GPIO_FN(MSIOF0L_TXD),
1287 GPIO_FN(VIO_DR0), GPIO_FN(VIO_DR1), GPIO_FN(VIO_DR2), GPIO_FN(VIO_DR3),
1288 GPIO_FN(VIO_DR4), GPIO_FN(VIO_DR5), GPIO_FN(VIO_DR6), GPIO_FN(VIO_DR7),
1289 GPIO_FN(VIO_VDR), GPIO_FN(VIO_HDR),
1290 GPIO_FN(VIO_CLKR), GPIO_FN(VIO_CKOR),
1291 GPIO_FN(SCIFA1_TXD), GPIO_FN(GPS_PGFA0),
1292 GPIO_FN(SCIFA1_SCK), GPIO_FN(GPS_PGFA1),
1293 GPIO_FN(SCIFA1_RTS), GPIO_FN(GPS_EPPSINMON),
1294 GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_CTS),
1295 GPIO_FN(MSIOF1_TXD), GPIO_FN(SCIFA1_TXD2), GPIO_FN(GPS_TXD),
1296 GPIO_FN(MSIOF1_TSYNC), GPIO_FN(SCIFA1_CTS2), GPIO_FN(I2C_SDA2),
1297 GPIO_FN(MSIOF1_TSCK), GPIO_FN(SCIFA1_SCK2),
1298 GPIO_FN(MSIOF1_RXD), GPIO_FN(SCIFA1_RXD2), GPIO_FN(GPS_RXD),
1299 GPIO_FN(MSIOF1_RSCK), GPIO_FN(SCIFA1_RTS2),
1300 GPIO_FN(MSIOF1_RSYNC), GPIO_FN(I2C_SCL2),
1301 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
1302 GPIO_FN(MSIOF1_SS1), GPIO_FN(EDBGREQ3),
1303 GPIO_FN(MSIOF1_SS2),
1304 GPIO_FN(PORT236_IROUT), GPIO_FN(IRDA_OUT),
1305 GPIO_FN(IRDA_IN), GPIO_FN(IRDA_FIRSEL),
1306 GPIO_FN(TPU1TO0), GPIO_FN(TS_SPSYNC3),
1307 GPIO_FN(TPU1TO1), GPIO_FN(TS_SDAT3),
1308 GPIO_FN(TPU1TO2), GPIO_FN(TS_SDEN3), GPIO_FN(PORT241_MSIOF2_SS1),
1309 GPIO_FN(TPU1TO3), GPIO_FN(PORT242_MSIOF2_TSCK),
1310 GPIO_FN(M13_BSW), GPIO_FN(PORT243_MSIOF2_TSYNC),
1311 GPIO_FN(M14_GSW), GPIO_FN(PORT244_MSIOF2_TXD),
1312 GPIO_FN(PORT245_IROUT), GPIO_FN(M15_RSW),
1313 GPIO_FN(SOUT3), GPIO_FN(SCIFA2_TXD1),
1314 GPIO_FN(SIN3), GPIO_FN(SCIFA2_RXD1),
1315 GPIO_FN(XRTS3), GPIO_FN(SCIFA2_RTS1), GPIO_FN(PORT248_MSIOF2_SS2),
1316 GPIO_FN(XCTS3), GPIO_FN(SCIFA2_CTS1), GPIO_FN(PORT249_MSIOF2_RXD),
1317 GPIO_FN(DINT), GPIO_FN(SCIFA2_SCK1), GPIO_FN(TS_SCK3),
1318 GPIO_FN(SDHICLK0), GPIO_FN(TCK2),
1319 GPIO_FN(SDHICD0),
1320 GPIO_FN(SDHID0_0), GPIO_FN(TMS2),
1321 GPIO_FN(SDHID0_1), GPIO_FN(TDO2),
1322 GPIO_FN(SDHID0_2), GPIO_FN(TDI2),
1323 GPIO_FN(SDHID0_3), GPIO_FN(RTCK2),
1324
1325 /* 49-6 (FN) */
1326 GPIO_FN(SDHICMD0), GPIO_FN(TRST2),
1327 GPIO_FN(SDHIWP0), GPIO_FN(EDBGREQ2),
1328 GPIO_FN(SDHICLK1), GPIO_FN(TCK3),
1329 GPIO_FN(SDHID1_0), GPIO_FN(M11_SLCD_SO2),
1330 GPIO_FN(TS_SPSYNC2), GPIO_FN(TMS3),
1331 GPIO_FN(SDHID1_1), GPIO_FN(M9_SLCD_AO2),
1332 GPIO_FN(TS_SDAT2), GPIO_FN(TDO3),
1333 GPIO_FN(SDHID1_2), GPIO_FN(M10_SLCD_CK2),
1334 GPIO_FN(TS_SDEN2), GPIO_FN(TDI3),
1335 GPIO_FN(SDHID1_3), GPIO_FN(M12_SLCD_CE2),
1336 GPIO_FN(TS_SCK2), GPIO_FN(RTCK3),
1337 GPIO_FN(SDHICMD1), GPIO_FN(TRST3),
1338 GPIO_FN(SDHICLK2), GPIO_FN(SCIFB_SCK),
1339 GPIO_FN(SDHID2_0), GPIO_FN(SCIFB_TXD),
1340 GPIO_FN(SDHID2_1), GPIO_FN(SCIFB_CTS),
1341 GPIO_FN(SDHID2_2), GPIO_FN(SCIFB_RXD),
1342 GPIO_FN(SDHID2_3), GPIO_FN(SCIFB_RTS),
1343 GPIO_FN(SDHICMD2),
1344 GPIO_FN(RESETOUTS),
1345 GPIO_FN(DIVLOCK),
1346};
1347
1348/* helper for top 4 bits in PORTnCR */
1349#define PCRH(in, in_pd, in_pu, out) \
1350 0, (out), (in), 0, \
1351 0, 0, 0, 0, \
1352 0, 0, (in_pd), 0, \
1353 0, 0, (in_pu), 0
1354
1355#define PORTCR(nr, reg) \
1356 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1357 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1358 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1359 PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
1360 PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
1361 PORT##nr##_FN6, PORT##nr##_FN7 } \
1362 }
1363
1364static struct pinmux_cfg_reg pinmux_config_regs[] = {
1365 PORTCR(0, 0xe6050000), /* PORT0CR */
1366 PORTCR(1, 0xe6050001), /* PORT1CR */
1367 PORTCR(2, 0xe6050002), /* PORT2CR */
1368 PORTCR(3, 0xe6050003), /* PORT3CR */
1369 PORTCR(4, 0xe6050004), /* PORT4CR */
1370 PORTCR(5, 0xe6050005), /* PORT5CR */
1371 PORTCR(6, 0xe6050006), /* PORT6CR */
1372 PORTCR(7, 0xe6050007), /* PORT7CR */
1373 PORTCR(8, 0xe6050008), /* PORT8CR */
1374 PORTCR(9, 0xe6050009), /* PORT9CR */
1375
1376 PORTCR(10, 0xe605000a), /* PORT10CR */
1377 PORTCR(11, 0xe605000b), /* PORT11CR */
1378 PORTCR(12, 0xe605000c), /* PORT12CR */
1379 PORTCR(13, 0xe605000d), /* PORT13CR */
1380 PORTCR(14, 0xe605000e), /* PORT14CR */
1381 PORTCR(15, 0xe605000f), /* PORT15CR */
1382 PORTCR(16, 0xe6050010), /* PORT16CR */
1383 PORTCR(17, 0xe6050011), /* PORT17CR */
1384 PORTCR(18, 0xe6050012), /* PORT18CR */
1385 PORTCR(19, 0xe6050013), /* PORT19CR */
1386
1387 PORTCR(20, 0xe6050014), /* PORT20CR */
1388 PORTCR(21, 0xe6050015), /* PORT21CR */
1389 PORTCR(22, 0xe6050016), /* PORT22CR */
1390 PORTCR(23, 0xe6050017), /* PORT23CR */
1391 PORTCR(24, 0xe6050018), /* PORT24CR */
1392 PORTCR(25, 0xe6050019), /* PORT25CR */
1393 PORTCR(26, 0xe605001a), /* PORT26CR */
1394 PORTCR(27, 0xe605001b), /* PORT27CR */
1395 PORTCR(28, 0xe605001c), /* PORT28CR */
1396 PORTCR(29, 0xe605001d), /* PORT29CR */
1397
1398 PORTCR(30, 0xe605001e), /* PORT30CR */
1399 PORTCR(31, 0xe605001f), /* PORT31CR */
1400 PORTCR(32, 0xe6050020), /* PORT32CR */
1401 PORTCR(33, 0xe6050021), /* PORT33CR */
1402 PORTCR(34, 0xe6050022), /* PORT34CR */
1403 PORTCR(35, 0xe6050023), /* PORT35CR */
1404 PORTCR(36, 0xe6050024), /* PORT36CR */
1405 PORTCR(37, 0xe6050025), /* PORT37CR */
1406 PORTCR(38, 0xe6050026), /* PORT38CR */
1407 PORTCR(39, 0xe6050027), /* PORT39CR */
1408
1409 PORTCR(40, 0xe6050028), /* PORT40CR */
1410 PORTCR(41, 0xe6050029), /* PORT41CR */
1411 PORTCR(42, 0xe605002a), /* PORT42CR */
1412 PORTCR(43, 0xe605002b), /* PORT43CR */
1413 PORTCR(44, 0xe605002c), /* PORT44CR */
1414 PORTCR(45, 0xe605002d), /* PORT45CR */
1415 PORTCR(46, 0xe605002e), /* PORT46CR */
1416 PORTCR(47, 0xe605002f), /* PORT47CR */
1417 PORTCR(48, 0xe6050030), /* PORT48CR */
1418 PORTCR(49, 0xe6050031), /* PORT49CR */
1419
1420 PORTCR(50, 0xe6050032), /* PORT50CR */
1421 PORTCR(51, 0xe6050033), /* PORT51CR */
1422 PORTCR(52, 0xe6050034), /* PORT52CR */
1423 PORTCR(53, 0xe6050035), /* PORT53CR */
1424 PORTCR(54, 0xe6050036), /* PORT54CR */
1425 PORTCR(55, 0xe6050037), /* PORT55CR */
1426 PORTCR(56, 0xe6050038), /* PORT56CR */
1427 PORTCR(57, 0xe6050039), /* PORT57CR */
1428 PORTCR(58, 0xe605003a), /* PORT58CR */
1429 PORTCR(59, 0xe605003b), /* PORT59CR */
1430
1431 PORTCR(60, 0xe605003c), /* PORT60CR */
1432 PORTCR(61, 0xe605003d), /* PORT61CR */
1433 PORTCR(62, 0xe605003e), /* PORT62CR */
1434 PORTCR(63, 0xe605003f), /* PORT63CR */
1435 PORTCR(64, 0xe6050040), /* PORT64CR */
1436 PORTCR(65, 0xe6050041), /* PORT65CR */
1437 PORTCR(66, 0xe6050042), /* PORT66CR */
1438 PORTCR(67, 0xe6050043), /* PORT67CR */
1439 PORTCR(68, 0xe6050044), /* PORT68CR */
1440 PORTCR(69, 0xe6050045), /* PORT69CR */
1441
1442 PORTCR(70, 0xe6050046), /* PORT70CR */
1443 PORTCR(71, 0xe6050047), /* PORT71CR */
1444 PORTCR(72, 0xe6050048), /* PORT72CR */
1445 PORTCR(73, 0xe6050049), /* PORT73CR */
1446 PORTCR(74, 0xe605004a), /* PORT74CR */
1447 PORTCR(75, 0xe605004b), /* PORT75CR */
1448 PORTCR(76, 0xe605004c), /* PORT76CR */
1449 PORTCR(77, 0xe605004d), /* PORT77CR */
1450 PORTCR(78, 0xe605004e), /* PORT78CR */
1451 PORTCR(79, 0xe605004f), /* PORT79CR */
1452
1453 PORTCR(80, 0xe6050050), /* PORT80CR */
1454 PORTCR(81, 0xe6050051), /* PORT81CR */
1455 PORTCR(82, 0xe6050052), /* PORT82CR */
1456 PORTCR(83, 0xe6050053), /* PORT83CR */
1457 PORTCR(84, 0xe6050054), /* PORT84CR */
1458 PORTCR(85, 0xe6050055), /* PORT85CR */
1459 PORTCR(86, 0xe6050056), /* PORT86CR */
1460 PORTCR(87, 0xe6050057), /* PORT87CR */
1461 PORTCR(88, 0xe6051058), /* PORT88CR */
1462 PORTCR(89, 0xe6051059), /* PORT89CR */
1463
1464 PORTCR(90, 0xe605105a), /* PORT90CR */
1465 PORTCR(91, 0xe605105b), /* PORT91CR */
1466 PORTCR(92, 0xe605105c), /* PORT92CR */
1467 PORTCR(93, 0xe605105d), /* PORT93CR */
1468 PORTCR(94, 0xe605105e), /* PORT94CR */
1469 PORTCR(95, 0xe605105f), /* PORT95CR */
1470 PORTCR(96, 0xe6051060), /* PORT96CR */
1471 PORTCR(97, 0xe6051061), /* PORT97CR */
1472 PORTCR(98, 0xe6051062), /* PORT98CR */
1473 PORTCR(99, 0xe6051063), /* PORT99CR */
1474
1475 PORTCR(100, 0xe6051064), /* PORT100CR */
1476 PORTCR(101, 0xe6051065), /* PORT101CR */
1477 PORTCR(102, 0xe6051066), /* PORT102CR */
1478 PORTCR(103, 0xe6051067), /* PORT103CR */
1479 PORTCR(104, 0xe6051068), /* PORT104CR */
1480 PORTCR(105, 0xe6051069), /* PORT105CR */
1481 PORTCR(106, 0xe605106a), /* PORT106CR */
1482 PORTCR(107, 0xe605106b), /* PORT107CR */
1483 PORTCR(108, 0xe605106c), /* PORT108CR */
1484 PORTCR(109, 0xe605106d), /* PORT109CR */
1485
1486 PORTCR(110, 0xe605106e), /* PORT110CR */
1487 PORTCR(111, 0xe605106f), /* PORT111CR */
1488 PORTCR(112, 0xe6051070), /* PORT112CR */
1489 PORTCR(113, 0xe6051071), /* PORT113CR */
1490 PORTCR(114, 0xe6051072), /* PORT114CR */
1491 PORTCR(115, 0xe6051073), /* PORT115CR */
1492 PORTCR(116, 0xe6051074), /* PORT116CR */
1493 PORTCR(117, 0xe6051075), /* PORT117CR */
1494 PORTCR(118, 0xe6051076), /* PORT118CR */
1495 PORTCR(119, 0xe6051077), /* PORT119CR */
1496
1497 PORTCR(120, 0xe6051078), /* PORT120CR */
1498 PORTCR(121, 0xe6051079), /* PORT121CR */
1499 PORTCR(122, 0xe605107a), /* PORT122CR */
1500 PORTCR(123, 0xe605107b), /* PORT123CR */
1501 PORTCR(124, 0xe605107c), /* PORT124CR */
1502 PORTCR(125, 0xe605107d), /* PORT125CR */
1503 PORTCR(126, 0xe605107e), /* PORT126CR */
1504 PORTCR(127, 0xe605107f), /* PORT127CR */
1505 PORTCR(128, 0xe6051080), /* PORT128CR */
1506 PORTCR(129, 0xe6051081), /* PORT129CR */
1507
1508 PORTCR(130, 0xe6051082), /* PORT130CR */
1509 PORTCR(131, 0xe6051083), /* PORT131CR */
1510 PORTCR(132, 0xe6051084), /* PORT132CR */
1511 PORTCR(133, 0xe6051085), /* PORT133CR */
1512 PORTCR(134, 0xe6051086), /* PORT134CR */
1513 PORTCR(135, 0xe6051087), /* PORT135CR */
1514 PORTCR(136, 0xe6051088), /* PORT136CR */
1515 PORTCR(137, 0xe6051089), /* PORT137CR */
1516 PORTCR(138, 0xe605108a), /* PORT138CR */
1517 PORTCR(139, 0xe605108b), /* PORT139CR */
1518
1519 PORTCR(140, 0xe605108c), /* PORT140CR */
1520 PORTCR(141, 0xe605108d), /* PORT141CR */
1521 PORTCR(142, 0xe605108e), /* PORT142CR */
1522 PORTCR(143, 0xe605108f), /* PORT143CR */
1523 PORTCR(144, 0xe6051090), /* PORT144CR */
1524 PORTCR(145, 0xe6051091), /* PORT145CR */
1525 PORTCR(146, 0xe6051092), /* PORT146CR */
1526 PORTCR(147, 0xe6051093), /* PORT147CR */
1527 PORTCR(148, 0xe6051094), /* PORT148CR */
1528 PORTCR(149, 0xe6051095), /* PORT149CR */
1529
1530 PORTCR(150, 0xe6051096), /* PORT150CR */
1531 PORTCR(151, 0xe6051097), /* PORT151CR */
1532 PORTCR(152, 0xe6051098), /* PORT152CR */
1533 PORTCR(153, 0xe6051099), /* PORT153CR */
1534 PORTCR(154, 0xe605109a), /* PORT154CR */
1535 PORTCR(155, 0xe605109b), /* PORT155CR */
1536 PORTCR(156, 0xe605109c), /* PORT156CR */
1537 PORTCR(157, 0xe605109d), /* PORT157CR */
1538 PORTCR(158, 0xe605109e), /* PORT158CR */
1539 PORTCR(159, 0xe605109f), /* PORT159CR */
1540
1541 PORTCR(160, 0xe60510a0), /* PORT160CR */
1542 PORTCR(161, 0xe60510a1), /* PORT161CR */
1543 PORTCR(162, 0xe60510a2), /* PORT162CR */
1544 PORTCR(163, 0xe60510a3), /* PORT163CR */
1545 PORTCR(164, 0xe60510a4), /* PORT164CR */
1546 PORTCR(165, 0xe60510a5), /* PORT165CR */
1547 PORTCR(166, 0xe60510a6), /* PORT166CR */
1548 PORTCR(167, 0xe60510a7), /* PORT167CR */
1549 PORTCR(168, 0xe60510a8), /* PORT168CR */
1550 PORTCR(169, 0xe60510a9), /* PORT169CR */
1551
1552 PORTCR(170, 0xe60510aa), /* PORT170CR */
1553 PORTCR(171, 0xe60510ab), /* PORT171CR */
1554 PORTCR(172, 0xe60510ac), /* PORT172CR */
1555 PORTCR(173, 0xe60510ad), /* PORT173CR */
1556 PORTCR(174, 0xe60510ae), /* PORT174CR */
1557 PORTCR(175, 0xe60520af), /* PORT175CR */
1558 PORTCR(176, 0xe60520b0), /* PORT176CR */
1559 PORTCR(177, 0xe60520b1), /* PORT177CR */
1560 PORTCR(178, 0xe60520b2), /* PORT178CR */
1561 PORTCR(179, 0xe60520b3), /* PORT179CR */
1562
1563 PORTCR(180, 0xe60520b4), /* PORT180CR */
1564 PORTCR(181, 0xe60520b5), /* PORT181CR */
1565 PORTCR(182, 0xe60520b6), /* PORT182CR */
1566 PORTCR(183, 0xe60520b7), /* PORT183CR */
1567 PORTCR(184, 0xe60520b8), /* PORT184CR */
1568 PORTCR(185, 0xe60520b9), /* PORT185CR */
1569 PORTCR(186, 0xe60520ba), /* PORT186CR */
1570 PORTCR(187, 0xe60520bb), /* PORT187CR */
1571 PORTCR(188, 0xe60520bc), /* PORT188CR */
1572 PORTCR(189, 0xe60520bd), /* PORT189CR */
1573
1574 PORTCR(190, 0xe60520be), /* PORT190CR */
1575 PORTCR(191, 0xe60520bf), /* PORT191CR */
1576 PORTCR(192, 0xe60520c0), /* PORT192CR */
1577 PORTCR(193, 0xe60520c1), /* PORT193CR */
1578 PORTCR(194, 0xe60520c2), /* PORT194CR */
1579 PORTCR(195, 0xe60520c3), /* PORT195CR */
1580 PORTCR(196, 0xe60520c4), /* PORT196CR */
1581 PORTCR(197, 0xe60520c5), /* PORT197CR */
1582 PORTCR(198, 0xe60520c6), /* PORT198CR */
1583 PORTCR(199, 0xe60520c7), /* PORT199CR */
1584
1585 PORTCR(200, 0xe60520c8), /* PORT200CR */
1586 PORTCR(201, 0xe60520c9), /* PORT201CR */
1587 PORTCR(202, 0xe60520ca), /* PORT202CR */
1588 PORTCR(203, 0xe60520cb), /* PORT203CR */
1589 PORTCR(204, 0xe60520cc), /* PORT204CR */
1590 PORTCR(205, 0xe60520cd), /* PORT205CR */
1591 PORTCR(206, 0xe60520ce), /* PORT206CR */
1592 PORTCR(207, 0xe60520cf), /* PORT207CR */
1593 PORTCR(208, 0xe60520d0), /* PORT208CR */
1594 PORTCR(209, 0xe60520d1), /* PORT209CR */
1595
1596 PORTCR(210, 0xe60520d2), /* PORT210CR */
1597 PORTCR(211, 0xe60520d3), /* PORT211CR */
1598 PORTCR(212, 0xe60520d4), /* PORT212CR */
1599 PORTCR(213, 0xe60520d5), /* PORT213CR */
1600 PORTCR(214, 0xe60520d6), /* PORT214CR */
1601 PORTCR(215, 0xe60520d7), /* PORT215CR */
1602 PORTCR(216, 0xe60520d8), /* PORT216CR */
1603 PORTCR(217, 0xe60520d9), /* PORT217CR */
1604 PORTCR(218, 0xe60520da), /* PORT218CR */
1605 PORTCR(219, 0xe60520db), /* PORT219CR */
1606
1607 PORTCR(220, 0xe60520dc), /* PORT220CR */
1608 PORTCR(221, 0xe60520dd), /* PORT221CR */
1609 PORTCR(222, 0xe60520de), /* PORT222CR */
1610 PORTCR(223, 0xe60520df), /* PORT223CR */
1611 PORTCR(224, 0xe60520e0), /* PORT224CR */
1612 PORTCR(225, 0xe60520e1), /* PORT225CR */
1613 PORTCR(226, 0xe60520e2), /* PORT226CR */
1614 PORTCR(227, 0xe60520e3), /* PORT227CR */
1615 PORTCR(228, 0xe60520e4), /* PORT228CR */
1616 PORTCR(229, 0xe60520e5), /* PORT229CR */
1617
1618 PORTCR(230, 0xe60520e6), /* PORT230CR */
1619 PORTCR(231, 0xe60520e7), /* PORT231CR */
1620 PORTCR(232, 0xe60520e8), /* PORT232CR */
1621 PORTCR(233, 0xe60520e9), /* PORT233CR */
1622 PORTCR(234, 0xe60520ea), /* PORT234CR */
1623 PORTCR(235, 0xe60520eb), /* PORT235CR */
1624 PORTCR(236, 0xe60530ec), /* PORT236CR */
1625 PORTCR(237, 0xe60530ed), /* PORT237CR */
1626 PORTCR(238, 0xe60530ee), /* PORT238CR */
1627 PORTCR(239, 0xe60530ef), /* PORT239CR */
1628
1629 PORTCR(240, 0xe60530f0), /* PORT240CR */
1630 PORTCR(241, 0xe60530f1), /* PORT241CR */
1631 PORTCR(242, 0xe60530f2), /* PORT242CR */
1632 PORTCR(243, 0xe60530f3), /* PORT243CR */
1633 PORTCR(244, 0xe60530f4), /* PORT244CR */
1634 PORTCR(245, 0xe60530f5), /* PORT245CR */
1635 PORTCR(246, 0xe60530f6), /* PORT246CR */
1636 PORTCR(247, 0xe60530f7), /* PORT247CR */
1637 PORTCR(248, 0xe60530f8), /* PORT248CR */
1638 PORTCR(249, 0xe60530f9), /* PORT249CR */
1639
1640 PORTCR(250, 0xe60530fa), /* PORT250CR */
1641 PORTCR(251, 0xe60530fb), /* PORT251CR */
1642 PORTCR(252, 0xe60530fc), /* PORT252CR */
1643 PORTCR(253, 0xe60530fd), /* PORT253CR */
1644 PORTCR(254, 0xe60530fe), /* PORT254CR */
1645 PORTCR(255, 0xe60530ff), /* PORT255CR */
1646 PORTCR(256, 0xe6053100), /* PORT256CR */
1647 PORTCR(257, 0xe6053101), /* PORT257CR */
1648 PORTCR(258, 0xe6053102), /* PORT258CR */
1649 PORTCR(259, 0xe6053103), /* PORT259CR */
1650
1651 PORTCR(260, 0xe6053104), /* PORT260CR */
1652 PORTCR(261, 0xe6053105), /* PORT261CR */
1653 PORTCR(262, 0xe6053106), /* PORT262CR */
1654 PORTCR(263, 0xe6053107), /* PORT263CR */
1655 PORTCR(264, 0xe6053108), /* PORT264CR */
1656 PORTCR(265, 0xe6053109), /* PORT265CR */
1657 PORTCR(266, 0xe605310a), /* PORT266CR */
1658 PORTCR(267, 0xe605310b), /* PORT267CR */
1659 PORTCR(268, 0xe605310c), /* PORT268CR */
1660 PORTCR(269, 0xe605310d), /* PORT269CR */
1661
1662 PORTCR(270, 0xe605310e), /* PORT270CR */
1663 PORTCR(271, 0xe605310f), /* PORT271CR */
1664 PORTCR(272, 0xe6053110), /* PORT272CR */
1665
1666 { PINMUX_CFG_REG("MSELBCR", 0xe6058024, 32, 1) {
1667 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1668 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1669 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1670 0, 0,
1671 0, 0,
1672 0, 0,
1673 0, 0,
1674 0, 0,
1675 MSELBCR_MSEL2_0, MSELBCR_MSEL2_1,
1676 0, 0,
1677 0, 0 }
1678 },
1679 { },
1680};
1681
1682static struct pinmux_data_reg pinmux_data_regs[] = {
1683 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
1684 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1685 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1686 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1687 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1688 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1689 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1690 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1691 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
1692 },
1693 { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054004, 32) {
1694 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1695 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1696 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1697 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1698 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
1699 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1700 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1701 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
1702 },
1703 { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054008, 32) {
1704 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1705 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1706 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1707 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1708 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1709 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1710 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1711 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
1712 },
1713 { PINMUX_DATA_REG("PORTD127_096DR", 0xe6055004, 32) {
1714 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
1715 PORT123_DATA, PORT122_DATA, PORT121_DATA, PORT120_DATA,
1716 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1717 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1718 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1719 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1720 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1721 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
1722 },
1723 { PINMUX_DATA_REG("PORTD159_128DR", 0xe6055008, 32) {
1724 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1725 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1726 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1727 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1728 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1729 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1730 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1731 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
1732 },
1733 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6056000, 32) {
1734 PORT191_DATA, PORT190_DATA, PORT189_DATA, PORT188_DATA,
1735 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
1736 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
1737 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
1738 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
1739 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
1740 PORT167_DATA, PORT166_DATA, PORT165_DATA, PORT164_DATA,
1741 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
1742 },
1743 { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056004, 32) {
1744 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
1745 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
1746 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
1747 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
1748 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
1749 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
1750 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
1751 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
1752 },
1753 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6057000, 32) {
1754 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
1755 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
1756 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
1757 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
1758 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
1759 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
1760 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
1761 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
1762 },
1763 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6057004, 32) {
1764 0, 0, 0, 0,
1765 0, 0, 0, 0,
1766 0, 0, 0, 0,
1767 0, 0, 0, PORT272_DATA,
1768 PORT271_DATA, PORT270_DATA, PORT269_DATA, PORT268_DATA,
1769 PORT267_DATA, PORT266_DATA, PORT265_DATA, PORT264_DATA,
1770 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
1771 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
1772 },
1773 { },
1774};
1775
1776static struct pinmux_info sh7367_pinmux_info = {
1777 .name = "sh7367_pfc",
1778 .reserved_id = PINMUX_RESERVED,
1779 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1780 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1781 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1782 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1783 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1784 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1785 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1786
1787 .first_gpio = GPIO_PORT0,
1788 .last_gpio = GPIO_FN_DIVLOCK,
1789
1790 .gpios = pinmux_gpios,
1791 .cfg_regs = pinmux_config_regs,
1792 .data_regs = pinmux_data_regs,
1793
1794 .gpio_data = pinmux_data,
1795 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1796};
1797
1798void sh7367_pinmux_init(void)
1799{
1800 register_pinmux(&sh7367_pinmux_info);
1801}
diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
new file mode 100644
index 000000000000..9557d0964d73
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
@@ -0,0 +1,1637 @@
1/*
2 * sh7372 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 Kuninori Morimoto <morimoto.kuninori@renesas.com>
5 *
6 * Based on
7 * sh7367 processor support - PFC hardware block
8 * Copyright (C) 2010 Magnus Damm
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2 of the License.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/gpio.h>
26#include <mach/sh7372.h>
27
28#define _1(fn, pfx, sfx) fn(pfx, sfx)
29
30#define _10(fn, pfx, sfx) \
31 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
32 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
33 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
34 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
35 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
36
37#define _80(fn, pfx, sfx) \
38 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
39 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
40 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
41 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx)
42
43#define _190(fn, pfx, sfx) \
44 _10(fn, pfx, sfx), _80(fn, pfx, sfx), _10(fn, pfx##9, sfx), \
45 _10(fn, pfx##10, sfx), _80(fn, pfx##1, sfx), _1(fn, pfx##190, sfx)
46
47#define _PORT(pfx, sfx) pfx##_##sfx
48#define PORT_ALL(str) _190(_PORT, PORT, str)
49
50enum {
51 PINMUX_RESERVED = 0,
52
53 /* PORT0_DATA -> PORT190_DATA */
54 PINMUX_DATA_BEGIN,
55 PORT_ALL(DATA),
56 PINMUX_DATA_END,
57
58 /* PORT0_IN -> PORT190_IN */
59 PINMUX_INPUT_BEGIN,
60 PORT_ALL(IN),
61 PINMUX_INPUT_END,
62
63 /* PORT0_IN_PU -> PORT190_IN_PU */
64 PINMUX_INPUT_PULLUP_BEGIN,
65 PORT_ALL(IN_PU),
66 PINMUX_INPUT_PULLUP_END,
67
68 /* PORT0_IN_PD -> PORT190_IN_PD */
69 PINMUX_INPUT_PULLDOWN_BEGIN,
70 PORT_ALL(IN_PD),
71 PINMUX_INPUT_PULLDOWN_END,
72
73 /* PORT0_OUT -> PORT190_OUT */
74 PINMUX_OUTPUT_BEGIN,
75 PORT_ALL(OUT),
76 PINMUX_OUTPUT_END,
77
78 PINMUX_FUNCTION_BEGIN,
79 PORT_ALL(FN_IN), /* PORT0_FN_IN -> PORT190_FN_IN */
80 PORT_ALL(FN_OUT), /* PORT0_FN_OUT -> PORT190_FN_OUT */
81 PORT_ALL(FN0), /* PORT0_FN0 -> PORT190_FN0 */
82 PORT_ALL(FN1), /* PORT0_FN1 -> PORT190_FN1 */
83 PORT_ALL(FN2), /* PORT0_FN2 -> PORT190_FN2 */
84 PORT_ALL(FN3), /* PORT0_FN3 -> PORT190_FN3 */
85 PORT_ALL(FN4), /* PORT0_FN4 -> PORT190_FN4 */
86 PORT_ALL(FN5), /* PORT0_FN5 -> PORT190_FN5 */
87 PORT_ALL(FN6), /* PORT0_FN6 -> PORT190_FN6 */
88 PORT_ALL(FN7), /* PORT0_FN7 -> PORT190_FN7 */
89
90 MSEL1CR_31_0, MSEL1CR_31_1,
91 MSEL1CR_30_0, MSEL1CR_30_1,
92 MSEL1CR_29_0, MSEL1CR_29_1,
93 MSEL1CR_28_0, MSEL1CR_28_1,
94 MSEL1CR_27_0, MSEL1CR_27_1,
95 MSEL1CR_26_0, MSEL1CR_26_1,
96 MSEL1CR_16_0, MSEL1CR_16_1,
97 MSEL1CR_15_0, MSEL1CR_15_1,
98 MSEL1CR_14_0, MSEL1CR_14_1,
99 MSEL1CR_13_0, MSEL1CR_13_1,
100 MSEL1CR_12_0, MSEL1CR_12_1,
101 MSEL1CR_9_0, MSEL1CR_9_1,
102 MSEL1CR_8_0, MSEL1CR_8_1,
103 MSEL1CR_7_0, MSEL1CR_7_1,
104 MSEL1CR_6_0, MSEL1CR_6_1,
105 MSEL1CR_4_0, MSEL1CR_4_1,
106 MSEL1CR_3_0, MSEL1CR_3_1,
107 MSEL1CR_2_0, MSEL1CR_2_1,
108 MSEL1CR_0_0, MSEL1CR_0_1,
109
110 MSEL3CR_27_0, MSEL3CR_27_1,
111 MSEL3CR_26_0, MSEL3CR_26_1,
112 MSEL3CR_21_0, MSEL3CR_21_1,
113 MSEL3CR_20_0, MSEL3CR_20_1,
114 MSEL3CR_15_0, MSEL3CR_15_1,
115 MSEL3CR_9_0, MSEL3CR_9_1,
116 MSEL3CR_6_0, MSEL3CR_6_1,
117
118 MSEL4CR_19_0, MSEL4CR_19_1,
119 MSEL4CR_18_0, MSEL4CR_18_1,
120 MSEL4CR_17_0, MSEL4CR_17_1,
121 MSEL4CR_16_0, MSEL4CR_16_1,
122 MSEL4CR_15_0, MSEL4CR_15_1,
123 MSEL4CR_14_0, MSEL4CR_14_1,
124 MSEL4CR_10_0, MSEL4CR_10_1,
125 MSEL4CR_6_0, MSEL4CR_6_1,
126 MSEL4CR_4_0, MSEL4CR_4_1,
127 MSEL4CR_1_0, MSEL4CR_1_1,
128 PINMUX_FUNCTION_END,
129
130 PINMUX_MARK_BEGIN,
131
132 /* IRQ */
133 IRQ0_6_MARK, IRQ0_162_MARK, IRQ1_MARK, IRQ2_4_MARK,
134 IRQ2_5_MARK, IRQ3_8_MARK, IRQ3_16_MARK, IRQ4_17_MARK,
135 IRQ4_163_MARK, IRQ5_MARK, IRQ6_39_MARK, IRQ6_164_MARK,
136 IRQ7_40_MARK, IRQ7_167_MARK, IRQ8_41_MARK, IRQ8_168_MARK,
137 IRQ9_42_MARK, IRQ9_169_MARK, IRQ10_MARK, IRQ11_MARK,
138 IRQ12_80_MARK, IRQ12_137_MARK, IRQ13_81_MARK, IRQ13_145_MARK,
139 IRQ14_82_MARK, IRQ14_146_MARK, IRQ15_83_MARK, IRQ15_147_MARK,
140 IRQ16_84_MARK, IRQ16_170_MARK, IRQ17_MARK, IRQ18_MARK,
141 IRQ19_MARK, IRQ20_MARK, IRQ21_MARK, IRQ22_MARK,
142 IRQ23_MARK, IRQ24_MARK, IRQ25_MARK, IRQ26_121_MARK,
143 IRQ26_172_MARK, IRQ27_122_MARK, IRQ27_180_MARK, IRQ28_123_MARK,
144 IRQ28_181_MARK, IRQ29_129_MARK, IRQ29_182_MARK, IRQ30_130_MARK,
145 IRQ30_183_MARK, IRQ31_138_MARK, IRQ31_184_MARK,
146
147 /* MSIOF0 */
148 MSIOF0_TSYNC_MARK, MSIOF0_TSCK_MARK, MSIOF0_RXD_MARK,
149 MSIOF0_RSCK_MARK, MSIOF0_RSYNC_MARK, MSIOF0_MCK0_MARK,
150 MSIOF0_MCK1_MARK, MSIOF0_SS1_MARK, MSIOF0_SS2_MARK,
151 MSIOF0_TXD_MARK,
152
153 /* MSIOF1 */
154 MSIOF1_TSCK_39_MARK, MSIOF1_TSYNC_40_MARK,
155 MSIOF1_TSCK_88_MARK, MSIOF1_TSYNC_89_MARK,
156 MSIOF1_TXD_41_MARK, MSIOF1_RXD_42_MARK,
157 MSIOF1_TXD_90_MARK, MSIOF1_RXD_91_MARK,
158 MSIOF1_SS1_43_MARK, MSIOF1_SS2_44_MARK,
159 MSIOF1_SS1_92_MARK, MSIOF1_SS2_93_MARK,
160 MSIOF1_RSCK_MARK, MSIOF1_RSYNC_MARK,
161 MSIOF1_MCK0_MARK, MSIOF1_MCK1_MARK,
162
163 /* MSIOF2 */
164 MSIOF2_RSCK_MARK, MSIOF2_RSYNC_MARK, MSIOF2_MCK0_MARK,
165 MSIOF2_MCK1_MARK, MSIOF2_SS1_MARK, MSIOF2_SS2_MARK,
166 MSIOF2_TSYNC_MARK, MSIOF2_TSCK_MARK, MSIOF2_RXD_MARK,
167 MSIOF2_TXD_MARK,
168
169 /* MSIOF3 */
170 BBIF1_RXD_MARK, BBIF1_TSYNC_MARK, BBIF1_TSCK_MARK,
171 BBIF1_TXD_MARK, BBIF1_RSCK_MARK, BBIF1_RSYNC_MARK,
172 BBIF1_FLOW_MARK, BB_RX_FLOW_N_MARK,
173
174 /* MSIOF4 */
175 BBIF2_TSCK1_MARK, BBIF2_TSYNC1_MARK,
176 BBIF2_TXD1_MARK, BBIF2_RXD_MARK,
177
178 /* FSI */
179 FSIACK_MARK, FSIBCK_MARK, FSIAILR_MARK, FSIAIBT_MARK,
180 FSIAISLD_MARK, FSIAOMC_MARK, FSIAOLR_MARK, FSIAOBT_MARK,
181 FSIAOSLD_MARK, FSIASPDIF_11_MARK, FSIASPDIF_15_MARK,
182
183 /* FMSI */
184 FMSOCK_MARK, FMSOOLR_MARK, FMSIOLR_MARK, FMSOOBT_MARK,
185 FMSIOBT_MARK, FMSOSLD_MARK, FMSOILR_MARK, FMSIILR_MARK,
186 FMSOIBT_MARK, FMSIIBT_MARK, FMSISLD_MARK, FMSICK_MARK,
187
188 /* SCIFA0 */
189 SCIFA0_TXD_MARK, SCIFA0_RXD_MARK, SCIFA0_SCK_MARK,
190 SCIFA0_RTS_MARK, SCIFA0_CTS_MARK,
191
192 /* SCIFA1 */
193 SCIFA1_TXD_MARK, SCIFA1_RXD_MARK, SCIFA1_SCK_MARK,
194 SCIFA1_RTS_MARK, SCIFA1_CTS_MARK,
195
196 /* SCIFA2 */
197 SCIFA2_CTS1_MARK, SCIFA2_RTS1_MARK, SCIFA2_TXD1_MARK,
198 SCIFA2_RXD1_MARK, SCIFA2_SCK1_MARK,
199
200 /* SCIFA3 */
201 SCIFA3_CTS_43_MARK, SCIFA3_CTS_140_MARK, SCIFA3_RTS_44_MARK,
202 SCIFA3_RTS_141_MARK, SCIFA3_SCK_MARK, SCIFA3_TXD_MARK,
203 SCIFA3_RXD_MARK,
204
205 /* SCIFA4 */
206 SCIFA4_RXD_MARK, SCIFA4_TXD_MARK,
207
208 /* SCIFA5 */
209 SCIFA5_RXD_MARK, SCIFA5_TXD_MARK,
210
211 /* SCIFB */
212 SCIFB_SCK_MARK, SCIFB_RTS_MARK, SCIFB_CTS_MARK,
213 SCIFB_TXD_MARK, SCIFB_RXD_MARK,
214
215 /* CEU */
216 VIO_HD_MARK, VIO_CKO1_MARK, VIO_CKO2_MARK, VIO_VD_MARK,
217 VIO_CLK_MARK, VIO_FIELD_MARK, VIO_CKO_MARK,
218 VIO_D0_MARK, VIO_D1_MARK, VIO_D2_MARK, VIO_D3_MARK,
219 VIO_D4_MARK, VIO_D5_MARK, VIO_D6_MARK, VIO_D7_MARK,
220 VIO_D8_MARK, VIO_D9_MARK, VIO_D10_MARK, VIO_D11_MARK,
221 VIO_D12_MARK, VIO_D13_MARK, VIO_D14_MARK, VIO_D15_MARK,
222
223 /* USB0 */
224 IDIN_0_MARK, EXTLP_0_MARK, OVCN2_0_MARK, PWEN_0_MARK,
225 OVCN_0_MARK, VBUS0_0_MARK,
226
227 /* USB1 */
228 IDIN_1_18_MARK, IDIN_1_113_MARK,
229 PWEN_1_115_MARK, PWEN_1_138_MARK,
230 OVCN_1_114_MARK, OVCN_1_162_MARK,
231 EXTLP_1_MARK, OVCN2_1_MARK,
232 VBUS0_1_MARK,
233
234 /* GPIO */
235 GPI0_MARK, GPI1_MARK, GPO0_MARK, GPO1_MARK,
236
237 /* BSC */
238 BS_MARK, WE1_MARK,
239 CKO_MARK, WAIT_MARK, RDWR_MARK,
240
241 A0_MARK, A1_MARK, A2_MARK, A3_MARK,
242 A6_MARK, A7_MARK, A8_MARK, A9_MARK,
243 A10_MARK, A11_MARK, A12_MARK, A13_MARK,
244 A14_MARK, A15_MARK, A16_MARK, A17_MARK,
245 A18_MARK, A19_MARK, A20_MARK, A21_MARK,
246 A22_MARK, A23_MARK, A24_MARK, A25_MARK,
247 A26_MARK,
248
249 CS0_MARK, CS2_MARK, CS4_MARK,
250 CS5A_MARK, CS5B_MARK, CS6A_MARK,
251
252 /* BSC/FLCTL */
253 RD_FSC_MARK, WE0_FWE_MARK, A4_FOE_MARK, A5_FCDE_MARK,
254 D0_NAF0_MARK, D1_NAF1_MARK, D2_NAF2_MARK, D3_NAF3_MARK,
255 D4_NAF4_MARK, D5_NAF5_MARK, D6_NAF6_MARK, D7_NAF7_MARK,
256 D8_NAF8_MARK, D9_NAF9_MARK, D10_NAF10_MARK, D11_NAF11_MARK,
257 D12_NAF12_MARK, D13_NAF13_MARK, D14_NAF14_MARK, D15_NAF15_MARK,
258
259 /* MMCIF(1) */
260 MMCD0_0_MARK, MMCD0_1_MARK, MMCD0_2_MARK, MMCD0_3_MARK,
261 MMCD0_4_MARK, MMCD0_5_MARK, MMCD0_6_MARK, MMCD0_7_MARK,
262 MMCCMD0_MARK, MMCCLK0_MARK,
263
264 /* MMCIF(2) */
265 MMCD1_0_MARK, MMCD1_1_MARK, MMCD1_2_MARK, MMCD1_3_MARK,
266 MMCD1_4_MARK, MMCD1_5_MARK, MMCD1_6_MARK, MMCD1_7_MARK,
267 MMCCLK1_MARK, MMCCMD1_MARK,
268
269 /* SPU2 */
270 VINT_I_MARK,
271
272 /* FLCTL */
273 FCE1_MARK, FCE0_MARK, FRB_MARK,
274
275 /* HSI */
276 GP_RX_FLAG_MARK, GP_RX_DATA_MARK, GP_TX_READY_MARK,
277 GP_RX_WAKE_MARK, MP_TX_FLAG_MARK, MP_TX_DATA_MARK,
278 MP_RX_READY_MARK, MP_TX_WAKE_MARK,
279
280 /* MFI */
281 MFIv6_MARK,
282 MFIv4_MARK,
283
284 MEMC_CS0_MARK, MEMC_BUSCLK_MEMC_A0_MARK,
285 MEMC_CS1_MEMC_A1_MARK, MEMC_ADV_MEMC_DREQ0_MARK,
286 MEMC_WAIT_MEMC_DREQ1_MARK, MEMC_NOE_MARK,
287 MEMC_NWE_MARK, MEMC_INT_MARK,
288
289 MEMC_AD0_MARK, MEMC_AD1_MARK, MEMC_AD2_MARK,
290 MEMC_AD3_MARK, MEMC_AD4_MARK, MEMC_AD5_MARK,
291 MEMC_AD6_MARK, MEMC_AD7_MARK, MEMC_AD8_MARK,
292 MEMC_AD9_MARK, MEMC_AD10_MARK, MEMC_AD11_MARK,
293 MEMC_AD12_MARK, MEMC_AD13_MARK, MEMC_AD14_MARK,
294 MEMC_AD15_MARK,
295
296 /* SIM */
297 SIM_RST_MARK, SIM_CLK_MARK, SIM_D_MARK,
298
299 /* TPU */
300 TPU0TO0_MARK, TPU0TO1_MARK,
301 TPU0TO2_93_MARK, TPU0TO2_99_MARK,
302 TPU0TO3_MARK,
303
304 /* I2C2 */
305 I2C_SCL2_MARK, I2C_SDA2_MARK,
306
307 /* I2C3(1) */
308 I2C_SCL3_MARK, I2C_SDA3_MARK,
309
310 /* I2C3(2) */
311 I2C_SCL3S_MARK, I2C_SDA3S_MARK,
312
313 /* I2C4(2) */
314 I2C_SCL4_MARK, I2C_SDA4_MARK,
315
316 /* I2C4(2) */
317 I2C_SCL4S_MARK, I2C_SDA4S_MARK,
318
319 /* KEYSC */
320 KEYOUT0_MARK, KEYIN0_121_MARK, KEYIN0_136_MARK,
321 KEYOUT1_MARK, KEYIN1_122_MARK, KEYIN1_135_MARK,
322 KEYOUT2_MARK, KEYIN2_123_MARK, KEYIN2_134_MARK,
323 KEYOUT3_MARK, KEYIN3_124_MARK, KEYIN3_133_MARK,
324 KEYOUT4_MARK, KEYIN4_MARK,
325 KEYOUT5_MARK, KEYIN5_MARK,
326 KEYOUT6_MARK, KEYIN6_MARK,
327 KEYOUT7_MARK, KEYIN7_MARK,
328
329 /* LCDC */
330 LCDC0_SELECT_MARK,
331 LCDC1_SELECT_MARK,
332 LCDHSYN_MARK, LCDCS_MARK, LCDVSYN_MARK, LCDDCK_MARK,
333 LCDWR_MARK, LCDRD_MARK, LCDDISP_MARK, LCDRS_MARK,
334 LCDLCLK_MARK, LCDDON_MARK,
335
336 LCDD0_MARK, LCDD1_MARK, LCDD2_MARK, LCDD3_MARK,
337 LCDD4_MARK, LCDD5_MARK, LCDD6_MARK, LCDD7_MARK,
338 LCDD8_MARK, LCDD9_MARK, LCDD10_MARK, LCDD11_MARK,
339 LCDD12_MARK, LCDD13_MARK, LCDD14_MARK, LCDD15_MARK,
340 LCDD16_MARK, LCDD17_MARK, LCDD18_MARK, LCDD19_MARK,
341 LCDD20_MARK, LCDD21_MARK, LCDD22_MARK, LCDD23_MARK,
342
343 /* IRDA */
344 IRDA_OUT_MARK, IRDA_IN_MARK, IRDA_FIRSEL_MARK,
345 IROUT_139_MARK, IROUT_140_MARK,
346
347 /* TSIF1 */
348 TS0_1SELECT_MARK,
349 TS0_2SELECT_MARK,
350 TS1_1SELECT_MARK,
351 TS1_2SELECT_MARK,
352
353 TS_SPSYNC1_MARK, TS_SDAT1_MARK,
354 TS_SDEN1_MARK, TS_SCK1_MARK,
355
356 /* TSIF2 */
357 TS_SPSYNC2_MARK, TS_SDAT2_MARK,
358 TS_SDEN2_MARK, TS_SCK2_MARK,
359
360 /* HDMI */
361 HDMI_HPD_MARK, HDMI_CEC_MARK,
362
363 /* SDHI0 */
364 SDHICLK0_MARK, SDHICD0_MARK,
365 SDHICMD0_MARK, SDHIWP0_MARK,
366 SDHID0_0_MARK, SDHID0_1_MARK,
367 SDHID0_2_MARK, SDHID0_3_MARK,
368
369 /* SDHI1 */
370 SDHICLK1_MARK, SDHICMD1_MARK, SDHID1_0_MARK,
371 SDHID1_1_MARK, SDHID1_2_MARK, SDHID1_3_MARK,
372
373 /* SDHI2 */
374 SDHICLK2_MARK, SDHICMD2_MARK, SDHID2_0_MARK,
375 SDHID2_1_MARK, SDHID2_2_MARK, SDHID2_3_MARK,
376
377 /* SDENC */
378 SDENC_CPG_MARK,
379 SDENC_DV_CLKI_MARK,
380
381 PINMUX_MARK_END,
382};
383
384/* PORT_DATA_I_PD(nr) */
385#define _I___D(nr) \
386 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
387 PORT##nr##_IN, PORT##nr##_IN_PD)
388
389/* PORT_DATA_I_PU(nr) */
390#define _I__U_(nr) \
391 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
392 PORT##nr##_IN, PORT##nr##_IN_PU)
393
394/* PORT_DATA_I_PU_PD(nr) */
395#define _I__UD(nr) \
396 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
397 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
398
399/* PORT_DATA_O(nr) */
400#define __O___(nr) \
401 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT)
402
403/* PORT_DATA_IO(nr) */
404#define _IO___(nr) \
405 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
406 PORT##nr##_IN)
407
408/* PORT_DATA_IO_PD(nr) */
409#define _IO__D(nr) \
410 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
411 PORT##nr##_IN, PORT##nr##_IN_PD)
412
413/* PORT_DATA_IO_PU(nr) */
414#define _IO_U_(nr) \
415 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
416 PORT##nr##_IN, PORT##nr##_IN_PU)
417
418/* PORT_DATA_IO_PU_PD(nr) */
419#define _IO_UD(nr) \
420 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_OUT, \
421 PORT##nr##_IN, PORT##nr##_IN_PD, PORT##nr##_IN_PU)
422
423
424static pinmux_enum_t pinmux_data[] = {
425
426 /* specify valid pin states for each pin in GPIO mode */
427
428 _IO__D(0), _IO__D(1), __O___(2), _I___D(3), _I___D(4),
429 _I___D(5), _IO_UD(6), _I___D(7), _IO__D(8), __O___(9),
430
431 __O___(10), __O___(11), _IO_UD(12), _IO__D(13), _IO__D(14),
432 __O___(15), _IO__D(16), _IO__D(17), _I___D(18), _IO___(19),
433
434 _IO___(20), _IO___(21), _IO___(22), _IO___(23), _IO___(24),
435 _IO___(25), _IO___(26), _IO___(27), _IO___(28), _IO___(29),
436
437 _IO___(30), _IO___(31), _IO___(32), _IO___(33), _IO___(34),
438 _IO___(35), _IO___(36), _IO___(37), _IO___(38), _IO___(39),
439
440 _IO___(40), _IO___(41), _IO___(42), _IO___(43), _IO___(44),
441 _IO___(45), _IO_U_(46), _IO_U_(47), _IO_U_(48), _IO_U_(49),
442
443 _IO_U_(50), _IO_U_(51), _IO_U_(52), _IO_U_(53), _IO_U_(54),
444 _IO_U_(55), _IO_U_(56), _IO_U_(57), _IO_U_(58), _IO_U_(59),
445
446 _IO_U_(60), _IO_U_(61), _IO___(62), __O___(63), __O___(64),
447 _IO_U_(65), __O___(66), _IO_U_(67), __O___(68), _IO___(69), /*66?*/
448
449 _IO___(70), _IO___(71), __O___(72), _I__U_(73), _I__UD(74),
450 _IO_UD(75), _IO_UD(76), _IO_UD(77), _IO_UD(78), _IO_UD(79),
451
452 _IO_UD(80), _IO_UD(81), _IO_UD(82), _IO_UD(83), _IO_UD(84),
453 _IO_UD(85), _IO_UD(86), _IO_UD(87), _IO_UD(88), _IO_UD(89),
454
455 _IO_UD(90), _IO_UD(91), _IO_UD(92), _IO_UD(93), _IO_UD(94),
456 _IO_UD(95), _IO_U_(96), _IO_UD(97), _IO_UD(98), __O___(99), /*99?*/
457
458 _IO__D(100), _IO__D(101), _IO__D(102), _IO__D(103), _IO__D(104),
459 _IO__D(105), _IO_U_(106), _IO_U_(107), _IO_U_(108), _IO_U_(109),
460
461 _IO_U_(110), _IO_U_(111), _IO__D(112), _IO__D(113), _IO_U_(114),
462 _IO_U_(115), _IO_U_(116), _IO_U_(117), _IO_U_(118), _IO_U_(119),
463
464 _IO_U_(120), _IO__D(121), _IO__D(122), _IO__D(123), _IO__D(124),
465 _IO__D(125), _IO__D(126), _IO__D(127), _IO__D(128), _IO_UD(129),
466
467 _IO_UD(130), _IO_UD(131), _IO_UD(132), _IO_UD(133), _IO_UD(134),
468 _IO_UD(135), _IO__D(136), _IO__D(137), _IO__D(138), _IO__D(139),
469
470 _IO__D(140), _IO__D(141), _IO__D(142), _IO_UD(143), _IO__D(144),
471 _IO__D(145), _IO__D(146), _IO__D(147), _IO__D(148), _IO__D(149),
472
473 _IO__D(150), _IO__D(151), _IO_UD(152), _I___D(153), _IO_UD(154),
474 _I___D(155), _IO__D(156), _IO__D(157), _I___D(158), _IO__D(159),
475
476 __O___(160), _IO__D(161), _IO__D(162), _IO__D(163), _I___D(164),
477 _IO__D(165), _I___D(166), _I___D(167), _I___D(168), _I___D(169),
478
479 _I___D(170), __O___(171), _IO_UD(172), _IO_UD(173), _IO_UD(174),
480 _IO_UD(175), _IO_UD(176), _IO_UD(177), _IO_UD(178), __O___(179),
481
482 _IO_UD(180), _IO_UD(181), _IO_UD(182), _IO_UD(183), _IO_UD(184),
483 __O___(185), _IO_UD(186), _IO_UD(187), _IO_UD(188), _IO_UD(189),
484
485 _IO_UD(190),
486
487 /* IRQ */
488 PINMUX_DATA(IRQ0_6_MARK, PORT6_FN0, MSEL1CR_0_0),
489 PINMUX_DATA(IRQ0_162_MARK, PORT162_FN0, MSEL1CR_0_1),
490 PINMUX_DATA(IRQ1_MARK, PORT12_FN0),
491 PINMUX_DATA(IRQ2_4_MARK, PORT4_FN0, MSEL1CR_2_0),
492 PINMUX_DATA(IRQ2_5_MARK, PORT5_FN0, MSEL1CR_2_1),
493 PINMUX_DATA(IRQ3_8_MARK, PORT8_FN0, MSEL1CR_3_0),
494 PINMUX_DATA(IRQ3_16_MARK, PORT16_FN0, MSEL1CR_3_1),
495 PINMUX_DATA(IRQ4_17_MARK, PORT17_FN0, MSEL1CR_4_0),
496 PINMUX_DATA(IRQ4_163_MARK, PORT163_FN0, MSEL1CR_4_1),
497 PINMUX_DATA(IRQ5_MARK, PORT18_FN0),
498 PINMUX_DATA(IRQ6_39_MARK, PORT39_FN0, MSEL1CR_6_0),
499 PINMUX_DATA(IRQ6_164_MARK, PORT164_FN0, MSEL1CR_6_1),
500 PINMUX_DATA(IRQ7_40_MARK, PORT40_FN0, MSEL1CR_7_1),
501 PINMUX_DATA(IRQ7_167_MARK, PORT167_FN0, MSEL1CR_7_0),
502 PINMUX_DATA(IRQ8_41_MARK, PORT41_FN0, MSEL1CR_8_1),
503 PINMUX_DATA(IRQ8_168_MARK, PORT168_FN0, MSEL1CR_8_0),
504 PINMUX_DATA(IRQ9_42_MARK, PORT42_FN0, MSEL1CR_9_0),
505 PINMUX_DATA(IRQ9_169_MARK, PORT169_FN0, MSEL1CR_9_1),
506 PINMUX_DATA(IRQ10_MARK, PORT65_FN0, MSEL1CR_9_1),
507 PINMUX_DATA(IRQ11_MARK, PORT67_FN0),
508 PINMUX_DATA(IRQ12_80_MARK, PORT80_FN0, MSEL1CR_12_0),
509 PINMUX_DATA(IRQ12_137_MARK, PORT137_FN0, MSEL1CR_12_1),
510 PINMUX_DATA(IRQ13_81_MARK, PORT81_FN0, MSEL1CR_13_0),
511 PINMUX_DATA(IRQ13_145_MARK, PORT145_FN0, MSEL1CR_13_1),
512 PINMUX_DATA(IRQ14_82_MARK, PORT82_FN0, MSEL1CR_14_0),
513 PINMUX_DATA(IRQ14_146_MARK, PORT146_FN0, MSEL1CR_14_1),
514 PINMUX_DATA(IRQ15_83_MARK, PORT83_FN0, MSEL1CR_15_0),
515 PINMUX_DATA(IRQ15_147_MARK, PORT147_FN0, MSEL1CR_15_1),
516 PINMUX_DATA(IRQ16_84_MARK, PORT84_FN0, MSEL1CR_16_0),
517 PINMUX_DATA(IRQ16_170_MARK, PORT170_FN0, MSEL1CR_16_1),
518 PINMUX_DATA(IRQ17_MARK, PORT85_FN0),
519 PINMUX_DATA(IRQ18_MARK, PORT86_FN0),
520 PINMUX_DATA(IRQ19_MARK, PORT87_FN0),
521 PINMUX_DATA(IRQ20_MARK, PORT92_FN0),
522 PINMUX_DATA(IRQ21_MARK, PORT93_FN0),
523 PINMUX_DATA(IRQ22_MARK, PORT94_FN0),
524 PINMUX_DATA(IRQ23_MARK, PORT95_FN0),
525 PINMUX_DATA(IRQ24_MARK, PORT112_FN0),
526 PINMUX_DATA(IRQ25_MARK, PORT119_FN0),
527 PINMUX_DATA(IRQ26_121_MARK, PORT121_FN0, MSEL1CR_26_1),
528 PINMUX_DATA(IRQ26_172_MARK, PORT172_FN0, MSEL1CR_26_0),
529 PINMUX_DATA(IRQ27_122_MARK, PORT122_FN0, MSEL1CR_27_1),
530 PINMUX_DATA(IRQ27_180_MARK, PORT180_FN0, MSEL1CR_27_0),
531 PINMUX_DATA(IRQ28_123_MARK, PORT123_FN0, MSEL1CR_28_1),
532 PINMUX_DATA(IRQ28_181_MARK, PORT181_FN0, MSEL1CR_28_0),
533 PINMUX_DATA(IRQ29_129_MARK, PORT129_FN0, MSEL1CR_29_1),
534 PINMUX_DATA(IRQ29_182_MARK, PORT182_FN0, MSEL1CR_29_0),
535 PINMUX_DATA(IRQ30_130_MARK, PORT130_FN0, MSEL1CR_30_1),
536 PINMUX_DATA(IRQ30_183_MARK, PORT183_FN0, MSEL1CR_30_0),
537 PINMUX_DATA(IRQ31_138_MARK, PORT138_FN0, MSEL1CR_31_1),
538 PINMUX_DATA(IRQ31_184_MARK, PORT184_FN0, MSEL1CR_31_0),
539
540 /* Function 1 */
541 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT0_FN1),
542 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT1_FN1),
543 PINMUX_DATA(BBIF2_TXD1_MARK, PORT2_FN1),
544 PINMUX_DATA(BBIF2_RXD_MARK, PORT3_FN1),
545 PINMUX_DATA(FSIACK_MARK, PORT4_FN1),
546 PINMUX_DATA(FSIAILR_MARK, PORT5_FN1),
547 PINMUX_DATA(FSIAIBT_MARK, PORT6_FN1),
548 PINMUX_DATA(FSIAISLD_MARK, PORT7_FN1),
549 PINMUX_DATA(FSIAOMC_MARK, PORT8_FN1),
550 PINMUX_DATA(FSIAOLR_MARK, PORT9_FN1),
551 PINMUX_DATA(FSIAOBT_MARK, PORT10_FN1),
552 PINMUX_DATA(FSIAOSLD_MARK, PORT11_FN1),
553 PINMUX_DATA(FMSOCK_MARK, PORT12_FN1),
554 PINMUX_DATA(FMSOOLR_MARK, PORT13_FN1),
555 PINMUX_DATA(FMSOOBT_MARK, PORT14_FN1),
556 PINMUX_DATA(FMSOSLD_MARK, PORT15_FN1),
557 PINMUX_DATA(FMSOILR_MARK, PORT16_FN1),
558 PINMUX_DATA(FMSOIBT_MARK, PORT17_FN1),
559 PINMUX_DATA(FMSISLD_MARK, PORT18_FN1),
560 PINMUX_DATA(A0_MARK, PORT19_FN1),
561 PINMUX_DATA(A1_MARK, PORT20_FN1),
562 PINMUX_DATA(A2_MARK, PORT21_FN1),
563 PINMUX_DATA(A3_MARK, PORT22_FN1),
564 PINMUX_DATA(A4_FOE_MARK, PORT23_FN1),
565 PINMUX_DATA(A5_FCDE_MARK, PORT24_FN1),
566 PINMUX_DATA(A6_MARK, PORT25_FN1),
567 PINMUX_DATA(A7_MARK, PORT26_FN1),
568 PINMUX_DATA(A8_MARK, PORT27_FN1),
569 PINMUX_DATA(A9_MARK, PORT28_FN1),
570 PINMUX_DATA(A10_MARK, PORT29_FN1),
571 PINMUX_DATA(A11_MARK, PORT30_FN1),
572 PINMUX_DATA(A12_MARK, PORT31_FN1),
573 PINMUX_DATA(A13_MARK, PORT32_FN1),
574 PINMUX_DATA(A14_MARK, PORT33_FN1),
575 PINMUX_DATA(A15_MARK, PORT34_FN1),
576 PINMUX_DATA(A16_MARK, PORT35_FN1),
577 PINMUX_DATA(A17_MARK, PORT36_FN1),
578 PINMUX_DATA(A18_MARK, PORT37_FN1),
579 PINMUX_DATA(A19_MARK, PORT38_FN1),
580 PINMUX_DATA(A20_MARK, PORT39_FN1),
581 PINMUX_DATA(A21_MARK, PORT40_FN1),
582 PINMUX_DATA(A22_MARK, PORT41_FN1),
583 PINMUX_DATA(A23_MARK, PORT42_FN1),
584 PINMUX_DATA(A24_MARK, PORT43_FN1),
585 PINMUX_DATA(A25_MARK, PORT44_FN1),
586 PINMUX_DATA(A26_MARK, PORT45_FN1),
587 PINMUX_DATA(D0_NAF0_MARK, PORT46_FN1),
588 PINMUX_DATA(D1_NAF1_MARK, PORT47_FN1),
589 PINMUX_DATA(D2_NAF2_MARK, PORT48_FN1),
590 PINMUX_DATA(D3_NAF3_MARK, PORT49_FN1),
591 PINMUX_DATA(D4_NAF4_MARK, PORT50_FN1),
592 PINMUX_DATA(D5_NAF5_MARK, PORT51_FN1),
593 PINMUX_DATA(D6_NAF6_MARK, PORT52_FN1),
594 PINMUX_DATA(D7_NAF7_MARK, PORT53_FN1),
595 PINMUX_DATA(D8_NAF8_MARK, PORT54_FN1),
596 PINMUX_DATA(D9_NAF9_MARK, PORT55_FN1),
597 PINMUX_DATA(D10_NAF10_MARK, PORT56_FN1),
598 PINMUX_DATA(D11_NAF11_MARK, PORT57_FN1),
599 PINMUX_DATA(D12_NAF12_MARK, PORT58_FN1),
600 PINMUX_DATA(D13_NAF13_MARK, PORT59_FN1),
601 PINMUX_DATA(D14_NAF14_MARK, PORT60_FN1),
602 PINMUX_DATA(D15_NAF15_MARK, PORT61_FN1),
603 PINMUX_DATA(CS0_MARK, PORT62_FN1),
604 PINMUX_DATA(CS2_MARK, PORT63_FN1),
605 PINMUX_DATA(CS4_MARK, PORT64_FN1),
606 PINMUX_DATA(CS5A_MARK, PORT65_FN1),
607 PINMUX_DATA(CS5B_MARK, PORT66_FN1),
608 PINMUX_DATA(CS6A_MARK, PORT67_FN1),
609 PINMUX_DATA(FCE0_MARK, PORT68_FN1),
610 PINMUX_DATA(RD_FSC_MARK, PORT69_FN1),
611 PINMUX_DATA(WE0_FWE_MARK, PORT70_FN1),
612 PINMUX_DATA(WE1_MARK, PORT71_FN1),
613 PINMUX_DATA(CKO_MARK, PORT72_FN1),
614 PINMUX_DATA(FRB_MARK, PORT73_FN1),
615 PINMUX_DATA(WAIT_MARK, PORT74_FN1),
616 PINMUX_DATA(RDWR_MARK, PORT75_FN1),
617 PINMUX_DATA(MEMC_AD0_MARK, PORT76_FN1),
618 PINMUX_DATA(MEMC_AD1_MARK, PORT77_FN1),
619 PINMUX_DATA(MEMC_AD2_MARK, PORT78_FN1),
620 PINMUX_DATA(MEMC_AD3_MARK, PORT79_FN1),
621 PINMUX_DATA(MEMC_AD4_MARK, PORT80_FN1),
622 PINMUX_DATA(MEMC_AD5_MARK, PORT81_FN1),
623 PINMUX_DATA(MEMC_AD6_MARK, PORT82_FN1),
624 PINMUX_DATA(MEMC_AD7_MARK, PORT83_FN1),
625 PINMUX_DATA(MEMC_AD8_MARK, PORT84_FN1),
626 PINMUX_DATA(MEMC_AD9_MARK, PORT85_FN1),
627 PINMUX_DATA(MEMC_AD10_MARK, PORT86_FN1),
628 PINMUX_DATA(MEMC_AD11_MARK, PORT87_FN1),
629 PINMUX_DATA(MEMC_AD12_MARK, PORT88_FN1),
630 PINMUX_DATA(MEMC_AD13_MARK, PORT89_FN1),
631 PINMUX_DATA(MEMC_AD14_MARK, PORT90_FN1),
632 PINMUX_DATA(MEMC_AD15_MARK, PORT91_FN1),
633 PINMUX_DATA(MEMC_CS0_MARK, PORT92_FN1),
634 PINMUX_DATA(MEMC_BUSCLK_MEMC_A0_MARK, PORT93_FN1),
635 PINMUX_DATA(MEMC_CS1_MEMC_A1_MARK, PORT94_FN1),
636 PINMUX_DATA(MEMC_ADV_MEMC_DREQ0_MARK, PORT95_FN1),
637 PINMUX_DATA(MEMC_WAIT_MEMC_DREQ1_MARK, PORT96_FN1),
638 PINMUX_DATA(MEMC_NOE_MARK, PORT97_FN1),
639 PINMUX_DATA(MEMC_NWE_MARK, PORT98_FN1),
640 PINMUX_DATA(MEMC_INT_MARK, PORT99_FN1),
641 PINMUX_DATA(VIO_VD_MARK, PORT100_FN1),
642 PINMUX_DATA(VIO_HD_MARK, PORT101_FN1),
643 PINMUX_DATA(VIO_D0_MARK, PORT102_FN1),
644 PINMUX_DATA(VIO_D1_MARK, PORT103_FN1),
645 PINMUX_DATA(VIO_D2_MARK, PORT104_FN1),
646 PINMUX_DATA(VIO_D3_MARK, PORT105_FN1),
647 PINMUX_DATA(VIO_D4_MARK, PORT106_FN1),
648 PINMUX_DATA(VIO_D5_MARK, PORT107_FN1),
649 PINMUX_DATA(VIO_D6_MARK, PORT108_FN1),
650 PINMUX_DATA(VIO_D7_MARK, PORT109_FN1),
651 PINMUX_DATA(VIO_D8_MARK, PORT110_FN1),
652 PINMUX_DATA(VIO_D9_MARK, PORT111_FN1),
653 PINMUX_DATA(VIO_D10_MARK, PORT112_FN1),
654 PINMUX_DATA(VIO_D11_MARK, PORT113_FN1),
655 PINMUX_DATA(VIO_D12_MARK, PORT114_FN1),
656 PINMUX_DATA(VIO_D13_MARK, PORT115_FN1),
657 PINMUX_DATA(VIO_D14_MARK, PORT116_FN1),
658 PINMUX_DATA(VIO_D15_MARK, PORT117_FN1),
659 PINMUX_DATA(VIO_CLK_MARK, PORT118_FN1),
660 PINMUX_DATA(VIO_FIELD_MARK, PORT119_FN1),
661 PINMUX_DATA(VIO_CKO_MARK, PORT120_FN1),
662 PINMUX_DATA(LCDD0_MARK, PORT121_FN1),
663 PINMUX_DATA(LCDD1_MARK, PORT122_FN1),
664 PINMUX_DATA(LCDD2_MARK, PORT123_FN1),
665 PINMUX_DATA(LCDD3_MARK, PORT124_FN1),
666 PINMUX_DATA(LCDD4_MARK, PORT125_FN1),
667 PINMUX_DATA(LCDD5_MARK, PORT126_FN1),
668 PINMUX_DATA(LCDD6_MARK, PORT127_FN1),
669 PINMUX_DATA(LCDD7_MARK, PORT128_FN1),
670 PINMUX_DATA(LCDD8_MARK, PORT129_FN1),
671 PINMUX_DATA(LCDD9_MARK, PORT130_FN1),
672 PINMUX_DATA(LCDD10_MARK, PORT131_FN1),
673 PINMUX_DATA(LCDD11_MARK, PORT132_FN1),
674 PINMUX_DATA(LCDD12_MARK, PORT133_FN1),
675 PINMUX_DATA(LCDD13_MARK, PORT134_FN1),
676 PINMUX_DATA(LCDD14_MARK, PORT135_FN1),
677 PINMUX_DATA(LCDD15_MARK, PORT136_FN1),
678 PINMUX_DATA(LCDD16_MARK, PORT137_FN1),
679 PINMUX_DATA(LCDD17_MARK, PORT138_FN1),
680 PINMUX_DATA(LCDD18_MARK, PORT139_FN1),
681 PINMUX_DATA(LCDD19_MARK, PORT140_FN1),
682 PINMUX_DATA(LCDD20_MARK, PORT141_FN1),
683 PINMUX_DATA(LCDD21_MARK, PORT142_FN1),
684 PINMUX_DATA(LCDD22_MARK, PORT143_FN1),
685 PINMUX_DATA(LCDD23_MARK, PORT144_FN1),
686 PINMUX_DATA(LCDHSYN_MARK, PORT145_FN1),
687 PINMUX_DATA(LCDVSYN_MARK, PORT146_FN1),
688 PINMUX_DATA(LCDDCK_MARK, PORT147_FN1),
689 PINMUX_DATA(LCDRD_MARK, PORT148_FN1),
690 PINMUX_DATA(LCDDISP_MARK, PORT149_FN1),
691 PINMUX_DATA(LCDLCLK_MARK, PORT150_FN1),
692 PINMUX_DATA(LCDDON_MARK, PORT151_FN1),
693 PINMUX_DATA(SCIFA0_TXD_MARK, PORT152_FN1),
694 PINMUX_DATA(SCIFA0_RXD_MARK, PORT153_FN1),
695 PINMUX_DATA(SCIFA1_TXD_MARK, PORT154_FN1),
696 PINMUX_DATA(SCIFA1_RXD_MARK, PORT155_FN1),
697 PINMUX_DATA(TS_SPSYNC1_MARK, PORT156_FN1),
698 PINMUX_DATA(TS_SDAT1_MARK, PORT157_FN1),
699 PINMUX_DATA(TS_SDEN1_MARK, PORT158_FN1),
700 PINMUX_DATA(TS_SCK1_MARK, PORT159_FN1),
701 PINMUX_DATA(TPU0TO0_MARK, PORT160_FN1),
702 PINMUX_DATA(TPU0TO1_MARK, PORT161_FN1),
703 PINMUX_DATA(SCIFB_SCK_MARK, PORT162_FN1),
704 PINMUX_DATA(SCIFB_RTS_MARK, PORT163_FN1),
705 PINMUX_DATA(SCIFB_CTS_MARK, PORT164_FN1),
706 PINMUX_DATA(SCIFB_TXD_MARK, PORT165_FN1),
707 PINMUX_DATA(SCIFB_RXD_MARK, PORT166_FN1),
708 PINMUX_DATA(VBUS0_0_MARK, PORT167_FN1),
709 PINMUX_DATA(VBUS0_1_MARK, PORT168_FN1),
710 PINMUX_DATA(HDMI_HPD_MARK, PORT169_FN1),
711 PINMUX_DATA(HDMI_CEC_MARK, PORT170_FN1),
712 PINMUX_DATA(SDHICLK0_MARK, PORT171_FN1),
713 PINMUX_DATA(SDHICD0_MARK, PORT172_FN1),
714 PINMUX_DATA(SDHID0_0_MARK, PORT173_FN1),
715 PINMUX_DATA(SDHID0_1_MARK, PORT174_FN1),
716 PINMUX_DATA(SDHID0_2_MARK, PORT175_FN1),
717 PINMUX_DATA(SDHID0_3_MARK, PORT176_FN1),
718 PINMUX_DATA(SDHICMD0_MARK, PORT177_FN1),
719 PINMUX_DATA(SDHIWP0_MARK, PORT178_FN1),
720 PINMUX_DATA(SDHICLK1_MARK, PORT179_FN1),
721 PINMUX_DATA(SDHID1_0_MARK, PORT180_FN1),
722 PINMUX_DATA(SDHID1_1_MARK, PORT181_FN1),
723 PINMUX_DATA(SDHID1_2_MARK, PORT182_FN1),
724 PINMUX_DATA(SDHID1_3_MARK, PORT183_FN1),
725 PINMUX_DATA(SDHICMD1_MARK, PORT184_FN1),
726 PINMUX_DATA(SDHICLK2_MARK, PORT185_FN1),
727 PINMUX_DATA(SDHID2_0_MARK, PORT186_FN1),
728 PINMUX_DATA(SDHID2_1_MARK, PORT187_FN1),
729 PINMUX_DATA(SDHID2_2_MARK, PORT188_FN1),
730 PINMUX_DATA(SDHID2_3_MARK, PORT189_FN1),
731 PINMUX_DATA(SDHICMD2_MARK, PORT190_FN1),
732
733 /* Function 2 */
734 PINMUX_DATA(FSIBCK_MARK, PORT4_FN2),
735 PINMUX_DATA(SCIFA4_RXD_MARK, PORT5_FN2),
736 PINMUX_DATA(SCIFA4_TXD_MARK, PORT6_FN2),
737 PINMUX_DATA(SCIFA5_RXD_MARK, PORT8_FN2),
738 PINMUX_DATA(FSIASPDIF_11_MARK, PORT11_FN2),
739 PINMUX_DATA(SCIFA5_TXD_MARK, PORT12_FN2),
740 PINMUX_DATA(FMSIOLR_MARK, PORT13_FN2),
741 PINMUX_DATA(FMSIOBT_MARK, PORT14_FN2),
742 PINMUX_DATA(FSIASPDIF_15_MARK, PORT15_FN2),
743 PINMUX_DATA(FMSIILR_MARK, PORT16_FN2),
744 PINMUX_DATA(FMSIIBT_MARK, PORT17_FN2),
745 PINMUX_DATA(BS_MARK, PORT19_FN2),
746 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT36_FN2),
747 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT37_FN2),
748 PINMUX_DATA(MSIOF0_RXD_MARK, PORT38_FN2),
749 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT39_FN2),
750 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT40_FN2),
751 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT41_FN2),
752 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT42_FN2),
753 PINMUX_DATA(MSIOF0_SS1_MARK, PORT43_FN2),
754 PINMUX_DATA(MSIOF0_SS2_MARK, PORT44_FN2),
755 PINMUX_DATA(MSIOF0_TXD_MARK, PORT45_FN2),
756 PINMUX_DATA(FMSICK_MARK, PORT65_FN2),
757 PINMUX_DATA(FCE1_MARK, PORT66_FN2),
758 PINMUX_DATA(BBIF1_RXD_MARK, PORT76_FN2),
759 PINMUX_DATA(BBIF1_TSYNC_MARK, PORT77_FN2),
760 PINMUX_DATA(BBIF1_TSCK_MARK, PORT78_FN2),
761 PINMUX_DATA(BBIF1_TXD_MARK, PORT79_FN2),
762 PINMUX_DATA(BBIF1_RSCK_MARK, PORT80_FN2),
763 PINMUX_DATA(BBIF1_RSYNC_MARK, PORT81_FN2),
764 PINMUX_DATA(BBIF1_FLOW_MARK, PORT82_FN2),
765 PINMUX_DATA(BB_RX_FLOW_N_MARK, PORT83_FN2),
766 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT84_FN2),
767 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT85_FN2),
768 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT86_FN2),
769 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT87_FN2),
770 PINMUX_DATA(MSIOF1_TSCK_88_MARK, PORT88_FN2, MSEL4CR_10_1),
771 PINMUX_DATA(MSIOF1_TSYNC_89_MARK, PORT89_FN2, MSEL4CR_10_1),
772 PINMUX_DATA(MSIOF1_TXD_90_MARK, PORT90_FN2, MSEL4CR_10_1),
773 PINMUX_DATA(MSIOF1_RXD_91_MARK, PORT91_FN2, MSEL4CR_10_1),
774 PINMUX_DATA(MSIOF1_SS1_92_MARK, PORT92_FN2, MSEL4CR_10_1),
775 PINMUX_DATA(MSIOF1_SS2_93_MARK, PORT93_FN2, MSEL4CR_10_1),
776 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT94_FN2),
777 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT95_FN2),
778 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT96_FN2),
779 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT97_FN2),
780 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT98_FN2),
781 PINMUX_DATA(I2C_SCL2_MARK, PORT110_FN2),
782 PINMUX_DATA(I2C_SDA2_MARK, PORT111_FN2),
783 PINMUX_DATA(I2C_SCL3_MARK, PORT114_FN2, MSEL4CR_16_1),
784 PINMUX_DATA(I2C_SDA3_MARK, PORT115_FN2, MSEL4CR_16_1),
785 PINMUX_DATA(I2C_SCL4_MARK, PORT116_FN2, MSEL4CR_17_1),
786 PINMUX_DATA(I2C_SDA4_MARK, PORT117_FN2, MSEL4CR_17_1),
787 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT134_FN2),
788 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT135_FN2),
789 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT136_FN2),
790 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT137_FN2),
791 PINMUX_DATA(MSIOF2_SS1_MARK, PORT138_FN2),
792 PINMUX_DATA(MSIOF2_SS2_MARK, PORT139_FN2),
793 PINMUX_DATA(SCIFA3_CTS_140_MARK, PORT140_FN2, MSEL3CR_9_1),
794 PINMUX_DATA(SCIFA3_RTS_141_MARK, PORT141_FN2),
795 PINMUX_DATA(SCIFA3_SCK_MARK, PORT142_FN2),
796 PINMUX_DATA(SCIFA3_TXD_MARK, PORT143_FN2),
797 PINMUX_DATA(SCIFA3_RXD_MARK, PORT144_FN2),
798 PINMUX_DATA(MSIOF2_TSYNC_MARK, PORT148_FN2),
799 PINMUX_DATA(MSIOF2_TSCK_MARK, PORT149_FN2),
800 PINMUX_DATA(MSIOF2_RXD_MARK, PORT150_FN2),
801 PINMUX_DATA(MSIOF2_TXD_MARK, PORT151_FN2),
802 PINMUX_DATA(SCIFA0_SCK_MARK, PORT156_FN2),
803 PINMUX_DATA(SCIFA0_RTS_MARK, PORT157_FN2),
804 PINMUX_DATA(SCIFA0_CTS_MARK, PORT158_FN2),
805 PINMUX_DATA(SCIFA1_SCK_MARK, PORT159_FN2),
806 PINMUX_DATA(SCIFA1_RTS_MARK, PORT160_FN2),
807 PINMUX_DATA(SCIFA1_CTS_MARK, PORT161_FN2),
808
809 /* Function 3 */
810 PINMUX_DATA(VIO_CKO1_MARK, PORT16_FN3),
811 PINMUX_DATA(VIO_CKO2_MARK, PORT17_FN3),
812 PINMUX_DATA(IDIN_1_18_MARK, PORT18_FN3, MSEL4CR_14_1),
813 PINMUX_DATA(MSIOF1_TSCK_39_MARK, PORT39_FN3, MSEL4CR_10_0),
814 PINMUX_DATA(MSIOF1_TSYNC_40_MARK, PORT40_FN3, MSEL4CR_10_0),
815 PINMUX_DATA(MSIOF1_TXD_41_MARK, PORT41_FN3, MSEL4CR_10_0),
816 PINMUX_DATA(MSIOF1_RXD_42_MARK, PORT42_FN3, MSEL4CR_10_0),
817 PINMUX_DATA(MSIOF1_SS1_43_MARK, PORT43_FN3, MSEL4CR_10_0),
818 PINMUX_DATA(MSIOF1_SS2_44_MARK, PORT44_FN3, MSEL4CR_10_0),
819 PINMUX_DATA(MMCD1_0_MARK, PORT54_FN3, MSEL4CR_15_1),
820 PINMUX_DATA(MMCD1_1_MARK, PORT55_FN3, MSEL4CR_15_1),
821 PINMUX_DATA(MMCD1_2_MARK, PORT56_FN3, MSEL4CR_15_1),
822 PINMUX_DATA(MMCD1_3_MARK, PORT57_FN3, MSEL4CR_15_1),
823 PINMUX_DATA(MMCD1_4_MARK, PORT58_FN3, MSEL4CR_15_1),
824 PINMUX_DATA(MMCD1_5_MARK, PORT59_FN3, MSEL4CR_15_1),
825 PINMUX_DATA(MMCD1_6_MARK, PORT60_FN3, MSEL4CR_15_1),
826 PINMUX_DATA(MMCD1_7_MARK, PORT61_FN3, MSEL4CR_15_1),
827 PINMUX_DATA(VINT_I_MARK, PORT65_FN3),
828 PINMUX_DATA(MMCCLK1_MARK, PORT66_FN3, MSEL4CR_15_1),
829 PINMUX_DATA(MMCCMD1_MARK, PORT67_FN3, MSEL4CR_15_1),
830 PINMUX_DATA(TPU0TO2_93_MARK, PORT93_FN3),
831 PINMUX_DATA(TPU0TO2_99_MARK, PORT99_FN3),
832 PINMUX_DATA(TPU0TO3_MARK, PORT112_FN3),
833 PINMUX_DATA(IDIN_0_MARK, PORT113_FN3),
834 PINMUX_DATA(EXTLP_0_MARK, PORT114_FN3),
835 PINMUX_DATA(OVCN2_0_MARK, PORT115_FN3),
836 PINMUX_DATA(PWEN_0_MARK, PORT116_FN3),
837 PINMUX_DATA(OVCN_0_MARK, PORT117_FN3),
838 PINMUX_DATA(KEYOUT7_MARK, PORT121_FN3),
839 PINMUX_DATA(KEYOUT6_MARK, PORT122_FN3),
840 PINMUX_DATA(KEYOUT5_MARK, PORT123_FN3),
841 PINMUX_DATA(KEYOUT4_MARK, PORT124_FN3),
842 PINMUX_DATA(KEYOUT3_MARK, PORT125_FN3),
843 PINMUX_DATA(KEYOUT2_MARK, PORT126_FN3),
844 PINMUX_DATA(KEYOUT1_MARK, PORT127_FN3),
845 PINMUX_DATA(KEYOUT0_MARK, PORT128_FN3),
846 PINMUX_DATA(KEYIN7_MARK, PORT129_FN3),
847 PINMUX_DATA(KEYIN6_MARK, PORT130_FN3),
848 PINMUX_DATA(KEYIN5_MARK, PORT131_FN3),
849 PINMUX_DATA(KEYIN4_MARK, PORT132_FN3),
850 PINMUX_DATA(KEYIN3_133_MARK, PORT133_FN3, MSEL4CR_18_0),
851 PINMUX_DATA(KEYIN2_134_MARK, PORT134_FN3, MSEL4CR_18_0),
852 PINMUX_DATA(KEYIN1_135_MARK, PORT135_FN3, MSEL4CR_18_0),
853 PINMUX_DATA(KEYIN0_136_MARK, PORT136_FN3, MSEL4CR_18_0),
854 PINMUX_DATA(TS_SPSYNC2_MARK, PORT137_FN3),
855 PINMUX_DATA(IROUT_139_MARK, PORT139_FN3),
856 PINMUX_DATA(IRDA_OUT_MARK, PORT140_FN3),
857 PINMUX_DATA(IRDA_IN_MARK, PORT141_FN3),
858 PINMUX_DATA(IRDA_FIRSEL_MARK, PORT142_FN3),
859 PINMUX_DATA(TS_SDAT2_MARK, PORT145_FN3),
860 PINMUX_DATA(TS_SDEN2_MARK, PORT146_FN3),
861 PINMUX_DATA(TS_SCK2_MARK, PORT147_FN3),
862
863 /* Function 4 */
864 PINMUX_DATA(SCIFA3_CTS_43_MARK, PORT43_FN4, MSEL3CR_9_0),
865 PINMUX_DATA(SCIFA3_RTS_44_MARK, PORT44_FN4),
866 PINMUX_DATA(GP_RX_FLAG_MARK, PORT76_FN4),
867 PINMUX_DATA(GP_RX_DATA_MARK, PORT77_FN4),
868 PINMUX_DATA(GP_TX_READY_MARK, PORT78_FN4),
869 PINMUX_DATA(GP_RX_WAKE_MARK, PORT79_FN4),
870 PINMUX_DATA(MP_TX_FLAG_MARK, PORT80_FN4),
871 PINMUX_DATA(MP_TX_DATA_MARK, PORT81_FN4),
872 PINMUX_DATA(MP_RX_READY_MARK, PORT82_FN4),
873 PINMUX_DATA(MP_TX_WAKE_MARK, PORT83_FN4),
874 PINMUX_DATA(MMCD0_0_MARK, PORT84_FN4, MSEL4CR_15_0),
875 PINMUX_DATA(MMCD0_1_MARK, PORT85_FN4, MSEL4CR_15_0),
876 PINMUX_DATA(MMCD0_2_MARK, PORT86_FN4, MSEL4CR_15_0),
877 PINMUX_DATA(MMCD0_3_MARK, PORT87_FN4, MSEL4CR_15_0),
878 PINMUX_DATA(MMCD0_4_MARK, PORT88_FN4, MSEL4CR_15_0),
879 PINMUX_DATA(MMCD0_5_MARK, PORT89_FN4, MSEL4CR_15_0),
880 PINMUX_DATA(MMCD0_6_MARK, PORT90_FN4, MSEL4CR_15_0),
881 PINMUX_DATA(MMCD0_7_MARK, PORT91_FN4, MSEL4CR_15_0),
882 PINMUX_DATA(MMCCMD0_MARK, PORT92_FN4, MSEL4CR_15_0),
883 PINMUX_DATA(SIM_RST_MARK, PORT94_FN4),
884 PINMUX_DATA(SIM_CLK_MARK, PORT95_FN4),
885 PINMUX_DATA(SIM_D_MARK, PORT98_FN4),
886 PINMUX_DATA(MMCCLK0_MARK, PORT99_FN4, MSEL4CR_15_0),
887 PINMUX_DATA(IDIN_1_113_MARK, PORT113_FN4, MSEL4CR_14_0),
888 PINMUX_DATA(OVCN_1_114_MARK, PORT114_FN4, MSEL4CR_14_0),
889 PINMUX_DATA(PWEN_1_115_MARK, PORT115_FN4),
890 PINMUX_DATA(EXTLP_1_MARK, PORT116_FN4),
891 PINMUX_DATA(OVCN2_1_MARK, PORT117_FN4),
892 PINMUX_DATA(KEYIN0_121_MARK, PORT121_FN4, MSEL4CR_18_1),
893 PINMUX_DATA(KEYIN1_122_MARK, PORT122_FN4, MSEL4CR_18_1),
894 PINMUX_DATA(KEYIN2_123_MARK, PORT123_FN4, MSEL4CR_18_1),
895 PINMUX_DATA(KEYIN3_124_MARK, PORT124_FN4, MSEL4CR_18_1),
896 PINMUX_DATA(PWEN_1_138_MARK, PORT138_FN4),
897 PINMUX_DATA(IROUT_140_MARK, PORT140_FN4),
898 PINMUX_DATA(LCDCS_MARK, PORT145_FN4),
899 PINMUX_DATA(LCDWR_MARK, PORT147_FN4),
900 PINMUX_DATA(LCDRS_MARK, PORT149_FN4),
901 PINMUX_DATA(OVCN_1_162_MARK, PORT162_FN4, MSEL4CR_14_1),
902
903 /* Function 5 */
904 PINMUX_DATA(GPI0_MARK, PORT41_FN5),
905 PINMUX_DATA(GPI1_MARK, PORT42_FN5),
906 PINMUX_DATA(GPO0_MARK, PORT43_FN5),
907 PINMUX_DATA(GPO1_MARK, PORT44_FN5),
908 PINMUX_DATA(I2C_SCL3S_MARK, PORT137_FN5, MSEL4CR_16_0),
909 PINMUX_DATA(I2C_SDA3S_MARK, PORT145_FN5, MSEL4CR_16_0),
910 PINMUX_DATA(I2C_SCL4S_MARK, PORT146_FN5, MSEL4CR_17_0),
911 PINMUX_DATA(I2C_SDA4S_MARK, PORT147_FN5, MSEL4CR_17_0),
912
913 /* Function select */
914 PINMUX_DATA(LCDC0_SELECT_MARK, MSEL3CR_6_0),
915 PINMUX_DATA(LCDC1_SELECT_MARK, MSEL3CR_6_1),
916
917 PINMUX_DATA(TS0_1SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_0),
918 PINMUX_DATA(TS0_2SELECT_MARK, MSEL3CR_21_0, MSEL3CR_20_1),
919 PINMUX_DATA(TS1_1SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_0),
920 PINMUX_DATA(TS1_2SELECT_MARK, MSEL3CR_27_0, MSEL3CR_26_1),
921
922 PINMUX_DATA(SDENC_CPG_MARK, MSEL4CR_19_0),
923 PINMUX_DATA(SDENC_DV_CLKI_MARK, MSEL4CR_19_1),
924
925 PINMUX_DATA(MFIv6_MARK, MSEL4CR_6_0),
926 PINMUX_DATA(MFIv4_MARK, MSEL4CR_6_1),
927};
928
929#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
930#define GPIO_PORT_ALL() _190(_GPIO_PORT, , unused)
931#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
932
933static struct pinmux_gpio pinmux_gpios[] = {
934
935 /* PORT */
936 GPIO_PORT_ALL(),
937
938 /* IRQ */
939 GPIO_FN(IRQ0_6), GPIO_FN(IRQ0_162), GPIO_FN(IRQ1),
940 GPIO_FN(IRQ2_4), GPIO_FN(IRQ2_5), GPIO_FN(IRQ3_8),
941 GPIO_FN(IRQ3_16), GPIO_FN(IRQ4_17), GPIO_FN(IRQ4_163),
942 GPIO_FN(IRQ5), GPIO_FN(IRQ6_39), GPIO_FN(IRQ6_164),
943 GPIO_FN(IRQ7_40), GPIO_FN(IRQ7_167), GPIO_FN(IRQ8_41),
944 GPIO_FN(IRQ8_168), GPIO_FN(IRQ9_42), GPIO_FN(IRQ9_169),
945 GPIO_FN(IRQ10), GPIO_FN(IRQ11), GPIO_FN(IRQ12_80),
946 GPIO_FN(IRQ12_137), GPIO_FN(IRQ13_81), GPIO_FN(IRQ13_145),
947 GPIO_FN(IRQ14_82), GPIO_FN(IRQ14_146), GPIO_FN(IRQ15_83),
948 GPIO_FN(IRQ15_147), GPIO_FN(IRQ16_84), GPIO_FN(IRQ16_170),
949 GPIO_FN(IRQ17), GPIO_FN(IRQ18), GPIO_FN(IRQ19),
950 GPIO_FN(IRQ20), GPIO_FN(IRQ21), GPIO_FN(IRQ22),
951 GPIO_FN(IRQ23), GPIO_FN(IRQ24), GPIO_FN(IRQ25),
952 GPIO_FN(IRQ26_121), GPIO_FN(IRQ26_172), GPIO_FN(IRQ27_122),
953 GPIO_FN(IRQ27_180), GPIO_FN(IRQ28_123), GPIO_FN(IRQ28_181),
954 GPIO_FN(IRQ29_129), GPIO_FN(IRQ29_182), GPIO_FN(IRQ30_130),
955 GPIO_FN(IRQ30_183), GPIO_FN(IRQ31_138), GPIO_FN(IRQ31_184),
956
957 /* MSIOF0 */
958 GPIO_FN(MSIOF0_TSYNC), GPIO_FN(MSIOF0_TSCK), GPIO_FN(MSIOF0_RXD),
959 GPIO_FN(MSIOF0_RSCK), GPIO_FN(MSIOF0_RSYNC), GPIO_FN(MSIOF0_MCK0),
960 GPIO_FN(MSIOF0_MCK1), GPIO_FN(MSIOF0_SS1), GPIO_FN(MSIOF0_SS2),
961 GPIO_FN(MSIOF0_TXD),
962
963 /* MSIOF1 */
964 GPIO_FN(MSIOF1_TSCK_39), GPIO_FN(MSIOF1_TSCK_88),
965 GPIO_FN(MSIOF1_TSYNC_40), GPIO_FN(MSIOF1_TSYNC_89),
966 GPIO_FN(MSIOF1_TXD_41), GPIO_FN(MSIOF1_TXD_90),
967 GPIO_FN(MSIOF1_RXD_42), GPIO_FN(MSIOF1_RXD_91),
968 GPIO_FN(MSIOF1_SS1_43), GPIO_FN(MSIOF1_SS1_92),
969 GPIO_FN(MSIOF1_SS2_44), GPIO_FN(MSIOF1_SS2_93),
970 GPIO_FN(MSIOF1_RSCK), GPIO_FN(MSIOF1_RSYNC),
971 GPIO_FN(MSIOF1_MCK0), GPIO_FN(MSIOF1_MCK1),
972
973 /* MSIOF2 */
974 GPIO_FN(MSIOF2_RSCK), GPIO_FN(MSIOF2_RSYNC), GPIO_FN(MSIOF2_MCK0),
975 GPIO_FN(MSIOF2_MCK1), GPIO_FN(MSIOF2_SS1), GPIO_FN(MSIOF2_SS2),
976 GPIO_FN(MSIOF2_TSYNC), GPIO_FN(MSIOF2_TSCK), GPIO_FN(MSIOF2_RXD),
977 GPIO_FN(MSIOF2_TXD),
978
979 /* MSIOF3 */
980 GPIO_FN(BBIF1_RXD), GPIO_FN(BBIF1_TSYNC), GPIO_FN(BBIF1_TSCK),
981 GPIO_FN(BBIF1_TXD), GPIO_FN(BBIF1_RSCK), GPIO_FN(BBIF1_RSYNC),
982 GPIO_FN(BBIF1_FLOW), GPIO_FN(BB_RX_FLOW_N),
983
984 /* MSIOF4 */
985 GPIO_FN(BBIF2_TSCK1), GPIO_FN(BBIF2_TSYNC1),
986 GPIO_FN(BBIF2_TXD1), GPIO_FN(BBIF2_RXD),
987
988 /* FSI */
989 GPIO_FN(FSIACK), GPIO_FN(FSIBCK), GPIO_FN(FSIAILR),
990 GPIO_FN(FSIAIBT), GPIO_FN(FSIAISLD), GPIO_FN(FSIAOMC),
991 GPIO_FN(FSIAOLR), GPIO_FN(FSIAOBT), GPIO_FN(FSIAOSLD),
992 GPIO_FN(FSIASPDIF_11), GPIO_FN(FSIASPDIF_15),
993
994 /* FMSI */
995 GPIO_FN(FMSOCK), GPIO_FN(FMSOOLR), GPIO_FN(FMSIOLR),
996 GPIO_FN(FMSOOBT), GPIO_FN(FMSIOBT), GPIO_FN(FMSOSLD),
997 GPIO_FN(FMSOILR), GPIO_FN(FMSIILR), GPIO_FN(FMSOIBT),
998 GPIO_FN(FMSIIBT), GPIO_FN(FMSISLD), GPIO_FN(FMSICK),
999
1000 /* SCIFA0 */
1001 GPIO_FN(SCIFA0_TXD), GPIO_FN(SCIFA0_RXD), GPIO_FN(SCIFA0_SCK),
1002 GPIO_FN(SCIFA0_RTS), GPIO_FN(SCIFA0_CTS),
1003
1004 /* SCIFA1 */
1005 GPIO_FN(SCIFA1_TXD), GPIO_FN(SCIFA1_RXD), GPIO_FN(SCIFA1_SCK),
1006 GPIO_FN(SCIFA1_RTS), GPIO_FN(SCIFA1_CTS),
1007
1008 /* SCIFA2 */
1009 GPIO_FN(SCIFA2_CTS1), GPIO_FN(SCIFA2_RTS1), GPIO_FN(SCIFA2_TXD1),
1010 GPIO_FN(SCIFA2_RXD1), GPIO_FN(SCIFA2_SCK1),
1011
1012 /* SCIFA3 */
1013 GPIO_FN(SCIFA3_CTS_43), GPIO_FN(SCIFA3_CTS_140),
1014 GPIO_FN(SCIFA3_RTS_44), GPIO_FN(SCIFA3_RTS_141),
1015 GPIO_FN(SCIFA3_SCK), GPIO_FN(SCIFA3_TXD),
1016 GPIO_FN(SCIFA3_RXD),
1017
1018 /* SCIFA4 */
1019 GPIO_FN(SCIFA4_RXD), GPIO_FN(SCIFA4_TXD),
1020
1021 /* SCIFA5 */
1022 GPIO_FN(SCIFA5_RXD), GPIO_FN(SCIFA5_TXD),
1023
1024 /* SCIFB */
1025 GPIO_FN(SCIFB_SCK), GPIO_FN(SCIFB_RTS), GPIO_FN(SCIFB_CTS),
1026 GPIO_FN(SCIFB_TXD), GPIO_FN(SCIFB_RXD),
1027
1028 /* CEU */
1029 GPIO_FN(VIO_HD), GPIO_FN(VIO_CKO1), GPIO_FN(VIO_CKO2),
1030 GPIO_FN(VIO_VD), GPIO_FN(VIO_CLK), GPIO_FN(VIO_FIELD),
1031 GPIO_FN(VIO_CKO), GPIO_FN(VIO_D0), GPIO_FN(VIO_D1),
1032 GPIO_FN(VIO_D2), GPIO_FN(VIO_D3), GPIO_FN(VIO_D4),
1033 GPIO_FN(VIO_D5), GPIO_FN(VIO_D6), GPIO_FN(VIO_D7),
1034 GPIO_FN(VIO_D8), GPIO_FN(VIO_D9), GPIO_FN(VIO_D10),
1035 GPIO_FN(VIO_D11), GPIO_FN(VIO_D12), GPIO_FN(VIO_D13),
1036 GPIO_FN(VIO_D14), GPIO_FN(VIO_D15),
1037
1038 /* USB0 */
1039 GPIO_FN(IDIN_0), GPIO_FN(EXTLP_0), GPIO_FN(OVCN2_0),
1040 GPIO_FN(PWEN_0), GPIO_FN(OVCN_0), GPIO_FN(VBUS0_0),
1041
1042 /* USB1 */
1043 GPIO_FN(IDIN_1_18), GPIO_FN(IDIN_1_113),
1044 GPIO_FN(OVCN_1_114), GPIO_FN(OVCN_1_162),
1045 GPIO_FN(PWEN_1_115), GPIO_FN(PWEN_1_138),
1046 GPIO_FN(EXTLP_1), GPIO_FN(OVCN2_1),
1047 GPIO_FN(VBUS0_1),
1048
1049 /* GPIO */
1050 GPIO_FN(GPI0), GPIO_FN(GPI1), GPIO_FN(GPO0), GPIO_FN(GPO1),
1051
1052 /* BSC */
1053 GPIO_FN(BS), GPIO_FN(WE1), GPIO_FN(CKO),
1054 GPIO_FN(WAIT), GPIO_FN(RDWR),
1055
1056 GPIO_FN(A0), GPIO_FN(A1), GPIO_FN(A2),
1057 GPIO_FN(A3), GPIO_FN(A6), GPIO_FN(A7),
1058 GPIO_FN(A8), GPIO_FN(A9), GPIO_FN(A10),
1059 GPIO_FN(A11), GPIO_FN(A12), GPIO_FN(A13),
1060 GPIO_FN(A14), GPIO_FN(A15), GPIO_FN(A16),
1061 GPIO_FN(A17), GPIO_FN(A18), GPIO_FN(A19),
1062 GPIO_FN(A20), GPIO_FN(A21), GPIO_FN(A22),
1063 GPIO_FN(A23), GPIO_FN(A24), GPIO_FN(A25),
1064 GPIO_FN(A26),
1065
1066 GPIO_FN(CS0), GPIO_FN(CS2), GPIO_FN(CS4),
1067 GPIO_FN(CS5A), GPIO_FN(CS5B), GPIO_FN(CS6A),
1068
1069 /* BSC/FLCTL */
1070 GPIO_FN(RD_FSC), GPIO_FN(WE0_FWE), GPIO_FN(A4_FOE),
1071 GPIO_FN(A5_FCDE), GPIO_FN(D0_NAF0), GPIO_FN(D1_NAF1),
1072 GPIO_FN(D2_NAF2), GPIO_FN(D3_NAF3), GPIO_FN(D4_NAF4),
1073 GPIO_FN(D5_NAF5), GPIO_FN(D6_NAF6), GPIO_FN(D7_NAF7),
1074 GPIO_FN(D8_NAF8), GPIO_FN(D9_NAF9), GPIO_FN(D10_NAF10),
1075 GPIO_FN(D11_NAF11), GPIO_FN(D12_NAF12), GPIO_FN(D13_NAF13),
1076 GPIO_FN(D14_NAF14), GPIO_FN(D15_NAF15),
1077
1078 /* MMCIF(1) */
1079 GPIO_FN(MMCD0_0), GPIO_FN(MMCD0_1), GPIO_FN(MMCD0_2),
1080 GPIO_FN(MMCD0_3), GPIO_FN(MMCD0_4), GPIO_FN(MMCD0_5),
1081 GPIO_FN(MMCD0_6), GPIO_FN(MMCD0_7), GPIO_FN(MMCCMD0),
1082 GPIO_FN(MMCCLK0),
1083
1084 /* MMCIF(2) */
1085 GPIO_FN(MMCD1_0), GPIO_FN(MMCD1_1), GPIO_FN(MMCD1_2),
1086 GPIO_FN(MMCD1_3), GPIO_FN(MMCD1_4), GPIO_FN(MMCD1_5),
1087 GPIO_FN(MMCD1_6), GPIO_FN(MMCD1_7), GPIO_FN(MMCCLK1),
1088 GPIO_FN(MMCCMD1),
1089
1090 /* SPU2 */
1091 GPIO_FN(VINT_I),
1092
1093 /* FLCTL */
1094 GPIO_FN(FCE1), GPIO_FN(FCE0), GPIO_FN(FRB),
1095
1096 /* HSI */
1097 GPIO_FN(GP_RX_FLAG), GPIO_FN(GP_RX_DATA), GPIO_FN(GP_TX_READY),
1098 GPIO_FN(GP_RX_WAKE), GPIO_FN(MP_TX_FLAG), GPIO_FN(MP_TX_DATA),
1099 GPIO_FN(MP_RX_READY), GPIO_FN(MP_TX_WAKE),
1100
1101 /* MFI */
1102 GPIO_FN(MFIv6),
1103 GPIO_FN(MFIv4),
1104
1105 GPIO_FN(MEMC_BUSCLK_MEMC_A0), GPIO_FN(MEMC_ADV_MEMC_DREQ0),
1106 GPIO_FN(MEMC_WAIT_MEMC_DREQ1), GPIO_FN(MEMC_CS1_MEMC_A1),
1107 GPIO_FN(MEMC_CS0), GPIO_FN(MEMC_NOE),
1108 GPIO_FN(MEMC_NWE), GPIO_FN(MEMC_INT),
1109
1110 GPIO_FN(MEMC_AD0), GPIO_FN(MEMC_AD1), GPIO_FN(MEMC_AD2),
1111 GPIO_FN(MEMC_AD3), GPIO_FN(MEMC_AD4), GPIO_FN(MEMC_AD5),
1112 GPIO_FN(MEMC_AD6), GPIO_FN(MEMC_AD7), GPIO_FN(MEMC_AD8),
1113 GPIO_FN(MEMC_AD9), GPIO_FN(MEMC_AD10), GPIO_FN(MEMC_AD11),
1114 GPIO_FN(MEMC_AD12), GPIO_FN(MEMC_AD13), GPIO_FN(MEMC_AD14),
1115 GPIO_FN(MEMC_AD15),
1116
1117 /* SIM */
1118 GPIO_FN(SIM_RST), GPIO_FN(SIM_CLK), GPIO_FN(SIM_D),
1119
1120 /* TPU */
1121 GPIO_FN(TPU0TO0), GPIO_FN(TPU0TO1), GPIO_FN(TPU0TO2_93),
1122 GPIO_FN(TPU0TO2_99), GPIO_FN(TPU0TO3),
1123
1124 /* I2C2 */
1125 GPIO_FN(I2C_SCL2), GPIO_FN(I2C_SDA2),
1126
1127 /* I2C3(1) */
1128 GPIO_FN(I2C_SCL3), GPIO_FN(I2C_SDA3),
1129
1130 /* I2C3(2) */
1131 GPIO_FN(I2C_SCL3S), GPIO_FN(I2C_SDA3S),
1132
1133 /* I2C4(2) */
1134 GPIO_FN(I2C_SCL4), GPIO_FN(I2C_SDA4),
1135
1136 /* I2C4(2) */
1137 GPIO_FN(I2C_SCL4S), GPIO_FN(I2C_SDA4S),
1138
1139 /* KEYSC */
1140 GPIO_FN(KEYOUT0), GPIO_FN(KEYIN0_121), GPIO_FN(KEYIN0_136),
1141 GPIO_FN(KEYOUT1), GPIO_FN(KEYIN1_122), GPIO_FN(KEYIN1_135),
1142 GPIO_FN(KEYOUT2), GPIO_FN(KEYIN2_123), GPIO_FN(KEYIN2_134),
1143 GPIO_FN(KEYOUT3), GPIO_FN(KEYIN3_124), GPIO_FN(KEYIN3_133),
1144 GPIO_FN(KEYOUT4), GPIO_FN(KEYIN4), GPIO_FN(KEYOUT5),
1145 GPIO_FN(KEYIN5), GPIO_FN(KEYOUT6), GPIO_FN(KEYIN6),
1146 GPIO_FN(KEYOUT7), GPIO_FN(KEYIN7),
1147
1148 /* LCDC */
1149 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDVSYN),
1150 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(LCDRD),
1151 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(LCDLCLK),
1152 GPIO_FN(LCDDON),
1153
1154 GPIO_FN(LCDD0), GPIO_FN(LCDD1), GPIO_FN(LCDD2),
1155 GPIO_FN(LCDD3), GPIO_FN(LCDD4), GPIO_FN(LCDD5),
1156 GPIO_FN(LCDD6), GPIO_FN(LCDD7), GPIO_FN(LCDD8),
1157 GPIO_FN(LCDD9), GPIO_FN(LCDD10), GPIO_FN(LCDD11),
1158 GPIO_FN(LCDD12), GPIO_FN(LCDD13), GPIO_FN(LCDD14),
1159 GPIO_FN(LCDD15), GPIO_FN(LCDD16), GPIO_FN(LCDD17),
1160 GPIO_FN(LCDD18), GPIO_FN(LCDD19), GPIO_FN(LCDD20),
1161 GPIO_FN(LCDD21), GPIO_FN(LCDD22), GPIO_FN(LCDD23),
1162
1163 /* IRDA */
1164 GPIO_FN(IRDA_OUT), GPIO_FN(IRDA_IN), GPIO_FN(IRDA_FIRSEL),
1165 GPIO_FN(IROUT_139), GPIO_FN(IROUT_140),
1166
1167 /* TSIF1 */
1168 GPIO_FN(TS0_1SELECT),
1169 GPIO_FN(TS0_2SELECT),
1170 GPIO_FN(TS1_1SELECT),
1171 GPIO_FN(TS1_2SELECT),
1172
1173 GPIO_FN(TS_SPSYNC1), GPIO_FN(TS_SDAT1),
1174 GPIO_FN(TS_SDEN1), GPIO_FN(TS_SCK1),
1175
1176 /* TSIF2 */
1177 GPIO_FN(TS_SPSYNC2), GPIO_FN(TS_SDAT2),
1178 GPIO_FN(TS_SDEN2), GPIO_FN(TS_SCK2),
1179
1180 /* HDMI */
1181 GPIO_FN(HDMI_HPD), GPIO_FN(HDMI_CEC),
1182
1183 /* SDHI0 */
1184 GPIO_FN(SDHICLK0), GPIO_FN(SDHICD0), GPIO_FN(SDHICMD0),
1185 GPIO_FN(SDHIWP0), GPIO_FN(SDHID0_0), GPIO_FN(SDHID0_1),
1186 GPIO_FN(SDHID0_2), GPIO_FN(SDHID0_3),
1187
1188 /* SDHI1 */
1189 GPIO_FN(SDHICLK1), GPIO_FN(SDHICMD1), GPIO_FN(SDHID1_0),
1190 GPIO_FN(SDHID1_1), GPIO_FN(SDHID1_2), GPIO_FN(SDHID1_3),
1191
1192 /* SDHI2 */
1193 GPIO_FN(SDHICLK2), GPIO_FN(SDHICMD2), GPIO_FN(SDHID2_0),
1194 GPIO_FN(SDHID2_1), GPIO_FN(SDHID2_2), GPIO_FN(SDHID2_3),
1195
1196 /* SDENC */
1197 GPIO_FN(SDENC_CPG),
1198 GPIO_FN(SDENC_DV_CLKI),
1199};
1200
1201/* helper for top 4 bits in PORTnCR */
1202#define PCRH(in, in_pd, in_pu, out) \
1203 0, (out), (in), 0, \
1204 0, 0, 0, 0, \
1205 0, 0, (in_pd), 0, \
1206 0, 0, (in_pu), 0
1207
1208#define PORTCR(nr, reg) \
1209 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1210 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1211 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1212 PORT##nr##_FN0, PORT##nr##_FN1, PORT##nr##_FN2, \
1213 PORT##nr##_FN3, PORT##nr##_FN4, PORT##nr##_FN5, \
1214 PORT##nr##_FN6, PORT##nr##_FN7 } \
1215 }
1216
1217static struct pinmux_cfg_reg pinmux_config_regs[] = {
1218 PORTCR(0, 0xE6051000), /* PORT0CR */
1219 PORTCR(1, 0xE6051001), /* PORT1CR */
1220 PORTCR(2, 0xE6051002), /* PORT2CR */
1221 PORTCR(3, 0xE6051003), /* PORT3CR */
1222 PORTCR(4, 0xE6051004), /* PORT4CR */
1223 PORTCR(5, 0xE6051005), /* PORT5CR */
1224 PORTCR(6, 0xE6051006), /* PORT6CR */
1225 PORTCR(7, 0xE6051007), /* PORT7CR */
1226 PORTCR(8, 0xE6051008), /* PORT8CR */
1227 PORTCR(9, 0xE6051009), /* PORT9CR */
1228 PORTCR(10, 0xE605100A), /* PORT10CR */
1229 PORTCR(11, 0xE605100B), /* PORT11CR */
1230 PORTCR(12, 0xE605100C), /* PORT12CR */
1231 PORTCR(13, 0xE605100D), /* PORT13CR */
1232 PORTCR(14, 0xE605100E), /* PORT14CR */
1233 PORTCR(15, 0xE605100F), /* PORT15CR */
1234 PORTCR(16, 0xE6051010), /* PORT16CR */
1235 PORTCR(17, 0xE6051011), /* PORT17CR */
1236 PORTCR(18, 0xE6051012), /* PORT18CR */
1237 PORTCR(19, 0xE6051013), /* PORT19CR */
1238 PORTCR(20, 0xE6051014), /* PORT20CR */
1239 PORTCR(21, 0xE6051015), /* PORT21CR */
1240 PORTCR(22, 0xE6051016), /* PORT22CR */
1241 PORTCR(23, 0xE6051017), /* PORT23CR */
1242 PORTCR(24, 0xE6051018), /* PORT24CR */
1243 PORTCR(25, 0xE6051019), /* PORT25CR */
1244 PORTCR(26, 0xE605101A), /* PORT26CR */
1245 PORTCR(27, 0xE605101B), /* PORT27CR */
1246 PORTCR(28, 0xE605101C), /* PORT28CR */
1247 PORTCR(29, 0xE605101D), /* PORT29CR */
1248 PORTCR(30, 0xE605101E), /* PORT30CR */
1249 PORTCR(31, 0xE605101F), /* PORT31CR */
1250 PORTCR(32, 0xE6051020), /* PORT32CR */
1251 PORTCR(33, 0xE6051021), /* PORT33CR */
1252 PORTCR(34, 0xE6051022), /* PORT34CR */
1253 PORTCR(35, 0xE6051023), /* PORT35CR */
1254 PORTCR(36, 0xE6051024), /* PORT36CR */
1255 PORTCR(37, 0xE6051025), /* PORT37CR */
1256 PORTCR(38, 0xE6051026), /* PORT38CR */
1257 PORTCR(39, 0xE6051027), /* PORT39CR */
1258 PORTCR(40, 0xE6051028), /* PORT40CR */
1259 PORTCR(41, 0xE6051029), /* PORT41CR */
1260 PORTCR(42, 0xE605102A), /* PORT42CR */
1261 PORTCR(43, 0xE605102B), /* PORT43CR */
1262 PORTCR(44, 0xE605102C), /* PORT44CR */
1263 PORTCR(45, 0xE605102D), /* PORT45CR */
1264 PORTCR(46, 0xE605202E), /* PORT46CR */
1265 PORTCR(47, 0xE605202F), /* PORT47CR */
1266 PORTCR(48, 0xE6052030), /* PORT48CR */
1267 PORTCR(49, 0xE6052031), /* PORT49CR */
1268 PORTCR(50, 0xE6052032), /* PORT50CR */
1269 PORTCR(51, 0xE6052033), /* PORT51CR */
1270 PORTCR(52, 0xE6052034), /* PORT52CR */
1271 PORTCR(53, 0xE6052035), /* PORT53CR */
1272 PORTCR(54, 0xE6052036), /* PORT54CR */
1273 PORTCR(55, 0xE6052037), /* PORT55CR */
1274 PORTCR(56, 0xE6052038), /* PORT56CR */
1275 PORTCR(57, 0xE6052039), /* PORT57CR */
1276 PORTCR(58, 0xE605203A), /* PORT58CR */
1277 PORTCR(59, 0xE605203B), /* PORT59CR */
1278 PORTCR(60, 0xE605203C), /* PORT60CR */
1279 PORTCR(61, 0xE605203D), /* PORT61CR */
1280 PORTCR(62, 0xE605203E), /* PORT62CR */
1281 PORTCR(63, 0xE605203F), /* PORT63CR */
1282 PORTCR(64, 0xE6052040), /* PORT64CR */
1283 PORTCR(65, 0xE6052041), /* PORT65CR */
1284 PORTCR(66, 0xE6052042), /* PORT66CR */
1285 PORTCR(67, 0xE6052043), /* PORT67CR */
1286 PORTCR(68, 0xE6052044), /* PORT68CR */
1287 PORTCR(69, 0xE6052045), /* PORT69CR */
1288 PORTCR(70, 0xE6052046), /* PORT70CR */
1289 PORTCR(71, 0xE6052047), /* PORT71CR */
1290 PORTCR(72, 0xE6052048), /* PORT72CR */
1291 PORTCR(73, 0xE6052049), /* PORT73CR */
1292 PORTCR(74, 0xE605204A), /* PORT74CR */
1293 PORTCR(75, 0xE605204B), /* PORT75CR */
1294 PORTCR(76, 0xE605004C), /* PORT76CR */
1295 PORTCR(77, 0xE605004D), /* PORT77CR */
1296 PORTCR(78, 0xE605004E), /* PORT78CR */
1297 PORTCR(79, 0xE605004F), /* PORT79CR */
1298 PORTCR(80, 0xE6050050), /* PORT80CR */
1299 PORTCR(81, 0xE6050051), /* PORT81CR */
1300 PORTCR(82, 0xE6050052), /* PORT82CR */
1301 PORTCR(83, 0xE6050053), /* PORT83CR */
1302 PORTCR(84, 0xE6050054), /* PORT84CR */
1303 PORTCR(85, 0xE6050055), /* PORT85CR */
1304 PORTCR(86, 0xE6050056), /* PORT86CR */
1305 PORTCR(87, 0xE6050057), /* PORT87CR */
1306 PORTCR(88, 0xE6050058), /* PORT88CR */
1307 PORTCR(89, 0xE6050059), /* PORT89CR */
1308 PORTCR(90, 0xE605005A), /* PORT90CR */
1309 PORTCR(91, 0xE605005B), /* PORT91CR */
1310 PORTCR(92, 0xE605005C), /* PORT92CR */
1311 PORTCR(93, 0xE605005D), /* PORT93CR */
1312 PORTCR(94, 0xE605005E), /* PORT94CR */
1313 PORTCR(95, 0xE605005F), /* PORT95CR */
1314 PORTCR(96, 0xE6050060), /* PORT96CR */
1315 PORTCR(97, 0xE6050061), /* PORT97CR */
1316 PORTCR(98, 0xE6050062), /* PORT98CR */
1317 PORTCR(99, 0xE6050063), /* PORT99CR */
1318 PORTCR(100, 0xE6053064), /* PORT100CR */
1319 PORTCR(101, 0xE6053065), /* PORT101CR */
1320 PORTCR(102, 0xE6053066), /* PORT102CR */
1321 PORTCR(103, 0xE6053067), /* PORT103CR */
1322 PORTCR(104, 0xE6053068), /* PORT104CR */
1323 PORTCR(105, 0xE6053069), /* PORT105CR */
1324 PORTCR(106, 0xE605306A), /* PORT106CR */
1325 PORTCR(107, 0xE605306B), /* PORT107CR */
1326 PORTCR(108, 0xE605306C), /* PORT108CR */
1327 PORTCR(109, 0xE605306D), /* PORT109CR */
1328 PORTCR(110, 0xE605306E), /* PORT110CR */
1329 PORTCR(111, 0xE605306F), /* PORT111CR */
1330 PORTCR(112, 0xE6053070), /* PORT112CR */
1331 PORTCR(113, 0xE6053071), /* PORT113CR */
1332 PORTCR(114, 0xE6053072), /* PORT114CR */
1333 PORTCR(115, 0xE6053073), /* PORT115CR */
1334 PORTCR(116, 0xE6053074), /* PORT116CR */
1335 PORTCR(117, 0xE6053075), /* PORT117CR */
1336 PORTCR(118, 0xE6053076), /* PORT118CR */
1337 PORTCR(119, 0xE6053077), /* PORT119CR */
1338 PORTCR(120, 0xE6053078), /* PORT120CR */
1339 PORTCR(121, 0xE6050079), /* PORT121CR */
1340 PORTCR(122, 0xE605007A), /* PORT122CR */
1341 PORTCR(123, 0xE605007B), /* PORT123CR */
1342 PORTCR(124, 0xE605007C), /* PORT124CR */
1343 PORTCR(125, 0xE605007D), /* PORT125CR */
1344 PORTCR(126, 0xE605007E), /* PORT126CR */
1345 PORTCR(127, 0xE605007F), /* PORT127CR */
1346 PORTCR(128, 0xE6050080), /* PORT128CR */
1347 PORTCR(129, 0xE6050081), /* PORT129CR */
1348 PORTCR(130, 0xE6050082), /* PORT130CR */
1349 PORTCR(131, 0xE6050083), /* PORT131CR */
1350 PORTCR(132, 0xE6050084), /* PORT132CR */
1351 PORTCR(133, 0xE6050085), /* PORT133CR */
1352 PORTCR(134, 0xE6050086), /* PORT134CR */
1353 PORTCR(135, 0xE6050087), /* PORT135CR */
1354 PORTCR(136, 0xE6050088), /* PORT136CR */
1355 PORTCR(137, 0xE6050089), /* PORT137CR */
1356 PORTCR(138, 0xE605008A), /* PORT138CR */
1357 PORTCR(139, 0xE605008B), /* PORT139CR */
1358 PORTCR(140, 0xE605008C), /* PORT140CR */
1359 PORTCR(141, 0xE605008D), /* PORT141CR */
1360 PORTCR(142, 0xE605008E), /* PORT142CR */
1361 PORTCR(143, 0xE605008F), /* PORT143CR */
1362 PORTCR(144, 0xE6050090), /* PORT144CR */
1363 PORTCR(145, 0xE6050091), /* PORT145CR */
1364 PORTCR(146, 0xE6050092), /* PORT146CR */
1365 PORTCR(147, 0xE6050093), /* PORT147CR */
1366 PORTCR(148, 0xE6050094), /* PORT148CR */
1367 PORTCR(149, 0xE6050095), /* PORT149CR */
1368 PORTCR(150, 0xE6050096), /* PORT150CR */
1369 PORTCR(151, 0xE6050097), /* PORT151CR */
1370 PORTCR(152, 0xE6053098), /* PORT152CR */
1371 PORTCR(153, 0xE6053099), /* PORT153CR */
1372 PORTCR(154, 0xE605309A), /* PORT154CR */
1373 PORTCR(155, 0xE605309B), /* PORT155CR */
1374 PORTCR(156, 0xE605009C), /* PORT156CR */
1375 PORTCR(157, 0xE605009D), /* PORT157CR */
1376 PORTCR(158, 0xE605009E), /* PORT158CR */
1377 PORTCR(159, 0xE605009F), /* PORT159CR */
1378 PORTCR(160, 0xE60500A0), /* PORT160CR */
1379 PORTCR(161, 0xE60500A1), /* PORT161CR */
1380 PORTCR(162, 0xE60500A2), /* PORT162CR */
1381 PORTCR(163, 0xE60500A3), /* PORT163CR */
1382 PORTCR(164, 0xE60500A4), /* PORT164CR */
1383 PORTCR(165, 0xE60500A5), /* PORT165CR */
1384 PORTCR(166, 0xE60500A6), /* PORT166CR */
1385 PORTCR(167, 0xE60520A7), /* PORT167CR */
1386 PORTCR(168, 0xE60520A8), /* PORT168CR */
1387 PORTCR(169, 0xE60520A9), /* PORT169CR */
1388 PORTCR(170, 0xE60520AA), /* PORT170CR */
1389 PORTCR(171, 0xE60520AB), /* PORT171CR */
1390 PORTCR(172, 0xE60520AC), /* PORT172CR */
1391 PORTCR(173, 0xE60520AD), /* PORT173CR */
1392 PORTCR(174, 0xE60520AE), /* PORT174CR */
1393 PORTCR(175, 0xE60520AF), /* PORT175CR */
1394 PORTCR(176, 0xE60520B0), /* PORT176CR */
1395 PORTCR(177, 0xE60520B1), /* PORT177CR */
1396 PORTCR(178, 0xE60520B2), /* PORT178CR */
1397 PORTCR(179, 0xE60520B3), /* PORT179CR */
1398 PORTCR(180, 0xE60520B4), /* PORT180CR */
1399 PORTCR(181, 0xE60520B5), /* PORT181CR */
1400 PORTCR(182, 0xE60520B6), /* PORT182CR */
1401 PORTCR(183, 0xE60520B7), /* PORT183CR */
1402 PORTCR(184, 0xE60520B8), /* PORT184CR */
1403 PORTCR(185, 0xE60520B9), /* PORT185CR */
1404 PORTCR(186, 0xE60520BA), /* PORT186CR */
1405 PORTCR(187, 0xE60520BB), /* PORT187CR */
1406 PORTCR(188, 0xE60520BC), /* PORT188CR */
1407 PORTCR(189, 0xE60520BD), /* PORT189CR */
1408 PORTCR(190, 0xE60520BE), /* PORT190CR */
1409
1410 { PINMUX_CFG_REG("MSEL1CR", 0xE605800C, 32, 1) {
1411 MSEL1CR_31_0, MSEL1CR_31_1,
1412 MSEL1CR_30_0, MSEL1CR_30_1,
1413 MSEL1CR_29_0, MSEL1CR_29_1,
1414 MSEL1CR_28_0, MSEL1CR_28_1,
1415 MSEL1CR_27_0, MSEL1CR_27_1,
1416 MSEL1CR_26_0, MSEL1CR_26_1,
1417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1418 0, 0, 0, 0, 0, 0, 0, 0,
1419 MSEL1CR_16_0, MSEL1CR_16_1,
1420 MSEL1CR_15_0, MSEL1CR_15_1,
1421 MSEL1CR_14_0, MSEL1CR_14_1,
1422 MSEL1CR_13_0, MSEL1CR_13_1,
1423 MSEL1CR_12_0, MSEL1CR_12_1,
1424 0, 0, 0, 0,
1425 MSEL1CR_9_0, MSEL1CR_9_1,
1426 MSEL1CR_8_0, MSEL1CR_8_1,
1427 MSEL1CR_7_0, MSEL1CR_7_1,
1428 MSEL1CR_6_0, MSEL1CR_6_1,
1429 0, 0,
1430 MSEL1CR_4_0, MSEL1CR_4_1,
1431 MSEL1CR_3_0, MSEL1CR_3_1,
1432 MSEL1CR_2_0, MSEL1CR_2_1,
1433 0, 0,
1434 MSEL1CR_0_0, MSEL1CR_0_1,
1435 }
1436 },
1437 { PINMUX_CFG_REG("MSEL3CR", 0xE6058020, 32, 1) {
1438 0, 0, 0, 0,
1439 0, 0, 0, 0,
1440 MSEL3CR_27_0, MSEL3CR_27_1,
1441 MSEL3CR_26_0, MSEL3CR_26_1,
1442 0, 0, 0, 0,
1443 0, 0, 0, 0,
1444 MSEL3CR_21_0, MSEL3CR_21_1,
1445 MSEL3CR_20_0, MSEL3CR_20_1,
1446 0, 0, 0, 0,
1447 0, 0, 0, 0,
1448 MSEL3CR_15_0, MSEL3CR_15_1,
1449 0, 0, 0, 0,
1450 0, 0, 0, 0,
1451 0, 0,
1452 MSEL3CR_9_0, MSEL3CR_9_1,
1453 0, 0, 0, 0,
1454 MSEL3CR_6_0, MSEL3CR_6_1,
1455 0, 0, 0, 0,
1456 0, 0, 0, 0,
1457 0, 0, 0, 0,
1458 }
1459 },
1460 { PINMUX_CFG_REG("MSEL4CR", 0xE6058024, 32, 1) {
1461 0, 0, 0, 0,
1462 0, 0, 0, 0,
1463 0, 0, 0, 0,
1464 0, 0, 0, 0,
1465 0, 0, 0, 0,
1466 0, 0, 0, 0,
1467 MSEL4CR_19_0, MSEL4CR_19_1,
1468 MSEL4CR_18_0, MSEL4CR_18_1,
1469 MSEL4CR_17_0, MSEL4CR_17_1,
1470 MSEL4CR_16_0, MSEL4CR_16_1,
1471 MSEL4CR_15_0, MSEL4CR_15_1,
1472 MSEL4CR_14_0, MSEL4CR_14_1,
1473 0, 0, 0, 0,
1474 0, 0,
1475 MSEL4CR_10_0, MSEL4CR_10_1,
1476 0, 0, 0, 0,
1477 0, 0,
1478 MSEL4CR_6_0, MSEL4CR_6_1,
1479 0, 0,
1480 MSEL4CR_4_0, MSEL4CR_4_1,
1481 0, 0, 0, 0,
1482 MSEL4CR_1_0, MSEL4CR_1_1,
1483 0, 0,
1484 }
1485 },
1486 { },
1487};
1488
1489static struct pinmux_data_reg pinmux_data_regs[] = {
1490 { PINMUX_DATA_REG("PORTL095_064DR", 0xE6054008, 32) {
1491 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1492 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1493 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1494 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1495 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1496 0, 0, 0, 0,
1497 0, 0, 0, 0,
1498 0, 0, 0, 0,
1499 }
1500 },
1501 { PINMUX_DATA_REG("PORTL127_096DR", 0xE605400C, 32) {
1502 PORT127_DATA, PORT126_DATA, PORT125_DATA, PORT124_DATA,
1503 PORT123_DATA, PORT122_DATA, PORT121_DATA, 0,
1504 0, 0, 0, 0,
1505 0, 0, 0, 0,
1506 0, 0, 0, 0,
1507 0, 0, 0, 0,
1508 0, 0, 0, 0,
1509 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA,
1510 }
1511 },
1512 { PINMUX_DATA_REG("PORTL159_128DR", 0xE6054010, 32) {
1513 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1514 0, 0, 0, 0,
1515 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1516 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1517 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1518 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1519 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1520 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA,
1521 }
1522 },
1523 { PINMUX_DATA_REG("PORTL191_160DR", 0xE6054014, 32) {
1524 0, 0, 0, 0,
1525 0, 0, 0, 0,
1526 0, 0, 0, 0,
1527 0, 0, 0, 0,
1528 0, 0, 0, 0,
1529 0, 0, 0, 0,
1530 0, PORT166_DATA, PORT165_DATA, PORT164_DATA,
1531 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA,
1532 }
1533 },
1534 { PINMUX_DATA_REG("PORTD031_000DR", 0xE6055000, 32) {
1535 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1536 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1537 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1538 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1539 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1540 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1541 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1542 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA,
1543 }
1544 },
1545 { PINMUX_DATA_REG("PORTD063_032DR", 0xE6055004, 32) {
1546 0, 0, 0, 0, 0, 0, 0, 0,
1547 0, 0, 0, 0, 0, 0, 0, 0,
1548 0, 0, PORT45_DATA, PORT44_DATA,
1549 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1550 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1551 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA,
1552 }
1553 },
1554 { PINMUX_DATA_REG("PORTR063_032DR", 0xE6056004, 32) {
1555 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1556 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1557 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1558 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1559 PORT47_DATA, PORT46_DATA, 0, 0,
1560 0, 0, 0, 0,
1561 0, 0, 0, 0,
1562 0, 0, 0, 0,
1563 }
1564 },
1565 { PINMUX_DATA_REG("PORTR095_064DR", 0xE6056008, 32) {
1566 0, 0, 0, 0,
1567 0, 0, 0, 0,
1568 0, 0, 0, 0,
1569 0, 0, 0, 0,
1570 0, 0, 0, 0,
1571 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1572 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1573 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA,
1574 }
1575 },
1576 { PINMUX_DATA_REG("PORTR191_160DR", 0xE6056014, 32) {
1577 0, PORT190_DATA, PORT189_DATA, PORT188_DATA,
1578 PORT187_DATA, PORT186_DATA, PORT185_DATA, PORT184_DATA,
1579 PORT183_DATA, PORT182_DATA, PORT181_DATA, PORT180_DATA,
1580 PORT179_DATA, PORT178_DATA, PORT177_DATA, PORT176_DATA,
1581 PORT175_DATA, PORT174_DATA, PORT173_DATA, PORT172_DATA,
1582 PORT171_DATA, PORT170_DATA, PORT169_DATA, PORT168_DATA,
1583 PORT167_DATA, 0, 0, 0,
1584 0, 0, 0, 0,
1585 }
1586 },
1587 { PINMUX_DATA_REG("PORTU127_096DR", 0xE605700C, 32) {
1588 0, 0, 0, 0,
1589 0, 0, 0, PORT120_DATA,
1590 PORT119_DATA, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1591 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1592 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1593 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1594 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1595 0, 0, 0, 0,
1596 }
1597 },
1598 { PINMUX_DATA_REG("PORTU159_128DR", 0xE6057010, 32) {
1599 0, 0, 0, 0,
1600 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1601 0, 0, 0, 0,
1602 0, 0, 0, 0,
1603 0, 0, 0, 0,
1604 0, 0, 0, 0,
1605 0, 0, 0, 0,
1606 0, 0, 0, 0,
1607 }
1608 },
1609 { },
1610};
1611
1612static struct pinmux_info sh7372_pinmux_info = {
1613 .name = "sh7372_pfc",
1614 .reserved_id = PINMUX_RESERVED,
1615 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1616 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1617 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1618 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1619 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1620 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1621 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1622
1623 .first_gpio = GPIO_PORT0,
1624 .last_gpio = GPIO_FN_SDENC_DV_CLKI,
1625
1626 .gpios = pinmux_gpios,
1627 .cfg_regs = pinmux_config_regs,
1628 .data_regs = pinmux_data_regs,
1629
1630 .gpio_data = pinmux_data,
1631 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1632};
1633
1634void sh7372_pinmux_init(void)
1635{
1636 register_pinmux(&sh7372_pinmux_info);
1637}
diff --git a/arch/arm/mach-shmobile/pfc-sh7377.c b/arch/arm/mach-shmobile/pfc-sh7377.c
new file mode 100644
index 000000000000..613e6842ad05
--- /dev/null
+++ b/arch/arm/mach-shmobile/pfc-sh7377.c
@@ -0,0 +1,1767 @@
1/*
2 * sh7377 processor support - PFC hardware block
3 *
4 * Copyright (C) 2010 NISHIMOTO Hiroki
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of the
9 * License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/init.h>
21#include <linux/kernel.h>
22#include <linux/gpio.h>
23#include <mach/sh7377.h>
24
25#define _1(fn, pfx, sfx) fn(pfx, sfx)
26
27#define _10(fn, pfx, sfx) \
28 _1(fn, pfx##0, sfx), _1(fn, pfx##1, sfx), \
29 _1(fn, pfx##2, sfx), _1(fn, pfx##3, sfx), \
30 _1(fn, pfx##4, sfx), _1(fn, pfx##5, sfx), \
31 _1(fn, pfx##6, sfx), _1(fn, pfx##7, sfx), \
32 _1(fn, pfx##8, sfx), _1(fn, pfx##9, sfx)
33
34#define _90(fn, pfx, sfx) \
35 _10(fn, pfx##1, sfx), _10(fn, pfx##2, sfx), \
36 _10(fn, pfx##3, sfx), _10(fn, pfx##4, sfx), \
37 _10(fn, pfx##5, sfx), _10(fn, pfx##6, sfx), \
38 _10(fn, pfx##7, sfx), _10(fn, pfx##8, sfx), \
39 _10(fn, pfx##9, sfx)
40
41#define _265(fn, pfx, sfx) \
42 _10(fn, pfx, sfx), _90(fn, pfx, sfx), \
43 _10(fn, pfx##10, sfx), \
44 _1(fn, pfx##110, sfx), _1(fn, pfx##111, sfx), \
45 _1(fn, pfx##112, sfx), _1(fn, pfx##113, sfx), \
46 _1(fn, pfx##114, sfx), _1(fn, pfx##115, sfx), \
47 _1(fn, pfx##116, sfx), _1(fn, pfx##117, sfx), \
48 _1(fn, pfx##118, sfx), \
49 _1(fn, pfx##128, sfx), _1(fn, pfx##129, sfx), \
50 _10(fn, pfx##13, sfx), _10(fn, pfx##14, sfx), \
51 _10(fn, pfx##15, sfx), \
52 _1(fn, pfx##160, sfx), _1(fn, pfx##161, sfx), \
53 _1(fn, pfx##162, sfx), _1(fn, pfx##163, sfx), \
54 _1(fn, pfx##164, sfx), \
55 _1(fn, pfx##192, sfx), _1(fn, pfx##193, sfx), \
56 _1(fn, pfx##194, sfx), _1(fn, pfx##195, sfx), \
57 _1(fn, pfx##196, sfx), _1(fn, pfx##197, sfx), \
58 _1(fn, pfx##198, sfx), _1(fn, pfx##199, sfx), \
59 _10(fn, pfx##20, sfx), _10(fn, pfx##21, sfx), \
60 _10(fn, pfx##22, sfx), _10(fn, pfx##23, sfx), \
61 _10(fn, pfx##24, sfx), _10(fn, pfx##25, sfx), \
62 _1(fn, pfx##260, sfx), _1(fn, pfx##261, sfx), \
63 _1(fn, pfx##262, sfx), _1(fn, pfx##263, sfx), \
64 _1(fn, pfx##264, sfx)
65
66#define _PORT(pfx, sfx) pfx##_##sfx
67#define PORT_265(str) _265(_PORT, PORT, str)
68
69enum {
70 PINMUX_RESERVED = 0,
71
72 PINMUX_DATA_BEGIN,
73 PORT_265(DATA), /* PORT0_DATA -> PORT264_DATA */
74 PINMUX_DATA_END,
75
76 PINMUX_INPUT_BEGIN,
77 PORT_265(IN), /* PORT0_IN -> PORT264_IN */
78 PINMUX_INPUT_END,
79
80 PINMUX_INPUT_PULLUP_BEGIN,
81 PORT_265(IN_PU), /* PORT0_IN_PU -> PORT264_IN_PU */
82 PINMUX_INPUT_PULLUP_END,
83
84 PINMUX_INPUT_PULLDOWN_BEGIN,
85 PORT_265(IN_PD), /* PORT0_IN_PD -> PORT264_IN_PD */
86 PINMUX_INPUT_PULLDOWN_END,
87
88 PINMUX_OUTPUT_BEGIN,
89 PORT_265(OUT), /* PORT0_OUT -> PORT264_OUT */
90 PINMUX_OUTPUT_END,
91
92 PINMUX_FUNCTION_BEGIN,
93 PORT_265(FN_IN), /* PORT0_FN_IN -> PORT264_FN_IN */
94 PORT_265(FN_OUT), /* PORT0_FN_OUT -> PORT264_FN_OUT */
95 PORT_265(FN0), /* PORT0_FN0 -> PORT264_FN0 */
96 PORT_265(FN1), /* PORT0_FN1 -> PORT264_FN1 */
97 PORT_265(FN2), /* PORT0_FN2 -> PORT264_FN2 */
98 PORT_265(FN3), /* PORT0_FN3 -> PORT264_FN3 */
99 PORT_265(FN4), /* PORT0_FN4 -> PORT264_FN4 */
100 PORT_265(FN5), /* PORT0_FN5 -> PORT264_FN5 */
101 PORT_265(FN6), /* PORT0_FN6 -> PORT264_FN6 */
102 PORT_265(FN7), /* PORT0_FN7 -> PORT264_FN7 */
103
104 MSELBCR_MSEL17_1, MSELBCR_MSEL17_0,
105 MSELBCR_MSEL16_1, MSELBCR_MSEL16_0,
106 PINMUX_FUNCTION_END,
107
108 PINMUX_MARK_BEGIN,
109 /* Special Pull-up / Pull-down Functions */
110 PORT66_KEYIN0_PU_MARK, PORT67_KEYIN1_PU_MARK,
111 PORT68_KEYIN2_PU_MARK, PORT69_KEYIN3_PU_MARK,
112 PORT70_KEYIN4_PU_MARK, PORT71_KEYIN5_PU_MARK,
113 PORT72_KEYIN6_PU_MARK,
114
115 /* 55-1 */
116 VBUS_0_MARK,
117 CPORT0_MARK,
118 CPORT1_MARK,
119 CPORT2_MARK,
120 CPORT3_MARK,
121 CPORT4_MARK,
122 CPORT5_MARK,
123 CPORT6_MARK,
124 CPORT7_MARK,
125 CPORT8_MARK,
126 CPORT9_MARK,
127 CPORT10_MARK,
128 CPORT11_MARK, SIN2_MARK,
129 CPORT12_MARK, XCTS2_MARK,
130 CPORT13_MARK, RFSPO4_MARK,
131 CPORT14_MARK, RFSPO5_MARK,
132 CPORT15_MARK, SCIFA0_SCK_MARK, GPS_AGC2_MARK,
133 CPORT16_MARK, SCIFA0_TXD_MARK, GPS_AGC3_MARK,
134 CPORT17_IC_OE_MARK, SOUT2_MARK,
135 CPORT18_MARK, XRTS2_MARK, PORT19_VIO_CKO2_MARK,
136 CPORT19_MPORT1_MARK,
137 CPORT20_MARK, RFSPO6_MARK,
138 CPORT21_MARK, STATUS0_MARK,
139 CPORT22_MARK, STATUS1_MARK,
140 CPORT23_MARK, STATUS2_MARK, RFSPO7_MARK,
141 B_SYNLD1_MARK,
142 B_SYNLD2_MARK, SYSENMSK_MARK,
143 XMAINPS_MARK,
144 XDIVPS_MARK,
145 XIDRST_MARK,
146 IDCLK_MARK, IC_DP_MARK,
147 IDIO_MARK, IC_DM_MARK,
148 SOUT1_MARK, SCIFA4_TXD_MARK, M02_BERDAT_MARK,
149 SIN1_MARK, SCIFA4_RXD_MARK, XWUP_MARK,
150 XRTS1_MARK, SCIFA4_RTS_MARK, M03_BERCLK_MARK,
151 XCTS1_MARK, SCIFA4_CTS_MARK,
152 PCMCLKO_MARK,
153 SYNC8KO_MARK,
154
155 /* 55-2 */
156 DNPCM_A_MARK,
157 UPPCM_A_MARK,
158 VACK_MARK,
159 XTALB1L_MARK,
160 GPS_AGC1_MARK, SCIFA0_RTS_MARK,
161 GPS_AGC4_MARK, SCIFA0_RXD_MARK,
162 GPS_PWRDOWN_MARK, SCIFA0_CTS_MARK,
163 GPS_IM_MARK,
164 GPS_IS_MARK,
165 GPS_QM_MARK,
166 GPS_QS_MARK,
167 FMSOCK_MARK, PORT49_IRDA_OUT_MARK, PORT49_IROUT_MARK,
168 FMSOOLR_MARK, BBIF2_TSYNC2_MARK, TPU2TO2_MARK, IPORT3_MARK,
169 FMSIOLR_MARK,
170 FMSOOBT_MARK, BBIF2_TSCK2_MARK, TPU2TO3_MARK, OPORT1_MARK,
171 FMSIOBT_MARK,
172 FMSOSLD_MARK, BBIF2_TXD2_MARK, OPORT2_MARK,
173 FMSOILR_MARK, PORT53_IRDA_IN_MARK, TPU3TO3_MARK, OPORT3_MARK,
174 FMSIILR_MARK,
175 FMSOIBT_MARK, PORT54_IRDA_FIRSEL_MARK, TPU3TO2_MARK, FMSIIBT_MARK,
176 FMSISLD_MARK, MFG0_OUT1_MARK, TPU0TO0_MARK,
177 A0_EA0_MARK, BS_MARK,
178 A12_EA12_MARK, PORT58_VIO_CKOR_MARK, TPU4TO2_MARK,
179 A13_EA13_MARK, PORT59_IROUT_MARK, MFG0_OUT2_MARK, TPU0TO1_MARK,
180 A14_EA14_MARK, PORT60_KEYOUT5_MARK,
181 A15_EA15_MARK, PORT61_KEYOUT4_MARK,
182 A16_EA16_MARK, PORT62_KEYOUT3_MARK, MSIOF0_SS1_MARK,
183 A17_EA17_MARK, PORT63_KEYOUT2_MARK, MSIOF0_TSYNC_MARK,
184 A18_EA18_MARK, PORT64_KEYOUT1_MARK, MSIOF0_TSCK_MARK,
185 A19_EA19_MARK, PORT65_KEYOUT0_MARK, MSIOF0_TXD_MARK,
186 A20_EA20_MARK, PORT66_KEYIN0_MARK, MSIOF0_RSCK_MARK,
187 A21_EA21_MARK, PORT67_KEYIN1_MARK, MSIOF0_RSYNC_MARK,
188 A22_EA22_MARK, PORT68_KEYIN2_MARK, MSIOF0_MCK0_MARK,
189 A23_EA23_MARK, PORT69_KEYIN3_MARK, MSIOF0_MCK1_MARK,
190 A24_EA24_MARK, PORT70_KEYIN4_MARK, MSIOF0_RXD_MARK,
191 A25_EA25_MARK, PORT71_KEYIN5_MARK, MSIOF0_SS2_MARK,
192 A26_MARK, PORT72_KEYIN6_MARK,
193 D0_ED0_NAF0_MARK,
194 D1_ED1_NAF1_MARK,
195 D2_ED2_NAF2_MARK,
196 D3_ED3_NAF3_MARK,
197 D4_ED4_NAF4_MARK,
198 D5_ED5_NAF5_MARK,
199 D6_ED6_NAF6_MARK,
200 D7_ED7_NAF7_MARK,
201 D8_ED8_NAF8_MARK,
202 D9_ED9_NAF9_MARK,
203 D10_ED10_NAF10_MARK,
204 D11_ED11_NAF11_MARK,
205 D12_ED12_NAF12_MARK,
206 D13_ED13_NAF13_MARK,
207 D14_ED14_NAF14_MARK,
208 D15_ED15_NAF15_MARK,
209 CS4_MARK,
210 CS5A_MARK, FMSICK_MARK,
211 CS5B_MARK, FCE1_MARK,
212
213 /* 55-3 */
214 CS6B_MARK, XCS2_MARK, CS6A_MARK, DACK0_MARK,
215 FCE0_MARK,
216 WAIT_MARK, DREQ0_MARK,
217 RD_XRD_MARK,
218 WE0_XWR0_FWE_MARK,
219 WE1_XWR1_MARK,
220 FRB_MARK,
221 CKO_MARK,
222 NBRSTOUT_MARK,
223 NBRST_MARK,
224 GPS_EPPSIN_MARK,
225 LATCHPULSE_MARK,
226 LTESIGNAL_MARK,
227 LEGACYSTATE_MARK,
228 TCKON_MARK,
229 VIO_VD_MARK, PORT128_KEYOUT0_MARK, IPORT0_MARK,
230 VIO_HD_MARK, PORT129_KEYOUT1_MARK, IPORT1_MARK,
231 VIO_D0_MARK, PORT130_KEYOUT2_MARK, PORT130_MSIOF2_RXD_MARK,
232 VIO_D1_MARK, PORT131_KEYOUT3_MARK, PORT131_MSIOF2_SS1_MARK,
233 VIO_D2_MARK, PORT132_KEYOUT4_MARK, PORT132_MSIOF2_SS2_MARK,
234 VIO_D3_MARK, PORT133_KEYOUT5_MARK, PORT133_MSIOF2_TSYNC_MARK,
235 VIO_D4_MARK, PORT134_KEYIN0_MARK, PORT134_MSIOF2_TXD_MARK,
236 VIO_D5_MARK, PORT135_KEYIN1_MARK, PORT135_MSIOF2_TSCK_MARK,
237 VIO_D6_MARK, PORT136_KEYIN2_MARK,
238 VIO_D7_MARK, PORT137_KEYIN3_MARK,
239 VIO_D8_MARK, M9_SLCD_A01_MARK, PORT138_FSIAOMC_MARK,
240 VIO_D9_MARK, M10_SLCD_CK1_MARK, PORT139_FSIAOLR_MARK,
241 VIO_D10_MARK, M11_SLCD_SO1_MARK, TPU0TO2_MARK, PORT140_FSIAOBT_MARK,
242 VIO_D11_MARK, M12_SLCD_CE1_MARK, TPU0TO3_MARK, PORT141_FSIAOSLD_MARK,
243 VIO_D12_MARK, M13_BSW_MARK, PORT142_FSIACK_MARK,
244 VIO_D13_MARK, M14_GSW_MARK, PORT143_FSIAILR_MARK,
245 VIO_D14_MARK, M15_RSW_MARK, PORT144_FSIAIBT_MARK,
246 VIO_D15_MARK, TPU1TO3_MARK, PORT145_FSIAISLD_MARK,
247 VIO_CLK_MARK, PORT146_KEYIN4_MARK, IPORT2_MARK,
248 VIO_FIELD_MARK, PORT147_KEYIN5_MARK,
249 VIO_CKO_MARK, PORT148_KEYIN6_MARK,
250 A27_MARK, RDWR_XWE_MARK, MFG0_IN1_MARK,
251 MFG0_IN2_MARK,
252 TS_SPSYNC3_MARK, MSIOF2_RSCK_MARK,
253 TS_SDAT3_MARK, MSIOF2_RSYNC_MARK,
254 TPU1TO2_MARK, TS_SDEN3_MARK, PORT153_MSIOF2_SS1_MARK,
255 SOUT3_MARK, SCIFA2_TXD1_MARK, MSIOF2_MCK0_MARK,
256 SIN3_MARK, SCIFA2_RXD1_MARK, MSIOF2_MCK1_MARK,
257 XRTS3_MARK, SCIFA2_RTS1_MARK, PORT156_MSIOF2_SS2_MARK,
258 XCTS3_MARK, SCIFA2_CTS1_MARK, PORT157_MSIOF2_RXD_MARK,
259
260 /* 55-4 */
261 DINT_MARK, SCIFA2_SCK1_MARK, TS_SCK3_MARK,
262 PORT159_SCIFB_SCK_MARK, PORT159_SCIFA5_SCK_MARK, NMI_MARK,
263 PORT160_SCIFB_TXD_MARK, PORT160_SCIFA5_TXD_MARK, SOUT0_MARK,
264 PORT161_SCIFB_CTS_MARK, PORT161_SCIFA5_CTS_MARK, XCTS0_MARK,
265 MFG3_IN2_MARK,
266 PORT162_SCIFB_RXD_MARK, PORT162_SCIFA5_RXD_MARK, SIN0_MARK,
267 MFG3_IN1_MARK,
268 PORT163_SCIFB_RTS_MARK, PORT163_SCIFA5_RTS_MARK, XRTS0_MARK,
269 MFG3_OUT1_MARK, TPU3TO0_MARK,
270 LCDD0_MARK, PORT192_KEYOUT0_MARK, EXT_CKI_MARK,
271 LCDD1_MARK, PORT193_KEYOUT1_MARK, PORT193_SCIFA5_CTS_MARK,
272 BBIF2_TSYNC1_MARK,
273 LCDD2_MARK, PORT194_KEYOUT2_MARK, PORT194_SCIFA5_RTS_MARK,
274 BBIF2_TSCK1_MARK,
275 LCDD3_MARK, PORT195_KEYOUT3_MARK, PORT195_SCIFA5_RXD_MARK,
276 BBIF2_TXD1_MARK,
277 LCDD4_MARK, PORT196_KEYOUT4_MARK, PORT196_SCIFA5_TXD_MARK,
278 LCDD5_MARK, PORT197_KEYOUT5_MARK, PORT197_SCIFA5_SCK_MARK,
279 MFG2_OUT2_MARK,
280 TPU2TO1_MARK,
281 LCDD6_MARK, XWR2_MARK,
282 LCDD7_MARK, TPU4TO1_MARK, MFG4_OUT2_MARK, XWR3_MARK,
283 LCDD8_MARK, PORT200_KEYIN0_MARK, VIO_DR0_MARK, D16_MARK, ED16_MARK,
284 LCDD9_MARK, PORT201_KEYIN1_MARK, VIO_DR1_MARK, D17_MARK, ED17_MARK,
285 LCDD10_MARK, PORT202_KEYIN2_MARK, VIO_DR2_MARK, D18_MARK, ED18_MARK,
286 LCDD11_MARK, PORT203_KEYIN3_MARK, VIO_DR3_MARK, D19_MARK, ED19_MARK,
287 LCDD12_MARK, PORT204_KEYIN4_MARK, VIO_DR4_MARK, D20_MARK, ED20_MARK,
288 LCDD13_MARK, PORT205_KEYIN5_MARK, VIO_DR5_MARK, D21_MARK, ED21_MARK,
289 LCDD14_MARK, PORT206_KEYIN6_MARK, VIO_DR6_MARK, D22_MARK, ED22_MARK,
290 LCDD15_MARK, PORT207_MSIOF0L_SS1_MARK, PORT207_KEYOUT0_MARK,
291 VIO_DR7_MARK, D23_MARK, ED23_MARK,
292 LCDD16_MARK, PORT208_MSIOF0L_SS2_MARK, PORT208_KEYOUT1_MARK,
293 VIO_VDR_MARK, D24_MARK, ED24_MARK,
294 LCDD17_MARK, PORT209_KEYOUT2_MARK, VIO_HDR_MARK, D25_MARK, ED25_MARK,
295 LCDD18_MARK, DREQ2_MARK, PORT210_MSIOF0L_SS1_MARK, D26_MARK, ED26_MARK,
296 LCDD19_MARK, PORT211_MSIOF0L_SS2_MARK, D27_MARK, ED27_MARK,
297 LCDD20_MARK, TS_SPSYNC1_MARK, MSIOF0L_MCK0_MARK, D28_MARK, ED28_MARK,
298 LCDD21_MARK, TS_SDAT1_MARK, MSIOF0L_MCK1_MARK, D29_MARK, ED29_MARK,
299 LCDD22_MARK, TS_SDEN1_MARK, MSIOF0L_RSCK_MARK, D30_MARK, ED30_MARK,
300 LCDD23_MARK, TS_SCK1_MARK, MSIOF0L_RSYNC_MARK, D31_MARK, ED31_MARK,
301 LCDDCK_MARK, LCDWR_MARK, PORT216_KEYOUT3_MARK, VIO_CLKR_MARK,
302 LCDRD_MARK, DACK2_MARK, MSIOF0L_TSYNC_MARK,
303 LCDHSYN_MARK, LCDCS_MARK, LCDCS2_MARK, DACK3_MARK,
304 PORT218_VIO_CKOR_MARK, PORT218_KEYOUT4_MARK,
305 LCDDISP_MARK, LCDRS_MARK, DREQ3_MARK, MSIOF0L_TSCK_MARK,
306 LCDVSYN_MARK, LCDVSYN2_MARK, PORT220_KEYOUT5_MARK,
307 LCDLCLK_MARK, DREQ1_MARK, PWEN_MARK, MSIOF0L_RXD_MARK,
308 LCDDON_MARK, LCDDON2_MARK, DACK1_MARK, OVCN_MARK, MSIOF0L_TXD_MARK,
309 SCIFA1_TXD_MARK, OVCN2_MARK,
310 EXTLP_MARK, SCIFA1_SCK_MARK, USBTERM_MARK, PORT226_VIO_CKO2_MARK,
311 SCIFA1_RTS_MARK, IDIN_MARK,
312 SCIFA1_RXD_MARK,
313 SCIFA1_CTS_MARK, MFG1_IN1_MARK,
314 MSIOF1_TXD_MARK, SCIFA2_TXD2_MARK, PORT230_FSIAOMC_MARK,
315 MSIOF1_TSYNC_MARK, SCIFA2_CTS2_MARK, PORT231_FSIAOLR_MARK,
316 MSIOF1_TSCK_MARK, SCIFA2_SCK2_MARK, PORT232_FSIAOBT_MARK,
317 MSIOF1_RXD_MARK, SCIFA2_RXD2_MARK, GPS_VCOTRIG_MARK,
318 PORT233_FSIACK_MARK,
319 MSIOF1_RSCK_MARK, SCIFA2_RTS2_MARK, PORT234_FSIAOSLD_MARK,
320 MSIOF1_RSYNC_MARK, OPORT0_MARK, MFG1_IN2_MARK, PORT235_FSIAILR_MARK,
321 MSIOF1_MCK0_MARK, I2C_SDA2_MARK, PORT236_FSIAIBT_MARK,
322 MSIOF1_MCK1_MARK, I2C_SCL2_MARK, PORT237_FSIAISLD_MARK,
323 MSIOF1_SS1_MARK, EDBGREQ3_MARK,
324
325 /* 55-5 */
326 MSIOF1_SS2_MARK,
327 SCIFA6_TXD_MARK,
328 PORT241_IRDA_OUT_MARK, PORT241_IROUT_MARK, MFG4_OUT1_MARK,
329 TPU4TO0_MARK,
330 PORT242_IRDA_IN_MARK, MFG4_IN2_MARK,
331 PORT243_IRDA_FIRSEL_MARK, PORT243_VIO_CKO2_MARK,
332 PORT244_SCIFA5_CTS_MARK, MFG2_IN1_MARK, PORT244_SCIFB_CTS_MARK,
333 PORT244_MSIOF2_RXD_MARK,
334 PORT245_SCIFA5_RTS_MARK, MFG2_IN2_MARK, PORT245_SCIFB_RTS_MARK,
335 PORT245_MSIOF2_TXD_MARK,
336 PORT246_SCIFA5_RXD_MARK, MFG1_OUT1_MARK, PORT246_SCIFB_RXD_MARK,
337 TPU1TO0_MARK,
338 PORT247_SCIFA5_TXD_MARK, MFG3_OUT2_MARK, PORT247_SCIFB_TXD_MARK,
339 TPU3TO1_MARK,
340 PORT248_SCIFA5_SCK_MARK, MFG2_OUT1_MARK, PORT248_SCIFB_SCK_MARK,
341 TPU2TO0_MARK,
342 PORT248_MSIOF2_TSCK_MARK,
343 PORT249_IROUT_MARK, MFG4_IN1_MARK, PORT249_MSIOF2_TSYNC_MARK,
344 SDHICLK0_MARK, TCK2_SWCLK_MC0_MARK,
345 SDHICD0_MARK,
346 SDHID0_0_MARK, TMS2_SWDIO_MC0_MARK,
347 SDHID0_1_MARK, TDO2_SWO0_MC0_MARK,
348 SDHID0_2_MARK, TDI2_MARK,
349 SDHID0_3_MARK, RTCK2_SWO1_MC0_MARK,
350 SDHICMD0_MARK, TRST2_MARK,
351 SDHIWP0_MARK, EDBGREQ2_MARK,
352 SDHICLK1_MARK, TCK3_SWCLK_MC1_MARK,
353 SDHID1_0_MARK, M11_SLCD_SO2_MARK, TS_SPSYNC2_MARK,
354 TMS3_SWDIO_MC1_MARK,
355 SDHID1_1_MARK, M9_SLCD_A02_MARK, TS_SDAT2_MARK, TDO3_SWO0_MC1_MARK,
356 SDHID1_2_MARK, M10_SLCD_CK2_MARK, TS_SDEN2_MARK, TDI3_MARK,
357 SDHID1_3_MARK, M12_SLCD_CE2_MARK, TS_SCK2_MARK, RTCK3_SWO1_MC1_MARK,
358 SDHICMD1_MARK, TRST3_MARK,
359 RESETOUTS_MARK,
360 PINMUX_MARK_END,
361};
362
363#define PORT_DATA_I(nr) \
364 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, PORT##nr##_IN)
365
366#define PORT_DATA_I_PD(nr) \
367 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
368 PORT##nr##_IN, PORT##nr##_IN_PD)
369
370#define PORT_DATA_I_PU(nr) \
371 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
372 PORT##nr##_IN, PORT##nr##_IN_PU)
373
374#define PORT_DATA_I_PU_PD(nr) \
375 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
376 PORT##nr##_IN, PORT##nr##_IN_PD, \
377 PORT##nr##_IN_PU)
378
379#define PORT_DATA_O(nr) \
380 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
381 PORT##nr##_OUT)
382
383#define PORT_DATA_IO(nr) \
384 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
385 PORT##nr##_OUT, PORT##nr##_IN)
386
387#define PORT_DATA_IO_PD(nr) \
388 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
389 PORT##nr##_OUT, PORT##nr##_IN, \
390 PORT##nr##_IN_PD)
391
392#define PORT_DATA_IO_PU(nr) \
393 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
394 PORT##nr##_OUT, PORT##nr##_IN, \
395 PORT##nr##_IN_PU)
396
397#define PORT_DATA_IO_PU_PD(nr) \
398 PINMUX_DATA(PORT##nr##_DATA, PORT##nr##_FN0, \
399 PORT##nr##_OUT, PORT##nr##_IN, \
400 PORT##nr##_IN_PD, PORT##nr##_IN_PU)
401
402static pinmux_enum_t pinmux_data[] = {
403 /* specify valid pin states for each pin in GPIO mode */
404 /* 55-1 (GPIO) */
405 PORT_DATA_I_PD(0), PORT_DATA_I_PU(1),
406 PORT_DATA_I_PU(2), PORT_DATA_I_PU(3),
407 PORT_DATA_I_PU(4), PORT_DATA_I_PU(5),
408 PORT_DATA_I_PU(6), PORT_DATA_I_PU(7),
409 PORT_DATA_I_PU(8), PORT_DATA_I_PU(9),
410 PORT_DATA_I_PU(10), PORT_DATA_I_PU(11),
411 PORT_DATA_IO_PU(12), PORT_DATA_IO_PU(13),
412 PORT_DATA_IO_PU_PD(14), PORT_DATA_IO_PU_PD(15),
413 PORT_DATA_O(16), PORT_DATA_IO(17),
414 PORT_DATA_O(18), PORT_DATA_O(19),
415 PORT_DATA_O(20), PORT_DATA_O(21),
416 PORT_DATA_O(22), PORT_DATA_O(23),
417 PORT_DATA_O(24), PORT_DATA_I_PD(25),
418 PORT_DATA_I_PD(26), PORT_DATA_O(27),
419 PORT_DATA_O(28), PORT_DATA_O(29),
420 PORT_DATA_IO(30), PORT_DATA_IO_PU(31),
421 PORT_DATA_IO_PD(32), PORT_DATA_I_PU(33),
422 PORT_DATA_IO_PD(34), PORT_DATA_I_PU_PD(35),
423 PORT_DATA_O(36), PORT_DATA_IO(37),
424
425 /* 55-2 (GPIO) */
426 PORT_DATA_O(38), PORT_DATA_I_PU(39),
427 PORT_DATA_I_PU_PD(40), PORT_DATA_O(41),
428 PORT_DATA_IO_PD(42), PORT_DATA_IO_PD(43),
429 PORT_DATA_IO_PD(44), PORT_DATA_I_PD(45),
430 PORT_DATA_I_PD(46), PORT_DATA_I_PD(47),
431 PORT_DATA_I_PD(48), PORT_DATA_IO_PU_PD(49),
432 PORT_DATA_IO_PD(50), PORT_DATA_IO_PD(51),
433 PORT_DATA_O(52), PORT_DATA_IO_PU_PD(53),
434 PORT_DATA_IO_PU_PD(54), PORT_DATA_IO_PD(55),
435 PORT_DATA_I_PU_PD(56), PORT_DATA_IO(57),
436 PORT_DATA_IO(58), PORT_DATA_IO(59),
437 PORT_DATA_IO(60), PORT_DATA_IO(61),
438 PORT_DATA_IO_PD(62), PORT_DATA_IO_PD(63),
439 PORT_DATA_IO_PD(64), PORT_DATA_IO_PD(65),
440 PORT_DATA_IO_PU_PD(66), PORT_DATA_IO_PU_PD(67),
441 PORT_DATA_IO_PU_PD(68), PORT_DATA_IO_PU_PD(69),
442 PORT_DATA_IO_PU_PD(70), PORT_DATA_IO_PU_PD(71),
443 PORT_DATA_IO_PU_PD(72), PORT_DATA_I_PU_PD(73),
444 PORT_DATA_IO_PU(74), PORT_DATA_IO_PU(75),
445 PORT_DATA_IO_PU(76), PORT_DATA_IO_PU(77),
446 PORT_DATA_IO_PU(78), PORT_DATA_IO_PU(79),
447 PORT_DATA_IO_PU(80), PORT_DATA_IO_PU(81),
448 PORT_DATA_IO_PU(82), PORT_DATA_IO_PU(83),
449 PORT_DATA_IO_PU(84), PORT_DATA_IO_PU(85),
450 PORT_DATA_IO_PU(86), PORT_DATA_IO_PU(87),
451 PORT_DATA_IO_PU(88), PORT_DATA_IO_PU(89),
452 PORT_DATA_O(90), PORT_DATA_IO_PU(91),
453 PORT_DATA_O(92),
454
455 /* 55-3 (GPIO) */
456 PORT_DATA_IO_PU(93),
457 PORT_DATA_O(94),
458 PORT_DATA_I_PU_PD(95),
459 PORT_DATA_IO(96), PORT_DATA_IO(97),
460 PORT_DATA_IO(98), PORT_DATA_I_PU(99),
461 PORT_DATA_O(100), PORT_DATA_O(101),
462 PORT_DATA_I_PU(102), PORT_DATA_IO_PD(103),
463 PORT_DATA_I_PD(104), PORT_DATA_I_PD(105),
464 PORT_DATA_I_PD(106), PORT_DATA_I_PD(107),
465 PORT_DATA_I_PD(108), PORT_DATA_IO_PD(109),
466 PORT_DATA_IO_PD(110), PORT_DATA_I_PD(111),
467 PORT_DATA_IO_PD(112), PORT_DATA_IO_PD(113),
468 PORT_DATA_IO_PD(114), PORT_DATA_I_PD(115),
469 PORT_DATA_I_PD(116), PORT_DATA_IO_PD(117),
470 PORT_DATA_I_PD(118), PORT_DATA_IO_PD(128),
471 PORT_DATA_IO_PD(129), PORT_DATA_IO_PD(130),
472 PORT_DATA_IO_PD(131), PORT_DATA_IO_PD(132),
473 PORT_DATA_IO_PD(133), PORT_DATA_IO_PU_PD(134),
474 PORT_DATA_IO_PU_PD(135), PORT_DATA_IO_PU_PD(136),
475 PORT_DATA_IO_PU_PD(137), PORT_DATA_IO_PD(138),
476 PORT_DATA_IO_PD(139), PORT_DATA_IO_PD(140),
477 PORT_DATA_IO_PD(141), PORT_DATA_IO_PD(142),
478 PORT_DATA_IO_PD(143), PORT_DATA_IO_PU_PD(144),
479 PORT_DATA_IO_PD(145), PORT_DATA_IO_PU_PD(146),
480 PORT_DATA_IO_PU_PD(147), PORT_DATA_IO_PU_PD(148),
481 PORT_DATA_IO_PU_PD(149), PORT_DATA_I_PD(150),
482 PORT_DATA_IO_PU_PD(151), PORT_DATA_IO_PD(152),
483 PORT_DATA_IO_PD(153), PORT_DATA_IO_PD(154),
484 PORT_DATA_I_PD(155), PORT_DATA_IO_PU_PD(156),
485 PORT_DATA_I_PD(157), PORT_DATA_IO_PD(158),
486
487 /* 55-4 (GPIO) */
488 PORT_DATA_IO_PU_PD(159), PORT_DATA_IO_PU_PD(160),
489 PORT_DATA_I_PU_PD(161), PORT_DATA_I_PU_PD(162),
490 PORT_DATA_IO_PU_PD(163), PORT_DATA_I_PU_PD(164),
491 PORT_DATA_IO_PD(192), PORT_DATA_IO_PD(193),
492 PORT_DATA_IO_PD(194), PORT_DATA_IO_PD(195),
493 PORT_DATA_IO_PD(196), PORT_DATA_IO_PD(197),
494 PORT_DATA_IO_PD(198), PORT_DATA_IO_PD(199),
495 PORT_DATA_IO_PU_PD(200), PORT_DATA_IO_PU_PD(201),
496 PORT_DATA_IO_PU_PD(202), PORT_DATA_IO_PU_PD(203),
497 PORT_DATA_IO_PU_PD(204), PORT_DATA_IO_PU_PD(205),
498 PORT_DATA_IO_PU_PD(206), PORT_DATA_IO_PD(207),
499 PORT_DATA_IO_PD(208), PORT_DATA_IO_PD(209),
500 PORT_DATA_IO_PD(210), PORT_DATA_IO_PD(211),
501 PORT_DATA_IO_PD(212), PORT_DATA_IO_PD(213),
502 PORT_DATA_IO_PD(214), PORT_DATA_IO_PD(215),
503 PORT_DATA_IO_PD(216), PORT_DATA_IO_PD(217),
504 PORT_DATA_O(218), PORT_DATA_IO_PD(219),
505 PORT_DATA_IO_PD(220), PORT_DATA_IO_PD(221),
506 PORT_DATA_IO_PU_PD(222),
507 PORT_DATA_I_PU_PD(223), PORT_DATA_I_PU_PD(224),
508 PORT_DATA_IO_PU_PD(225), PORT_DATA_O(226),
509 PORT_DATA_IO_PU_PD(227), PORT_DATA_I_PD(228),
510 PORT_DATA_I_PD(229), PORT_DATA_IO(230),
511 PORT_DATA_IO_PD(231), PORT_DATA_IO_PU_PD(232),
512 PORT_DATA_I_PD(233), PORT_DATA_IO_PU_PD(234),
513 PORT_DATA_IO_PU_PD(235), PORT_DATA_IO_PU_PD(236),
514 PORT_DATA_IO_PD(237), PORT_DATA_IO_PU_PD(238),
515
516 /* 55-5 (GPIO) */
517 PORT_DATA_IO_PU_PD(239), PORT_DATA_IO_PU_PD(240),
518 PORT_DATA_O(241), PORT_DATA_I_PD(242),
519 PORT_DATA_IO_PU_PD(243), PORT_DATA_IO_PU_PD(244),
520 PORT_DATA_IO_PU_PD(245), PORT_DATA_IO_PU_PD(246),
521 PORT_DATA_IO_PU_PD(247), PORT_DATA_IO_PU_PD(248),
522 PORT_DATA_IO_PU_PD(249), PORT_DATA_IO_PD(250),
523 PORT_DATA_IO_PU_PD(251), PORT_DATA_IO_PU_PD(252),
524 PORT_DATA_IO_PU_PD(253), PORT_DATA_IO_PU_PD(254),
525 PORT_DATA_IO_PU_PD(255), PORT_DATA_IO_PU_PD(256),
526 PORT_DATA_IO_PU_PD(257), PORT_DATA_IO_PD(258),
527 PORT_DATA_IO_PU_PD(259), PORT_DATA_IO_PU_PD(260),
528 PORT_DATA_IO_PU_PD(261), PORT_DATA_IO_PU_PD(262),
529 PORT_DATA_IO_PU_PD(263),
530
531 /* Special Pull-up / Pull-down Functions */
532 PINMUX_DATA(PORT66_KEYIN0_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
533 PORT66_FN2, PORT66_IN_PU),
534 PINMUX_DATA(PORT67_KEYIN1_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
535 PORT67_FN2, PORT67_IN_PU),
536 PINMUX_DATA(PORT68_KEYIN2_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
537 PORT68_FN2, PORT68_IN_PU),
538 PINMUX_DATA(PORT69_KEYIN3_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
539 PORT69_FN2, PORT69_IN_PU),
540 PINMUX_DATA(PORT70_KEYIN4_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
541 PORT70_FN2, PORT70_IN_PU),
542 PINMUX_DATA(PORT71_KEYIN5_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
543 PORT71_FN2, PORT71_IN_PU),
544 PINMUX_DATA(PORT72_KEYIN6_PU_MARK, MSELBCR_MSEL17_0, MSELBCR_MSEL16_0,
545 PORT72_FN2, PORT72_IN_PU),
546
547
548 /* 55-1 (FN) */
549 PINMUX_DATA(VBUS_0_MARK, PORT0_FN1),
550 PINMUX_DATA(CPORT0_MARK, PORT1_FN1),
551 PINMUX_DATA(CPORT1_MARK, PORT2_FN1),
552 PINMUX_DATA(CPORT2_MARK, PORT3_FN1),
553 PINMUX_DATA(CPORT3_MARK, PORT4_FN1),
554 PINMUX_DATA(CPORT4_MARK, PORT5_FN1),
555 PINMUX_DATA(CPORT5_MARK, PORT6_FN1),
556 PINMUX_DATA(CPORT6_MARK, PORT7_FN1),
557 PINMUX_DATA(CPORT7_MARK, PORT8_FN1),
558 PINMUX_DATA(CPORT8_MARK, PORT9_FN1),
559 PINMUX_DATA(CPORT9_MARK, PORT10_FN1),
560 PINMUX_DATA(CPORT10_MARK, PORT11_FN1),
561 PINMUX_DATA(CPORT11_MARK, PORT12_FN1),
562 PINMUX_DATA(SIN2_MARK, PORT12_FN2),
563 PINMUX_DATA(CPORT12_MARK, PORT13_FN1),
564 PINMUX_DATA(XCTS2_MARK, PORT13_FN2),
565 PINMUX_DATA(CPORT13_MARK, PORT14_FN1),
566 PINMUX_DATA(RFSPO4_MARK, PORT14_FN2),
567 PINMUX_DATA(CPORT14_MARK, PORT15_FN1),
568 PINMUX_DATA(RFSPO5_MARK, PORT15_FN2),
569 PINMUX_DATA(CPORT15_MARK, PORT16_FN1),
570 PINMUX_DATA(SCIFA0_SCK_MARK, PORT16_FN2),
571 PINMUX_DATA(GPS_AGC2_MARK, PORT16_FN3),
572 PINMUX_DATA(CPORT16_MARK, PORT17_FN1),
573 PINMUX_DATA(SCIFA0_TXD_MARK, PORT17_FN2),
574 PINMUX_DATA(GPS_AGC3_MARK, PORT17_FN3),
575 PINMUX_DATA(CPORT17_IC_OE_MARK, PORT18_FN1),
576 PINMUX_DATA(SOUT2_MARK, PORT18_FN2),
577 PINMUX_DATA(CPORT18_MARK, PORT19_FN1),
578 PINMUX_DATA(XRTS2_MARK, PORT19_FN2),
579 PINMUX_DATA(PORT19_VIO_CKO2_MARK, PORT19_FN3),
580 PINMUX_DATA(CPORT19_MPORT1_MARK, PORT20_FN1),
581 PINMUX_DATA(CPORT20_MARK, PORT21_FN1),
582 PINMUX_DATA(RFSPO6_MARK, PORT21_FN2),
583 PINMUX_DATA(CPORT21_MARK, PORT22_FN1),
584 PINMUX_DATA(STATUS0_MARK, PORT22_FN2),
585 PINMUX_DATA(CPORT22_MARK, PORT23_FN1),
586 PINMUX_DATA(STATUS1_MARK, PORT23_FN2),
587 PINMUX_DATA(CPORT23_MARK, PORT24_FN1),
588 PINMUX_DATA(STATUS2_MARK, PORT24_FN2),
589 PINMUX_DATA(RFSPO7_MARK, PORT24_FN3),
590 PINMUX_DATA(B_SYNLD1_MARK, PORT25_FN1),
591 PINMUX_DATA(B_SYNLD2_MARK, PORT26_FN1),
592 PINMUX_DATA(SYSENMSK_MARK, PORT26_FN2),
593 PINMUX_DATA(XMAINPS_MARK, PORT27_FN1),
594 PINMUX_DATA(XDIVPS_MARK, PORT28_FN1),
595 PINMUX_DATA(XIDRST_MARK, PORT29_FN1),
596 PINMUX_DATA(IDCLK_MARK, PORT30_FN1),
597 PINMUX_DATA(IC_DP_MARK, PORT30_FN2),
598 PINMUX_DATA(IDIO_MARK, PORT31_FN1),
599 PINMUX_DATA(IC_DM_MARK, PORT31_FN2),
600 PINMUX_DATA(SOUT1_MARK, PORT32_FN1),
601 PINMUX_DATA(SCIFA4_TXD_MARK, PORT32_FN2),
602 PINMUX_DATA(M02_BERDAT_MARK, PORT32_FN3),
603 PINMUX_DATA(SIN1_MARK, PORT33_FN1),
604 PINMUX_DATA(SCIFA4_RXD_MARK, PORT33_FN2),
605 PINMUX_DATA(XWUP_MARK, PORT33_FN3),
606 PINMUX_DATA(XRTS1_MARK, PORT34_FN1),
607 PINMUX_DATA(SCIFA4_RTS_MARK, PORT34_FN2),
608 PINMUX_DATA(M03_BERCLK_MARK, PORT34_FN3),
609 PINMUX_DATA(XCTS1_MARK, PORT35_FN1),
610 PINMUX_DATA(SCIFA4_CTS_MARK, PORT35_FN2),
611 PINMUX_DATA(PCMCLKO_MARK, PORT36_FN1),
612 PINMUX_DATA(SYNC8KO_MARK, PORT37_FN1),
613
614 /* 55-2 (FN) */
615 PINMUX_DATA(DNPCM_A_MARK, PORT38_FN1),
616 PINMUX_DATA(UPPCM_A_MARK, PORT39_FN1),
617 PINMUX_DATA(VACK_MARK, PORT40_FN1),
618 PINMUX_DATA(XTALB1L_MARK, PORT41_FN1),
619 PINMUX_DATA(GPS_AGC1_MARK, PORT42_FN1),
620 PINMUX_DATA(SCIFA0_RTS_MARK, PORT42_FN2),
621 PINMUX_DATA(GPS_AGC4_MARK, PORT43_FN1),
622 PINMUX_DATA(SCIFA0_RXD_MARK, PORT43_FN2),
623 PINMUX_DATA(GPS_PWRDOWN_MARK, PORT44_FN1),
624 PINMUX_DATA(SCIFA0_CTS_MARK, PORT44_FN2),
625 PINMUX_DATA(GPS_IM_MARK, PORT45_FN1),
626 PINMUX_DATA(GPS_IS_MARK, PORT46_FN1),
627 PINMUX_DATA(GPS_QM_MARK, PORT47_FN1),
628 PINMUX_DATA(GPS_QS_MARK, PORT48_FN1),
629 PINMUX_DATA(FMSOCK_MARK, PORT49_FN1),
630 PINMUX_DATA(PORT49_IRDA_OUT_MARK, PORT49_FN2),
631 PINMUX_DATA(PORT49_IROUT_MARK, PORT49_FN3),
632 PINMUX_DATA(FMSOOLR_MARK, PORT50_FN1),
633 PINMUX_DATA(BBIF2_TSYNC2_MARK, PORT50_FN2),
634 PINMUX_DATA(TPU2TO2_MARK, PORT50_FN3),
635 PINMUX_DATA(IPORT3_MARK, PORT50_FN4),
636 PINMUX_DATA(FMSIOLR_MARK, PORT50_FN5),
637 PINMUX_DATA(FMSOOBT_MARK, PORT51_FN1),
638 PINMUX_DATA(BBIF2_TSCK2_MARK, PORT51_FN2),
639 PINMUX_DATA(TPU2TO3_MARK, PORT51_FN3),
640 PINMUX_DATA(OPORT1_MARK, PORT51_FN4),
641 PINMUX_DATA(FMSIOBT_MARK, PORT51_FN5),
642 PINMUX_DATA(FMSOSLD_MARK, PORT52_FN1),
643 PINMUX_DATA(BBIF2_TXD2_MARK, PORT52_FN2),
644 PINMUX_DATA(OPORT2_MARK, PORT52_FN3),
645 PINMUX_DATA(FMSOILR_MARK, PORT53_FN1),
646 PINMUX_DATA(PORT53_IRDA_IN_MARK, PORT53_FN2),
647 PINMUX_DATA(TPU3TO3_MARK, PORT53_FN3),
648 PINMUX_DATA(OPORT3_MARK, PORT53_FN4),
649 PINMUX_DATA(FMSIILR_MARK, PORT53_FN5),
650 PINMUX_DATA(FMSOIBT_MARK, PORT54_FN1),
651 PINMUX_DATA(PORT54_IRDA_FIRSEL_MARK, PORT54_FN2),
652 PINMUX_DATA(TPU3TO2_MARK, PORT54_FN3),
653 PINMUX_DATA(FMSIIBT_MARK, PORT54_FN4),
654 PINMUX_DATA(FMSISLD_MARK, PORT55_FN1),
655 PINMUX_DATA(MFG0_OUT1_MARK, PORT55_FN2),
656 PINMUX_DATA(TPU0TO0_MARK, PORT55_FN3),
657 PINMUX_DATA(A0_EA0_MARK, PORT57_FN1),
658 PINMUX_DATA(BS_MARK, PORT57_FN2),
659 PINMUX_DATA(A12_EA12_MARK, PORT58_FN1),
660 PINMUX_DATA(PORT58_VIO_CKOR_MARK, PORT58_FN2),
661 PINMUX_DATA(TPU4TO2_MARK, PORT58_FN3),
662 PINMUX_DATA(A13_EA13_MARK, PORT59_FN1),
663 PINMUX_DATA(PORT59_IROUT_MARK, PORT59_FN2),
664 PINMUX_DATA(MFG0_OUT2_MARK, PORT59_FN3),
665 PINMUX_DATA(TPU0TO1_MARK, PORT59_FN4),
666 PINMUX_DATA(A14_EA14_MARK, PORT60_FN1),
667 PINMUX_DATA(PORT60_KEYOUT5_MARK, PORT60_FN2),
668 PINMUX_DATA(A15_EA15_MARK, PORT61_FN1),
669 PINMUX_DATA(PORT61_KEYOUT4_MARK, PORT61_FN2),
670 PINMUX_DATA(A16_EA16_MARK, PORT62_FN1),
671 PINMUX_DATA(PORT62_KEYOUT3_MARK, PORT62_FN2),
672 PINMUX_DATA(MSIOF0_SS1_MARK, PORT62_FN3),
673 PINMUX_DATA(A17_EA17_MARK, PORT63_FN1),
674 PINMUX_DATA(PORT63_KEYOUT2_MARK, PORT63_FN2),
675 PINMUX_DATA(MSIOF0_TSYNC_MARK, PORT63_FN3),
676 PINMUX_DATA(A18_EA18_MARK, PORT64_FN1),
677 PINMUX_DATA(PORT64_KEYOUT1_MARK, PORT64_FN2),
678 PINMUX_DATA(MSIOF0_TSCK_MARK, PORT64_FN3),
679 PINMUX_DATA(A19_EA19_MARK, PORT65_FN1),
680 PINMUX_DATA(PORT65_KEYOUT0_MARK, PORT65_FN2),
681 PINMUX_DATA(MSIOF0_TXD_MARK, PORT65_FN3),
682 PINMUX_DATA(A20_EA20_MARK, PORT66_FN1),
683 PINMUX_DATA(PORT66_KEYIN0_MARK, PORT66_FN2),
684 PINMUX_DATA(MSIOF0_RSCK_MARK, PORT66_FN3),
685 PINMUX_DATA(A21_EA21_MARK, PORT67_FN1),
686 PINMUX_DATA(PORT67_KEYIN1_MARK, PORT67_FN2),
687 PINMUX_DATA(MSIOF0_RSYNC_MARK, PORT67_FN3),
688 PINMUX_DATA(A22_EA22_MARK, PORT68_FN1),
689 PINMUX_DATA(PORT68_KEYIN2_MARK, PORT68_FN2),
690 PINMUX_DATA(MSIOF0_MCK0_MARK, PORT68_FN3),
691 PINMUX_DATA(A23_EA23_MARK, PORT69_FN1),
692 PINMUX_DATA(PORT69_KEYIN3_MARK, PORT69_FN2),
693 PINMUX_DATA(MSIOF0_MCK1_MARK, PORT69_FN3),
694 PINMUX_DATA(A24_EA24_MARK, PORT70_FN1),
695 PINMUX_DATA(PORT70_KEYIN4_MARK, PORT70_FN2),
696 PINMUX_DATA(MSIOF0_RXD_MARK, PORT70_FN3),
697 PINMUX_DATA(A25_EA25_MARK, PORT71_FN1),
698 PINMUX_DATA(PORT71_KEYIN5_MARK, PORT71_FN2),
699 PINMUX_DATA(MSIOF0_SS2_MARK, PORT71_FN3),
700 PINMUX_DATA(A26_MARK, PORT72_FN1),
701 PINMUX_DATA(PORT72_KEYIN6_MARK, PORT72_FN2),
702 PINMUX_DATA(D0_ED0_NAF0_MARK, PORT74_FN1),
703 PINMUX_DATA(D1_ED1_NAF1_MARK, PORT75_FN1),
704 PINMUX_DATA(D2_ED2_NAF2_MARK, PORT76_FN1),
705 PINMUX_DATA(D3_ED3_NAF3_MARK, PORT77_FN1),
706 PINMUX_DATA(D4_ED4_NAF4_MARK, PORT78_FN1),
707 PINMUX_DATA(D5_ED5_NAF5_MARK, PORT79_FN1),
708 PINMUX_DATA(D6_ED6_NAF6_MARK, PORT80_FN1),
709 PINMUX_DATA(D7_ED7_NAF7_MARK, PORT81_FN1),
710 PINMUX_DATA(D8_ED8_NAF8_MARK, PORT82_FN1),
711 PINMUX_DATA(D9_ED9_NAF9_MARK, PORT83_FN1),
712 PINMUX_DATA(D10_ED10_NAF10_MARK, PORT84_FN1),
713 PINMUX_DATA(D11_ED11_NAF11_MARK, PORT85_FN1),
714 PINMUX_DATA(D12_ED12_NAF12_MARK, PORT86_FN1),
715 PINMUX_DATA(D13_ED13_NAF13_MARK, PORT87_FN1),
716 PINMUX_DATA(D14_ED14_NAF14_MARK, PORT88_FN1),
717 PINMUX_DATA(D15_ED15_NAF15_MARK, PORT89_FN1),
718 PINMUX_DATA(CS4_MARK, PORT90_FN1),
719 PINMUX_DATA(CS5A_MARK, PORT91_FN1),
720 PINMUX_DATA(FMSICK_MARK, PORT91_FN2),
721 PINMUX_DATA(CS5B_MARK, PORT92_FN1),
722 PINMUX_DATA(FCE1_MARK, PORT92_FN2),
723
724 /* 55-3 (FN) */
725 PINMUX_DATA(CS6B_MARK, PORT93_FN1),
726 PINMUX_DATA(XCS2_MARK, PORT93_FN2),
727 PINMUX_DATA(CS6A_MARK, PORT93_FN3),
728 PINMUX_DATA(DACK0_MARK, PORT93_FN4),
729 PINMUX_DATA(FCE0_MARK, PORT94_FN1),
730 PINMUX_DATA(WAIT_MARK, PORT95_FN1),
731 PINMUX_DATA(DREQ0_MARK, PORT95_FN2),
732 PINMUX_DATA(RD_XRD_MARK, PORT96_FN1),
733 PINMUX_DATA(WE0_XWR0_FWE_MARK, PORT97_FN1),
734 PINMUX_DATA(WE1_XWR1_MARK, PORT98_FN1),
735 PINMUX_DATA(FRB_MARK, PORT99_FN1),
736 PINMUX_DATA(CKO_MARK, PORT100_FN1),
737 PINMUX_DATA(NBRSTOUT_MARK, PORT101_FN1),
738 PINMUX_DATA(NBRST_MARK, PORT102_FN1),
739 PINMUX_DATA(GPS_EPPSIN_MARK, PORT106_FN1),
740 PINMUX_DATA(LATCHPULSE_MARK, PORT110_FN1),
741 PINMUX_DATA(LTESIGNAL_MARK, PORT111_FN1),
742 PINMUX_DATA(LEGACYSTATE_MARK, PORT112_FN1),
743 PINMUX_DATA(TCKON_MARK, PORT118_FN1),
744 PINMUX_DATA(VIO_VD_MARK, PORT128_FN1),
745 PINMUX_DATA(PORT128_KEYOUT0_MARK, PORT128_FN2),
746 PINMUX_DATA(IPORT0_MARK, PORT128_FN3),
747 PINMUX_DATA(VIO_HD_MARK, PORT129_FN1),
748 PINMUX_DATA(PORT129_KEYOUT1_MARK, PORT129_FN2),
749 PINMUX_DATA(IPORT1_MARK, PORT129_FN3),
750 PINMUX_DATA(VIO_D0_MARK, PORT130_FN1),
751 PINMUX_DATA(PORT130_KEYOUT2_MARK, PORT130_FN2),
752 PINMUX_DATA(PORT130_MSIOF2_RXD_MARK, PORT130_FN3),
753 PINMUX_DATA(VIO_D1_MARK, PORT131_FN1),
754 PINMUX_DATA(PORT131_KEYOUT3_MARK, PORT131_FN2),
755 PINMUX_DATA(PORT131_MSIOF2_SS1_MARK, PORT131_FN3),
756 PINMUX_DATA(VIO_D2_MARK, PORT132_FN1),
757 PINMUX_DATA(PORT132_KEYOUT4_MARK, PORT132_FN2),
758 PINMUX_DATA(PORT132_MSIOF2_SS2_MARK, PORT132_FN3),
759 PINMUX_DATA(VIO_D3_MARK, PORT133_FN1),
760 PINMUX_DATA(PORT133_KEYOUT5_MARK, PORT133_FN2),
761 PINMUX_DATA(PORT133_MSIOF2_TSYNC_MARK, PORT133_FN3),
762 PINMUX_DATA(VIO_D4_MARK, PORT134_FN1),
763 PINMUX_DATA(PORT134_KEYIN0_MARK, PORT134_FN2),
764 PINMUX_DATA(PORT134_MSIOF2_TXD_MARK, PORT134_FN3),
765 PINMUX_DATA(VIO_D5_MARK, PORT135_FN1),
766 PINMUX_DATA(PORT135_KEYIN1_MARK, PORT135_FN2),
767 PINMUX_DATA(PORT135_MSIOF2_TSCK_MARK, PORT135_FN3),
768 PINMUX_DATA(VIO_D6_MARK, PORT136_FN1),
769 PINMUX_DATA(PORT136_KEYIN2_MARK, PORT136_FN2),
770 PINMUX_DATA(VIO_D7_MARK, PORT137_FN1),
771 PINMUX_DATA(PORT137_KEYIN3_MARK, PORT137_FN2),
772 PINMUX_DATA(VIO_D8_MARK, PORT138_FN1),
773 PINMUX_DATA(M9_SLCD_A01_MARK, PORT138_FN2),
774 PINMUX_DATA(PORT138_FSIAOMC_MARK, PORT138_FN3),
775 PINMUX_DATA(VIO_D9_MARK, PORT139_FN1),
776 PINMUX_DATA(M10_SLCD_CK1_MARK, PORT139_FN2),
777 PINMUX_DATA(PORT139_FSIAOLR_MARK, PORT139_FN3),
778 PINMUX_DATA(VIO_D10_MARK, PORT140_FN1),
779 PINMUX_DATA(M11_SLCD_SO1_MARK, PORT140_FN2),
780 PINMUX_DATA(TPU0TO2_MARK, PORT140_FN3),
781 PINMUX_DATA(PORT140_FSIAOBT_MARK, PORT140_FN4),
782 PINMUX_DATA(VIO_D11_MARK, PORT141_FN1),
783 PINMUX_DATA(M12_SLCD_CE1_MARK, PORT141_FN2),
784 PINMUX_DATA(TPU0TO3_MARK, PORT141_FN3),
785 PINMUX_DATA(PORT141_FSIAOSLD_MARK, PORT141_FN4),
786 PINMUX_DATA(VIO_D12_MARK, PORT142_FN1),
787 PINMUX_DATA(M13_BSW_MARK, PORT142_FN2),
788 PINMUX_DATA(PORT142_FSIACK_MARK, PORT142_FN3),
789 PINMUX_DATA(VIO_D13_MARK, PORT143_FN1),
790 PINMUX_DATA(M14_GSW_MARK, PORT143_FN2),
791 PINMUX_DATA(PORT143_FSIAILR_MARK, PORT143_FN3),
792 PINMUX_DATA(VIO_D14_MARK, PORT144_FN1),
793 PINMUX_DATA(M15_RSW_MARK, PORT144_FN2),
794 PINMUX_DATA(PORT144_FSIAIBT_MARK, PORT144_FN3),
795 PINMUX_DATA(VIO_D15_MARK, PORT145_FN1),
796 PINMUX_DATA(TPU1TO3_MARK, PORT145_FN2),
797 PINMUX_DATA(PORT145_FSIAISLD_MARK, PORT145_FN3),
798 PINMUX_DATA(VIO_CLK_MARK, PORT146_FN1),
799 PINMUX_DATA(PORT146_KEYIN4_MARK, PORT146_FN2),
800 PINMUX_DATA(IPORT2_MARK, PORT146_FN3),
801 PINMUX_DATA(VIO_FIELD_MARK, PORT147_FN1),
802 PINMUX_DATA(PORT147_KEYIN5_MARK, PORT147_FN2),
803 PINMUX_DATA(VIO_CKO_MARK, PORT148_FN1),
804 PINMUX_DATA(PORT148_KEYIN6_MARK, PORT148_FN2),
805 PINMUX_DATA(A27_MARK, PORT149_FN1),
806 PINMUX_DATA(RDWR_XWE_MARK, PORT149_FN2),
807 PINMUX_DATA(MFG0_IN1_MARK, PORT149_FN3),
808 PINMUX_DATA(MFG0_IN2_MARK, PORT150_FN1),
809 PINMUX_DATA(TS_SPSYNC3_MARK, PORT151_FN1),
810 PINMUX_DATA(MSIOF2_RSCK_MARK, PORT151_FN2),
811 PINMUX_DATA(TS_SDAT3_MARK, PORT152_FN1),
812 PINMUX_DATA(MSIOF2_RSYNC_MARK, PORT152_FN2),
813 PINMUX_DATA(TPU1TO2_MARK, PORT153_FN1),
814 PINMUX_DATA(TS_SDEN3_MARK, PORT153_FN2),
815 PINMUX_DATA(PORT153_MSIOF2_SS1_MARK, PORT153_FN3),
816 PINMUX_DATA(SOUT3_MARK, PORT154_FN1),
817 PINMUX_DATA(SCIFA2_TXD1_MARK, PORT154_FN2),
818 PINMUX_DATA(MSIOF2_MCK0_MARK, PORT154_FN3),
819 PINMUX_DATA(SIN3_MARK, PORT155_FN1),
820 PINMUX_DATA(SCIFA2_RXD1_MARK, PORT155_FN2),
821 PINMUX_DATA(MSIOF2_MCK1_MARK, PORT155_FN3),
822 PINMUX_DATA(XRTS3_MARK, PORT156_FN1),
823 PINMUX_DATA(SCIFA2_RTS1_MARK, PORT156_FN2),
824 PINMUX_DATA(PORT156_MSIOF2_SS2_MARK, PORT156_FN3),
825 PINMUX_DATA(XCTS3_MARK, PORT157_FN1),
826 PINMUX_DATA(SCIFA2_CTS1_MARK, PORT157_FN2),
827 PINMUX_DATA(PORT157_MSIOF2_RXD_MARK, PORT157_FN3),
828
829 /* 55-4 (FN) */
830 PINMUX_DATA(DINT_MARK, PORT158_FN1),
831 PINMUX_DATA(SCIFA2_SCK1_MARK, PORT158_FN2),
832 PINMUX_DATA(TS_SCK3_MARK, PORT158_FN3),
833 PINMUX_DATA(PORT159_SCIFB_SCK_MARK, PORT159_FN1),
834 PINMUX_DATA(PORT159_SCIFA5_SCK_MARK, PORT159_FN2),
835 PINMUX_DATA(NMI_MARK, PORT159_FN3),
836 PINMUX_DATA(PORT160_SCIFB_TXD_MARK, PORT160_FN1),
837 PINMUX_DATA(PORT160_SCIFA5_TXD_MARK, PORT160_FN2),
838 PINMUX_DATA(SOUT0_MARK, PORT160_FN3),
839 PINMUX_DATA(PORT161_SCIFB_CTS_MARK, PORT161_FN1),
840 PINMUX_DATA(PORT161_SCIFA5_CTS_MARK, PORT161_FN2),
841 PINMUX_DATA(XCTS0_MARK, PORT161_FN3),
842 PINMUX_DATA(MFG3_IN2_MARK, PORT161_FN4),
843 PINMUX_DATA(PORT162_SCIFB_RXD_MARK, PORT162_FN1),
844 PINMUX_DATA(PORT162_SCIFA5_RXD_MARK, PORT162_FN2),
845 PINMUX_DATA(SIN0_MARK, PORT162_FN3),
846 PINMUX_DATA(MFG3_IN1_MARK, PORT162_FN4),
847 PINMUX_DATA(PORT163_SCIFB_RTS_MARK, PORT163_FN1),
848 PINMUX_DATA(PORT163_SCIFA5_RTS_MARK, PORT163_FN2),
849 PINMUX_DATA(XRTS0_MARK, PORT163_FN3),
850 PINMUX_DATA(MFG3_OUT1_MARK, PORT163_FN4),
851 PINMUX_DATA(TPU3TO0_MARK, PORT163_FN5),
852 PINMUX_DATA(LCDD0_MARK, PORT192_FN1),
853 PINMUX_DATA(PORT192_KEYOUT0_MARK, PORT192_FN2),
854 PINMUX_DATA(EXT_CKI_MARK, PORT192_FN3),
855 PINMUX_DATA(LCDD1_MARK, PORT193_FN1),
856 PINMUX_DATA(PORT193_KEYOUT1_MARK, PORT193_FN2),
857 PINMUX_DATA(PORT193_SCIFA5_CTS_MARK, PORT193_FN3),
858 PINMUX_DATA(BBIF2_TSYNC1_MARK, PORT193_FN4),
859 PINMUX_DATA(LCDD2_MARK, PORT194_FN1),
860 PINMUX_DATA(PORT194_KEYOUT2_MARK, PORT194_FN2),
861 PINMUX_DATA(PORT194_SCIFA5_RTS_MARK, PORT194_FN3),
862 PINMUX_DATA(BBIF2_TSCK1_MARK, PORT194_FN4),
863 PINMUX_DATA(LCDD3_MARK, PORT195_FN1),
864 PINMUX_DATA(PORT195_KEYOUT3_MARK, PORT195_FN2),
865 PINMUX_DATA(PORT195_SCIFA5_RXD_MARK, PORT195_FN3),
866 PINMUX_DATA(BBIF2_TXD1_MARK, PORT195_FN4),
867 PINMUX_DATA(LCDD4_MARK, PORT196_FN1),
868 PINMUX_DATA(PORT196_KEYOUT4_MARK, PORT196_FN2),
869 PINMUX_DATA(PORT196_SCIFA5_TXD_MARK, PORT196_FN3),
870 PINMUX_DATA(LCDD5_MARK, PORT197_FN1),
871 PINMUX_DATA(PORT197_KEYOUT5_MARK, PORT197_FN2),
872 PINMUX_DATA(PORT197_SCIFA5_SCK_MARK, PORT197_FN3),
873 PINMUX_DATA(MFG2_OUT2_MARK, PORT197_FN4),
874 PINMUX_DATA(LCDD6_MARK, PORT198_FN1),
875 PINMUX_DATA(LCDD7_MARK, PORT199_FN1),
876 PINMUX_DATA(TPU4TO1_MARK, PORT199_FN2),
877 PINMUX_DATA(MFG4_OUT2_MARK, PORT199_FN3),
878 PINMUX_DATA(LCDD8_MARK, PORT200_FN1),
879 PINMUX_DATA(PORT200_KEYIN0_MARK, PORT200_FN2),
880 PINMUX_DATA(VIO_DR0_MARK, PORT200_FN3),
881 PINMUX_DATA(D16_MARK, PORT200_FN4),
882 PINMUX_DATA(LCDD9_MARK, PORT201_FN1),
883 PINMUX_DATA(PORT201_KEYIN1_MARK, PORT201_FN2),
884 PINMUX_DATA(VIO_DR1_MARK, PORT201_FN3),
885 PINMUX_DATA(D17_MARK, PORT201_FN4),
886 PINMUX_DATA(LCDD10_MARK, PORT202_FN1),
887 PINMUX_DATA(PORT202_KEYIN2_MARK, PORT202_FN2),
888 PINMUX_DATA(VIO_DR2_MARK, PORT202_FN3),
889 PINMUX_DATA(D18_MARK, PORT202_FN4),
890 PINMUX_DATA(LCDD11_MARK, PORT203_FN1),
891 PINMUX_DATA(PORT203_KEYIN3_MARK, PORT203_FN2),
892 PINMUX_DATA(VIO_DR3_MARK, PORT203_FN3),
893 PINMUX_DATA(D19_MARK, PORT203_FN4),
894 PINMUX_DATA(LCDD12_MARK, PORT204_FN1),
895 PINMUX_DATA(PORT204_KEYIN4_MARK, PORT204_FN2),
896 PINMUX_DATA(VIO_DR4_MARK, PORT204_FN3),
897 PINMUX_DATA(D20_MARK, PORT204_FN4),
898 PINMUX_DATA(LCDD13_MARK, PORT205_FN1),
899 PINMUX_DATA(PORT205_KEYIN5_MARK, PORT205_FN2),
900 PINMUX_DATA(VIO_DR5_MARK, PORT205_FN3),
901 PINMUX_DATA(D21_MARK, PORT205_FN4),
902 PINMUX_DATA(LCDD14_MARK, PORT206_FN1),
903 PINMUX_DATA(PORT206_KEYIN6_MARK, PORT206_FN2),
904 PINMUX_DATA(VIO_DR6_MARK, PORT206_FN3),
905 PINMUX_DATA(D22_MARK, PORT206_FN4),
906 PINMUX_DATA(LCDD15_MARK, PORT207_FN1),
907 PINMUX_DATA(PORT207_MSIOF0L_SS1_MARK, PORT207_FN2),
908 PINMUX_DATA(PORT207_KEYOUT0_MARK, PORT207_FN3),
909 PINMUX_DATA(VIO_DR7_MARK, PORT207_FN4),
910 PINMUX_DATA(D23_MARK, PORT207_FN5),
911 PINMUX_DATA(LCDD16_MARK, PORT208_FN1),
912 PINMUX_DATA(PORT208_MSIOF0L_SS2_MARK, PORT208_FN2),
913 PINMUX_DATA(PORT208_KEYOUT1_MARK, PORT208_FN3),
914 PINMUX_DATA(VIO_VDR_MARK, PORT208_FN4),
915 PINMUX_DATA(D24_MARK, PORT208_FN5),
916 PINMUX_DATA(LCDD17_MARK, PORT209_FN1),
917 PINMUX_DATA(PORT209_KEYOUT2_MARK, PORT209_FN2),
918 PINMUX_DATA(VIO_HDR_MARK, PORT209_FN3),
919 PINMUX_DATA(D25_MARK, PORT209_FN4),
920 PINMUX_DATA(LCDD18_MARK, PORT210_FN1),
921 PINMUX_DATA(DREQ2_MARK, PORT210_FN2),
922 PINMUX_DATA(PORT210_MSIOF0L_SS1_MARK, PORT210_FN3),
923 PINMUX_DATA(D26_MARK, PORT210_FN4),
924 PINMUX_DATA(LCDD19_MARK, PORT211_FN1),
925 PINMUX_DATA(PORT211_MSIOF0L_SS2_MARK, PORT211_FN2),
926 PINMUX_DATA(D27_MARK, PORT211_FN3),
927 PINMUX_DATA(LCDD20_MARK, PORT212_FN1),
928 PINMUX_DATA(TS_SPSYNC1_MARK, PORT212_FN2),
929 PINMUX_DATA(MSIOF0L_MCK0_MARK, PORT212_FN3),
930 PINMUX_DATA(D28_MARK, PORT212_FN4),
931 PINMUX_DATA(LCDD21_MARK, PORT213_FN1),
932 PINMUX_DATA(TS_SDAT1_MARK, PORT213_FN2),
933 PINMUX_DATA(MSIOF0L_MCK1_MARK, PORT213_FN3),
934 PINMUX_DATA(D29_MARK, PORT213_FN4),
935 PINMUX_DATA(LCDD22_MARK, PORT214_FN1),
936 PINMUX_DATA(TS_SDEN1_MARK, PORT214_FN2),
937 PINMUX_DATA(MSIOF0L_RSCK_MARK, PORT214_FN3),
938 PINMUX_DATA(D30_MARK, PORT214_FN4),
939 PINMUX_DATA(LCDD23_MARK, PORT215_FN1),
940 PINMUX_DATA(TS_SCK1_MARK, PORT215_FN2),
941 PINMUX_DATA(MSIOF0L_RSYNC_MARK, PORT215_FN3),
942 PINMUX_DATA(D31_MARK, PORT215_FN4),
943 PINMUX_DATA(LCDDCK_MARK, PORT216_FN1),
944 PINMUX_DATA(LCDWR_MARK, PORT216_FN2),
945 PINMUX_DATA(PORT216_KEYOUT3_MARK, PORT216_FN3),
946 PINMUX_DATA(VIO_CLKR_MARK, PORT216_FN4),
947 PINMUX_DATA(LCDRD_MARK, PORT217_FN1),
948 PINMUX_DATA(DACK2_MARK, PORT217_FN2),
949 PINMUX_DATA(MSIOF0L_TSYNC_MARK, PORT217_FN3),
950 PINMUX_DATA(LCDHSYN_MARK, PORT218_FN1),
951 PINMUX_DATA(LCDCS_MARK, PORT218_FN2),
952 PINMUX_DATA(LCDCS2_MARK, PORT218_FN3),
953 PINMUX_DATA(DACK3_MARK, PORT218_FN4),
954 PINMUX_DATA(PORT218_VIO_CKOR_MARK, PORT218_FN5),
955 PINMUX_DATA(PORT218_KEYOUT4_MARK, PORT218_FN6),
956 PINMUX_DATA(LCDDISP_MARK, PORT219_FN1),
957 PINMUX_DATA(LCDRS_MARK, PORT219_FN2),
958 PINMUX_DATA(DREQ3_MARK, PORT219_FN3),
959 PINMUX_DATA(MSIOF0L_TSCK_MARK, PORT219_FN4),
960 PINMUX_DATA(LCDVSYN_MARK, PORT220_FN1),
961 PINMUX_DATA(LCDVSYN2_MARK, PORT220_FN2),
962 PINMUX_DATA(PORT220_KEYOUT5_MARK, PORT220_FN3),
963 PINMUX_DATA(LCDLCLK_MARK, PORT221_FN1),
964 PINMUX_DATA(DREQ1_MARK, PORT221_FN2),
965 PINMUX_DATA(PWEN_MARK, PORT221_FN3),
966 PINMUX_DATA(MSIOF0L_RXD_MARK, PORT221_FN4),
967 PINMUX_DATA(LCDDON_MARK, PORT222_FN1),
968 PINMUX_DATA(LCDDON2_MARK, PORT222_FN2),
969 PINMUX_DATA(DACK1_MARK, PORT222_FN3),
970 PINMUX_DATA(OVCN_MARK, PORT222_FN4),
971 PINMUX_DATA(MSIOF0L_TXD_MARK, PORT222_FN5),
972 PINMUX_DATA(SCIFA1_TXD_MARK, PORT225_FN1),
973 PINMUX_DATA(OVCN2_MARK, PORT225_FN2),
974 PINMUX_DATA(EXTLP_MARK, PORT226_FN1),
975 PINMUX_DATA(SCIFA1_SCK_MARK, PORT226_FN2),
976 PINMUX_DATA(USBTERM_MARK, PORT226_FN3),
977 PINMUX_DATA(PORT226_VIO_CKO2_MARK, PORT226_FN4),
978 PINMUX_DATA(SCIFA1_RTS_MARK, PORT227_FN1),
979 PINMUX_DATA(IDIN_MARK, PORT227_FN2),
980 PINMUX_DATA(SCIFA1_RXD_MARK, PORT228_FN1),
981 PINMUX_DATA(SCIFA1_CTS_MARK, PORT229_FN1),
982 PINMUX_DATA(MFG1_IN1_MARK, PORT229_FN2),
983 PINMUX_DATA(MSIOF1_TXD_MARK, PORT230_FN1),
984 PINMUX_DATA(SCIFA2_TXD2_MARK, PORT230_FN2),
985 PINMUX_DATA(PORT230_FSIAOMC_MARK, PORT230_FN3),
986 PINMUX_DATA(MSIOF1_TSYNC_MARK, PORT231_FN1),
987 PINMUX_DATA(SCIFA2_CTS2_MARK, PORT231_FN2),
988 PINMUX_DATA(PORT231_FSIAOLR_MARK, PORT231_FN3),
989 PINMUX_DATA(MSIOF1_TSCK_MARK, PORT232_FN1),
990 PINMUX_DATA(SCIFA2_SCK2_MARK, PORT232_FN2),
991 PINMUX_DATA(PORT232_FSIAOBT_MARK, PORT232_FN3),
992 PINMUX_DATA(MSIOF1_RXD_MARK, PORT233_FN1),
993 PINMUX_DATA(SCIFA2_RXD2_MARK, PORT233_FN2),
994 PINMUX_DATA(GPS_VCOTRIG_MARK, PORT233_FN3),
995 PINMUX_DATA(PORT233_FSIACK_MARK, PORT233_FN4),
996 PINMUX_DATA(MSIOF1_RSCK_MARK, PORT234_FN1),
997 PINMUX_DATA(SCIFA2_RTS2_MARK, PORT234_FN2),
998 PINMUX_DATA(PORT234_FSIAOSLD_MARK, PORT234_FN3),
999 PINMUX_DATA(MSIOF1_RSYNC_MARK, PORT235_FN1),
1000 PINMUX_DATA(OPORT0_MARK, PORT235_FN2),
1001 PINMUX_DATA(MFG1_IN2_MARK, PORT235_FN3),
1002 PINMUX_DATA(PORT235_FSIAILR_MARK, PORT235_FN4),
1003 PINMUX_DATA(MSIOF1_MCK0_MARK, PORT236_FN1),
1004 PINMUX_DATA(I2C_SDA2_MARK, PORT236_FN2),
1005 PINMUX_DATA(PORT236_FSIAIBT_MARK, PORT236_FN3),
1006 PINMUX_DATA(MSIOF1_MCK1_MARK, PORT237_FN1),
1007 PINMUX_DATA(I2C_SCL2_MARK, PORT237_FN2),
1008 PINMUX_DATA(PORT237_FSIAISLD_MARK, PORT237_FN3),
1009 PINMUX_DATA(MSIOF1_SS1_MARK, PORT238_FN1),
1010 PINMUX_DATA(EDBGREQ3_MARK, PORT238_FN2),
1011
1012 /* 55-5 (FN) */
1013 PINMUX_DATA(MSIOF1_SS2_MARK, PORT239_FN1),
1014 PINMUX_DATA(SCIFA6_TXD_MARK, PORT240_FN1),
1015 PINMUX_DATA(PORT241_IRDA_OUT_MARK, PORT241_FN1),
1016 PINMUX_DATA(PORT241_IROUT_MARK, PORT241_FN2),
1017 PINMUX_DATA(MFG4_OUT1_MARK, PORT241_FN3),
1018 PINMUX_DATA(TPU4TO0_MARK, PORT241_FN4),
1019 PINMUX_DATA(PORT242_IRDA_IN_MARK, PORT242_FN1),
1020 PINMUX_DATA(MFG4_IN2_MARK, PORT242_FN2),
1021 PINMUX_DATA(PORT243_IRDA_FIRSEL_MARK, PORT243_FN1),
1022 PINMUX_DATA(PORT243_VIO_CKO2_MARK, PORT243_FN2),
1023 PINMUX_DATA(PORT244_SCIFA5_CTS_MARK, PORT244_FN1),
1024 PINMUX_DATA(MFG2_IN1_MARK, PORT244_FN2),
1025 PINMUX_DATA(PORT244_SCIFB_CTS_MARK, PORT244_FN3),
1026 PINMUX_DATA(PORT245_SCIFA5_RTS_MARK, PORT245_FN1),
1027 PINMUX_DATA(MFG2_IN2_MARK, PORT245_FN2),
1028 PINMUX_DATA(PORT245_SCIFB_RTS_MARK, PORT245_FN3),
1029 PINMUX_DATA(PORT246_SCIFA5_RXD_MARK, PORT246_FN1),
1030 PINMUX_DATA(MFG1_OUT1_MARK, PORT246_FN2),
1031 PINMUX_DATA(PORT246_SCIFB_RXD_MARK, PORT246_FN3),
1032 PINMUX_DATA(TPU1TO0_MARK, PORT246_FN4),
1033 PINMUX_DATA(PORT247_SCIFA5_TXD_MARK, PORT247_FN1),
1034 PINMUX_DATA(MFG3_OUT2_MARK, PORT247_FN2),
1035 PINMUX_DATA(PORT247_SCIFB_TXD_MARK, PORT247_FN3),
1036 PINMUX_DATA(TPU3TO1_MARK, PORT247_FN4),
1037 PINMUX_DATA(PORT248_SCIFA5_SCK_MARK, PORT248_FN1),
1038 PINMUX_DATA(MFG2_OUT1_MARK, PORT248_FN2),
1039 PINMUX_DATA(PORT248_SCIFB_SCK_MARK, PORT248_FN3),
1040 PINMUX_DATA(TPU2TO0_MARK, PORT248_FN4),
1041 PINMUX_DATA(PORT249_IROUT_MARK, PORT249_FN1),
1042 PINMUX_DATA(MFG4_IN1_MARK, PORT249_FN2),
1043 PINMUX_DATA(SDHICLK0_MARK, PORT250_FN1),
1044 PINMUX_DATA(TCK2_SWCLK_MC0_MARK, PORT250_FN2),
1045 PINMUX_DATA(SDHICD0_MARK, PORT251_FN1),
1046 PINMUX_DATA(SDHID0_0_MARK, PORT252_FN1),
1047 PINMUX_DATA(TMS2_SWDIO_MC0_MARK, PORT252_FN2),
1048 PINMUX_DATA(SDHID0_1_MARK, PORT253_FN1),
1049 PINMUX_DATA(TDO2_SWO0_MC0_MARK, PORT253_FN2),
1050 PINMUX_DATA(SDHID0_2_MARK, PORT254_FN1),
1051 PINMUX_DATA(TDI2_MARK, PORT254_FN2),
1052 PINMUX_DATA(SDHID0_3_MARK, PORT255_FN1),
1053 PINMUX_DATA(RTCK2_SWO1_MC0_MARK, PORT255_FN2),
1054 PINMUX_DATA(SDHICMD0_MARK, PORT256_FN1),
1055 PINMUX_DATA(TRST2_MARK, PORT256_FN2),
1056 PINMUX_DATA(SDHIWP0_MARK, PORT257_FN1),
1057 PINMUX_DATA(EDBGREQ2_MARK, PORT257_FN2),
1058 PINMUX_DATA(SDHICLK1_MARK, PORT258_FN1),
1059 PINMUX_DATA(TCK3_SWCLK_MC1_MARK, PORT258_FN2),
1060 PINMUX_DATA(SDHID1_0_MARK, PORT259_FN1),
1061 PINMUX_DATA(M11_SLCD_SO2_MARK, PORT259_FN2),
1062 PINMUX_DATA(TS_SPSYNC2_MARK, PORT259_FN3),
1063 PINMUX_DATA(TMS3_SWDIO_MC1_MARK, PORT259_FN4),
1064 PINMUX_DATA(SDHID1_1_MARK, PORT260_FN1),
1065 PINMUX_DATA(M9_SLCD_A02_MARK, PORT260_FN2),
1066 PINMUX_DATA(TS_SDAT2_MARK, PORT260_FN3),
1067 PINMUX_DATA(TDO3_SWO0_MC1_MARK, PORT260_FN4),
1068 PINMUX_DATA(SDHID1_2_MARK, PORT261_FN1),
1069 PINMUX_DATA(M10_SLCD_CK2_MARK, PORT261_FN2),
1070 PINMUX_DATA(TS_SDEN2_MARK, PORT261_FN3),
1071 PINMUX_DATA(TDI3_MARK, PORT261_FN4),
1072 PINMUX_DATA(SDHID1_3_MARK, PORT262_FN1),
1073 PINMUX_DATA(M12_SLCD_CE2_MARK, PORT262_FN2),
1074 PINMUX_DATA(TS_SCK2_MARK, PORT262_FN3),
1075 PINMUX_DATA(RTCK3_SWO1_MC1_MARK, PORT262_FN4),
1076 PINMUX_DATA(SDHICMD1_MARK, PORT263_FN1),
1077 PINMUX_DATA(TRST3_MARK, PORT263_FN2),
1078 PINMUX_DATA(RESETOUTS_MARK, PORT264_FN1),
1079};
1080
1081#define _GPIO_PORT(pfx, sfx) PINMUX_GPIO(GPIO_PORT##pfx, PORT##pfx##_DATA)
1082#define GPIO_PORT_265() _265(_GPIO_PORT, , unused)
1083#define GPIO_FN(str) PINMUX_GPIO(GPIO_FN_##str, str##_MARK)
1084
1085static struct pinmux_gpio pinmux_gpios[] = {
1086 /* 55-1 -> 55-5 (GPIO) */
1087 GPIO_PORT_265(),
1088
1089 /* Special Pull-up / Pull-down Functions */
1090 GPIO_FN(PORT66_KEYIN0_PU), GPIO_FN(PORT67_KEYIN1_PU),
1091 GPIO_FN(PORT68_KEYIN2_PU), GPIO_FN(PORT69_KEYIN3_PU),
1092 GPIO_FN(PORT70_KEYIN4_PU), GPIO_FN(PORT71_KEYIN5_PU),
1093 GPIO_FN(PORT72_KEYIN6_PU),
1094
1095 /* 55-1 (FN) */
1096 GPIO_FN(VBUS_0),
1097 GPIO_FN(CPORT0),
1098 GPIO_FN(CPORT1),
1099 GPIO_FN(CPORT2),
1100 GPIO_FN(CPORT3),
1101 GPIO_FN(CPORT4),
1102 GPIO_FN(CPORT5),
1103 GPIO_FN(CPORT6),
1104 GPIO_FN(CPORT7),
1105 GPIO_FN(CPORT8),
1106 GPIO_FN(CPORT9),
1107 GPIO_FN(CPORT10),
1108 GPIO_FN(CPORT11), GPIO_FN(SIN2),
1109 GPIO_FN(CPORT12), GPIO_FN(XCTS2),
1110 GPIO_FN(CPORT13), GPIO_FN(RFSPO4),
1111 GPIO_FN(CPORT14), GPIO_FN(RFSPO5),
1112 GPIO_FN(CPORT15), GPIO_FN(SCIFA0_SCK), GPIO_FN(GPS_AGC2),
1113 GPIO_FN(CPORT16), GPIO_FN(SCIFA0_TXD), GPIO_FN(GPS_AGC3),
1114 GPIO_FN(CPORT17_IC_OE), GPIO_FN(SOUT2),
1115 GPIO_FN(CPORT18), GPIO_FN(XRTS2), GPIO_FN(PORT19_VIO_CKO2),
1116 GPIO_FN(CPORT19_MPORT1),
1117 GPIO_FN(CPORT20), GPIO_FN(RFSPO6),
1118 GPIO_FN(CPORT21), GPIO_FN(STATUS0),
1119 GPIO_FN(CPORT22), GPIO_FN(STATUS1),
1120 GPIO_FN(CPORT23), GPIO_FN(STATUS2), GPIO_FN(RFSPO7),
1121 GPIO_FN(B_SYNLD1),
1122 GPIO_FN(B_SYNLD2), GPIO_FN(SYSENMSK),
1123 GPIO_FN(XMAINPS),
1124 GPIO_FN(XDIVPS),
1125 GPIO_FN(XIDRST),
1126 GPIO_FN(IDCLK), GPIO_FN(IC_DP),
1127 GPIO_FN(IDIO), GPIO_FN(IC_DM),
1128 GPIO_FN(SOUT1), GPIO_FN(SCIFA4_TXD), GPIO_FN(M02_BERDAT),
1129 GPIO_FN(SIN1), GPIO_FN(SCIFA4_RXD), GPIO_FN(XWUP),
1130 GPIO_FN(XRTS1), GPIO_FN(SCIFA4_RTS), GPIO_FN(M03_BERCLK),
1131 GPIO_FN(XCTS1), GPIO_FN(SCIFA4_CTS),
1132 GPIO_FN(PCMCLKO),
1133 GPIO_FN(SYNC8KO),
1134
1135 /* 55-2 (FN) */
1136 GPIO_FN(DNPCM_A),
1137 GPIO_FN(UPPCM_A),
1138 GPIO_FN(VACK),
1139 GPIO_FN(XTALB1L),
1140 GPIO_FN(GPS_AGC1), GPIO_FN(SCIFA0_RTS),
1141 GPIO_FN(GPS_AGC4), GPIO_FN(SCIFA0_RXD),
1142 GPIO_FN(GPS_PWRDOWN), GPIO_FN(SCIFA0_CTS),
1143 GPIO_FN(GPS_IM),
1144 GPIO_FN(GPS_IS),
1145 GPIO_FN(GPS_QM),
1146 GPIO_FN(GPS_QS),
1147 GPIO_FN(FMSOCK), GPIO_FN(PORT49_IRDA_OUT), GPIO_FN(PORT49_IROUT),
1148 GPIO_FN(FMSOOLR), GPIO_FN(BBIF2_TSYNC2), GPIO_FN(TPU2TO2),
1149 GPIO_FN(IPORT3), GPIO_FN(FMSIOLR),
1150 GPIO_FN(FMSOOBT), GPIO_FN(BBIF2_TSCK2), GPIO_FN(TPU2TO3),
1151 GPIO_FN(OPORT1), GPIO_FN(FMSIOBT),
1152 GPIO_FN(FMSOSLD), GPIO_FN(BBIF2_TXD2), GPIO_FN(OPORT2),
1153 GPIO_FN(FMSOILR), GPIO_FN(PORT53_IRDA_IN), GPIO_FN(TPU3TO3),
1154 GPIO_FN(OPORT3), GPIO_FN(FMSIILR),
1155 GPIO_FN(FMSOIBT), GPIO_FN(PORT54_IRDA_FIRSEL), GPIO_FN(TPU3TO2),
1156 GPIO_FN(FMSIIBT),
1157 GPIO_FN(FMSISLD), GPIO_FN(MFG0_OUT1), GPIO_FN(TPU0TO0),
1158 GPIO_FN(A0_EA0), GPIO_FN(BS),
1159 GPIO_FN(A12_EA12), GPIO_FN(PORT58_VIO_CKOR), GPIO_FN(TPU4TO2),
1160 GPIO_FN(A13_EA13), GPIO_FN(PORT59_IROUT), GPIO_FN(MFG0_OUT2),
1161 GPIO_FN(TPU0TO1),
1162 GPIO_FN(A14_EA14), GPIO_FN(PORT60_KEYOUT5),
1163 GPIO_FN(A15_EA15), GPIO_FN(PORT61_KEYOUT4),
1164 GPIO_FN(A16_EA16), GPIO_FN(PORT62_KEYOUT3), GPIO_FN(MSIOF0_SS1),
1165 GPIO_FN(A17_EA17), GPIO_FN(PORT63_KEYOUT2), GPIO_FN(MSIOF0_TSYNC),
1166 GPIO_FN(A18_EA18), GPIO_FN(PORT64_KEYOUT1), GPIO_FN(MSIOF0_TSCK),
1167 GPIO_FN(A19_EA19), GPIO_FN(PORT65_KEYOUT0), GPIO_FN(MSIOF0_TXD),
1168 GPIO_FN(A20_EA20), GPIO_FN(PORT66_KEYIN0), GPIO_FN(MSIOF0_RSCK),
1169 GPIO_FN(A21_EA21), GPIO_FN(PORT67_KEYIN1), GPIO_FN(MSIOF0_RSYNC),
1170 GPIO_FN(A22_EA22), GPIO_FN(PORT68_KEYIN2), GPIO_FN(MSIOF0_MCK0),
1171 GPIO_FN(A23_EA23), GPIO_FN(PORT69_KEYIN3), GPIO_FN(MSIOF0_MCK1),
1172 GPIO_FN(A24_EA24), GPIO_FN(PORT70_KEYIN4), GPIO_FN(MSIOF0_RXD),
1173 GPIO_FN(A25_EA25), GPIO_FN(PORT71_KEYIN5), GPIO_FN(MSIOF0_SS2),
1174 GPIO_FN(A26), GPIO_FN(PORT72_KEYIN6),
1175 GPIO_FN(D0_ED0_NAF0),
1176 GPIO_FN(D1_ED1_NAF1),
1177 GPIO_FN(D2_ED2_NAF2),
1178 GPIO_FN(D3_ED3_NAF3),
1179 GPIO_FN(D4_ED4_NAF4),
1180 GPIO_FN(D5_ED5_NAF5),
1181 GPIO_FN(D6_ED6_NAF6),
1182 GPIO_FN(D7_ED7_NAF7),
1183 GPIO_FN(D8_ED8_NAF8),
1184 GPIO_FN(D9_ED9_NAF9),
1185 GPIO_FN(D10_ED10_NAF10),
1186 GPIO_FN(D11_ED11_NAF11),
1187 GPIO_FN(D12_ED12_NAF12),
1188 GPIO_FN(D13_ED13_NAF13),
1189 GPIO_FN(D14_ED14_NAF14),
1190 GPIO_FN(D15_ED15_NAF15),
1191 GPIO_FN(CS4),
1192 GPIO_FN(CS5A), GPIO_FN(FMSICK),
1193
1194 /* 55-3 (FN) */
1195 GPIO_FN(CS5B), GPIO_FN(FCE1),
1196 GPIO_FN(CS6B), GPIO_FN(XCS2), GPIO_FN(CS6A), GPIO_FN(DACK0),
1197 GPIO_FN(FCE0),
1198 GPIO_FN(WAIT), GPIO_FN(DREQ0),
1199 GPIO_FN(RD_XRD),
1200 GPIO_FN(WE0_XWR0_FWE),
1201 GPIO_FN(WE1_XWR1),
1202 GPIO_FN(FRB),
1203 GPIO_FN(CKO),
1204 GPIO_FN(NBRSTOUT),
1205 GPIO_FN(NBRST),
1206 GPIO_FN(GPS_EPPSIN),
1207 GPIO_FN(LATCHPULSE),
1208 GPIO_FN(LTESIGNAL),
1209 GPIO_FN(LEGACYSTATE),
1210 GPIO_FN(TCKON),
1211 GPIO_FN(VIO_VD), GPIO_FN(PORT128_KEYOUT0), GPIO_FN(IPORT0),
1212 GPIO_FN(VIO_HD), GPIO_FN(PORT129_KEYOUT1), GPIO_FN(IPORT1),
1213 GPIO_FN(VIO_D0), GPIO_FN(PORT130_KEYOUT2), GPIO_FN(PORT130_MSIOF2_RXD),
1214 GPIO_FN(VIO_D1), GPIO_FN(PORT131_KEYOUT3), GPIO_FN(PORT131_MSIOF2_SS1),
1215 GPIO_FN(VIO_D2), GPIO_FN(PORT132_KEYOUT4), GPIO_FN(PORT132_MSIOF2_SS2),
1216 GPIO_FN(VIO_D3), GPIO_FN(PORT133_KEYOUT5),
1217 GPIO_FN(PORT133_MSIOF2_TSYNC),
1218 GPIO_FN(VIO_D4), GPIO_FN(PORT134_KEYIN0), GPIO_FN(PORT134_MSIOF2_TXD),
1219 GPIO_FN(VIO_D5), GPIO_FN(PORT135_KEYIN1), GPIO_FN(PORT135_MSIOF2_TSCK),
1220 GPIO_FN(VIO_D6), GPIO_FN(PORT136_KEYIN2),
1221 GPIO_FN(VIO_D7), GPIO_FN(PORT137_KEYIN3),
1222 GPIO_FN(VIO_D8), GPIO_FN(M9_SLCD_A01), GPIO_FN(PORT138_FSIAOMC),
1223 GPIO_FN(VIO_D9), GPIO_FN(M10_SLCD_CK1), GPIO_FN(PORT139_FSIAOLR),
1224 GPIO_FN(VIO_D10), GPIO_FN(M11_SLCD_SO1), GPIO_FN(TPU0TO2),
1225 GPIO_FN(PORT140_FSIAOBT),
1226 GPIO_FN(VIO_D11), GPIO_FN(M12_SLCD_CE1), GPIO_FN(TPU0TO3),
1227 GPIO_FN(PORT141_FSIAOSLD),
1228 GPIO_FN(VIO_D12), GPIO_FN(M13_BSW), GPIO_FN(PORT142_FSIACK),
1229 GPIO_FN(VIO_D13), GPIO_FN(M14_GSW), GPIO_FN(PORT143_FSIAILR),
1230 GPIO_FN(VIO_D14), GPIO_FN(M15_RSW), GPIO_FN(PORT144_FSIAIBT),
1231 GPIO_FN(VIO_D15), GPIO_FN(TPU1TO3), GPIO_FN(PORT145_FSIAISLD),
1232 GPIO_FN(VIO_CLK), GPIO_FN(PORT146_KEYIN4), GPIO_FN(IPORT2),
1233 GPIO_FN(VIO_FIELD), GPIO_FN(PORT147_KEYIN5),
1234 GPIO_FN(VIO_CKO), GPIO_FN(PORT148_KEYIN6),
1235 GPIO_FN(A27), GPIO_FN(RDWR_XWE), GPIO_FN(MFG0_IN1),
1236 GPIO_FN(MFG0_IN2),
1237 GPIO_FN(TS_SPSYNC3), GPIO_FN(MSIOF2_RSCK),
1238 GPIO_FN(TS_SDAT3), GPIO_FN(MSIOF2_RSYNC),
1239 GPIO_FN(TPU1TO2), GPIO_FN(TS_SDEN3), GPIO_FN(PORT153_MSIOF2_SS1),
1240 GPIO_FN(SOUT3), GPIO_FN(SCIFA2_TXD1), GPIO_FN(MSIOF2_MCK0),
1241 GPIO_FN(SIN3), GPIO_FN(SCIFA2_RXD1), GPIO_FN(MSIOF2_MCK1),
1242 GPIO_FN(XRTS3), GPIO_FN(SCIFA2_RTS1), GPIO_FN(PORT156_MSIOF2_SS2),
1243 GPIO_FN(XCTS3), GPIO_FN(SCIFA2_CTS1), GPIO_FN(PORT157_MSIOF2_RXD),
1244
1245 /* 55-4 (FN) */
1246 GPIO_FN(DINT), GPIO_FN(SCIFA2_SCK1), GPIO_FN(TS_SCK3),
1247 GPIO_FN(PORT159_SCIFB_SCK), GPIO_FN(PORT159_SCIFA5_SCK), GPIO_FN(NMI),
1248 GPIO_FN(PORT160_SCIFB_TXD), GPIO_FN(PORT160_SCIFA5_TXD), GPIO_FN(SOUT0),
1249 GPIO_FN(PORT161_SCIFB_CTS), GPIO_FN(PORT161_SCIFA5_CTS), GPIO_FN(XCTS0),
1250 GPIO_FN(MFG3_IN2),
1251 GPIO_FN(PORT162_SCIFB_RXD), GPIO_FN(PORT162_SCIFA5_RXD), GPIO_FN(SIN0),
1252 GPIO_FN(MFG3_IN1),
1253 GPIO_FN(PORT163_SCIFB_RTS), GPIO_FN(PORT163_SCIFA5_RTS), GPIO_FN(XRTS0),
1254 GPIO_FN(MFG3_OUT1), GPIO_FN(TPU3TO0),
1255 GPIO_FN(LCDD0), GPIO_FN(PORT192_KEYOUT0), GPIO_FN(EXT_CKI),
1256 GPIO_FN(LCDD1), GPIO_FN(PORT193_KEYOUT1), GPIO_FN(PORT193_SCIFA5_CTS),
1257 GPIO_FN(BBIF2_TSYNC1),
1258 GPIO_FN(LCDD2), GPIO_FN(PORT194_KEYOUT2), GPIO_FN(PORT194_SCIFA5_RTS),
1259 GPIO_FN(BBIF2_TSCK1),
1260 GPIO_FN(LCDD3), GPIO_FN(PORT195_KEYOUT3), GPIO_FN(PORT195_SCIFA5_RXD),
1261 GPIO_FN(BBIF2_TXD1),
1262 GPIO_FN(LCDD4), GPIO_FN(PORT196_KEYOUT4), GPIO_FN(PORT196_SCIFA5_TXD),
1263 GPIO_FN(LCDD5), GPIO_FN(PORT197_KEYOUT5), GPIO_FN(PORT197_SCIFA5_SCK),
1264 GPIO_FN(MFG2_OUT2),
1265 GPIO_FN(LCDD6),
1266 GPIO_FN(LCDD7), GPIO_FN(TPU4TO1), GPIO_FN(MFG4_OUT2),
1267 GPIO_FN(LCDD8), GPIO_FN(PORT200_KEYIN0), GPIO_FN(VIO_DR0),
1268 GPIO_FN(D16),
1269 GPIO_FN(LCDD9), GPIO_FN(PORT201_KEYIN1), GPIO_FN(VIO_DR1),
1270 GPIO_FN(D17),
1271 GPIO_FN(LCDD10), GPIO_FN(PORT202_KEYIN2), GPIO_FN(VIO_DR2),
1272 GPIO_FN(D18),
1273 GPIO_FN(LCDD11), GPIO_FN(PORT203_KEYIN3), GPIO_FN(VIO_DR3),
1274 GPIO_FN(D19),
1275 GPIO_FN(LCDD12), GPIO_FN(PORT204_KEYIN4), GPIO_FN(VIO_DR4),
1276 GPIO_FN(D20),
1277 GPIO_FN(LCDD13), GPIO_FN(PORT205_KEYIN5), GPIO_FN(VIO_DR5),
1278 GPIO_FN(D21),
1279 GPIO_FN(LCDD14), GPIO_FN(PORT206_KEYIN6), GPIO_FN(VIO_DR6),
1280 GPIO_FN(D22),
1281 GPIO_FN(LCDD15), GPIO_FN(PORT207_MSIOF0L_SS1), GPIO_FN(PORT207_KEYOUT0),
1282 GPIO_FN(VIO_DR7), GPIO_FN(D23),
1283 GPIO_FN(LCDD16), GPIO_FN(PORT208_MSIOF0L_SS2), GPIO_FN(PORT208_KEYOUT1),
1284 GPIO_FN(VIO_VDR), GPIO_FN(D24),
1285 GPIO_FN(LCDD17), GPIO_FN(PORT209_KEYOUT2), GPIO_FN(VIO_HDR),
1286 GPIO_FN(D25),
1287 GPIO_FN(LCDD18), GPIO_FN(DREQ2), GPIO_FN(PORT210_MSIOF0L_SS1),
1288 GPIO_FN(D26),
1289 GPIO_FN(LCDD19), GPIO_FN(PORT211_MSIOF0L_SS2), GPIO_FN(D27),
1290 GPIO_FN(LCDD20), GPIO_FN(TS_SPSYNC1), GPIO_FN(MSIOF0L_MCK0),
1291 GPIO_FN(D28),
1292 GPIO_FN(LCDD21), GPIO_FN(TS_SDAT1), GPIO_FN(MSIOF0L_MCK1),
1293 GPIO_FN(D29),
1294 GPIO_FN(LCDD22), GPIO_FN(TS_SDEN1), GPIO_FN(MSIOF0L_RSCK),
1295 GPIO_FN(D30),
1296 GPIO_FN(LCDD23), GPIO_FN(TS_SCK1), GPIO_FN(MSIOF0L_RSYNC),
1297 GPIO_FN(D31),
1298 GPIO_FN(LCDDCK), GPIO_FN(LCDWR), GPIO_FN(PORT216_KEYOUT3),
1299 GPIO_FN(VIO_CLKR),
1300 GPIO_FN(LCDRD), GPIO_FN(DACK2), GPIO_FN(MSIOF0L_TSYNC),
1301 GPIO_FN(LCDHSYN), GPIO_FN(LCDCS), GPIO_FN(LCDCS2), GPIO_FN(DACK3),
1302 GPIO_FN(PORT218_VIO_CKOR), GPIO_FN(PORT218_KEYOUT4),
1303 GPIO_FN(LCDDISP), GPIO_FN(LCDRS), GPIO_FN(DREQ3), GPIO_FN(MSIOF0L_TSCK),
1304 GPIO_FN(LCDVSYN), GPIO_FN(LCDVSYN2), GPIO_FN(PORT220_KEYOUT5),
1305 GPIO_FN(LCDLCLK), GPIO_FN(DREQ1), GPIO_FN(PWEN), GPIO_FN(MSIOF0L_RXD),
1306 GPIO_FN(LCDDON), GPIO_FN(LCDDON2), GPIO_FN(DACK1), GPIO_FN(OVCN),
1307 GPIO_FN(MSIOF0L_TXD),
1308 GPIO_FN(SCIFA1_TXD), GPIO_FN(OVCN2),
1309 GPIO_FN(EXTLP), GPIO_FN(SCIFA1_SCK), GPIO_FN(USBTERM),
1310 GPIO_FN(PORT226_VIO_CKO2),
1311 GPIO_FN(SCIFA1_RTS), GPIO_FN(IDIN),
1312 GPIO_FN(SCIFA1_RXD),
1313 GPIO_FN(SCIFA1_CTS), GPIO_FN(MFG1_IN1),
1314 GPIO_FN(MSIOF1_TXD), GPIO_FN(SCIFA2_TXD2), GPIO_FN(PORT230_FSIAOMC),
1315 GPIO_FN(MSIOF1_TSYNC), GPIO_FN(SCIFA2_CTS2), GPIO_FN(PORT231_FSIAOLR),
1316 GPIO_FN(MSIOF1_TSCK), GPIO_FN(SCIFA2_SCK2), GPIO_FN(PORT232_FSIAOBT),
1317 GPIO_FN(MSIOF1_RXD), GPIO_FN(SCIFA2_RXD2), GPIO_FN(GPS_VCOTRIG),
1318 GPIO_FN(PORT233_FSIACK),
1319 GPIO_FN(MSIOF1_RSCK), GPIO_FN(SCIFA2_RTS2), GPIO_FN(PORT234_FSIAOSLD),
1320 GPIO_FN(MSIOF1_RSYNC), GPIO_FN(OPORT0), GPIO_FN(MFG1_IN2),
1321 GPIO_FN(PORT235_FSIAILR),
1322 GPIO_FN(MSIOF1_MCK0), GPIO_FN(I2C_SDA2), GPIO_FN(PORT236_FSIAIBT),
1323 GPIO_FN(MSIOF1_MCK1), GPIO_FN(I2C_SCL2), GPIO_FN(PORT237_FSIAISLD),
1324 GPIO_FN(MSIOF1_SS1), GPIO_FN(EDBGREQ3),
1325
1326 /* 55-5 (FN) */
1327 GPIO_FN(MSIOF1_SS2),
1328 GPIO_FN(SCIFA6_TXD),
1329 GPIO_FN(PORT241_IRDA_OUT), GPIO_FN(PORT241_IROUT), GPIO_FN(MFG4_OUT1),
1330 GPIO_FN(TPU4TO0),
1331 GPIO_FN(PORT242_IRDA_IN), GPIO_FN(MFG4_IN2),
1332 GPIO_FN(PORT243_IRDA_FIRSEL), GPIO_FN(PORT243_VIO_CKO2),
1333 GPIO_FN(PORT244_SCIFA5_CTS), GPIO_FN(MFG2_IN1),
1334 GPIO_FN(PORT244_SCIFB_CTS),
1335 GPIO_FN(PORT245_SCIFA5_RTS), GPIO_FN(MFG2_IN2),
1336 GPIO_FN(PORT245_SCIFB_RTS),
1337 GPIO_FN(PORT246_SCIFA5_RXD), GPIO_FN(MFG1_OUT1),
1338 GPIO_FN(PORT246_SCIFB_RXD), GPIO_FN(TPU1TO0),
1339 GPIO_FN(PORT247_SCIFA5_TXD), GPIO_FN(MFG3_OUT2),
1340 GPIO_FN(PORT247_SCIFB_TXD), GPIO_FN(TPU3TO1),
1341 GPIO_FN(PORT248_SCIFA5_SCK), GPIO_FN(MFG2_OUT1),
1342 GPIO_FN(PORT248_SCIFB_SCK), GPIO_FN(TPU2TO0),
1343 GPIO_FN(PORT249_IROUT), GPIO_FN(MFG4_IN1),
1344 GPIO_FN(SDHICLK0), GPIO_FN(TCK2_SWCLK_MC0),
1345 GPIO_FN(SDHICD0),
1346 GPIO_FN(SDHID0_0), GPIO_FN(TMS2_SWDIO_MC0),
1347 GPIO_FN(SDHID0_1), GPIO_FN(TDO2_SWO0_MC0),
1348 GPIO_FN(SDHID0_2), GPIO_FN(TDI2),
1349 GPIO_FN(SDHID0_3), GPIO_FN(RTCK2_SWO1_MC0),
1350 GPIO_FN(SDHICMD0), GPIO_FN(TRST2),
1351 GPIO_FN(SDHIWP0), GPIO_FN(EDBGREQ2),
1352 GPIO_FN(SDHICLK1), GPIO_FN(TCK3_SWCLK_MC1),
1353 GPIO_FN(SDHID1_0), GPIO_FN(M11_SLCD_SO2), GPIO_FN(TS_SPSYNC2),
1354 GPIO_FN(TMS3_SWDIO_MC1),
1355 GPIO_FN(SDHID1_1), GPIO_FN(M9_SLCD_A02), GPIO_FN(TS_SDAT2),
1356 GPIO_FN(TDO3_SWO0_MC1),
1357 GPIO_FN(SDHID1_2), GPIO_FN(M10_SLCD_CK2), GPIO_FN(TS_SDEN2),
1358 GPIO_FN(TDI3),
1359 GPIO_FN(SDHID1_3), GPIO_FN(M12_SLCD_CE2), GPIO_FN(TS_SCK2),
1360 GPIO_FN(RTCK3_SWO1_MC1),
1361 GPIO_FN(SDHICMD1), GPIO_FN(TRST3),
1362 GPIO_FN(RESETOUTS),
1363};
1364
1365/* helper for top 4 bits in PORTnCR */
1366#define PCRH(in, in_pd, in_pu, out) \
1367 0, (out), (in), 0, \
1368 0, 0, 0, 0, \
1369 0, 0, (in_pd), 0, \
1370 0, 0, (in_pu), 0
1371
1372#define PORTCR(nr, reg) \
1373 { PINMUX_CFG_REG("PORT" nr "CR", reg, 8, 4) { \
1374 PCRH(PORT##nr##_IN, PORT##nr##_IN_PD, \
1375 PORT##nr##_IN_PU, PORT##nr##_OUT), \
1376 PORT##nr##_FN0, PORT##nr##_FN1, \
1377 PORT##nr##_FN2, PORT##nr##_FN3, \
1378 PORT##nr##_FN4, PORT##nr##_FN5, \
1379 PORT##nr##_FN6, PORT##nr##_FN7 } \
1380 }
1381
1382static struct pinmux_cfg_reg pinmux_config_regs[] = {
1383 PORTCR(0, 0xe6050000), /* PORT0CR */
1384 PORTCR(1, 0xe6050001), /* PORT1CR */
1385 PORTCR(2, 0xe6050002), /* PORT2CR */
1386 PORTCR(3, 0xe6050003), /* PORT3CR */
1387 PORTCR(4, 0xe6050004), /* PORT4CR */
1388 PORTCR(5, 0xe6050005), /* PORT5CR */
1389 PORTCR(6, 0xe6050006), /* PORT6CR */
1390 PORTCR(7, 0xe6050007), /* PORT7CR */
1391 PORTCR(8, 0xe6050008), /* PORT8CR */
1392 PORTCR(9, 0xe6050009), /* PORT9CR */
1393
1394 PORTCR(10, 0xe605000a), /* PORT10CR */
1395 PORTCR(11, 0xe605000b), /* PORT11CR */
1396 PORTCR(12, 0xe605000c), /* PORT12CR */
1397 PORTCR(13, 0xe605000d), /* PORT13CR */
1398 PORTCR(14, 0xe605000e), /* PORT14CR */
1399 PORTCR(15, 0xe605000f), /* PORT15CR */
1400 PORTCR(16, 0xe6050010), /* PORT16CR */
1401 PORTCR(17, 0xe6050011), /* PORT17CR */
1402 PORTCR(18, 0xe6050012), /* PORT18CR */
1403 PORTCR(19, 0xe6050013), /* PORT19CR */
1404
1405 PORTCR(20, 0xe6050014), /* PORT20CR */
1406 PORTCR(21, 0xe6050015), /* PORT21CR */
1407 PORTCR(22, 0xe6050016), /* PORT22CR */
1408 PORTCR(23, 0xe6050017), /* PORT23CR */
1409 PORTCR(24, 0xe6050018), /* PORT24CR */
1410 PORTCR(25, 0xe6050019), /* PORT25CR */
1411 PORTCR(26, 0xe605001a), /* PORT26CR */
1412 PORTCR(27, 0xe605001b), /* PORT27CR */
1413 PORTCR(28, 0xe605001c), /* PORT28CR */
1414 PORTCR(29, 0xe605001d), /* PORT29CR */
1415
1416 PORTCR(30, 0xe605001e), /* PORT30CR */
1417 PORTCR(31, 0xe605001f), /* PORT31CR */
1418 PORTCR(32, 0xe6050020), /* PORT32CR */
1419 PORTCR(33, 0xe6050021), /* PORT33CR */
1420 PORTCR(34, 0xe6050022), /* PORT34CR */
1421 PORTCR(35, 0xe6050023), /* PORT35CR */
1422 PORTCR(36, 0xe6050024), /* PORT36CR */
1423 PORTCR(37, 0xe6050025), /* PORT37CR */
1424 PORTCR(38, 0xe6050026), /* PORT38CR */
1425 PORTCR(39, 0xe6050027), /* PORT39CR */
1426
1427 PORTCR(40, 0xe6050028), /* PORT40CR */
1428 PORTCR(41, 0xe6050029), /* PORT41CR */
1429 PORTCR(42, 0xe605002a), /* PORT42CR */
1430 PORTCR(43, 0xe605002b), /* PORT43CR */
1431 PORTCR(44, 0xe605002c), /* PORT44CR */
1432 PORTCR(45, 0xe605002d), /* PORT45CR */
1433 PORTCR(46, 0xe605002e), /* PORT46CR */
1434 PORTCR(47, 0xe605002f), /* PORT47CR */
1435 PORTCR(48, 0xe6050030), /* PORT48CR */
1436 PORTCR(49, 0xe6050031), /* PORT49CR */
1437
1438 PORTCR(50, 0xe6050032), /* PORT50CR */
1439 PORTCR(51, 0xe6050033), /* PORT51CR */
1440 PORTCR(52, 0xe6050034), /* PORT52CR */
1441 PORTCR(53, 0xe6050035), /* PORT53CR */
1442 PORTCR(54, 0xe6050036), /* PORT54CR */
1443 PORTCR(55, 0xe6050037), /* PORT55CR */
1444 PORTCR(56, 0xe6050038), /* PORT56CR */
1445 PORTCR(57, 0xe6050039), /* PORT57CR */
1446 PORTCR(58, 0xe605003a), /* PORT58CR */
1447 PORTCR(59, 0xe605003b), /* PORT59CR */
1448
1449 PORTCR(60, 0xe605003c), /* PORT60CR */
1450 PORTCR(61, 0xe605003d), /* PORT61CR */
1451 PORTCR(62, 0xe605003e), /* PORT62CR */
1452 PORTCR(63, 0xe605003f), /* PORT63CR */
1453 PORTCR(64, 0xe6050040), /* PORT64CR */
1454 PORTCR(65, 0xe6050041), /* PORT65CR */
1455 PORTCR(66, 0xe6050042), /* PORT66CR */
1456 PORTCR(67, 0xe6050043), /* PORT67CR */
1457 PORTCR(68, 0xe6050044), /* PORT68CR */
1458 PORTCR(69, 0xe6050045), /* PORT69CR */
1459
1460 PORTCR(70, 0xe6050046), /* PORT70CR */
1461 PORTCR(71, 0xe6050047), /* PORT71CR */
1462 PORTCR(72, 0xe6050048), /* PORT72CR */
1463 PORTCR(73, 0xe6050049), /* PORT73CR */
1464 PORTCR(74, 0xe605004a), /* PORT74CR */
1465 PORTCR(75, 0xe605004b), /* PORT75CR */
1466 PORTCR(76, 0xe605004c), /* PORT76CR */
1467 PORTCR(77, 0xe605004d), /* PORT77CR */
1468 PORTCR(78, 0xe605004e), /* PORT78CR */
1469 PORTCR(79, 0xe605004f), /* PORT79CR */
1470
1471 PORTCR(80, 0xe6050050), /* PORT80CR */
1472 PORTCR(81, 0xe6050051), /* PORT81CR */
1473 PORTCR(82, 0xe6050052), /* PORT82CR */
1474 PORTCR(83, 0xe6050053), /* PORT83CR */
1475 PORTCR(84, 0xe6050054), /* PORT84CR */
1476 PORTCR(85, 0xe6050055), /* PORT85CR */
1477 PORTCR(86, 0xe6050056), /* PORT86CR */
1478 PORTCR(87, 0xe6050057), /* PORT87CR */
1479 PORTCR(88, 0xe6050058), /* PORT88CR */
1480 PORTCR(89, 0xe6050059), /* PORT89CR */
1481
1482 PORTCR(90, 0xe605005a), /* PORT90CR */
1483 PORTCR(91, 0xe605005b), /* PORT91CR */
1484 PORTCR(92, 0xe605005c), /* PORT92CR */
1485 PORTCR(93, 0xe605005d), /* PORT93CR */
1486 PORTCR(94, 0xe605005e), /* PORT94CR */
1487 PORTCR(95, 0xe605005f), /* PORT95CR */
1488 PORTCR(96, 0xe6050060), /* PORT96CR */
1489 PORTCR(97, 0xe6050061), /* PORT97CR */
1490 PORTCR(98, 0xe6050062), /* PORT98CR */
1491 PORTCR(99, 0xe6050063), /* PORT99CR */
1492
1493 PORTCR(100, 0xe6050064), /* PORT100CR */
1494 PORTCR(101, 0xe6050065), /* PORT101CR */
1495 PORTCR(102, 0xe6050066), /* PORT102CR */
1496 PORTCR(103, 0xe6050067), /* PORT103CR */
1497 PORTCR(104, 0xe6050068), /* PORT104CR */
1498 PORTCR(105, 0xe6050069), /* PORT105CR */
1499 PORTCR(106, 0xe605006a), /* PORT106CR */
1500 PORTCR(107, 0xe605006b), /* PORT107CR */
1501 PORTCR(108, 0xe605006c), /* PORT108CR */
1502 PORTCR(109, 0xe605006d), /* PORT109CR */
1503
1504 PORTCR(110, 0xe605006e), /* PORT110CR */
1505 PORTCR(111, 0xe605006f), /* PORT111CR */
1506 PORTCR(112, 0xe6050070), /* PORT112CR */
1507 PORTCR(113, 0xe6050071), /* PORT113CR */
1508 PORTCR(114, 0xe6050072), /* PORT114CR */
1509 PORTCR(115, 0xe6050073), /* PORT115CR */
1510 PORTCR(116, 0xe6050074), /* PORT116CR */
1511 PORTCR(117, 0xe6050075), /* PORT117CR */
1512 PORTCR(118, 0xe6050076), /* PORT118CR */
1513
1514 PORTCR(128, 0xe6051080), /* PORT128CR */
1515 PORTCR(129, 0xe6051081), /* PORT129CR */
1516
1517 PORTCR(130, 0xe6051082), /* PORT130CR */
1518 PORTCR(131, 0xe6051083), /* PORT131CR */
1519 PORTCR(132, 0xe6051084), /* PORT132CR */
1520 PORTCR(133, 0xe6051085), /* PORT133CR */
1521 PORTCR(134, 0xe6051086), /* PORT134CR */
1522 PORTCR(135, 0xe6051087), /* PORT135CR */
1523 PORTCR(136, 0xe6051088), /* PORT136CR */
1524 PORTCR(137, 0xe6051089), /* PORT137CR */
1525 PORTCR(138, 0xe605108a), /* PORT138CR */
1526 PORTCR(139, 0xe605108b), /* PORT139CR */
1527
1528 PORTCR(140, 0xe605108c), /* PORT140CR */
1529 PORTCR(141, 0xe605108d), /* PORT141CR */
1530 PORTCR(142, 0xe605108e), /* PORT142CR */
1531 PORTCR(143, 0xe605108f), /* PORT143CR */
1532 PORTCR(144, 0xe6051090), /* PORT144CR */
1533 PORTCR(145, 0xe6051091), /* PORT145CR */
1534 PORTCR(146, 0xe6051092), /* PORT146CR */
1535 PORTCR(147, 0xe6051093), /* PORT147CR */
1536 PORTCR(148, 0xe6051094), /* PORT148CR */
1537 PORTCR(149, 0xe6051095), /* PORT149CR */
1538
1539 PORTCR(150, 0xe6051096), /* PORT150CR */
1540 PORTCR(151, 0xe6051097), /* PORT151CR */
1541 PORTCR(152, 0xe6051098), /* PORT152CR */
1542 PORTCR(153, 0xe6051099), /* PORT153CR */
1543 PORTCR(154, 0xe605109a), /* PORT154CR */
1544 PORTCR(155, 0xe605109b), /* PORT155CR */
1545 PORTCR(156, 0xe605109c), /* PORT156CR */
1546 PORTCR(157, 0xe605109d), /* PORT157CR */
1547 PORTCR(158, 0xe605109e), /* PORT158CR */
1548 PORTCR(159, 0xe605109f), /* PORT159CR */
1549
1550 PORTCR(160, 0xe60510a0), /* PORT160CR */
1551 PORTCR(161, 0xe60510a1), /* PORT161CR */
1552 PORTCR(162, 0xe60510a2), /* PORT162CR */
1553 PORTCR(163, 0xe60510a3), /* PORT163CR */
1554 PORTCR(164, 0xe60510a4), /* PORT164CR */
1555
1556 PORTCR(192, 0xe60520c0), /* PORT192CR */
1557 PORTCR(193, 0xe60520c1), /* PORT193CR */
1558 PORTCR(194, 0xe60520c2), /* PORT194CR */
1559 PORTCR(195, 0xe60520c3), /* PORT195CR */
1560 PORTCR(196, 0xe60520c4), /* PORT196CR */
1561 PORTCR(197, 0xe60520c5), /* PORT197CR */
1562 PORTCR(198, 0xe60520c6), /* PORT198CR */
1563 PORTCR(199, 0xe60520c7), /* PORT199CR */
1564
1565 PORTCR(200, 0xe60520c8), /* PORT200CR */
1566 PORTCR(201, 0xe60520c9), /* PORT201CR */
1567 PORTCR(202, 0xe60520ca), /* PORT202CR */
1568 PORTCR(203, 0xe60520cb), /* PORT203CR */
1569 PORTCR(204, 0xe60520cc), /* PORT204CR */
1570 PORTCR(205, 0xe60520cd), /* PORT205CR */
1571 PORTCR(206, 0xe60520ce), /* PORT206CR */
1572 PORTCR(207, 0xe60520cf), /* PORT207CR */
1573 PORTCR(208, 0xe60520d0), /* PORT208CR */
1574 PORTCR(209, 0xe60520d1), /* PORT209CR */
1575
1576 PORTCR(210, 0xe60520d2), /* PORT210CR */
1577 PORTCR(211, 0xe60520d3), /* PORT211CR */
1578 PORTCR(212, 0xe60520d4), /* PORT212CR */
1579 PORTCR(213, 0xe60520d5), /* PORT213CR */
1580 PORTCR(214, 0xe60520d6), /* PORT214CR */
1581 PORTCR(215, 0xe60520d7), /* PORT215CR */
1582 PORTCR(216, 0xe60520d8), /* PORT216CR */
1583 PORTCR(217, 0xe60520d9), /* PORT217CR */
1584 PORTCR(218, 0xe60520da), /* PORT218CR */
1585 PORTCR(219, 0xe60520db), /* PORT219CR */
1586
1587 PORTCR(220, 0xe60520dc), /* PORT220CR */
1588 PORTCR(221, 0xe60520dd), /* PORT221CR */
1589 PORTCR(222, 0xe60520de), /* PORT222CR */
1590 PORTCR(223, 0xe60520df), /* PORT223CR */
1591 PORTCR(224, 0xe60520e0), /* PORT224CR */
1592 PORTCR(225, 0xe60520e1), /* PORT225CR */
1593 PORTCR(226, 0xe60520e2), /* PORT226CR */
1594 PORTCR(227, 0xe60520e3), /* PORT227CR */
1595 PORTCR(228, 0xe60520e4), /* PORT228CR */
1596 PORTCR(229, 0xe60520e5), /* PORT229CR */
1597
1598 PORTCR(230, 0xe60520e6), /* PORT230CR */
1599 PORTCR(231, 0xe60520e7), /* PORT231CR */
1600 PORTCR(232, 0xe60520e8), /* PORT232CR */
1601 PORTCR(233, 0xe60520e9), /* PORT233CR */
1602 PORTCR(234, 0xe60520ea), /* PORT234CR */
1603 PORTCR(235, 0xe60520eb), /* PORT235CR */
1604 PORTCR(236, 0xe60520ec), /* PORT236CR */
1605 PORTCR(237, 0xe60520ed), /* PORT237CR */
1606 PORTCR(238, 0xe60520ee), /* PORT238CR */
1607 PORTCR(239, 0xe60520ef), /* PORT239CR */
1608
1609 PORTCR(240, 0xe60520f0), /* PORT240CR */
1610 PORTCR(241, 0xe60520f1), /* PORT241CR */
1611 PORTCR(242, 0xe60520f2), /* PORT242CR */
1612 PORTCR(243, 0xe60520f3), /* PORT243CR */
1613 PORTCR(244, 0xe60520f4), /* PORT244CR */
1614 PORTCR(245, 0xe60520f5), /* PORT245CR */
1615 PORTCR(246, 0xe60520f6), /* PORT246CR */
1616 PORTCR(247, 0xe60520f7), /* PORT247CR */
1617 PORTCR(248, 0xe60520f8), /* PORT248CR */
1618 PORTCR(249, 0xe60520f9), /* PORT249CR */
1619
1620 PORTCR(250, 0xe60520fa), /* PORT250CR */
1621 PORTCR(251, 0xe60520fb), /* PORT251CR */
1622 PORTCR(252, 0xe60520fc), /* PORT252CR */
1623 PORTCR(253, 0xe60520fd), /* PORT253CR */
1624 PORTCR(254, 0xe60520fe), /* PORT254CR */
1625 PORTCR(255, 0xe60520ff), /* PORT255CR */
1626 PORTCR(256, 0xe6052100), /* PORT256CR */
1627 PORTCR(257, 0xe6052101), /* PORT257CR */
1628 PORTCR(258, 0xe6052102), /* PORT258CR */
1629 PORTCR(259, 0xe6052103), /* PORT259CR */
1630
1631 PORTCR(260, 0xe6052104), /* PORT260CR */
1632 PORTCR(261, 0xe6052105), /* PORT261CR */
1633 PORTCR(262, 0xe6052106), /* PORT262CR */
1634 PORTCR(263, 0xe6052107), /* PORT263CR */
1635 PORTCR(264, 0xe6052108), /* PORT264CR */
1636
1637 { PINMUX_CFG_REG("MSELBCR", 0xe6058024, 32, 1) {
1638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1640 MSELBCR_MSEL17_0, MSELBCR_MSEL17_1,
1641 MSELBCR_MSEL16_0, MSELBCR_MSEL16_1,
1642 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1643 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
1644 },
1645 { },
1646};
1647
1648static struct pinmux_data_reg pinmux_data_regs[] = {
1649 { PINMUX_DATA_REG("PORTL031_000DR", 0xe6054000, 32) {
1650 PORT31_DATA, PORT30_DATA, PORT29_DATA, PORT28_DATA,
1651 PORT27_DATA, PORT26_DATA, PORT25_DATA, PORT24_DATA,
1652 PORT23_DATA, PORT22_DATA, PORT21_DATA, PORT20_DATA,
1653 PORT19_DATA, PORT18_DATA, PORT17_DATA, PORT16_DATA,
1654 PORT15_DATA, PORT14_DATA, PORT13_DATA, PORT12_DATA,
1655 PORT11_DATA, PORT10_DATA, PORT9_DATA, PORT8_DATA,
1656 PORT7_DATA, PORT6_DATA, PORT5_DATA, PORT4_DATA,
1657 PORT3_DATA, PORT2_DATA, PORT1_DATA, PORT0_DATA }
1658 },
1659 { PINMUX_DATA_REG("PORTL063_032DR", 0xe6054004, 32) {
1660 PORT63_DATA, PORT62_DATA, PORT61_DATA, PORT60_DATA,
1661 PORT59_DATA, PORT58_DATA, PORT57_DATA, PORT56_DATA,
1662 PORT55_DATA, PORT54_DATA, PORT53_DATA, PORT52_DATA,
1663 PORT51_DATA, PORT50_DATA, PORT49_DATA, PORT48_DATA,
1664 PORT47_DATA, PORT46_DATA, PORT45_DATA, PORT44_DATA,
1665 PORT43_DATA, PORT42_DATA, PORT41_DATA, PORT40_DATA,
1666 PORT39_DATA, PORT38_DATA, PORT37_DATA, PORT36_DATA,
1667 PORT35_DATA, PORT34_DATA, PORT33_DATA, PORT32_DATA }
1668 },
1669 { PINMUX_DATA_REG("PORTL095_064DR", 0xe6054008, 32) {
1670 PORT95_DATA, PORT94_DATA, PORT93_DATA, PORT92_DATA,
1671 PORT91_DATA, PORT90_DATA, PORT89_DATA, PORT88_DATA,
1672 PORT87_DATA, PORT86_DATA, PORT85_DATA, PORT84_DATA,
1673 PORT83_DATA, PORT82_DATA, PORT81_DATA, PORT80_DATA,
1674 PORT79_DATA, PORT78_DATA, PORT77_DATA, PORT76_DATA,
1675 PORT75_DATA, PORT74_DATA, PORT73_DATA, PORT72_DATA,
1676 PORT71_DATA, PORT70_DATA, PORT69_DATA, PORT68_DATA,
1677 PORT67_DATA, PORT66_DATA, PORT65_DATA, PORT64_DATA }
1678 },
1679 { PINMUX_DATA_REG("PORTD127_096DR", 0xe605400C, 32) {
1680 0, 0, 0, 0,
1681 0, 0, 0, 0,
1682 0, PORT118_DATA, PORT117_DATA, PORT116_DATA,
1683 PORT115_DATA, PORT114_DATA, PORT113_DATA, PORT112_DATA,
1684 PORT111_DATA, PORT110_DATA, PORT109_DATA, PORT108_DATA,
1685 PORT107_DATA, PORT106_DATA, PORT105_DATA, PORT104_DATA,
1686 PORT103_DATA, PORT102_DATA, PORT101_DATA, PORT100_DATA,
1687 PORT99_DATA, PORT98_DATA, PORT97_DATA, PORT96_DATA }
1688 },
1689 { PINMUX_DATA_REG("PORTD159_128DR", 0xe6055000, 32) {
1690 PORT159_DATA, PORT158_DATA, PORT157_DATA, PORT156_DATA,
1691 PORT155_DATA, PORT154_DATA, PORT153_DATA, PORT152_DATA,
1692 PORT151_DATA, PORT150_DATA, PORT149_DATA, PORT148_DATA,
1693 PORT147_DATA, PORT146_DATA, PORT145_DATA, PORT144_DATA,
1694 PORT143_DATA, PORT142_DATA, PORT141_DATA, PORT140_DATA,
1695 PORT139_DATA, PORT138_DATA, PORT137_DATA, PORT136_DATA,
1696 PORT135_DATA, PORT134_DATA, PORT133_DATA, PORT132_DATA,
1697 PORT131_DATA, PORT130_DATA, PORT129_DATA, PORT128_DATA }
1698 },
1699 { PINMUX_DATA_REG("PORTR191_160DR", 0xe6055004, 32) {
1700 0, 0, 0, 0,
1701 0, 0, 0, 0,
1702 0, 0, 0, 0,
1703 0, 0, 0, 0,
1704 0, 0, 0, 0,
1705 0, 0, 0, 0,
1706 0, 0, 0, PORT164_DATA,
1707 PORT163_DATA, PORT162_DATA, PORT161_DATA, PORT160_DATA }
1708 },
1709 { PINMUX_DATA_REG("PORTR223_192DR", 0xe6056000, 32) {
1710 PORT223_DATA, PORT222_DATA, PORT221_DATA, PORT220_DATA,
1711 PORT219_DATA, PORT218_DATA, PORT217_DATA, PORT216_DATA,
1712 PORT215_DATA, PORT214_DATA, PORT213_DATA, PORT212_DATA,
1713 PORT211_DATA, PORT210_DATA, PORT209_DATA, PORT208_DATA,
1714 PORT207_DATA, PORT206_DATA, PORT205_DATA, PORT204_DATA,
1715 PORT203_DATA, PORT202_DATA, PORT201_DATA, PORT200_DATA,
1716 PORT199_DATA, PORT198_DATA, PORT197_DATA, PORT196_DATA,
1717 PORT195_DATA, PORT194_DATA, PORT193_DATA, PORT192_DATA }
1718 },
1719 { PINMUX_DATA_REG("PORTU255_224DR", 0xe6056004, 32) {
1720 PORT255_DATA, PORT254_DATA, PORT253_DATA, PORT252_DATA,
1721 PORT251_DATA, PORT250_DATA, PORT249_DATA, PORT248_DATA,
1722 PORT247_DATA, PORT246_DATA, PORT245_DATA, PORT244_DATA,
1723 PORT243_DATA, PORT242_DATA, PORT241_DATA, PORT240_DATA,
1724 PORT239_DATA, PORT238_DATA, PORT237_DATA, PORT236_DATA,
1725 PORT235_DATA, PORT234_DATA, PORT233_DATA, PORT232_DATA,
1726 PORT231_DATA, PORT230_DATA, PORT229_DATA, PORT228_DATA,
1727 PORT227_DATA, PORT226_DATA, PORT225_DATA, PORT224_DATA }
1728 },
1729 { PINMUX_DATA_REG("PORTU287_256DR", 0xe6056008, 32) {
1730 0, 0, 0, 0,
1731 0, 0, 0, 0,
1732 0, 0, 0, 0,
1733 0, 0, 0, 0,
1734 0, 0, 0, 0,
1735 0, 0, 0, PORT264_DATA,
1736 PORT263_DATA, PORT262_DATA, PORT261_DATA, PORT260_DATA,
1737 PORT259_DATA, PORT258_DATA, PORT257_DATA, PORT256_DATA }
1738 },
1739 { },
1740};
1741
1742static struct pinmux_info sh7377_pinmux_info = {
1743 .name = "sh7377_pfc",
1744 .reserved_id = PINMUX_RESERVED,
1745 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
1746 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END },
1747 .input_pu = { PINMUX_INPUT_PULLUP_BEGIN, PINMUX_INPUT_PULLUP_END },
1748 .input_pd = { PINMUX_INPUT_PULLDOWN_BEGIN, PINMUX_INPUT_PULLDOWN_END },
1749 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END },
1750 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
1751 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
1752
1753 .first_gpio = GPIO_PORT0,
1754 .last_gpio = GPIO_FN_RESETOUTS,
1755
1756 .gpios = pinmux_gpios,
1757 .cfg_regs = pinmux_config_regs,
1758 .data_regs = pinmux_data_regs,
1759
1760 .gpio_data = pinmux_data,
1761 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1762};
1763
1764void sh7377_pinmux_init(void)
1765{
1766 register_pinmux(&sh7377_pinmux_info);
1767}
diff --git a/arch/arm/mach-shmobile/setup-sh7367.c b/arch/arm/mach-shmobile/setup-sh7367.c
new file mode 100644
index 000000000000..eca90716140e
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7367.c
@@ -0,0 +1,198 @@
1/*
2 * sh7367 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_timer.h>
30#include <mach/hardware.h>
31#include <asm/mach-types.h>
32#include <asm/mach/arch.h>
33
34static struct plat_sci_port scif0_platform_data = {
35 .mapbase = 0xe6c40000,
36 .flags = UPF_BOOT_AUTOCONF,
37 .type = PORT_SCIF,
38 .irqs = { 80, 80, 80, 80 },
39};
40
41static struct platform_device scif0_device = {
42 .name = "sh-sci",
43 .id = 0,
44 .dev = {
45 .platform_data = &scif0_platform_data,
46 },
47};
48
49static struct plat_sci_port scif1_platform_data = {
50 .mapbase = 0xe6c50000,
51 .flags = UPF_BOOT_AUTOCONF,
52 .type = PORT_SCIF,
53 .irqs = { 81, 81, 81, 81 },
54};
55
56static struct platform_device scif1_device = {
57 .name = "sh-sci",
58 .id = 1,
59 .dev = {
60 .platform_data = &scif1_platform_data,
61 },
62};
63
64static struct plat_sci_port scif2_platform_data = {
65 .mapbase = 0xe6c60000,
66 .flags = UPF_BOOT_AUTOCONF,
67 .type = PORT_SCIF,
68 .irqs = { 82, 82, 82, 82 },
69};
70
71static struct platform_device scif2_device = {
72 .name = "sh-sci",
73 .id = 2,
74 .dev = {
75 .platform_data = &scif2_platform_data,
76 },
77};
78
79static struct plat_sci_port scif3_platform_data = {
80 .mapbase = 0xe6c70000,
81 .flags = UPF_BOOT_AUTOCONF,
82 .type = PORT_SCIF,
83 .irqs = { 83, 83, 83, 83 },
84};
85
86static struct platform_device scif3_device = {
87 .name = "sh-sci",
88 .id = 3,
89 .dev = {
90 .platform_data = &scif3_platform_data,
91 },
92};
93
94static struct plat_sci_port scif4_platform_data = {
95 .mapbase = 0xe6c80000,
96 .flags = UPF_BOOT_AUTOCONF,
97 .type = PORT_SCIF,
98 .irqs = { 89, 89, 89, 89 },
99};
100
101static struct platform_device scif4_device = {
102 .name = "sh-sci",
103 .id = 4,
104 .dev = {
105 .platform_data = &scif4_platform_data,
106 },
107};
108
109static struct plat_sci_port scif5_platform_data = {
110 .mapbase = 0xe6cb0000,
111 .flags = UPF_BOOT_AUTOCONF,
112 .type = PORT_SCIF,
113 .irqs = { 90, 90, 90, 90 },
114};
115
116static struct platform_device scif5_device = {
117 .name = "sh-sci",
118 .id = 5,
119 .dev = {
120 .platform_data = &scif5_platform_data,
121 },
122};
123
124static struct plat_sci_port scif6_platform_data = {
125 .mapbase = 0xe6c30000,
126 .flags = UPF_BOOT_AUTOCONF,
127 .type = PORT_SCIF,
128 .irqs = { 91, 91, 91, 91 },
129};
130
131static struct platform_device scif6_device = {
132 .name = "sh-sci",
133 .id = 6,
134 .dev = {
135 .platform_data = &scif6_platform_data,
136 },
137};
138
139static struct sh_timer_config cmt10_platform_data = {
140 .name = "CMT10",
141 .channel_offset = 0x10,
142 .timer_bit = 0,
143 .clk = "r_clk",
144 .clockevent_rating = 125,
145 .clocksource_rating = 125,
146};
147
148static struct resource cmt10_resources[] = {
149 [0] = {
150 .name = "CMT10",
151 .start = 0xe6138010,
152 .end = 0xe613801b,
153 .flags = IORESOURCE_MEM,
154 },
155 [1] = {
156 .start = 72,
157 .flags = IORESOURCE_IRQ,
158 },
159};
160
161static struct platform_device cmt10_device = {
162 .name = "sh_cmt",
163 .id = 10,
164 .dev = {
165 .platform_data = &cmt10_platform_data,
166 },
167 .resource = cmt10_resources,
168 .num_resources = ARRAY_SIZE(cmt10_resources),
169};
170
171static struct platform_device *sh7367_early_devices[] __initdata = {
172 &scif0_device,
173 &scif1_device,
174 &scif2_device,
175 &scif3_device,
176 &scif4_device,
177 &scif5_device,
178 &scif6_device,
179 &cmt10_device,
180};
181
182void __init sh7367_add_standard_devices(void)
183{
184 platform_add_devices(sh7367_early_devices,
185 ARRAY_SIZE(sh7367_early_devices));
186}
187
188#define SYMSTPCR2 0xe6158048
189#define SYMSTPCR2_CMT1 (1 << 29)
190
191void __init sh7367_add_early_devices(void)
192{
193 /* enable clock to CMT1 */
194 __raw_writel(__raw_readl(SYMSTPCR2) & ~SYMSTPCR2_CMT1, SYMSTPCR2);
195
196 early_platform_add_devices(sh7367_early_devices,
197 ARRAY_SIZE(sh7367_early_devices));
198}
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
new file mode 100644
index 000000000000..1d1153290f59
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -0,0 +1,199 @@
1/*
2 * sh7372 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_intc.h>
30#include <linux/sh_timer.h>
31#include <mach/hardware.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35static struct plat_sci_port scif0_platform_data = {
36 .mapbase = 0xe6c40000,
37 .flags = UPF_BOOT_AUTOCONF,
38 .type = PORT_SCIF,
39 .irqs = { 80, 80, 80, 80 },
40};
41
42static struct platform_device scif0_device = {
43 .name = "sh-sci",
44 .id = 0,
45 .dev = {
46 .platform_data = &scif0_platform_data,
47 },
48};
49
50static struct plat_sci_port scif1_platform_data = {
51 .mapbase = 0xe6c50000,
52 .flags = UPF_BOOT_AUTOCONF,
53 .type = PORT_SCIF,
54 .irqs = { 81, 81, 81, 81 },
55};
56
57static struct platform_device scif1_device = {
58 .name = "sh-sci",
59 .id = 1,
60 .dev = {
61 .platform_data = &scif1_platform_data,
62 },
63};
64
65static struct plat_sci_port scif2_platform_data = {
66 .mapbase = 0xe6c60000,
67 .flags = UPF_BOOT_AUTOCONF,
68 .type = PORT_SCIF,
69 .irqs = { 82, 82, 82, 82 },
70};
71
72static struct platform_device scif2_device = {
73 .name = "sh-sci",
74 .id = 2,
75 .dev = {
76 .platform_data = &scif2_platform_data,
77 },
78};
79
80static struct plat_sci_port scif3_platform_data = {
81 .mapbase = 0xe6c70000,
82 .flags = UPF_BOOT_AUTOCONF,
83 .type = PORT_SCIF,
84 .irqs = { 83, 83, 83, 83 },
85};
86
87static struct platform_device scif3_device = {
88 .name = "sh-sci",
89 .id = 3,
90 .dev = {
91 .platform_data = &scif3_platform_data,
92 },
93};
94
95static struct plat_sci_port scif4_platform_data = {
96 .mapbase = 0xe6c80000,
97 .flags = UPF_BOOT_AUTOCONF,
98 .type = PORT_SCIF,
99 .irqs = { 89, 89, 89, 89 },
100};
101
102static struct platform_device scif4_device = {
103 .name = "sh-sci",
104 .id = 4,
105 .dev = {
106 .platform_data = &scif4_platform_data,
107 },
108};
109
110static struct plat_sci_port scif5_platform_data = {
111 .mapbase = 0xe6cb0000,
112 .flags = UPF_BOOT_AUTOCONF,
113 .type = PORT_SCIF,
114 .irqs = { 90, 90, 90, 90 },
115};
116
117static struct platform_device scif5_device = {
118 .name = "sh-sci",
119 .id = 5,
120 .dev = {
121 .platform_data = &scif5_platform_data,
122 },
123};
124
125static struct plat_sci_port scif6_platform_data = {
126 .mapbase = 0xe6c30000,
127 .flags = UPF_BOOT_AUTOCONF,
128 .type = PORT_SCIF,
129 .irqs = { 91, 91, 91, 91 },
130};
131
132static struct platform_device scif6_device = {
133 .name = "sh-sci",
134 .id = 6,
135 .dev = {
136 .platform_data = &scif6_platform_data,
137 },
138};
139
140static struct sh_timer_config cmt10_platform_data = {
141 .name = "CMT10",
142 .channel_offset = 0x10,
143 .timer_bit = 0,
144 .clk = "r_clk",
145 .clockevent_rating = 125,
146 .clocksource_rating = 125,
147};
148
149static struct resource cmt10_resources[] = {
150 [0] = {
151 .name = "CMT10",
152 .start = 0xe6138010,
153 .end = 0xe613801b,
154 .flags = IORESOURCE_MEM,
155 },
156 [1] = {
157 .start = 72,
158 .flags = IORESOURCE_IRQ,
159 },
160};
161
162static struct platform_device cmt10_device = {
163 .name = "sh_cmt",
164 .id = 10,
165 .dev = {
166 .platform_data = &cmt10_platform_data,
167 },
168 .resource = cmt10_resources,
169 .num_resources = ARRAY_SIZE(cmt10_resources),
170};
171
172static struct platform_device *sh7372_early_devices[] __initdata = {
173 &scif0_device,
174 &scif1_device,
175 &scif2_device,
176 &scif3_device,
177 &scif4_device,
178 &scif5_device,
179 &scif6_device,
180 &cmt10_device,
181};
182
183void __init sh7372_add_standard_devices(void)
184{
185 platform_add_devices(sh7372_early_devices,
186 ARRAY_SIZE(sh7372_early_devices));
187}
188
189#define SMSTPCR3 0xe615013c
190#define SMSTPCR3_CMT1 (1 << 29)
191
192void __init sh7372_add_early_devices(void)
193{
194 /* enable clock to CMT1 */
195 __raw_writel(__raw_readl(SMSTPCR3) & ~SMSTPCR3_CMT1, SMSTPCR3);
196
197 early_platform_add_devices(sh7372_early_devices,
198 ARRAY_SIZE(sh7372_early_devices));
199}
diff --git a/arch/arm/mach-shmobile/setup-sh7377.c b/arch/arm/mach-shmobile/setup-sh7377.c
new file mode 100644
index 000000000000..60e37774c35c
--- /dev/null
+++ b/arch/arm/mach-shmobile/setup-sh7377.c
@@ -0,0 +1,215 @@
1/*
2 * sh7377 processor support
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2008 Yoshihiro Shimoda
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/interrupt.h>
23#include <linux/irq.h>
24#include <linux/platform_device.h>
25#include <linux/delay.h>
26#include <linux/input.h>
27#include <linux/io.h>
28#include <linux/serial_sci.h>
29#include <linux/sh_intc.h>
30#include <linux/sh_timer.h>
31#include <mach/hardware.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34
35static struct plat_sci_port scif0_platform_data = {
36 .mapbase = 0xe6c40000,
37 .flags = UPF_BOOT_AUTOCONF,
38 .type = PORT_SCIF,
39 .irqs = { 80, 80, 80, 80 },
40};
41
42static struct platform_device scif0_device = {
43 .name = "sh-sci",
44 .id = 0,
45 .dev = {
46 .platform_data = &scif0_platform_data,
47 },
48};
49
50static struct plat_sci_port scif1_platform_data = {
51 .mapbase = 0xe6c50000,
52 .flags = UPF_BOOT_AUTOCONF,
53 .type = PORT_SCIF,
54 .irqs = { 81, 81, 81, 81 },
55};
56
57static struct platform_device scif1_device = {
58 .name = "sh-sci",
59 .id = 1,
60 .dev = {
61 .platform_data = &scif1_platform_data,
62 },
63};
64
65static struct plat_sci_port scif2_platform_data = {
66 .mapbase = 0xe6c60000,
67 .flags = UPF_BOOT_AUTOCONF,
68 .type = PORT_SCIF,
69 .irqs = { 82, 82, 82, 82 },
70};
71
72static struct platform_device scif2_device = {
73 .name = "sh-sci",
74 .id = 2,
75 .dev = {
76 .platform_data = &scif2_platform_data,
77 },
78};
79
80static struct plat_sci_port scif3_platform_data = {
81 .mapbase = 0xe6c70000,
82 .flags = UPF_BOOT_AUTOCONF,
83 .type = PORT_SCIF,
84 .irqs = { 83, 83, 83, 83 },
85};
86
87static struct platform_device scif3_device = {
88 .name = "sh-sci",
89 .id = 3,
90 .dev = {
91 .platform_data = &scif3_platform_data,
92 },
93};
94
95static struct plat_sci_port scif4_platform_data = {
96 .mapbase = 0xe6c80000,
97 .flags = UPF_BOOT_AUTOCONF,
98 .type = PORT_SCIF,
99 .irqs = { 89, 89, 89, 89 },
100};
101
102static struct platform_device scif4_device = {
103 .name = "sh-sci",
104 .id = 4,
105 .dev = {
106 .platform_data = &scif4_platform_data,
107 },
108};
109
110static struct plat_sci_port scif5_platform_data = {
111 .mapbase = 0xe6cb0000,
112 .flags = UPF_BOOT_AUTOCONF,
113 .type = PORT_SCIF,
114 .irqs = { 90, 90, 90, 90 },
115};
116
117static struct platform_device scif5_device = {
118 .name = "sh-sci",
119 .id = 5,
120 .dev = {
121 .platform_data = &scif5_platform_data,
122 },
123};
124
125static struct plat_sci_port scif6_platform_data = {
126 .mapbase = 0xe6cc0000,
127 .flags = UPF_BOOT_AUTOCONF,
128 .type = PORT_SCIF,
129 .irqs = { 196, 196, 196, 196 },
130};
131
132static struct platform_device scif6_device = {
133 .name = "sh-sci",
134 .id = 6,
135 .dev = {
136 .platform_data = &scif6_platform_data,
137 },
138};
139
140static struct plat_sci_port scif7_platform_data = {
141 .mapbase = 0xe6c30000,
142 .flags = UPF_BOOT_AUTOCONF,
143 .type = PORT_SCIF,
144 .irqs = { 91, 91, 91, 91 },
145};
146
147static struct platform_device scif7_device = {
148 .name = "sh-sci",
149 .id = 7,
150 .dev = {
151 .platform_data = &scif7_platform_data,
152 },
153};
154
155static struct sh_timer_config cmt10_platform_data = {
156 .name = "CMT10",
157 .channel_offset = 0x10,
158 .timer_bit = 0,
159 .clk = "r_clk",
160 .clockevent_rating = 125,
161 .clocksource_rating = 125,
162};
163
164static struct resource cmt10_resources[] = {
165 [0] = {
166 .name = "CMT10",
167 .start = 0xe6138010,
168 .end = 0xe613801b,
169 .flags = IORESOURCE_MEM,
170 },
171 [1] = {
172 .start = 72,
173 .flags = IORESOURCE_IRQ,
174 },
175};
176
177static struct platform_device cmt10_device = {
178 .name = "sh_cmt",
179 .id = 10,
180 .dev = {
181 .platform_data = &cmt10_platform_data,
182 },
183 .resource = cmt10_resources,
184 .num_resources = ARRAY_SIZE(cmt10_resources),
185};
186
187static struct platform_device *sh7377_early_devices[] __initdata = {
188 &scif0_device,
189 &scif1_device,
190 &scif2_device,
191 &scif3_device,
192 &scif4_device,
193 &scif5_device,
194 &scif6_device,
195 &scif7_device,
196 &cmt10_device,
197};
198
199void __init sh7377_add_standard_devices(void)
200{
201 platform_add_devices(sh7377_early_devices,
202 ARRAY_SIZE(sh7377_early_devices));
203}
204
205#define SMSTPCR3 0xe615013c
206#define SMSTPCR3_CMT1 (1 << 29)
207
208void __init sh7377_add_early_devices(void)
209{
210 /* enable clock to CMT1 */
211 __raw_writel(__raw_readl(SMSTPCR3) & ~SMSTPCR3_CMT1, SMSTPCR3);
212
213 early_platform_add_devices(sh7377_early_devices,
214 ARRAY_SIZE(sh7377_early_devices));
215}
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c
new file mode 100644
index 000000000000..895794b543cd
--- /dev/null
+++ b/arch/arm/mach-shmobile/timer.c
@@ -0,0 +1,46 @@
1/*
2 * SH-Mobile Timer
3 *
4 * Copyright (C) 2010 Magnus Damm
5 * Copyright (C) 2002 - 2009 Paul Mundt
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21#include <linux/platform_device.h>
22#include <asm/mach/time.h>
23
24static void __init shmobile_late_time_init(void)
25{
26 /*
27 * Make sure all compiled-in early timers register themselves.
28 *
29 * Run probe() for two "earlytimer" devices, these will be the
30 * clockevents and clocksource devices respectively. In the event
31 * that only a clockevents device is available, we -ENODEV on the
32 * clocksource and the jiffies clocksource is used transparently
33 * instead. No error handling is necessary here.
34 */
35 early_platform_driver_register_all("earlytimer");
36 early_platform_driver_probe("earlytimer", 2, 0);
37}
38
39static void __init shmobile_timer_init(void)
40{
41 late_time_init = shmobile_late_time_init;
42}
43
44struct sys_timer shmobile_timer = {
45 .init = shmobile_timer_init,
46};
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 01b50313914c..5f34eb674d68 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -358,7 +358,7 @@ static struct resource ave_resources[] = {
358 /* 358 /*
359 * The AVE3e requires two regions of 256MB that it considers 359 * The AVE3e requires two regions of 256MB that it considers
360 * "invisible". The hardware will not be able to access these 360 * "invisible". The hardware will not be able to access these
361 * adresses, so they should never point to system RAM. 361 * addresses, so they should never point to system RAM.
362 */ 362 */
363 { 363 {
364 .name = "AVE3e Reserved 0", 364 .name = "AVE3e Reserved 0",
@@ -1596,7 +1596,7 @@ static void __init u300_init_check_chip(void)
1596/* 1596/*
1597 * Some devices and their resources require reserved physical memory from 1597 * Some devices and their resources require reserved physical memory from
1598 * the end of the available RAM. This function traverses the list of devices 1598 * the end of the available RAM. This function traverses the list of devices
1599 * and assigns actual adresses to these. 1599 * and assigns actual addresses to these.
1600 */ 1600 */
1601static void __init u300_assign_physmem(void) 1601static void __init u300_assign_physmem(void)
1602{ 1602{
diff --git a/arch/arm/mach-u300/include/mach/debug-macro.S b/arch/arm/mach-u300/include/mach/debug-macro.S
index ca4a028c2661..92c12420256f 100644
--- a/arch/arm/mach-u300/include/mach/debug-macro.S
+++ b/arch/arm/mach-u300/include/mach/debug-macro.S
@@ -11,7 +11,7 @@
11#include <mach/hardware.h> 11#include <mach/hardware.h>
12 12
13 .macro addruart, rx, tmp 13 .macro addruart, rx, tmp
14 /* If we move the adress using MMU, use this. */ 14 /* If we move the address using MMU, use this. */
15 mrc p15, 0, \rx, c1, c0 15 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 16 tst \rx, #1 @ MMU enabled?
17 ldreq \rx, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address 17 ldreq \rx, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
diff --git a/arch/arm/mach-ux500/include/mach/hardware.h b/arch/arm/mach-ux500/include/mach/hardware.h
index 6da650202dc7..04ea836969b3 100644
--- a/arch/arm/mach-ux500/include/mach/hardware.h
+++ b/arch/arm/mach-ux500/include/mach/hardware.h
@@ -68,12 +68,12 @@
68#define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000) 68#define U8500_PKAM_BASE (U8500_PER6_BASE + 0x2000)
69#define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000) 69#define U8500_CRYPTO0_BASE (U8500_PER6_BASE + 0xa000)
70#define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000) 70#define U8500_CRYPTO1_BASE (U8500_PER6_BASE + 0xb000)
71#define U8500_CLKRST6_BASE (U8500_PER7_BASE + 0xf000) 71#define U8500_CLKRST6_BASE (U8500_PER6_BASE + 0xf000)
72 72
73/* per5 base addressess */ 73/* per5 base addressess */
74#define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000) 74#define U8500_USBOTG_BASE (U8500_PER5_BASE + 0x00000)
75#define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000) 75#define U8500_GPIO5_BASE (U8500_PER5_BASE + 0x1e000)
76#define U8500_CLKRST5_BASE (U8500_PER7_BASE + 0x1f000) 76#define U8500_CLKRST5_BASE (U8500_PER5_BASE + 0x1f000)
77 77
78/* per4 base addressess */ 78/* per4 base addressess */
79#define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000) 79#define U8500_BACKUPRAM0_BASE (U8500_PER4_BASE + 0x0000)
@@ -95,7 +95,7 @@
95#define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000) 95#define U8500_UART2_BASE (U8500_PER3_BASE + 0x7000)
96#define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000) 96#define U8500_SDI5_BASE (U8500_PER3_BASE + 0x8000)
97#define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000) 97#define U8500_GPIO3_BASE (U8500_PER3_BASE + 0xe000)
98#define U8500_CLKRST3_BASE (U8500_PER7_BASE + 0xf000) 98#define U8500_CLKRST3_BASE (U8500_PER3_BASE + 0xf000)
99 99
100/* per2 base addressess */ 100/* per2 base addressess */
101#define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000) 101#define U8500_I2C3_BASE (U8500_PER2_BASE + 0x0000)
@@ -123,7 +123,7 @@
123#define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000) 123#define U8500_SPI3_BASE (U8500_PER1_BASE + 0x9000)
124#define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000) 124#define U8500_SLIM0_BASE (U8500_PER1_BASE + 0xa000)
125#define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000) 125#define U8500_GPIO1_BASE (U8500_PER1_BASE + 0xe000)
126#define U8500_CLKRST1_BASE (U8500_PER2_BASE + 0xf000) 126#define U8500_CLKRST1_BASE (U8500_PER1_BASE + 0xf000)
127 127
128/* ST-Ericsson modified pl022 id */ 128/* ST-Ericsson modified pl022 id */
129#define SSP_PER_ID 0x01080022 129#define SSP_PER_ID 0x01080022
diff --git a/arch/arm/mach-w90x900/cpu.h b/arch/arm/mach-w90x900/cpu.h
index 4d58ba164e25..f8730b60bd76 100644
--- a/arch/arm/mach-w90x900/cpu.h
+++ b/arch/arm/mach-w90x900/cpu.h
@@ -57,3 +57,4 @@ extern struct platform_device nuc900_device_fmi;
57extern struct platform_device nuc900_device_kpi; 57extern struct platform_device nuc900_device_kpi;
58extern struct platform_device nuc900_device_rtc; 58extern struct platform_device nuc900_device_rtc;
59extern struct platform_device nuc900_device_ts; 59extern struct platform_device nuc900_device_ts;
60extern struct platform_device nuc900_device_lcd;
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c
index ec711f4b4019..48876122df91 100644
--- a/arch/arm/mach-w90x900/dev.c
+++ b/arch/arm/mach-w90x900/dev.c
@@ -34,6 +34,7 @@
34#include <mach/regs-serial.h> 34#include <mach/regs-serial.h>
35#include <mach/nuc900_spi.h> 35#include <mach/nuc900_spi.h>
36#include <mach/map.h> 36#include <mach/map.h>
37#include <mach/fb.h>
37 38
38#include "cpu.h" 39#include "cpu.h"
39 40
@@ -380,6 +381,47 @@ struct platform_device nuc900_device_kpi = {
380 .resource = nuc900_kpi_resource, 381 .resource = nuc900_kpi_resource,
381}; 382};
382 383
384#ifdef CONFIG_FB_NUC900
385
386static struct resource nuc900_lcd_resource[] = {
387 [0] = {
388 .start = W90X900_PA_LCD,
389 .end = W90X900_PA_LCD + W90X900_SZ_LCD - 1,
390 .flags = IORESOURCE_MEM,
391 },
392 [1] = {
393 .start = IRQ_LCD,
394 .end = IRQ_LCD,
395 .flags = IORESOURCE_IRQ,
396 }
397};
398
399static u64 nuc900_device_lcd_dmamask = -1;
400struct platform_device nuc900_device_lcd = {
401 .name = "nuc900-lcd",
402 .id = -1,
403 .num_resources = ARRAY_SIZE(nuc900_lcd_resource),
404 .resource = nuc900_lcd_resource,
405 .dev = {
406 .dma_mask = &nuc900_device_lcd_dmamask,
407 .coherent_dma_mask = -1,
408 }
409};
410
411void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd)
412{
413 struct nuc900fb_mach_info *npd;
414
415 npd = kmalloc(sizeof(*npd), GFP_KERNEL);
416 if (npd) {
417 memcpy(npd, pd, sizeof(*npd));
418 nuc900_device_lcd.dev.platform_data = npd;
419 } else {
420 printk(KERN_ERR "no memory for LCD platform data\n");
421 }
422}
423#endif
424
383/*Here should be your evb resourse,such as LCD*/ 425/*Here should be your evb resourse,such as LCD*/
384 426
385static struct platform_device *nuc900_public_dev[] __initdata = { 427static struct platform_device *nuc900_public_dev[] __initdata = {
diff --git a/arch/arm/mach-w90x900/include/mach/fb.h b/arch/arm/mach-w90x900/include/mach/fb.h
new file mode 100644
index 000000000000..cec5ece765ed
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/fb.h
@@ -0,0 +1,83 @@
1/* linux/include/asm/arch-nuc900/fb.h
2 *
3 * Copyright (c) 2008 Nuvoton technology corporation
4 * All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Changelog:
12 *
13 * 2008/08/26 vincen.zswan modify this file for LCD.
14 */
15
16#ifndef __ASM_ARM_FB_H
17#define __ASM_ARM_FB_H
18
19
20
21/* LCD Controller Hardware Desc */
22struct nuc900fb_hw {
23 unsigned int lcd_dccs;
24 unsigned int lcd_device_ctrl;
25 unsigned int lcd_mpulcd_cmd;
26 unsigned int lcd_int_cs;
27 unsigned int lcd_crtc_size;
28 unsigned int lcd_crtc_dend;
29 unsigned int lcd_crtc_hr;
30 unsigned int lcd_crtc_hsync;
31 unsigned int lcd_crtc_vr;
32 unsigned int lcd_va_baddr0;
33 unsigned int lcd_va_baddr1;
34 unsigned int lcd_va_fbctrl;
35 unsigned int lcd_va_scale;
36 unsigned int lcd_va_test;
37 unsigned int lcd_va_win;
38 unsigned int lcd_va_stuff;
39};
40
41/* LCD Display Description */
42struct nuc900fb_display {
43 /* LCD Image type */
44 unsigned type;
45
46 /* LCD Screen Size */
47 unsigned short width;
48 unsigned short height;
49
50 /* LCD Screen Info */
51 unsigned short xres;
52 unsigned short yres;
53 unsigned short bpp;
54
55 unsigned long pixclock;
56 unsigned short left_margin;
57 unsigned short right_margin;
58 unsigned short hsync_len;
59 unsigned short upper_margin;
60 unsigned short lower_margin;
61 unsigned short vsync_len;
62
63 /* hardware special register value */
64 unsigned int dccs;
65 unsigned int devctl;
66 unsigned int fbctrl;
67 unsigned int scale;
68};
69
70struct nuc900fb_mach_info {
71 struct nuc900fb_display *displays;
72 unsigned num_displays;
73 unsigned default_display;
74 /* GPIO Setting Info */
75 unsigned gpio_dir;
76 unsigned gpio_dir_mask;
77 unsigned gpio_data;
78 unsigned gpio_data_mask;
79};
80
81extern void __init nuc900_fb_set_platdata(struct nuc900fb_mach_info *);
82
83#endif /* __ASM_ARM_FB_H */
diff --git a/arch/arm/mach-w90x900/include/mach/regs-ldm.h b/arch/arm/mach-w90x900/include/mach/regs-ldm.h
new file mode 100644
index 000000000000..e9d480a5b232
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/regs-ldm.h
@@ -0,0 +1,253 @@
1/*
2 * arch/arm/mach-w90x900/include/mach/regs-serial.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * Description:
13 * Nuvoton Display, LCM Register list
14 * Author: Wang Qiang (rurality.linux@gmail.com) 2009/12/11
15 *
16 */
17
18
19#ifndef __ASM_ARM_W90X900_REGS_LDM_H
20#define __ASM_ARM_W90X900_REGS_LDM_H
21
22#include <mach/map.h>
23
24/* Display Controller Control/Status Register */
25#define REG_LCM_DCCS (0x00)
26
27#define LCM_DCCS_ENG_RST (1 << 0)
28#define LCM_DCCS_VA_EN (1 << 1)
29#define LCM_DCCS_OSD_EN (1 << 2)
30#define LCM_DCCS_DISP_OUT_EN (1 << 3)
31#define LCM_DCCS_DISP_INT_EN (1 << 4)
32#define LCM_DCCS_CMD_ON (1 << 5)
33#define LCM_DCCS_FIELD_INTR (1 << 6)
34#define LCM_DCCS_SINGLE (1 << 7)
35
36enum LCM_DCCS_VA_SRC {
37 LCM_DCCS_VA_SRC_YUV422 = (0 << 8),
38 LCM_DCCS_VA_SRC_YCBCR422 = (1 << 8),
39 LCM_DCCS_VA_SRC_RGB888 = (2 << 8),
40 LCM_DCCS_VA_SRC_RGB666 = (3 << 8),
41 LCM_DCCS_VA_SRC_RGB565 = (4 << 8),
42 LCM_DCCS_VA_SRC_RGB444LOW = (5 << 8),
43 LCM_DCCS_VA_SRC_RGB444HIGH = (7 << 8)
44};
45
46
47/* Display Device Control Register */
48#define REG_LCM_DEV_CTRL (0x04)
49
50enum LCM_DEV_CTRL_SWAP_YCbCr {
51 LCM_DEV_CTRL_SWAP_UYVY = (0 << 1),
52 LCM_DEV_CTRL_SWAP_YUYV = (1 << 1),
53 LCM_DEV_CTRL_SWAP_VYUY = (2 << 1),
54 LCM_DEV_CTRL_SWAP_YVYU = (3 << 1)
55};
56
57enum LCM_DEV_CTRL_RGB_SHIFT {
58 LCM_DEV_CTRL_RGB_SHIFT_NOT = (0 << 3),
59 LCM_DEV_CTRL_RGB_SHIFT_ONECYCLE = (1 << 3),
60 LCM_DEV_CTRL_RGB_SHIFT_TWOCYCLE = (2 << 3),
61 LCM_DEV_CTRL_RGB_SHIFT_NOT_DEF = (3 << 3)
62};
63
64enum LCM_DEV_CTRL_DEVICE {
65 LCM_DEV_CTRL_DEVICE_YUV422 = (0 << 5),
66 LCM_DEV_CTRL_DEVICE_YUV444 = (1 << 5),
67 LCM_DEV_CTRL_DEVICE_UNIPAC = (4 << 5),
68 LCM_DEV_CTRL_DEVICE_SEIKO_EPSON = (5 << 5),
69 LCM_DEV_CTRL_DEVICE_HIGH_COLOR = (6 << 5),
70 LCM_DEV_CTRL_DEVICE_MPU = (7 << 5)
71};
72
73#define LCM_DEV_CTRL_LCD_DDA (8)
74#define LCM_DEV_CTRL_YUV2CCIR (16)
75
76enum LCM_DEV_CTRL_LCD_SEL {
77 LCM_DEV_CTRL_LCD_SEL_RGB_GBR = (0 << 17),
78 LCM_DEV_CTRL_LCD_SEL_BGR_RBG = (1 << 17),
79 LCM_DEV_CTRL_LCD_SEL_GBR_RGB = (2 << 17),
80 LCM_DEV_CTRL_LCD_SEL_RBG_BGR = (3 << 17)
81};
82
83enum LCM_DEV_CTRL_FAL_D {
84 LCM_DEV_CTRL_FAL_D_FALLING = (0 << 19),
85 LCM_DEV_CTRL_FAL_D_RISING = (1 << 19),
86};
87
88enum LCM_DEV_CTRL_H_POL {
89 LCM_DEV_CTRL_H_POL_LOW = (0 << 20),
90 LCM_DEV_CTRL_H_POL_HIGH = (1 << 20),
91};
92
93enum LCM_DEV_CTRL_V_POL {
94 LCM_DEV_CTRL_V_POL_LOW = (0 << 21),
95 LCM_DEV_CTRL_V_POL_HIGH = (1 << 21),
96};
97
98enum LCM_DEV_CTRL_VR_LACE {
99 LCM_DEV_CTRL_VR_LACE_NINTERLACE = (0 << 22),
100 LCM_DEV_CTRL_VR_LACE_INTERLACE = (1 << 22),
101};
102
103enum LCM_DEV_CTRL_LACE {
104 LCM_DEV_CTRL_LACE_NINTERLACE = (0 << 23),
105 LCM_DEV_CTRL_LACE_INTERLACE = (1 << 23),
106};
107
108enum LCM_DEV_CTRL_RGB_SCALE {
109 LCM_DEV_CTRL_RGB_SCALE_4096 = (0 << 24),
110 LCM_DEV_CTRL_RGB_SCALE_65536 = (1 << 24),
111 LCM_DEV_CTRL_RGB_SCALE_262144 = (2 << 24),
112 LCM_DEV_CTRL_RGB_SCALE_16777216 = (3 << 24),
113};
114
115enum LCM_DEV_CTRL_DBWORD {
116 LCM_DEV_CTRL_DBWORD_HALFWORD = (0 << 26),
117 LCM_DEV_CTRL_DBWORD_FULLWORD = (1 << 26),
118};
119
120enum LCM_DEV_CTRL_MPU68 {
121 LCM_DEV_CTRL_MPU68_80_SERIES = (0 << 27),
122 LCM_DEV_CTRL_MPU68_68_SERIES = (1 << 27),
123};
124
125enum LCM_DEV_CTRL_DE_POL {
126 LCM_DEV_CTRL_DE_POL_HIGH = (0 << 28),
127 LCM_DEV_CTRL_DE_POL_LOW = (1 << 28),
128};
129
130#define LCM_DEV_CTRL_CMD16 (29)
131#define LCM_DEV_CTRL_CM16t18 (30)
132#define LCM_DEV_CTRL_CMD_LOW (31)
133
134/* MPU-Interface LCD Write Command */
135#define REG_LCM_MPU_CMD (0x08)
136
137/* Interrupt Control/Status Register */
138#define REG_LCM_INT_CS (0x0c)
139#define LCM_INT_CS_DISP_F_EN (1 << 0)
140#define LCM_INT_CS_UNDERRUN_EN (1 << 1)
141#define LCM_INT_CS_BUS_ERROR_INT (1 << 28)
142#define LCM_INT_CS_UNDERRUN_INT (1 << 29)
143#define LCM_INT_CS_DISP_F_STATUS (1 << 30)
144#define LCM_INT_CS_DISP_F_INT (1 << 31)
145
146/* CRTC Display Size Control Register */
147#define REG_LCM_CRTC_SIZE (0x10)
148#define LCM_CRTC_SIZE_VTTVAL(x) ((x) << 16)
149#define LCM_CRTC_SIZE_HTTVAL(x) ((x) << 0)
150
151/* CRTC Display Enable End */
152#define REG_LCM_CRTC_DEND (0x14)
153#define LCM_CRTC_DEND_VDENDVAL(x) ((x) << 16)
154#define LCM_CRTC_DEND_HDENDVAL(x) ((x) << 0)
155
156/* CRTC Internal Horizontal Retrace Control Register */
157#define REG_LCM_CRTC_HR (0x18)
158#define LCM_CRTC_HR_EVAL(x) ((x) << 16)
159#define LCM_CRTC_HR_SVAL(x) ((x) << 0)
160
161/* CRTC Horizontal Sync Control Register */
162#define REG_LCM_CRTC_HSYNC (0x1C)
163#define LCM_CRTC_HSYNC_SHIFTVAL(x) ((x) << 30)
164#define LCM_CRTC_HSYNC_EVAL(x) ((x) << 16)
165#define LCM_CRTC_HSYNC_SVAL(x) ((x) << 0)
166
167/* CRTC Internal Vertical Retrace Control Register */
168#define REG_LCM_CRTC_VR (0x20)
169#define LCM_CRTC_VR_EVAL(x) ((x) << 16)
170#define LCM_CRTC_VR_SVAL(x) ((x) << 0)
171
172/* Video Stream Frame Buffer-0 Starting Address */
173#define REG_LCM_VA_BADDR0 (0x24)
174
175/* Video Stream Frame Buffer-1 Starting Address */
176#define REG_LCM_VA_BADDR1 (0x28)
177
178/* Video Stream Frame Buffer Control Register */
179#define REG_LCM_VA_FBCTRL (0x2C)
180#define LCM_VA_FBCTRL_IO_REGION_HALF (1 << 28)
181#define LCM_VA_FBCTRL_FIELD_DUAL (1 << 29)
182#define LCM_VA_FBCTRL_START_BUF (1 << 30)
183#define LCM_VA_FBCTRL_DB_EN (1 << 31)
184
185/* Video Stream Scaling Control Register */
186#define REG_LCM_VA_SCALE (0x30)
187#define LCM_VA_SCALE_XCOPY_INTERPOLATION (0 << 15)
188#define LCM_VA_SCALE_XCOPY_DUPLICATION (1 << 15)
189
190/* Image Stream Active Window Coordinates */
191#define REG_LCM_VA_WIN (0x38)
192
193/* Image Stream Stuff Pixel */
194#define REG_LCM_VA_STUFF (0x3C)
195
196/* OSD Window Starting Coordinates */
197#define REG_LCM_OSD_WINS (0x40)
198
199/* OSD Window Ending Coordinates */
200#define REG_LCM_OSD_WINE (0x44)
201
202/* OSD Stream Frame Buffer Starting Address */
203#define REG_LCM_OSD_BADDR (0x48)
204
205/* OSD Stream Frame Buffer Control Register */
206#define REG_LCM_OSD_FBCTRL (0x4c)
207
208/* OSD Overlay Control Register */
209#define REG_LCM_OSD_OVERLAY (0x50)
210
211/* OSD Overlay Color-Key Pattern Register */
212#define REG_LCM_OSD_CKEY (0x54)
213
214/* OSD Overlay Color-Key Mask Register */
215#define REG_LCM_OSD_CMASK (0x58)
216
217/* OSD Window Skip1 Register */
218#define REG_LCM_OSD_SKIP1 (0x5C)
219
220/* OSD Window Skip2 Register */
221#define REG_LCM_OSD_SKIP2 (0x60)
222
223/* OSD horizontal up scaling control register */
224#define REG_LCM_OSD_SCALE (0x64)
225
226/* MPU Vsync control register */
227#define REG_LCM_MPU_VSYNC (0x68)
228
229/* Hardware cursor control Register */
230#define REG_LCM_HC_CTRL (0x6C)
231
232/* Hardware cursot tip point potison on va picture */
233#define REG_LCM_HC_POS (0x70)
234
235/* Hardware Cursor Window Buffer Control Register */
236#define REG_LCM_HC_WBCTRL (0x74)
237
238/* Hardware cursor memory base address register */
239#define REG_LCM_HC_BADDR (0x78)
240
241/* Hardware cursor color ram register mapped to bpp = 0 */
242#define REG_LCM_HC_COLOR0 (0x7C)
243
244/* Hardware cursor color ram register mapped to bpp = 1 */
245#define REG_LCM_HC_COLOR1 (0x80)
246
247/* Hardware cursor color ram register mapped to bpp = 2 */
248#define REG_LCM_HC_COLOR2 (0x84)
249
250/* Hardware cursor color ram register mapped to bpp = 3 */
251#define REG_LCM_HC_COLOR3 (0x88)
252
253#endif /* __ASM_ARM_W90X900_REGS_LDM_H */
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c
index cef903bcccd1..b3edc3cccf52 100644
--- a/arch/arm/mach-w90x900/mach-nuc950evb.c
+++ b/arch/arm/mach-w90x900/mach-nuc950evb.c
@@ -10,6 +10,8 @@
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as 11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation;version 2 of the License. 12 * published by the Free Software Foundation;version 2 of the License.
13 * history:
14 * Wang Qiang (rurality.linux@gmail.com) add LCD support
13 * 15 *
14 */ 16 */
15 17
@@ -18,9 +20,51 @@
18#include <asm/mach/map.h> 20#include <asm/mach/map.h>
19#include <asm/mach-types.h> 21#include <asm/mach-types.h>
20#include <mach/map.h> 22#include <mach/map.h>
23#include <mach/regs-ldm.h>
24#include <mach/fb.h>
21 25
22#include "nuc950.h" 26#include "nuc950.h"
23 27
28#ifdef CONFIG_FB_NUC900
29/* LCD Controller */
30static struct nuc900fb_display __initdata nuc950_lcd_info[] = {
31 /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */
32 [0] = {
33 .type = LCM_DCCS_VA_SRC_RGB565,
34 .width = 320,
35 .height = 240,
36 .xres = 320,
37 .yres = 240,
38 .bpp = 16,
39 .pixclock = 200000,
40 .left_margin = 34,
41 .right_margin = 54,
42 .hsync_len = 10,
43 .upper_margin = 18,
44 .lower_margin = 4,
45 .vsync_len = 1,
46 .dccs = 0x8e00041a,
47 .devctl = 0x060800c0,
48 .fbctrl = 0x00a000a0,
49 .scale = 0x04000400,
50 },
51};
52
53static struct nuc900fb_mach_info nuc950_fb_info __initdata = {
54#if defined(CONFIG_GPM1040A0_320X240)
55 .displays = &nuc950_lcd_info[0],
56#else
57 .displays = nuc950_lcd_info,
58#endif
59 .num_displays = ARRAY_SIZE(nuc950_lcd_info),
60 .default_display = 0,
61 .gpio_dir = 0x00000004,
62 .gpio_dir_mask = 0xFFFFFFFD,
63 .gpio_data = 0x00000004,
64 .gpio_data_mask = 0xFFFFFFFD,
65};
66#endif
67
24static void __init nuc950evb_map_io(void) 68static void __init nuc950evb_map_io(void)
25{ 69{
26 nuc950_map_io(); 70 nuc950_map_io();
@@ -30,6 +74,9 @@ static void __init nuc950evb_map_io(void)
30static void __init nuc950evb_init(void) 74static void __init nuc950evb_init(void)
31{ 75{
32 nuc950_board_init(); 76 nuc950_board_init();
77#ifdef CONFIG_FB_NUC900
78 nuc900_fb_set_platdata(&nuc950_fb_info);
79#endif
33} 80}
34 81
35MACHINE_START(W90P950EVB, "W90P950EVB") 82MACHINE_START(W90P950EVB, "W90P950EVB")
diff --git a/arch/arm/mach-w90x900/nuc950.c b/arch/arm/mach-w90x900/nuc950.c
index 149508116d18..4d1f1ab044c4 100644
--- a/arch/arm/mach-w90x900/nuc950.c
+++ b/arch/arm/mach-w90x900/nuc950.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21
21#include "cpu.h" 22#include "cpu.h"
22 23
23/* define specific CPU platform device */ 24/* define specific CPU platform device */
@@ -25,6 +26,9 @@
25static struct platform_device *nuc950_dev[] __initdata = { 26static struct platform_device *nuc950_dev[] __initdata = {
26 &nuc900_device_kpi, 27 &nuc900_device_kpi,
27 &nuc900_device_fmi, 28 &nuc900_device_fmi,
29#ifdef CONFIG_FB_NUC900
30 &nuc900_device_lcd,
31#endif
28}; 32};
29 33
30/* define specific CPU platform io map */ 34/* define specific CPU platform io map */
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 8b0a1ee039fa..7f7ad6f289bd 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -9,38 +9,43 @@ choice
9config ARCH_MX1 9config ARCH_MX1
10 bool "MX1-based" 10 bool "MX1-based"
11 select CPU_ARM920T 11 select CPU_ARM920T
12 select COMMON_CLKDEV 12 select IMX_HAVE_IOMUX_V1
13 help 13 help
14 This enables support for systems based on the Freescale i.MX1 family 14 This enables support for systems based on the Freescale i.MX1 family
15 15
16config ARCH_MX2 16config ARCH_MX2
17 bool "MX2-based" 17 bool "MX2-based"
18 select CPU_ARM926T 18 select CPU_ARM926T
19 select COMMON_CLKDEV 19 select IMX_HAVE_IOMUX_V1
20 help 20 help
21 This enables support for systems based on the Freescale i.MX2 family 21 This enables support for systems based on the Freescale i.MX2 family
22 22
23config ARCH_MX25 23config ARCH_MX25
24 bool "MX25-based" 24 bool "MX25-based"
25 select CPU_ARM926T 25 select CPU_ARM926T
26 select COMMON_CLKDEV 26 select ARCH_MXC_IOMUX_V3
27 select HAVE_FB_IMX
27 help 28 help
28 This enables support for systems based on the Freescale i.MX25 family 29 This enables support for systems based on the Freescale i.MX25 family
29 30
30config ARCH_MX3 31config ARCH_MX3
31 bool "MX3-based" 32 bool "MX3-based"
32 select CPU_V6 33 select CPU_V6
33 select COMMON_CLKDEV
34 help 34 help
35 This enables support for systems based on the Freescale i.MX3 family 35 This enables support for systems based on the Freescale i.MX3 family
36 36
37config ARCH_MXC91231 37config ARCH_MXC91231
38 bool "MXC91231-based" 38 bool "MXC91231-based"
39 select CPU_V6 39 select CPU_V6
40 select COMMON_CLKDEV
41 help 40 help
42 This enables support for systems based on the Freescale MXC91231 family 41 This enables support for systems based on the Freescale MXC91231 family
43 42
43config ARCH_MX5
44 bool "MX5-based"
45 select CPU_V7
46 help
47 This enables support for systems based on the Freescale i.MX51 family
48
44endchoice 49endchoice
45 50
46source "arch/arm/mach-mx1/Kconfig" 51source "arch/arm/mach-mx1/Kconfig"
@@ -48,12 +53,12 @@ source "arch/arm/mach-mx2/Kconfig"
48source "arch/arm/mach-mx3/Kconfig" 53source "arch/arm/mach-mx3/Kconfig"
49source "arch/arm/mach-mx25/Kconfig" 54source "arch/arm/mach-mx25/Kconfig"
50source "arch/arm/mach-mxc91231/Kconfig" 55source "arch/arm/mach-mxc91231/Kconfig"
56source "arch/arm/mach-mx5/Kconfig"
51 57
52endmenu 58endmenu
53 59
54config MXC_IRQ_PRIOR 60config MXC_IRQ_PRIOR
55 bool "Use IRQ priority" 61 bool "Use IRQ priority"
56 depends on ARCH_MXC
57 help 62 help
58 Select this if you want to use prioritized IRQ handling. 63 Select this if you want to use prioritized IRQ handling.
59 This feature prevents higher priority ISR to be interrupted 64 This feature prevents higher priority ISR to be interrupted
@@ -62,9 +67,16 @@ config MXC_IRQ_PRIOR
62 requirements for timing. 67 requirements for timing.
63 Say N here, unless you have a specialized requirement. 68 Say N here, unless you have a specialized requirement.
64 69
70config MXC_TZIC
71 bool "Enable TrustZone Interrupt Controller"
72 depends on ARCH_MX51
73 help
74 This will be automatically selected for all processors
75 containing this interrupt controller.
76 Say N here only if you are really sure.
77
65config MXC_PWM 78config MXC_PWM
66 tristate "Enable PWM driver" 79 tristate "Enable PWM driver"
67 depends on ARCH_MXC
68 select HAVE_PWM 80 select HAVE_PWM
69 help 81 help
70 Enable support for the i.MX PWM controller(s). 82 Enable support for the i.MX PWM controller(s).
@@ -74,7 +86,9 @@ config MXC_ULPI
74 86
75config ARCH_HAS_RNGA 87config ARCH_HAS_RNGA
76 bool 88 bool
77 depends on ARCH_MXC 89
90config IMX_HAVE_IOMUX_V1
91 bool
78 92
79config ARCH_MXC_IOMUX_V3 93config ARCH_MXC_IOMUX_V3
80 bool 94 bool
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 6cee38df58b2..895bc3c5e0c0 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -5,8 +5,12 @@
5# Common support 5# Common support
6obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o 6obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o
7 7
8obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o 8# MX51 uses the TZIC interrupt controller, older platforms use AVIC (irq.o)
9obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o 9obj-$(CONFIG_MXC_TZIC) += tzic.o
10
11obj-$(CONFIG_ARCH_MX1) += dma-mx1-mx2.o
12obj-$(CONFIG_ARCH_MX2) += dma-mx1-mx2.o
13obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o
10obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o 14obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
11obj-$(CONFIG_MXC_PWM) += pwm.o 15obj-$(CONFIG_MXC_PWM) += pwm.o
12obj-$(CONFIG_USB_EHCI_MXC) += ehci.o 16obj-$(CONFIG_USB_EHCI_MXC) += ehci.o
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
index da6387dcdf21..b62917ca3f95 100644
--- a/arch/arm/plat-mxc/audmux-v1.c
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -50,8 +50,18 @@ EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
50 50
51static int mxc_audmux_v1_init(void) 51static int mxc_audmux_v1_init(void)
52{ 52{
53 if (cpu_is_mx27() || cpu_is_mx21()) 53#ifdef CONFIG_MACH_MX21
54 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR); 54 if (cpu_is_mx21())
55 audmux_base = MX21_IO_ADDRESS(MX21_AUDMUX_BASE_ADDR);
56 else
57#endif
58#ifdef CONFIG_MACH_MX27
59 if (cpu_is_mx27())
60 audmux_base = MX27_IO_ADDRESS(MX27_AUDMUX_BASE_ADDR);
61 else
62#endif
63 (void)0;
64
55 return 0; 65 return 0;
56} 66}
57 67
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
index b06954a84436..d983cd6c788c 100644
--- a/arch/arm/plat-mxc/audmux-v2.c
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -190,7 +190,10 @@ static int mxc_audmux_v2_init(void)
190{ 190{
191 int ret; 191 int ret;
192 192
193 if (cpu_is_mx35()) { 193 if (cpu_is_mx31())
194 audmux_base = MX31_IO_ADDRESS(MX31_AUDMUX_BASE_ADDR);
195
196 else if (cpu_is_mx35()) {
194 audmux_clk = clk_get(NULL, "audmux"); 197 audmux_clk = clk_get(NULL, "audmux");
195 if (IS_ERR(audmux_clk)) { 198 if (IS_ERR(audmux_clk)) {
196 ret = PTR_ERR(audmux_clk); 199 ret = PTR_ERR(audmux_clk);
@@ -198,11 +201,9 @@ static int mxc_audmux_v2_init(void)
198 ret); 201 ret);
199 return ret; 202 return ret;
200 } 203 }
204 audmux_base = MX35_IO_ADDRESS(MX35_AUDMUX_BASE_ADDR);
201 } 205 }
202 206
203 if (cpu_is_mx31() || cpu_is_mx35())
204 audmux_base = IO_ADDRESS(AUDMUX_BASE_ADDR);
205
206 audmux_debugfs_init(); 207 audmux_debugfs_init();
207 208
208 return 0; 209 return 0;
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index 9e8fbd57495c..323ff8ccc877 100644
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -56,6 +56,7 @@ static void __clk_disable(struct clk *clk)
56 __clk_disable(clk->parent); 56 __clk_disable(clk->parent);
57 __clk_disable(clk->secondary); 57 __clk_disable(clk->secondary);
58 58
59 WARN_ON(!clk->usecount);
59 if (!(--clk->usecount) && clk->disable) 60 if (!(--clk->usecount) && clk->disable)
60 clk->disable(clk); 61 clk->disable(clk);
61} 62}
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c
index 9c1b3f9c4f4d..e16014b0d13c 100644
--- a/arch/arm/plat-mxc/dma-mx1-mx2.c
+++ b/arch/arm/plat-mxc/dma-mx1-mx2.c
@@ -128,6 +128,18 @@ struct imx_dma_channel {
128 int hw_chaining; 128 int hw_chaining;
129}; 129};
130 130
131static void __iomem *imx_dmav1_baseaddr;
132
133static void imx_dmav1_writel(unsigned val, unsigned offset)
134{
135 __raw_writel(val, imx_dmav1_baseaddr + offset);
136}
137
138static unsigned imx_dmav1_readl(unsigned offset)
139{
140 return __raw_readl(imx_dmav1_baseaddr + offset);
141}
142
131static struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS]; 143static struct imx_dma_channel imx_dma_channels[IMX_DMA_CHANNELS];
132 144
133static struct clk *dma_clk; 145static struct clk *dma_clk;
@@ -140,7 +152,6 @@ static int imx_dma_hw_chain(struct imx_dma_channel *imxdma)
140 return 0; 152 return 0;
141} 153}
142 154
143
144/* 155/*
145 * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation 156 * imx_dma_sg_next - prepare next chunk for scatter-gather DMA emulation
146 */ 157 */
@@ -160,17 +171,17 @@ static inline int imx_dma_sg_next(int channel, struct scatterlist *sg)
160 imxdma->resbytes -= now; 171 imxdma->resbytes -= now;
161 172
162 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ) 173 if ((imxdma->dma_mode & DMA_MODE_MASK) == DMA_MODE_READ)
163 __raw_writel(sg->dma_address, DMA_BASE + DMA_DAR(channel)); 174 imx_dmav1_writel(sg->dma_address, DMA_DAR(channel));
164 else 175 else
165 __raw_writel(sg->dma_address, DMA_BASE + DMA_SAR(channel)); 176 imx_dmav1_writel(sg->dma_address, DMA_SAR(channel));
166 177
167 __raw_writel(now, DMA_BASE + DMA_CNTR(channel)); 178 imx_dmav1_writel(now, DMA_CNTR(channel));
168 179
169 pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, " 180 pr_debug("imxdma%d: next sg chunk dst 0x%08x, src 0x%08x, "
170 "size 0x%08x\n", channel, 181 "size 0x%08x\n", channel,
171 __raw_readl(DMA_BASE + DMA_DAR(channel)), 182 imx_dmav1_readl(DMA_DAR(channel)),
172 __raw_readl(DMA_BASE + DMA_SAR(channel)), 183 imx_dmav1_readl(DMA_SAR(channel)),
173 __raw_readl(DMA_BASE + DMA_CNTR(channel))); 184 imx_dmav1_readl(DMA_CNTR(channel)));
174 185
175 return now; 186 return now;
176} 187}
@@ -218,27 +229,26 @@ imx_dma_setup_single(int channel, dma_addr_t dma_address,
218 channel, __func__, (unsigned int)dma_address, 229 channel, __func__, (unsigned int)dma_address,
219 dma_length, dev_addr); 230 dma_length, dev_addr);
220 231
221 __raw_writel(dev_addr, DMA_BASE + DMA_SAR(channel)); 232 imx_dmav1_writel(dev_addr, DMA_SAR(channel));
222 __raw_writel(dma_address, DMA_BASE + DMA_DAR(channel)); 233 imx_dmav1_writel(dma_address, DMA_DAR(channel));
223 __raw_writel(imxdma->ccr_from_device, 234 imx_dmav1_writel(imxdma->ccr_from_device, DMA_CCR(channel));
224 DMA_BASE + DMA_CCR(channel));
225 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) { 235 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
226 pr_debug("imxdma%d: %s dma_addressg=0x%08x dma_length=%d " 236 pr_debug("imxdma%d: %s dma_addressg=0x%08x dma_length=%d "
227 "dev_addr=0x%08x for write\n", 237 "dev_addr=0x%08x for write\n",
228 channel, __func__, (unsigned int)dma_address, 238 channel, __func__, (unsigned int)dma_address,
229 dma_length, dev_addr); 239 dma_length, dev_addr);
230 240
231 __raw_writel(dma_address, DMA_BASE + DMA_SAR(channel)); 241 imx_dmav1_writel(dma_address, DMA_SAR(channel));
232 __raw_writel(dev_addr, DMA_BASE + DMA_DAR(channel)); 242 imx_dmav1_writel(dev_addr, DMA_DAR(channel));
233 __raw_writel(imxdma->ccr_to_device, 243 imx_dmav1_writel(imxdma->ccr_to_device,
234 DMA_BASE + DMA_CCR(channel)); 244 DMA_CCR(channel));
235 } else { 245 } else {
236 printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n", 246 printk(KERN_ERR "imxdma%d: imx_dma_setup_single bad dmamode\n",
237 channel); 247 channel);
238 return -EINVAL; 248 return -EINVAL;
239 } 249 }
240 250
241 __raw_writel(dma_length, DMA_BASE + DMA_CNTR(channel)); 251 imx_dmav1_writel(dma_length, DMA_CNTR(channel));
242 252
243 return 0; 253 return 0;
244} 254}
@@ -316,17 +326,15 @@ imx_dma_setup_sg(int channel,
316 "dev_addr=0x%08x for read\n", 326 "dev_addr=0x%08x for read\n",
317 channel, __func__, sg, sgcount, dma_length, dev_addr); 327 channel, __func__, sg, sgcount, dma_length, dev_addr);
318 328
319 __raw_writel(dev_addr, DMA_BASE + DMA_SAR(channel)); 329 imx_dmav1_writel(dev_addr, DMA_SAR(channel));
320 __raw_writel(imxdma->ccr_from_device, 330 imx_dmav1_writel(imxdma->ccr_from_device, DMA_CCR(channel));
321 DMA_BASE + DMA_CCR(channel));
322 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) { 331 } else if ((dmamode & DMA_MODE_MASK) == DMA_MODE_WRITE) {
323 pr_debug("imxdma%d: %s sg=%p sgcount=%d total length=%d " 332 pr_debug("imxdma%d: %s sg=%p sgcount=%d total length=%d "
324 "dev_addr=0x%08x for write\n", 333 "dev_addr=0x%08x for write\n",
325 channel, __func__, sg, sgcount, dma_length, dev_addr); 334 channel, __func__, sg, sgcount, dma_length, dev_addr);
326 335
327 __raw_writel(dev_addr, DMA_BASE + DMA_DAR(channel)); 336 imx_dmav1_writel(dev_addr, DMA_DAR(channel));
328 __raw_writel(imxdma->ccr_to_device, 337 imx_dmav1_writel(imxdma->ccr_to_device, DMA_CCR(channel));
329 DMA_BASE + DMA_CCR(channel));
330 } else { 338 } else {
331 printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n", 339 printk(KERN_ERR "imxdma%d: imx_dma_setup_sg bad dmamode\n",
332 channel); 340 channel);
@@ -360,7 +368,7 @@ imx_dma_config_channel(int channel, unsigned int config_port,
360 imxdma->ccr_from_device = config_port | (config_mem << 2) | dreq; 368 imxdma->ccr_from_device = config_port | (config_mem << 2) | dreq;
361 imxdma->ccr_to_device = config_mem | (config_port << 2) | dreq; 369 imxdma->ccr_to_device = config_mem | (config_port << 2) | dreq;
362 370
363 __raw_writel(dmareq, DMA_BASE + DMA_RSSR(channel)); 371 imx_dmav1_writel(dmareq, DMA_RSSR(channel));
364 372
365 return 0; 373 return 0;
366} 374}
@@ -368,7 +376,7 @@ EXPORT_SYMBOL(imx_dma_config_channel);
368 376
369void imx_dma_config_burstlen(int channel, unsigned int burstlen) 377void imx_dma_config_burstlen(int channel, unsigned int burstlen)
370{ 378{
371 __raw_writel(burstlen, DMA_BASE + DMA_BLR(channel)); 379 imx_dmav1_writel(burstlen, DMA_BLR(channel));
372} 380}
373EXPORT_SYMBOL(imx_dma_config_burstlen); 381EXPORT_SYMBOL(imx_dma_config_burstlen);
374 382
@@ -398,7 +406,7 @@ imx_dma_setup_handlers(int channel,
398 } 406 }
399 407
400 local_irq_save(flags); 408 local_irq_save(flags);
401 __raw_writel(1 << channel, DMA_BASE + DMA_DISR); 409 imx_dmav1_writel(1 << channel, DMA_DISR);
402 imxdma->irq_handler = irq_handler; 410 imxdma->irq_handler = irq_handler;
403 imxdma->err_handler = err_handler; 411 imxdma->err_handler = err_handler;
404 imxdma->data = data; 412 imxdma->data = data;
@@ -462,22 +470,21 @@ void imx_dma_enable(int channel)
462 470
463 local_irq_save(flags); 471 local_irq_save(flags);
464 472
465 __raw_writel(1 << channel, DMA_BASE + DMA_DISR); 473 imx_dmav1_writel(1 << channel, DMA_DISR);
466 __raw_writel(__raw_readl(DMA_BASE + DMA_DIMR) & ~(1 << channel), 474 imx_dmav1_writel(imx_dmav1_readl(DMA_DIMR) & ~(1 << channel), DMA_DIMR);
467 DMA_BASE + DMA_DIMR); 475 imx_dmav1_writel(imx_dmav1_readl(DMA_CCR(channel)) | CCR_CEN |
468 __raw_writel(__raw_readl(DMA_BASE + DMA_CCR(channel)) | CCR_CEN | 476 CCR_ACRPT, DMA_CCR(channel));
469 CCR_ACRPT,
470 DMA_BASE + DMA_CCR(channel));
471 477
472#ifdef CONFIG_ARCH_MX2 478#ifdef CONFIG_ARCH_MX2
473 if (imxdma->sg && imx_dma_hw_chain(imxdma)) { 479 if ((cpu_is_mx21() || cpu_is_mx27()) &&
480 imxdma->sg && imx_dma_hw_chain(imxdma)) {
474 imxdma->sg = sg_next(imxdma->sg); 481 imxdma->sg = sg_next(imxdma->sg);
475 if (imxdma->sg) { 482 if (imxdma->sg) {
476 u32 tmp; 483 u32 tmp;
477 imx_dma_sg_next(channel, imxdma->sg); 484 imx_dma_sg_next(channel, imxdma->sg);
478 tmp = __raw_readl(DMA_BASE + DMA_CCR(channel)); 485 tmp = imx_dmav1_readl(DMA_CCR(channel));
479 __raw_writel(tmp | CCR_RPT | CCR_ACRPT, 486 imx_dmav1_writel(tmp | CCR_RPT | CCR_ACRPT,
480 DMA_BASE + DMA_CCR(channel)); 487 DMA_CCR(channel));
481 } 488 }
482 } 489 }
483#endif 490#endif
@@ -502,11 +509,10 @@ void imx_dma_disable(int channel)
502 del_timer(&imxdma->watchdog); 509 del_timer(&imxdma->watchdog);
503 510
504 local_irq_save(flags); 511 local_irq_save(flags);
505 __raw_writel(__raw_readl(DMA_BASE + DMA_DIMR) | (1 << channel), 512 imx_dmav1_writel(imx_dmav1_readl(DMA_DIMR) | (1 << channel), DMA_DIMR);
506 DMA_BASE + DMA_DIMR); 513 imx_dmav1_writel(imx_dmav1_readl(DMA_CCR(channel)) & ~CCR_CEN,
507 __raw_writel(__raw_readl(DMA_BASE + DMA_CCR(channel)) & ~CCR_CEN, 514 DMA_CCR(channel));
508 DMA_BASE + DMA_CCR(channel)); 515 imx_dmav1_writel(1 << channel, DMA_DISR);
509 __raw_writel(1 << channel, DMA_BASE + DMA_DISR);
510 imxdma->in_use = 0; 516 imxdma->in_use = 0;
511 local_irq_restore(flags); 517 local_irq_restore(flags);
512} 518}
@@ -517,7 +523,7 @@ static void imx_dma_watchdog(unsigned long chno)
517{ 523{
518 struct imx_dma_channel *imxdma = &imx_dma_channels[chno]; 524 struct imx_dma_channel *imxdma = &imx_dma_channels[chno];
519 525
520 __raw_writel(0, DMA_BASE + DMA_CCR(chno)); 526 imx_dmav1_writel(0, DMA_CCR(chno));
521 imxdma->in_use = 0; 527 imxdma->in_use = 0;
522 imxdma->sg = NULL; 528 imxdma->sg = NULL;
523 529
@@ -533,17 +539,17 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id)
533 unsigned int err_mask; 539 unsigned int err_mask;
534 int errcode; 540 int errcode;
535 541
536 disr = __raw_readl(DMA_BASE + DMA_DISR); 542 disr = imx_dmav1_readl(DMA_DISR);
537 543
538 err_mask = __raw_readl(DMA_BASE + DMA_DBTOSR) | 544 err_mask = imx_dmav1_readl(DMA_DBTOSR) |
539 __raw_readl(DMA_BASE + DMA_DRTOSR) | 545 imx_dmav1_readl(DMA_DRTOSR) |
540 __raw_readl(DMA_BASE + DMA_DSESR) | 546 imx_dmav1_readl(DMA_DSESR) |
541 __raw_readl(DMA_BASE + DMA_DBOSR); 547 imx_dmav1_readl(DMA_DBOSR);
542 548
543 if (!err_mask) 549 if (!err_mask)
544 return IRQ_HANDLED; 550 return IRQ_HANDLED;
545 551
546 __raw_writel(disr & err_mask, DMA_BASE + DMA_DISR); 552 imx_dmav1_writel(disr & err_mask, DMA_DISR);
547 553
548 for (i = 0; i < IMX_DMA_CHANNELS; i++) { 554 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
549 if (!(err_mask & (1 << i))) 555 if (!(err_mask & (1 << i)))
@@ -551,20 +557,20 @@ static irqreturn_t dma_err_handler(int irq, void *dev_id)
551 imxdma = &imx_dma_channels[i]; 557 imxdma = &imx_dma_channels[i];
552 errcode = 0; 558 errcode = 0;
553 559
554 if (__raw_readl(DMA_BASE + DMA_DBTOSR) & (1 << i)) { 560 if (imx_dmav1_readl(DMA_DBTOSR) & (1 << i)) {
555 __raw_writel(1 << i, DMA_BASE + DMA_DBTOSR); 561 imx_dmav1_writel(1 << i, DMA_DBTOSR);
556 errcode |= IMX_DMA_ERR_BURST; 562 errcode |= IMX_DMA_ERR_BURST;
557 } 563 }
558 if (__raw_readl(DMA_BASE + DMA_DRTOSR) & (1 << i)) { 564 if (imx_dmav1_readl(DMA_DRTOSR) & (1 << i)) {
559 __raw_writel(1 << i, DMA_BASE + DMA_DRTOSR); 565 imx_dmav1_writel(1 << i, DMA_DRTOSR);
560 errcode |= IMX_DMA_ERR_REQUEST; 566 errcode |= IMX_DMA_ERR_REQUEST;
561 } 567 }
562 if (__raw_readl(DMA_BASE + DMA_DSESR) & (1 << i)) { 568 if (imx_dmav1_readl(DMA_DSESR) & (1 << i)) {
563 __raw_writel(1 << i, DMA_BASE + DMA_DSESR); 569 imx_dmav1_writel(1 << i, DMA_DSESR);
564 errcode |= IMX_DMA_ERR_TRANSFER; 570 errcode |= IMX_DMA_ERR_TRANSFER;
565 } 571 }
566 if (__raw_readl(DMA_BASE + DMA_DBOSR) & (1 << i)) { 572 if (imx_dmav1_readl(DMA_DBOSR) & (1 << i)) {
567 __raw_writel(1 << i, DMA_BASE + DMA_DBOSR); 573 imx_dmav1_writel(1 << i, DMA_DBOSR);
568 errcode |= IMX_DMA_ERR_BUFFER; 574 errcode |= IMX_DMA_ERR_BUFFER;
569 } 575 }
570 if (imxdma->name && imxdma->err_handler) { 576 if (imxdma->name && imxdma->err_handler) {
@@ -607,7 +613,7 @@ static void dma_irq_handle_channel(int chno)
607 if (imxdma->sg) { 613 if (imxdma->sg) {
608 imx_dma_sg_next(chno, imxdma->sg); 614 imx_dma_sg_next(chno, imxdma->sg);
609 615
610 tmp = __raw_readl(DMA_BASE + DMA_CCR(chno)); 616 tmp = imx_dmav1_readl(DMA_CCR(chno));
611 617
612 if (imx_dma_hw_chain(imxdma)) { 618 if (imx_dma_hw_chain(imxdma)) {
613 /* FIXME: The timeout should probably be 619 /* FIXME: The timeout should probably be
@@ -617,15 +623,13 @@ static void dma_irq_handle_channel(int chno)
617 jiffies + msecs_to_jiffies(500)); 623 jiffies + msecs_to_jiffies(500));
618 624
619 tmp |= CCR_CEN | CCR_RPT | CCR_ACRPT; 625 tmp |= CCR_CEN | CCR_RPT | CCR_ACRPT;
620 __raw_writel(tmp, DMA_BASE + 626 imx_dmav1_writel(tmp, DMA_CCR(chno));
621 DMA_CCR(chno));
622 } else { 627 } else {
623 __raw_writel(tmp & ~CCR_CEN, DMA_BASE + 628 imx_dmav1_writel(tmp & ~CCR_CEN, DMA_CCR(chno));
624 DMA_CCR(chno));
625 tmp |= CCR_CEN; 629 tmp |= CCR_CEN;
626 } 630 }
627 631
628 __raw_writel(tmp, DMA_BASE + DMA_CCR(chno)); 632 imx_dmav1_writel(tmp, DMA_CCR(chno));
629 633
630 if (imxdma->prog_handler) 634 if (imxdma->prog_handler)
631 imxdma->prog_handler(chno, imxdma->data, 635 imxdma->prog_handler(chno, imxdma->data,
@@ -640,7 +644,7 @@ static void dma_irq_handle_channel(int chno)
640 } 644 }
641 } 645 }
642 646
643 __raw_writel(0, DMA_BASE + DMA_CCR(chno)); 647 imx_dmav1_writel(0, DMA_CCR(chno));
644 imxdma->in_use = 0; 648 imxdma->in_use = 0;
645 if (imxdma->irq_handler) 649 if (imxdma->irq_handler)
646 imxdma->irq_handler(chno, imxdma->data); 650 imxdma->irq_handler(chno, imxdma->data);
@@ -651,15 +655,16 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
651 int i, disr; 655 int i, disr;
652 656
653#ifdef CONFIG_ARCH_MX2 657#ifdef CONFIG_ARCH_MX2
654 dma_err_handler(irq, dev_id); 658 if (cpu_is_mx21() || cpu_is_mx27())
659 dma_err_handler(irq, dev_id);
655#endif 660#endif
656 661
657 disr = __raw_readl(DMA_BASE + DMA_DISR); 662 disr = imx_dmav1_readl(DMA_DISR);
658 663
659 pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n", 664 pr_debug("imxdma: dma_irq_handler called, disr=0x%08x\n",
660 disr); 665 disr);
661 666
662 __raw_writel(disr, DMA_BASE + DMA_DISR); 667 imx_dmav1_writel(disr, DMA_DISR);
663 for (i = 0; i < IMX_DMA_CHANNELS; i++) { 668 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
664 if (disr & (1 << i)) 669 if (disr & (1 << i))
665 dma_irq_handle_channel(i); 670 dma_irq_handle_channel(i);
@@ -699,17 +704,19 @@ int imx_dma_request(int channel, const char *name)
699 local_irq_restore(flags); /* request_irq() can block */ 704 local_irq_restore(flags); /* request_irq() can block */
700 705
701#ifdef CONFIG_ARCH_MX2 706#ifdef CONFIG_ARCH_MX2
702 ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", 707 if (cpu_is_mx21() || cpu_is_mx27()) {
703 NULL); 708 ret = request_irq(MX2x_INT_DMACH0 + channel,
704 if (ret) { 709 dma_irq_handler, 0, "DMA", NULL);
705 imxdma->name = NULL; 710 if (ret) {
706 printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", 711 imxdma->name = NULL;
707 MXC_INT_DMACH0 + channel, channel); 712 pr_crit("Can't register IRQ %d for DMA channel %d\n",
708 return ret; 713 MX2x_INT_DMACH0 + channel, channel);
714 return ret;
715 }
716 init_timer(&imxdma->watchdog);
717 imxdma->watchdog.function = &imx_dma_watchdog;
718 imxdma->watchdog.data = channel;
709 } 719 }
710 init_timer(&imxdma->watchdog);
711 imxdma->watchdog.function = &imx_dma_watchdog;
712 imxdma->watchdog.data = channel;
713#endif 720#endif
714 721
715 return ret; 722 return ret;
@@ -738,7 +745,8 @@ void imx_dma_free(int channel)
738 imxdma->name = NULL; 745 imxdma->name = NULL;
739 746
740#ifdef CONFIG_ARCH_MX2 747#ifdef CONFIG_ARCH_MX2
741 free_irq(MXC_INT_DMACH0 + channel, NULL); 748 if (cpu_is_mx21() || cpu_is_mx27())
749 free_irq(MX2x_INT_DMACH0 + channel, NULL);
742#endif 750#endif
743 751
744 local_irq_restore(flags); 752 local_irq_restore(flags);
@@ -796,34 +804,53 @@ static int __init imx_dma_init(void)
796 int ret = 0; 804 int ret = 0;
797 int i; 805 int i;
798 806
807#ifdef CONFIG_ARCH_MX1
808 if (cpu_is_mx1())
809 imx_dmav1_baseaddr = MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR);
810 else
811#endif
812#ifdef CONFIG_MACH_MX21
813 if (cpu_is_mx21())
814 imx_dmav1_baseaddr = MX21_IO_ADDRESS(MX21_DMA_BASE_ADDR);
815 else
816#endif
817#ifdef CONFIG_MACH_MX27
818 if (cpu_is_mx27())
819 imx_dmav1_baseaddr = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR);
820 else
821#endif
822 BUG();
823
799 dma_clk = clk_get(NULL, "dma"); 824 dma_clk = clk_get(NULL, "dma");
800 clk_enable(dma_clk); 825 clk_enable(dma_clk);
801 826
802 /* reset DMA module */ 827 /* reset DMA module */
803 __raw_writel(DCR_DRST, DMA_BASE + DMA_DCR); 828 imx_dmav1_writel(DCR_DRST, DMA_DCR);
804 829
805#ifdef CONFIG_ARCH_MX1 830#ifdef CONFIG_ARCH_MX1
806 ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL); 831 if (cpu_is_mx1()) {
807 if (ret) { 832 ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", NULL);
808 printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n"); 833 if (ret) {
809 return ret; 834 pr_crit("Wow! Can't register IRQ for DMA\n");
810 } 835 return ret;
836 }
811 837
812 ret = request_irq(DMA_ERR, dma_err_handler, 0, "DMA", NULL); 838 ret = request_irq(MX1_DMA_ERR, dma_err_handler, 0, "DMA", NULL);
813 if (ret) { 839 if (ret) {
814 printk(KERN_CRIT "Wow! Can't register ERRIRQ for DMA\n"); 840 pr_crit("Wow! Can't register ERRIRQ for DMA\n");
815 free_irq(DMA_INT, NULL); 841 free_irq(MX1_DMA_INT, NULL);
816 return ret; 842 return ret;
843 }
817 } 844 }
818#endif 845#endif
819 /* enable DMA module */ 846 /* enable DMA module */
820 __raw_writel(DCR_DEN, DMA_BASE + DMA_DCR); 847 imx_dmav1_writel(DCR_DEN, DMA_DCR);
821 848
822 /* clear all interrupts */ 849 /* clear all interrupts */
823 __raw_writel((1 << IMX_DMA_CHANNELS) - 1, DMA_BASE + DMA_DISR); 850 imx_dmav1_writel((1 << IMX_DMA_CHANNELS) - 1, DMA_DISR);
824 851
825 /* disable interrupts */ 852 /* disable interrupts */
826 __raw_writel((1 << IMX_DMA_CHANNELS) - 1, DMA_BASE + DMA_DIMR); 853 imx_dmav1_writel((1 << IMX_DMA_CHANNELS) - 1, DMA_DIMR);
827 854
828 for (i = 0; i < IMX_DMA_CHANNELS; i++) { 855 for (i = 0; i < IMX_DMA_CHANNELS; i++) {
829 imx_dma_channels[i].sg = NULL; 856 imx_dma_channels[i].sg = NULL;
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c
index 41599be882e8..cb0b63874482 100644
--- a/arch/arm/plat-mxc/ehci.c
+++ b/arch/arm/plat-mxc/ehci.c
@@ -25,25 +25,37 @@
25#define USBCTRL_OTGBASE_OFFSET 0x600 25#define USBCTRL_OTGBASE_OFFSET 0x600
26 26
27#define MX31_OTG_SIC_SHIFT 29 27#define MX31_OTG_SIC_SHIFT 29
28#define MX31_OTG_SIC_MASK (0xf << MX31_OTG_SIC_SHIFT) 28#define MX31_OTG_SIC_MASK (0x3 << MX31_OTG_SIC_SHIFT)
29#define MX31_OTG_PM_BIT (1 << 24) 29#define MX31_OTG_PM_BIT (1 << 24)
30 30
31#define MX31_H2_SIC_SHIFT 21 31#define MX31_H2_SIC_SHIFT 21
32#define MX31_H2_SIC_MASK (0xf << MX31_H2_SIC_SHIFT) 32#define MX31_H2_SIC_MASK (0x3 << MX31_H2_SIC_SHIFT)
33#define MX31_H2_PM_BIT (1 << 16) 33#define MX31_H2_PM_BIT (1 << 16)
34#define MX31_H2_DT_BIT (1 << 5) 34#define MX31_H2_DT_BIT (1 << 5)
35 35
36#define MX31_H1_SIC_SHIFT 13 36#define MX31_H1_SIC_SHIFT 13
37#define MX31_H1_SIC_MASK (0xf << MX31_H1_SIC_SHIFT) 37#define MX31_H1_SIC_MASK (0x3 << MX31_H1_SIC_SHIFT)
38#define MX31_H1_PM_BIT (1 << 8) 38#define MX31_H1_PM_BIT (1 << 8)
39#define MX31_H1_DT_BIT (1 << 4) 39#define MX31_H1_DT_BIT (1 << 4)
40 40
41#define MX35_OTG_SIC_SHIFT 29
42#define MX35_OTG_SIC_MASK (0x3 << MX35_OTG_SIC_SHIFT)
43#define MX35_OTG_PM_BIT (1 << 24)
44
45#define MX35_H1_SIC_SHIFT 21
46#define MX35_H1_SIC_MASK (0x3 << MX35_H1_SIC_SHIFT)
47#define MX35_H1_PM_BIT (1 << 8)
48#define MX35_H1_IPPUE_UP_BIT (1 << 7)
49#define MX35_H1_IPPUE_DOWN_BIT (1 << 6)
50#define MX35_H1_TLL_BIT (1 << 5)
51#define MX35_H1_USBTE_BIT (1 << 4)
52
41int mxc_set_usbcontrol(int port, unsigned int flags) 53int mxc_set_usbcontrol(int port, unsigned int flags)
42{ 54{
43 unsigned int v; 55 unsigned int v;
44 56#ifdef CONFIG_ARCH_MX3
45 if (cpu_is_mx31()) { 57 if (cpu_is_mx31()) {
46 v = readl(IO_ADDRESS(MX31_OTG_BASE_ADDR + 58 v = readl(MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR +
47 USBCTRL_OTGBASE_OFFSET)); 59 USBCTRL_OTGBASE_OFFSET));
48 60
49 switch (port) { 61 switch (port) {
@@ -51,15 +63,15 @@ int mxc_set_usbcontrol(int port, unsigned int flags)
51 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT); 63 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
52 v |= (flags & MXC_EHCI_INTERFACE_MASK) 64 v |= (flags & MXC_EHCI_INTERFACE_MASK)
53 << MX31_OTG_SIC_SHIFT; 65 << MX31_OTG_SIC_SHIFT;
54 if (flags & MXC_EHCI_POWER_PINS_ENABLED) 66 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
55 v |= MX31_OTG_PM_BIT; 67 v |= MX31_OTG_PM_BIT;
56 68
57 break; 69 break;
58 case 1: /* H1 port */ 70 case 1: /* H1 port */
59 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT); 71 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT | MX31_H1_DT_BIT);
60 v |= (flags & MXC_EHCI_INTERFACE_MASK) 72 v |= (flags & MXC_EHCI_INTERFACE_MASK)
61 << MX31_H1_SIC_SHIFT; 73 << MX31_H1_SIC_SHIFT;
62 if (flags & MXC_EHCI_POWER_PINS_ENABLED) 74 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
63 v |= MX31_H1_PM_BIT; 75 v |= MX31_H1_PM_BIT;
64 76
65 if (!(flags & MXC_EHCI_TTL_ENABLED)) 77 if (!(flags & MXC_EHCI_TTL_ENABLED))
@@ -67,7 +79,7 @@ int mxc_set_usbcontrol(int port, unsigned int flags)
67 79
68 break; 80 break;
69 case 2: /* H2 port */ 81 case 2: /* H2 port */
70 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT); 82 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT | MX31_H2_DT_BIT);
71 v |= (flags & MXC_EHCI_INTERFACE_MASK) 83 v |= (flags & MXC_EHCI_INTERFACE_MASK)
72 << MX31_H2_SIC_SHIFT; 84 << MX31_H2_SIC_SHIFT;
73 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED)) 85 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
@@ -77,13 +89,103 @@ int mxc_set_usbcontrol(int port, unsigned int flags)
77 v |= MX31_H2_DT_BIT; 89 v |= MX31_H2_DT_BIT;
78 90
79 break; 91 break;
92 default:
93 return -EINVAL;
80 } 94 }
81 95
82 writel(v, IO_ADDRESS(MX31_OTG_BASE_ADDR + 96 writel(v, MX31_IO_ADDRESS(MX31_OTG_BASE_ADDR +
83 USBCTRL_OTGBASE_OFFSET)); 97 USBCTRL_OTGBASE_OFFSET));
84 return 0; 98 return 0;
85 } 99 }
86 100
101 if (cpu_is_mx35()) {
102 v = readl(MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR +
103 USBCTRL_OTGBASE_OFFSET));
104
105 switch (port) {
106 case 0: /* OTG port */
107 v &= ~(MX35_OTG_SIC_MASK | MX35_OTG_PM_BIT);
108 v |= (flags & MXC_EHCI_INTERFACE_MASK)
109 << MX35_OTG_SIC_SHIFT;
110 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
111 v |= MX35_OTG_PM_BIT;
112
113 break;
114 case 1: /* H1 port */
115 v &= ~(MX35_H1_SIC_MASK | MX35_H1_PM_BIT | MX35_H1_TLL_BIT |
116 MX35_H1_USBTE_BIT | MX35_H1_IPPUE_DOWN_BIT | MX35_H1_IPPUE_UP_BIT);
117 v |= (flags & MXC_EHCI_INTERFACE_MASK)
118 << MX35_H1_SIC_SHIFT;
119 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
120 v |= MX35_H1_PM_BIT;
121
122 if (!(flags & MXC_EHCI_TTL_ENABLED))
123 v |= MX35_H1_TLL_BIT;
124
125 if (flags & MXC_EHCI_INTERNAL_PHY)
126 v |= MX35_H1_USBTE_BIT;
127
128 if (flags & MXC_EHCI_IPPUE_DOWN)
129 v |= MX35_H1_IPPUE_DOWN_BIT;
130
131 if (flags & MXC_EHCI_IPPUE_UP)
132 v |= MX35_H1_IPPUE_UP_BIT;
133
134 break;
135 default:
136 return -EINVAL;
137 }
138
139 writel(v, MX35_IO_ADDRESS(MX35_OTG_BASE_ADDR +
140 USBCTRL_OTGBASE_OFFSET));
141 return 0;
142 }
143#endif /* CONFIG_ARCH_MX3 */
144#ifdef CONFIG_MACH_MX27
145 if (cpu_is_mx27()) {
146 /* On i.MX27 we can use the i.MX31 USBCTRL bits, they
147 * are identical
148 */
149 v = readl(MX27_IO_ADDRESS(MX27_OTG_BASE_ADDR +
150 USBCTRL_OTGBASE_OFFSET));
151 switch (port) {
152 case 0: /* OTG port */
153 v &= ~(MX31_OTG_SIC_MASK | MX31_OTG_PM_BIT);
154 v |= (flags & MXC_EHCI_INTERFACE_MASK)
155 << MX31_OTG_SIC_SHIFT;
156 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
157 v |= MX31_OTG_PM_BIT;
158 break;
159 case 1: /* H1 port */
160 v &= ~(MX31_H1_SIC_MASK | MX31_H1_PM_BIT | MX31_H1_DT_BIT);
161 v |= (flags & MXC_EHCI_INTERFACE_MASK)
162 << MX31_H1_SIC_SHIFT;
163 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
164 v |= MX31_H1_PM_BIT;
165
166 if (!(flags & MXC_EHCI_TTL_ENABLED))
167 v |= MX31_H1_DT_BIT;
168
169 break;
170 case 2: /* H2 port */
171 v &= ~(MX31_H2_SIC_MASK | MX31_H2_PM_BIT | MX31_H2_DT_BIT);
172 v |= (flags & MXC_EHCI_INTERFACE_MASK)
173 << MX31_H2_SIC_SHIFT;
174 if (!(flags & MXC_EHCI_POWER_PINS_ENABLED))
175 v |= MX31_H2_PM_BIT;
176
177 if (!(flags & MXC_EHCI_TTL_ENABLED))
178 v |= MX31_H2_DT_BIT;
179
180 break;
181 default:
182 return -EINVAL;
183 }
184 writel(v, MX27_IO_ADDRESS(MX27_OTG_BASE_ADDR +
185 USBCTRL_OTGBASE_OFFSET));
186 return 0;
187 }
188#endif /* CONFIG_MACH_MX27 */
87 printk(KERN_WARNING 189 printk(KERN_WARNING
88 "%s() unable to setup USBCONTROL for this CPU\n", __func__); 190 "%s() unable to setup USBCONTROL for this CPU\n", __func__);
89 return -EINVAL; 191 return -EINVAL;
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
index d65ebe303b9f..70b23893f094 100644
--- a/arch/arm/plat-mxc/gpio.c
+++ b/arch/arm/plat-mxc/gpio.c
@@ -140,16 +140,13 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
140 val = __raw_readl(reg); 140 val = __raw_readl(reg);
141 edge = (val >> (bit << 1)) & 3; 141 edge = (val >> (bit << 1)) & 3;
142 val &= ~(0x3 << (bit << 1)); 142 val &= ~(0x3 << (bit << 1));
143 switch (edge) { 143 if (edge == GPIO_INT_HIGH_LEV) {
144 case GPIO_INT_HIGH_LEV:
145 edge = GPIO_INT_LOW_LEV; 144 edge = GPIO_INT_LOW_LEV;
146 pr_debug("mxc: switch GPIO %d to low trigger\n", gpio); 145 pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
147 break; 146 } else if (edge == GPIO_INT_LOW_LEV) {
148 case GPIO_INT_LOW_LEV:
149 edge = GPIO_INT_HIGH_LEV; 147 edge = GPIO_INT_HIGH_LEV;
150 pr_debug("mxc: switch GPIO %d to high trigger\n", gpio); 148 pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
151 break; 149 } else {
152 default:
153 pr_err("mxc: invalid configuration for GPIO %d: %x\n", 150 pr_err("mxc: invalid configuration for GPIO %d: %x\n",
154 gpio, edge); 151 gpio, edge);
155 return; 152 return;
@@ -157,25 +154,20 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
157 __raw_writel(val | (edge << (bit << 1)), reg); 154 __raw_writel(val | (edge << (bit << 1)), reg);
158} 155}
159 156
160/* handle n interrupts in one status register */ 157/* handle 32 interrupts in one status register */
161static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat) 158static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
162{ 159{
163 u32 gpio_irq_no; 160 u32 gpio_irq_no_base = port->virtual_irq_start;
164 161
165 gpio_irq_no = port->virtual_irq_start; 162 while (irq_stat != 0) {
166 for (; irq_stat != 0; irq_stat >>= 1, gpio_irq_no++) { 163 int irqoffset = fls(irq_stat) - 1;
167 u32 gpio = irq_to_gpio(gpio_irq_no);
168
169 if ((irq_stat & 1) == 0)
170 continue;
171 164
172 BUG_ON(!(irq_desc[gpio_irq_no].handle_irq)); 165 if (port->both_edges & (1 << irqoffset))
166 mxc_flip_edge(port, irqoffset);
173 167
174 if (port->both_edges & (1 << (gpio & 31))) 168 generic_handle_irq(gpio_irq_no_base + irqoffset);
175 mxc_flip_edge(port, gpio);
176 169
177 irq_desc[gpio_irq_no].handle_irq(gpio_irq_no, 170 irq_stat &= ~(1 << irqoffset);
178 &irq_desc[gpio_irq_no]);
179 } 171 }
180} 172}
181 173
diff --git a/arch/arm/plat-mxc/include/mach/board-kzmarm11.h b/arch/arm/plat-mxc/include/mach/board-kzmarm11.h
index 05ff2f31ef1f..93cc66f104c7 100644
--- a/arch/arm/plat-mxc/include/mach/board-kzmarm11.h
+++ b/arch/arm/plat-mxc/include/mach/board-kzmarm11.h
@@ -21,19 +21,19 @@
21/* 21/*
22 * KZM-ARM11-01 Board Control Registers on FPGA 22 * KZM-ARM11-01 Board Control Registers on FPGA
23 */ 23 */
24#define KZM_ARM11_CTL1 (CS4_BASE_ADDR + 0x1000) 24#define KZM_ARM11_CTL1 (MX31_CS4_BASE_ADDR + 0x1000)
25#define KZM_ARM11_CTL2 (CS4_BASE_ADDR + 0x1001) 25#define KZM_ARM11_CTL2 (MX31_CS4_BASE_ADDR + 0x1001)
26#define KZM_ARM11_RSW1 (CS4_BASE_ADDR + 0x1002) 26#define KZM_ARM11_RSW1 (MX31_CS4_BASE_ADDR + 0x1002)
27#define KZM_ARM11_BACK_LIGHT (CS4_BASE_ADDR + 0x1004) 27#define KZM_ARM11_BACK_LIGHT (MX31_CS4_BASE_ADDR + 0x1004)
28#define KZM_ARM11_FPGA_REV (CS4_BASE_ADDR + 0x1008) 28#define KZM_ARM11_FPGA_REV (MX31_CS4_BASE_ADDR + 0x1008)
29#define KZM_ARM11_7SEG_LED (CS4_BASE_ADDR + 0x1010) 29#define KZM_ARM11_7SEG_LED (MX31_CS4_BASE_ADDR + 0x1010)
30#define KZM_ARM11_LEDS (CS4_BASE_ADDR + 0x1020) 30#define KZM_ARM11_LEDS (MX31_CS4_BASE_ADDR + 0x1020)
31#define KZM_ARM11_DIPSW2 (CS4_BASE_ADDR + 0x1003) 31#define KZM_ARM11_DIPSW2 (MX31_CS4_BASE_ADDR + 0x1003)
32 32
33/* 33/*
34 * External UART for touch panel on FPGA 34 * External UART for touch panel on FPGA
35 */ 35 */
36#define KZM_ARM11_16550 (CS4_BASE_ADDR + 0x1050) 36#define KZM_ARM11_16550 (MX31_CS4_BASE_ADDR + 0x1050)
37 37
38#endif /* __ARM_ARCH_BOARD_KZM_ARM11_H */ 38#endif /* __ARM_ARCH_BOARD_KZM_ARM11_H */
39 39
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31ads.h b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
index 2cbfa35e82ff..095a199591c6 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31ads.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31ads.h
@@ -14,7 +14,7 @@
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15 15
16/* Base address of PBC controller */ 16/* Base address of PBC controller */
17#define PBC_BASE_ADDRESS IO_ADDRESS(CS4_BASE_ADDR) 17#define PBC_BASE_ADDRESS MX31_CS4_BASE_ADDR_VIRT
18/* Offsets for the PBC Controller register */ 18/* Offsets for the PBC Controller register */
19 19
20/* PBC Board status register offset */ 20/* PBC Board status register offset */
diff --git a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
index d5be6b5a6acf..fc5fec9b55f0 100644
--- a/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
+++ b/arch/arm/plat-mxc/include/mach/board-mx31moboard.h
@@ -25,6 +25,7 @@ enum mx31moboard_boards {
25 MX31NOBOARD = 0, 25 MX31NOBOARD = 0,
26 MX31DEVBOARD = 1, 26 MX31DEVBOARD = 1,
27 MX31MARXBOT = 2, 27 MX31MARXBOT = 2,
28 MX31SMARTBOT = 3,
28}; 29};
29 30
30/* 31/*
@@ -34,6 +35,7 @@ enum mx31moboard_boards {
34 35
35extern void mx31moboard_devboard_init(void); 36extern void mx31moboard_devboard_init(void);
36extern void mx31moboard_marxbot_init(void); 37extern void mx31moboard_marxbot_init(void);
38extern void mx31moboard_smartbot_init(void);
37 39
38#endif 40#endif
39 41
diff --git a/arch/arm/plat-mxc/include/mach/clock.h b/arch/arm/plat-mxc/include/mach/clock.h
index 43a82d0c534d..753a5988d85c 100644
--- a/arch/arm/plat-mxc/include/mach/clock.h
+++ b/arch/arm/plat-mxc/include/mach/clock.h
@@ -26,13 +26,6 @@
26struct module; 26struct module;
27 27
28struct clk { 28struct clk {
29#ifndef CONFIG_COMMON_CLKDEV
30 /* As soon as i.MX1 and i.MX31 switched to clkdev, this
31 * block can go away */
32 struct list_head node;
33 struct module *owner;
34 const char *name;
35#endif
36 int id; 29 int id;
37 /* Source clock this clk depends on */ 30 /* Source clock this clk depends on */
38 struct clk *parent; 31 struct clk *parent;
diff --git a/arch/arm/plat-mxc/include/mach/common.h b/arch/arm/plat-mxc/include/mach/common.h
index 4bf1068ffad9..2941472582d2 100644
--- a/arch/arm/plat-mxc/include/mach/common.h
+++ b/arch/arm/plat-mxc/include/mach/common.h
@@ -20,14 +20,17 @@ extern void mx25_map_io(void);
20extern void mx27_map_io(void); 20extern void mx27_map_io(void);
21extern void mx31_map_io(void); 21extern void mx31_map_io(void);
22extern void mx35_map_io(void); 22extern void mx35_map_io(void);
23extern void mx51_map_io(void);
23extern void mxc91231_map_io(void); 24extern void mxc91231_map_io(void);
24extern void mxc_init_irq(void __iomem *); 25extern void mxc_init_irq(void __iomem *);
26extern void tzic_init_irq(void __iomem *);
25extern void mx1_init_irq(void); 27extern void mx1_init_irq(void);
26extern void mx21_init_irq(void); 28extern void mx21_init_irq(void);
27extern void mx25_init_irq(void); 29extern void mx25_init_irq(void);
28extern void mx27_init_irq(void); 30extern void mx27_init_irq(void);
29extern void mx31_init_irq(void); 31extern void mx31_init_irq(void);
30extern void mx35_init_irq(void); 32extern void mx35_init_irq(void);
33extern void mx51_init_irq(void);
31extern void mxc91231_init_irq(void); 34extern void mxc91231_init_irq(void);
32extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int); 35extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
33extern int mx1_clocks_init(unsigned long fref); 36extern int mx1_clocks_init(unsigned long fref);
@@ -36,6 +39,8 @@ extern int mx25_clocks_init(void);
36extern int mx27_clocks_init(unsigned long fref); 39extern int mx27_clocks_init(unsigned long fref);
37extern int mx31_clocks_init(unsigned long fref); 40extern int mx31_clocks_init(unsigned long fref);
38extern int mx35_clocks_init(void); 41extern int mx35_clocks_init(void);
42extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
43 unsigned long ckih1, unsigned long ckih2);
39extern int mxc91231_clocks_init(unsigned long fref); 44extern int mxc91231_clocks_init(unsigned long fref);
40extern int mxc_register_gpios(void); 45extern int mxc_register_gpios(void);
41extern int mxc_register_device(struct platform_device *pdev, void *data); 46extern int mxc_register_device(struct platform_device *pdev, void *data);
diff --git a/arch/arm/plat-mxc/include/mach/debug-macro.S b/arch/arm/plat-mxc/include/mach/debug-macro.S
index 5a6ae1b9e1e8..0b6e11eaeb8c 100644
--- a/arch/arm/plat-mxc/include/mach/debug-macro.S
+++ b/arch/arm/plat-mxc/include/mach/debug-macro.S
@@ -10,6 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 * 11 *
12 */ 12 */
13#define IMX_NEEDS_DEPRECATED_SYMBOLS
13 14
14#ifdef CONFIG_ARCH_MX1 15#ifdef CONFIG_ARCH_MX1
15#include <mach/mx1.h> 16#include <mach/mx1.h>
@@ -44,13 +45,22 @@
44#define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR) 45#define UART_VADDR AIPS1_IO_ADDRESS(UART1_BASE_ADDR)
45#endif 46#endif
46 47
48#ifdef CONFIG_ARCH_MX5
49#ifdef UART_PADDR
50#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
51#endif
52#include <mach/mx51.h>
53#define UART_PADDR MX51_UART1_BASE_ADDR
54#define UART_VADDR MX51_AIPS1_IO_ADDRESS(MX51_UART1_BASE_ADDR)
55#endif
56
47#ifdef CONFIG_ARCH_MXC91231 57#ifdef CONFIG_ARCH_MXC91231
48#ifdef UART_PADDR 58#ifdef UART_PADDR
49#error "CONFIG_DEBUG_LL is incompatible with multiple archs" 59#error "CONFIG_DEBUG_LL is incompatible with multiple archs"
50#endif 60#endif
51#include <mach/mxc91231.h> 61#include <mach/mxc91231.h>
52#define UART_PADDR MXC91231_UART2_BASE_ADDR 62#define UART_PADDR MXC91231_UART2_BASE_ADDR
53#define UART_VADDR MXC91231_AIPS1_IO_ADDRESS(MXC91231_UART2_BASE_ADDR) 63#define UART_VADDR MXC91231_IO_ADDRESS(MXC91231_UART2_BASE_ADDR)
54#endif 64#endif
55 .macro addruart, rx, tmp 65 .macro addruart, rx, tmp
56 mrc p15, 0, \rx, c1, c0 66 mrc p15, 0, \rx, c1, c0
diff --git a/arch/arm/plat-mxc/include/mach/entry-macro.S b/arch/arm/plat-mxc/include/mach/entry-macro.S
index 7cf290efe768..aeb08697726b 100644
--- a/arch/arm/plat-mxc/include/mach/entry-macro.S
+++ b/arch/arm/plat-mxc/include/mach/entry-macro.S
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org> 2 * Copyright (C) 2007 Lennert Buytenhek <buytenh@wantstofly.org>
3 * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved. 3 * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
4 */ 4 */
5 5
6/* 6/*
@@ -18,11 +18,16 @@
18 .endm 18 .endm
19 19
20 .macro get_irqnr_preamble, base, tmp 20 .macro get_irqnr_preamble, base, tmp
21#ifndef CONFIG_MXC_TZIC
21 ldr \base, =avic_base 22 ldr \base, =avic_base
22 ldr \base, [\base] 23 ldr \base, [\base]
23#ifdef CONFIG_MXC_IRQ_PRIOR 24#ifdef CONFIG_MXC_IRQ_PRIOR
24 ldr r4, [\base, #AVIC_NIMASK] 25 ldr r4, [\base, #AVIC_NIMASK]
25#endif 26#endif
27#elif defined CONFIG_MXC_TZIC
28 ldr \base, =tzic_base
29 ldr \base, [\base]
30#endif /* CONFIG_MXC_TZIC */
26 .endm 31 .endm
27 32
28 .macro arch_ret_to_user, tmp1, tmp2 33 .macro arch_ret_to_user, tmp1, tmp2
@@ -32,6 +37,7 @@
32 @ and returns its number in irqnr 37 @ and returns its number in irqnr
33 @ and returns if an interrupt occured in irqstat 38 @ and returns if an interrupt occured in irqstat
34 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp 39 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
40#ifndef CONFIG_MXC_TZIC
35 @ Load offset & priority of the highest priority 41 @ Load offset & priority of the highest priority
36 @ interrupt pending from AVIC_NIVECSR 42 @ interrupt pending from AVIC_NIVECSR
37 ldr \irqstat, [\base, #0x40] 43 ldr \irqstat, [\base, #0x40]
@@ -45,6 +51,32 @@
45 strne \tmp, [\base, #AVIC_NIMASK] 51 strne \tmp, [\base, #AVIC_NIMASK]
46 streq r4, [\base, #AVIC_NIMASK] 52 streq r4, [\base, #AVIC_NIMASK]
47#endif 53#endif
54#elif defined CONFIG_MXC_TZIC
55 @ Load offset & priority of the highest priority
56 @ interrupt pending.
57 @ 0xD80 is HIPND0 register
58 mov \irqnr, #0
59 mov \irqstat, #0x0D80
601000:
61 ldr \tmp, [\irqstat, \base]
62 cmp \tmp, #0
63 bne 1001f
64 addeq \irqnr, \irqnr, #32
65 addeq \irqstat, \irqstat, #4
66 cmp \irqnr, #128
67 blo 1000b
68 b 2001f
691001: mov \irqstat, #1
701002: tst \tmp, \irqstat
71 bne 2002f
72 movs \tmp, \tmp, lsr #1
73 addne \irqnr, \irqnr, #1
74 bne 1002b
752001:
76 mov \irqnr, #0
772002:
78 movs \irqnr, \irqnr
79#endif
48 .endm 80 .endm
49 81
50 @ irq priority table (not used) 82 @ irq priority table (not used)
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index 78db75475f69..ebadf4ac43fc 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -22,6 +22,15 @@
22 22
23#include <asm/sizes.h> 23#include <asm/sizes.h>
24 24
25#define IMX_IO_ADDRESS(addr, module) \
26 ((void __force __iomem *) \
27 (((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\
28 (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0))
29
30#ifdef CONFIG_ARCH_MX5
31#include <mach/mx51.h>
32#endif
33
25#ifdef CONFIG_ARCH_MX3 34#ifdef CONFIG_ARCH_MX3
26#include <mach/mx3x.h> 35#include <mach/mx3x.h>
27#include <mach/mx31.h> 36#include <mach/mx31.h>
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx1.h b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
index bf23305c19cc..6b1507cf378e 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx1.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx1.h
@@ -1,166 +1,155 @@
1/* 1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* 3 *
4* This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5* modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
6* as published by the Free Software Foundation; either version 2 6 * as published by the Free Software Foundation; either version 2
7* of the License, or (at your option) any later version. 7 * of the License, or (at your option) any later version.
8* This program is distributed in the hope that it will be useful, 8 * This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11 * GNU General Public License for more details.
12* 12 *
13* You should have received a copy of the GNU General Public License 13 * You should have received a copy of the GNU General Public License
14* along with this program; if not, write to the Free Software 14 * along with this program; if not, write to the Free Software
15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16* MA 02110-1301, USA. 16 * MA 02110-1301, USA.
17*/ 17 */
18#ifndef __MACH_IOMUX_MX1_H__
19#define __MACH_IOMUX_MX1_H__
18 20
19#ifndef _MXC_IOMUX_MX1_H 21#include <mach/iomux-v1.h>
20#define _MXC_IOMUX_MX1_H
21 22
22#ifndef GPIO_PORTA 23#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
23#error Please include mach/iomux.h 24#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
24#endif 25#define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 1)
26#define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1)
27#define PA2_PF_PWM0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 2)
28#define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3)
29#define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4)
30#define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5)
31#define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6)
32#define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7)
33#define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8)
34#define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9)
35#define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10)
36#define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11)
37#define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12)
38#define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13)
39#define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14)
40#define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15)
41#define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16)
42#define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17)
43#define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17)
44#define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18)
45#define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19)
46#define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20)
47#define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21)
48#define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22)
49#define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23)
50#define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24)
51#define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24)
52#define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25)
53#define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25)
54#define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26)
55#define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26)
56#define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27)
57#define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27)
58#define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28)
59#define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28)
60#define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29)
61#define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29)
62#define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30)
63#define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30)
64#define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31)
65#define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31)
66#define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8)
67#define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8)
68#define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9)
69#define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9)
70#define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10)
71#define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10)
72#define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11)
73#define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11)
74#define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12)
75#define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12)
76#define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13)
77#define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13)
78#define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14)
79#define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15)
80#define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_AF | GPIO_IN | 16)
81#define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_AF | GPIO_OUT | 17)
82#define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18)
83#define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19)
84#define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20)
85#define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21)
86#define PB22_PF_USBD_RCV (GPIO_PORTB | GPIO_PF | 22)
87#define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23)
88#define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24)
89#define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25)
90#define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26)
91#define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27)
92#define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_PF | GPIO_OUT | 28)
93#define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_PF | GPIO_IN | 29)
94#define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_PF | GPIO_OUT | 30)
95#define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_PF | GPIO_IN | 31)
96#define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3)
97#define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4)
98#define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_PF | GPIO_IN | 5)
99#define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_PF | GPIO_OUT | 6)
100#define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7)
101#define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8)
102#define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9)
103#define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_PF | GPIO_IN | 10)
104#define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11)
105#define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 12)
106#define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13)
107#define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14)
108#define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15)
109#define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16)
110#define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17)
111#define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 24)
112#define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 25)
113#define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 26)
114#define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 27)
115#define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 28)
116#define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 29)
117#define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30)
118#define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 31)
119#define PD6_PF_LSCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 6)
120#define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7)
121#define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_AF | GPIO_IN | 7)
122#define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7)
123#define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8)
124#define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_AF | GPIO_OUT | 8)
125#define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8)
126#define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9)
127#define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_AF | GPIO_OUT | 9)
128#define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 9)
129#define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_PF | GPIO_OUT | 10)
130#define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_AF | GPIO_OUT | 10)
131#define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 10)
132#define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_PF | GPIO_OUT | 11)
133#define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_PF | GPIO_OUT | 12)
134#define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 13)
135#define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 14)
136#define PD15_PF_LD0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 15)
137#define PD16_PF_LD1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 16)
138#define PD17_PF_LD2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17)
139#define PD18_PF_LD3 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18)
140#define PD19_PF_LD4 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 19)
141#define PD20_PF_LD5 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 20)
142#define PD21_PF_LD6 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 21)
143#define PD22_PF_LD7 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 22)
144#define PD23_PF_LD8 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 23)
145#define PD24_PF_LD9 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 24)
146#define PD25_PF_LD10 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25)
147#define PD26_PF_LD11 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26)
148#define PD27_PF_LD12 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27)
149#define PD28_PF_LD13 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28)
150#define PD29_PF_LD14 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29)
151#define PD30_PF_LD15 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 30)
152#define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31)
153#define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31)
25 154
26/* FIXME: This list is not completed. The correct directions are 155#endif /* ifndef __MACH_IOMUX_MX1_H__ */
27* missing on some (many) pins
28*/
29
30
31/* Primary GPIO pin functions */
32
33#define PA0_AIN_SPI2_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
34#define PA0_AF_ETMTRACESYNC (GPIO_PORTA | GPIO_AF | 0)
35#define PA1_AOUT_SPI2_RXD (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 1)
36#define PA1_PF_TIN (GPIO_PORTA | GPIO_PF | 1)
37#define PA2_PF_PWM0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 2)
38#define PA3_PF_CSI_MCLK (GPIO_PORTA | GPIO_PF | 3)
39#define PA4_PF_CSI_D0 (GPIO_PORTA | GPIO_PF | 4)
40#define PA5_PF_CSI_D1 (GPIO_PORTA | GPIO_PF | 5)
41#define PA6_PF_CSI_D2 (GPIO_PORTA | GPIO_PF | 6)
42#define PA7_PF_CSI_D3 (GPIO_PORTA | GPIO_PF | 7)
43#define PA8_PF_CSI_D4 (GPIO_PORTA | GPIO_PF | 8)
44#define PA9_PF_CSI_D5 (GPIO_PORTA | GPIO_PF | 9)
45#define PA10_PF_CSI_D6 (GPIO_PORTA | GPIO_PF | 10)
46#define PA11_PF_CSI_D7 (GPIO_PORTA | GPIO_PF | 11)
47#define PA12_PF_CSI_VSYNC (GPIO_PORTA | GPIO_PF | 12)
48#define PA13_PF_CSI_HSYNC (GPIO_PORTA | GPIO_PF | 13)
49#define PA14_PF_CSI_PIXCLK (GPIO_PORTA | GPIO_PF | 14)
50#define PA15_PF_I2C_SDA (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15)
51#define PA16_PF_I2C_SCL (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16)
52#define PA17_AF_ETMTRACEPKT4 (GPIO_PORTA | GPIO_AF | 17)
53#define PA17_AIN_SPI2_SS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17)
54#define PA18_AF_ETMTRACEPKT5 (GPIO_PORTA | GPIO_AF | 18)
55#define PA19_AF_ETMTRACEPKT6 (GPIO_PORTA | GPIO_AF | 19)
56#define PA20_AF_ETMTRACEPKT7 (GPIO_PORTA | GPIO_AF | 20)
57#define PA21_PF_A0 (GPIO_PORTA | GPIO_PF | 21)
58#define PA22_PF_CS4 (GPIO_PORTA | GPIO_PF | 22)
59#define PA23_PF_CS5 (GPIO_PORTA | GPIO_PF | 23)
60#define PA24_PF_A16 (GPIO_PORTA | GPIO_PF | 24)
61#define PA24_AF_ETMTRACEPKT0 (GPIO_PORTA | GPIO_AF | 24)
62#define PA25_PF_A17 (GPIO_PORTA | GPIO_PF | 25)
63#define PA25_AF_ETMTRACEPKT1 (GPIO_PORTA | GPIO_AF | 25)
64#define PA26_PF_A18 (GPIO_PORTA | GPIO_PF | 26)
65#define PA26_AF_ETMTRACEPKT2 (GPIO_PORTA | GPIO_AF | 26)
66#define PA27_PF_A19 (GPIO_PORTA | GPIO_PF | 27)
67#define PA27_AF_ETMTRACEPKT3 (GPIO_PORTA | GPIO_AF | 27)
68#define PA28_PF_A20 (GPIO_PORTA | GPIO_PF | 28)
69#define PA28_AF_ETMPIPESTAT0 (GPIO_PORTA | GPIO_AF | 28)
70#define PA29_PF_A21 (GPIO_PORTA | GPIO_PF | 29)
71#define PA29_AF_ETMPIPESTAT1 (GPIO_PORTA | GPIO_AF | 29)
72#define PA30_PF_A22 (GPIO_PORTA | GPIO_PF | 30)
73#define PA30_AF_ETMPIPESTAT2 (GPIO_PORTA | GPIO_AF | 30)
74#define PA31_PF_A23 (GPIO_PORTA | GPIO_PF | 31)
75#define PA31_AF_ETMTRACECLK (GPIO_PORTA | GPIO_AF | 31)
76#define PB8_PF_SD_DAT0 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 8)
77#define PB8_AF_MS_PIO (GPIO_PORTB | GPIO_AF | 8)
78#define PB9_PF_SD_DAT1 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 9)
79#define PB9_AF_MS_PI1 (GPIO_PORTB | GPIO_AF | 9)
80#define PB10_PF_SD_DAT2 (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10)
81#define PB10_AF_MS_SCLKI (GPIO_PORTB | GPIO_AF | 10)
82#define PB11_PF_SD_DAT3 (GPIO_PORTB | GPIO_PF | 11)
83#define PB11_AF_MS_SDIO (GPIO_PORTB | GPIO_AF | 11)
84#define PB12_PF_SD_CLK (GPIO_PORTB | GPIO_PF | 12)
85#define PB12_AF_MS_SCLK0 (GPIO_PORTB | GPIO_AF | 12)
86#define PB13_PF_SD_CMD (GPIO_PORTB | GPIO_PF | GPIO_PUEN | 13)
87#define PB13_AF_MS_BS (GPIO_PORTB | GPIO_AF | 13)
88#define PB14_AF_SSI_RXFS (GPIO_PORTB | GPIO_AF | 14)
89#define PB15_AF_SSI_RXCLK (GPIO_PORTB | GPIO_AF | 15)
90#define PB16_AF_SSI_RXDAT (GPIO_PORTB | GPIO_AF | GPIO_IN | 16)
91#define PB17_AF_SSI_TXDAT (GPIO_PORTB | GPIO_AF | GPIO_OUT | 17)
92#define PB18_AF_SSI_TXFS (GPIO_PORTB | GPIO_AF | 18)
93#define PB19_AF_SSI_TXCLK (GPIO_PORTB | GPIO_AF | 19)
94#define PB20_PF_USBD_AFE (GPIO_PORTB | GPIO_PF | 20)
95#define PB21_PF_USBD_OE (GPIO_PORTB | GPIO_PF | 21)
96#define PB22_PF_USBD_RCV (GPIO_PORTB | GPIO_PF | 22)
97#define PB23_PF_USBD_SUSPND (GPIO_PORTB | GPIO_PF | 23)
98#define PB24_PF_USBD_VP (GPIO_PORTB | GPIO_PF | 24)
99#define PB25_PF_USBD_VM (GPIO_PORTB | GPIO_PF | 25)
100#define PB26_PF_USBD_VPO (GPIO_PORTB | GPIO_PF | 26)
101#define PB27_PF_USBD_VMO (GPIO_PORTB | GPIO_PF | 27)
102#define PB28_PF_UART2_CTS (GPIO_PORTB | GPIO_PF | GPIO_OUT | 28)
103#define PB29_PF_UART2_RTS (GPIO_PORTB | GPIO_PF | GPIO_IN | 29)
104#define PB30_PF_UART2_TXD (GPIO_PORTB | GPIO_PF | GPIO_OUT | 30)
105#define PB31_PF_UART2_RXD (GPIO_PORTB | GPIO_PF | GPIO_IN | 31)
106#define PC3_PF_SSI_RXFS (GPIO_PORTC | GPIO_PF | 3)
107#define PC4_PF_SSI_RXCLK (GPIO_PORTC | GPIO_PF | 4)
108#define PC5_PF_SSI_RXDAT (GPIO_PORTC | GPIO_PF | GPIO_IN | 5)
109#define PC6_PF_SSI_TXDAT (GPIO_PORTC | GPIO_PF | GPIO_OUT | 6)
110#define PC7_PF_SSI_TXFS (GPIO_PORTC | GPIO_PF | 7)
111#define PC8_PF_SSI_TXCLK (GPIO_PORTC | GPIO_PF | 8)
112#define PC9_PF_UART1_CTS (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9)
113#define PC10_PF_UART1_RTS (GPIO_PORTC | GPIO_PF | GPIO_IN | 10)
114#define PC11_PF_UART1_TXD (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11)
115#define PC12_PF_UART1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 12)
116#define PC13_PF_SPI1_SPI_RDY (GPIO_PORTC | GPIO_PF | 13)
117#define PC14_PF_SPI1_SCLK (GPIO_PORTC | GPIO_PF | 14)
118#define PC15_PF_SPI1_SS (GPIO_PORTC | GPIO_PF | 15)
119#define PC16_PF_SPI1_MISO (GPIO_PORTC | GPIO_PF | 16)
120#define PC17_PF_SPI1_MOSI (GPIO_PORTC | GPIO_PF | 17)
121#define PC24_BIN_UART3_RI (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 24)
122#define PC25_BIN_UART3_DSR (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 25)
123#define PC26_AOUT_UART3_DTR (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 26)
124#define PC27_BIN_UART3_DCD (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 27)
125#define PC28_BIN_UART3_CTS (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 28)
126#define PC29_AOUT_UART3_RTS (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 29)
127#define PC30_BIN_UART3_TX (GPIO_PORTC | GPIO_BIN | 30)
128#define PC31_AOUT_UART3_RX (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 31)
129#define PD6_PF_LSCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 6)
130#define PD7_PF_REV (GPIO_PORTD | GPIO_PF | 7)
131#define PD7_AF_UART2_DTR (GPIO_PORTD | GPIO_AF | GPIO_IN | 7)
132#define PD7_AIN_SPI2_SCLK (GPIO_PORTD | GPIO_AIN | 7)
133#define PD8_PF_CLS (GPIO_PORTD | GPIO_PF | 8)
134#define PD8_AF_UART2_DCD (GPIO_PORTD | GPIO_AF | GPIO_OUT | 8)
135#define PD8_AIN_SPI2_SS (GPIO_PORTD | GPIO_AIN | 8)
136#define PD9_PF_PS (GPIO_PORTD | GPIO_PF | 9)
137#define PD9_AF_UART2_RI (GPIO_PORTD | GPIO_AF | GPIO_OUT | 9)
138#define PD9_AOUT_SPI2_RXD (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 9)
139#define PD10_PF_SPL_SPR (GPIO_PORTD | GPIO_PF | GPIO_OUT | 10)
140#define PD10_AF_UART2_DSR (GPIO_PORTD | GPIO_AF | GPIO_OUT | 10)
141#define PD10_AIN_SPI2_TXD (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 10)
142#define PD11_PF_CONTRAST (GPIO_PORTD | GPIO_PF | GPIO_OUT | 11)
143#define PD12_PF_ACD_OE (GPIO_PORTD | GPIO_PF | GPIO_OUT | 12)
144#define PD13_PF_LP_HSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 13)
145#define PD14_PF_FLM_VSYNC (GPIO_PORTD | GPIO_PF | GPIO_OUT | 14)
146#define PD15_PF_LD0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 15)
147#define PD16_PF_LD1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 16)
148#define PD17_PF_LD2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17)
149#define PD18_PF_LD3 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18)
150#define PD19_PF_LD4 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 19)
151#define PD20_PF_LD5 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 20)
152#define PD21_PF_LD6 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 21)
153#define PD22_PF_LD7 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 22)
154#define PD23_PF_LD8 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 23)
155#define PD24_PF_LD9 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 24)
156#define PD25_PF_LD10 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25)
157#define PD26_PF_LD11 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26)
158#define PD27_PF_LD12 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27)
159#define PD28_PF_LD13 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28)
160#define PD29_PF_LD14 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29)
161#define PD30_PF_LD15 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 30)
162#define PD31_PF_TMR2OUT (GPIO_PORTD | GPIO_PF | 31)
163#define PD31_BIN_SPI2_TXD (GPIO_PORTD | GPIO_BIN | 31)
164
165
166#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx21.h b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
index 63aaa972e275..1495dfda7834 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx21.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx21.h
@@ -1,126 +1,122 @@
1/* 1/*
2* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> 2 * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
3* 3 *
4* This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5* modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
6* as published by the Free Software Foundation; either version 2 6 * as published by the Free Software Foundation; either version 2
7* of the License, or (at your option) any later version. 7 * of the License, or (at your option) any later version.
8* This program is distributed in the hope that it will be useful, 8 * This program is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details. 11 * GNU General Public License for more details.
12* 12 *
13* You should have received a copy of the GNU General Public License 13 * You should have received a copy of the GNU General Public License
14* along with this program; if not, write to the Free Software 14 * along with this program; if not, write to the Free Software
15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16* MA 02110-1301, USA. 16 * MA 02110-1301, USA.
17*/ 17 */
18 18#ifndef __MACH_IOMUX_MX21_H__
19#ifndef _MXC_IOMUX_MX21_H 19#define __MACH_IOMUX_MX21_H__
20#define _MXC_IOMUX_MX21_H 20
21 21#include <mach/iomux-mx2x.h>
22#ifndef GPIO_PORTA 22#include <mach/iomux-v1.h>
23#error Please include mach/iomux.h
24#endif
25
26 23
27/* Primary GPIO pin functions */ 24/* Primary GPIO pin functions */
28 25
29#define PB22_PF_USBH1_BYP (GPIO_PORTB | GPIO_PF | 22) 26#define PB22_PF_USBH1_BYP (GPIO_PORTB | GPIO_PF | 22)
30#define PB25_PF_USBH1_ON (GPIO_PORTB | GPIO_PF | 25) 27#define PB25_PF_USBH1_ON (GPIO_PORTB | GPIO_PF | 25)
31#define PC5_PF_USBOTG_SDA (GPIO_PORTC | GPIO_PF | 5) 28#define PC5_PF_USBOTG_SDA (GPIO_PORTC | GPIO_PF | 5)
32#define PC6_PF_USBOTG_SCL (GPIO_PORTC | GPIO_PF | 6) 29#define PC6_PF_USBOTG_SCL (GPIO_PORTC | GPIO_PF | 6)
33#define PC7_PF_USBOTG_ON (GPIO_PORTC | GPIO_PF | 7) 30#define PC7_PF_USBOTG_ON (GPIO_PORTC | GPIO_PF | 7)
34#define PC8_PF_USBOTG_FS (GPIO_PORTC | GPIO_PF | 8) 31#define PC8_PF_USBOTG_FS (GPIO_PORTC | GPIO_PF | 8)
35#define PC9_PF_USBOTG_OE (GPIO_PORTC | GPIO_PF | 9) 32#define PC9_PF_USBOTG_OE (GPIO_PORTC | GPIO_PF | 9)
36#define PC10_PF_USBOTG_TXDM (GPIO_PORTC | GPIO_PF | 10) 33#define PC10_PF_USBOTG_TXDM (GPIO_PORTC | GPIO_PF | 10)
37#define PC11_PF_USBOTG_TXDP (GPIO_PORTC | GPIO_PF | 11) 34#define PC11_PF_USBOTG_TXDP (GPIO_PORTC | GPIO_PF | 11)
38#define PC12_PF_USBOTG_RXDM (GPIO_PORTC | GPIO_PF | 12) 35#define PC12_PF_USBOTG_RXDM (GPIO_PORTC | GPIO_PF | 12)
39#define PC13_PF_USBOTG_RXDP (GPIO_PORTC | GPIO_PF | 13) 36#define PC13_PF_USBOTG_RXDP (GPIO_PORTC | GPIO_PF | 13)
40#define PC16_PF_SAP_FS (GPIO_PORTC | GPIO_PF | 16) 37#define PC16_PF_SAP_FS (GPIO_PORTC | GPIO_PF | 16)
41#define PC17_PF_SAP_RXD (GPIO_PORTC | GPIO_PF | 17) 38#define PC17_PF_SAP_RXD (GPIO_PORTC | GPIO_PF | 17)
42#define PC18_PF_SAP_TXD (GPIO_PORTC | GPIO_PF | 18) 39#define PC18_PF_SAP_TXD (GPIO_PORTC | GPIO_PF | 18)
43#define PC19_PF_SAP_CLK (GPIO_PORTC | GPIO_PF | 19) 40#define PC19_PF_SAP_CLK (GPIO_PORTC | GPIO_PF | 19)
44#define PE0_PF_TEST_WB2 (GPIO_PORTE | GPIO_PF | 0) 41#define PE0_PF_TEST_WB2 (GPIO_PORTE | GPIO_PF | 0)
45#define PE1_PF_TEST_WB1 (GPIO_PORTE | GPIO_PF | 1) 42#define PE1_PF_TEST_WB1 (GPIO_PORTE | GPIO_PF | 1)
46#define PE2_PF_TEST_WB0 (GPIO_PORTE | GPIO_PF | 2) 43#define PE2_PF_TEST_WB0 (GPIO_PORTE | GPIO_PF | 2)
47#define PF1_PF_NFCE (GPIO_PORTF | GPIO_PF | 1) 44#define PF1_PF_NFCE (GPIO_PORTF | GPIO_PF | 1)
48#define PF3_PF_NFCLE (GPIO_PORTF | GPIO_PF | 3) 45#define PF3_PF_NFCLE (GPIO_PORTF | GPIO_PF | 3)
49#define PF7_PF_NFIO0 (GPIO_PORTF | GPIO_PF | 7) 46#define PF7_PF_NFIO0 (GPIO_PORTF | GPIO_PF | 7)
50#define PF8_PF_NFIO1 (GPIO_PORTF | GPIO_PF | 8) 47#define PF8_PF_NFIO1 (GPIO_PORTF | GPIO_PF | 8)
51#define PF9_PF_NFIO2 (GPIO_PORTF | GPIO_PF | 9) 48#define PF9_PF_NFIO2 (GPIO_PORTF | GPIO_PF | 9)
52#define PF10_PF_NFIO3 (GPIO_PORTF | GPIO_PF | 10) 49#define PF10_PF_NFIO3 (GPIO_PORTF | GPIO_PF | 10)
53#define PF11_PF_NFIO4 (GPIO_PORTF | GPIO_PF | 11) 50#define PF11_PF_NFIO4 (GPIO_PORTF | GPIO_PF | 11)
54#define PF12_PF_NFIO5 (GPIO_PORTF | GPIO_PF | 12) 51#define PF12_PF_NFIO5 (GPIO_PORTF | GPIO_PF | 12)
55#define PF13_PF_NFIO6 (GPIO_PORTF | GPIO_PF | 13) 52#define PF13_PF_NFIO6 (GPIO_PORTF | GPIO_PF | 13)
56#define PF14_PF_NFIO7 (GPIO_PORTF | GPIO_PF | 14) 53#define PF14_PF_NFIO7 (GPIO_PORTF | GPIO_PF | 14)
57#define PF16_PF_RES (GPIO_PORTF | GPIO_PF | 16) 54#define PF16_PF_RES (GPIO_PORTF | GPIO_PF | 16)
58 55
59/* Alternate GPIO pin functions */ 56/* Alternate GPIO pin functions */
60 57
61#define PA5_AF_BMI_CLK_CS (GPIO_PORTA | GPIO_AF | 5) 58#define PA5_AF_BMI_CLK_CS (GPIO_PORTA | GPIO_AF | 5)
62#define PA6_AF_BMI_D0 (GPIO_PORTA | GPIO_AF | 6) 59#define PA6_AF_BMI_D0 (GPIO_PORTA | GPIO_AF | 6)
63#define PA7_AF_BMI_D1 (GPIO_PORTA | GPIO_AF | 7) 60#define PA7_AF_BMI_D1 (GPIO_PORTA | GPIO_AF | 7)
64#define PA8_AF_BMI_D2 (GPIO_PORTA | GPIO_AF | 8) 61#define PA8_AF_BMI_D2 (GPIO_PORTA | GPIO_AF | 8)
65#define PA9_AF_BMI_D3 (GPIO_PORTA | GPIO_AF | 9) 62#define PA9_AF_BMI_D3 (GPIO_PORTA | GPIO_AF | 9)
66#define PA10_AF_BMI_D4 (GPIO_PORTA | GPIO_AF | 10) 63#define PA10_AF_BMI_D4 (GPIO_PORTA | GPIO_AF | 10)
67#define PA11_AF_BMI_D5 (GPIO_PORTA | GPIO_AF | 11) 64#define PA11_AF_BMI_D5 (GPIO_PORTA | GPIO_AF | 11)
68#define PA12_AF_BMI_D6 (GPIO_PORTA | GPIO_AF | 12) 65#define PA12_AF_BMI_D6 (GPIO_PORTA | GPIO_AF | 12)
69#define PA13_AF_BMI_D7 (GPIO_PORTA | GPIO_AF | 13) 66#define PA13_AF_BMI_D7 (GPIO_PORTA | GPIO_AF | 13)
70#define PA14_AF_BMI_D8 (GPIO_PORTA | GPIO_AF | 14) 67#define PA14_AF_BMI_D8 (GPIO_PORTA | GPIO_AF | 14)
71#define PA15_AF_BMI_D9 (GPIO_PORTA | GPIO_AF | 15) 68#define PA15_AF_BMI_D9 (GPIO_PORTA | GPIO_AF | 15)
72#define PA16_AF_BMI_D10 (GPIO_PORTA | GPIO_AF | 16) 69#define PA16_AF_BMI_D10 (GPIO_PORTA | GPIO_AF | 16)
73#define PA17_AF_BMI_D11 (GPIO_PORTA | GPIO_AF | 17) 70#define PA17_AF_BMI_D11 (GPIO_PORTA | GPIO_AF | 17)
74#define PA18_AF_BMI_D12 (GPIO_PORTA | GPIO_AF | 18) 71#define PA18_AF_BMI_D12 (GPIO_PORTA | GPIO_AF | 18)
75#define PA19_AF_BMI_D13 (GPIO_PORTA | GPIO_AF | 19) 72#define PA19_AF_BMI_D13 (GPIO_PORTA | GPIO_AF | 19)
76#define PA20_AF_BMI_D14 (GPIO_PORTA | GPIO_AF | 20) 73#define PA20_AF_BMI_D14 (GPIO_PORTA | GPIO_AF | 20)
77#define PA21_AF_BMI_D15 (GPIO_PORTA | GPIO_AF | 21) 74#define PA21_AF_BMI_D15 (GPIO_PORTA | GPIO_AF | 21)
78#define PA22_AF_BMI_READ_REQ (GPIO_PORTA | GPIO_AF | 22) 75#define PA22_AF_BMI_READ_REQ (GPIO_PORTA | GPIO_AF | 22)
79#define PA23_AF_BMI_WRITE (GPIO_PORTA | GPIO_AF | 23) 76#define PA23_AF_BMI_WRITE (GPIO_PORTA | GPIO_AF | 23)
80#define PA29_AF_BMI_RX_FULL (GPIO_PORTA | GPIO_AF | 29) 77#define PA29_AF_BMI_RX_FULL (GPIO_PORTA | GPIO_AF | 29)
81#define PA30_AF_BMI_READ (GPIO_PORTA | GPIO_AF | 30) 78#define PA30_AF_BMI_READ (GPIO_PORTA | GPIO_AF | 30)
82 79
83/* AIN GPIO pin functions */ 80/* AIN GPIO pin functions */
84 81
85#define PC14_AIN_SYS_CLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14) 82#define PC14_AIN_SYS_CLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14)
86#define PD21_AIN_USBH2_FS (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 21) 83#define PD21_AIN_USBH2_FS (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 21)
87#define PD22_AIN_USBH2_OE (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 22) 84#define PD22_AIN_USBH2_OE (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 22)
88#define PD23_AIN_USBH2_TXDM (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 23) 85#define PD23_AIN_USBH2_TXDM (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 23)
89#define PD24_AIN_USBH2_TXDP (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 24) 86#define PD24_AIN_USBH2_TXDP (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 24)
90#define PE8_AIN_IR_TXD (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 8) 87#define PE8_AIN_IR_TXD (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 8)
91#define PF0_AIN_PC_RST (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 0) 88#define PF0_AIN_PC_RST (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 0)
92#define PF1_AIN_PC_CE1 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 1) 89#define PF1_AIN_PC_CE1 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 1)
93#define PF2_AIN_PC_CE2 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 2) 90#define PF2_AIN_PC_CE2 (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 2)
94#define PF3_AIN_PC_POE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 3) 91#define PF3_AIN_PC_POE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 3)
95#define PF4_AIN_PC_OE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 4) 92#define PF4_AIN_PC_OE (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 4)
96#define PF5_AIN_PC_RW (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 5) 93#define PF5_AIN_PC_RW (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 5)
97 94
98/* BIN GPIO pin functions */ 95/* BIN GPIO pin functions */
99 96
100#define PC14_BIN_SYS_CLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14) 97#define PC14_BIN_SYS_CLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14)
101#define PD27_BIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_BIN | GPIO_OUT | 27) 98#define PD27_BIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_BIN | GPIO_OUT | 27)
102 99
103/* CIN GPIO pin functions */ 100/* CIN GPIO pin functions */
104 101
105#define PB26_CIN_USBH1_RXDAT (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 26) 102#define PB26_CIN_USBH1_RXDAT (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 26)
106 103
107/* AOUT GPIO pin functions */ 104/* AOUT GPIO pin functions */
108 105
109#define PA29_AOUT_BMI_WAIT (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 29) 106#define PA29_AOUT_BMI_WAIT (GPIO_PORTA | GPIO_AOUT | GPIO_IN | 29)
110#define PD19_AOUT_USBH2_RXDM (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 19) 107#define PD19_AOUT_USBH2_RXDM (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 19)
111#define PD20_AOUT_USBH2_RXDP (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 20) 108#define PD20_AOUT_USBH2_RXDP (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 20)
112#define PD25_AOUT_EXT_DMAREQ (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 25) 109#define PD25_AOUT_EXT_DMAREQ (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 25)
113#define PD26_AOUT_USBOTG_RXDAT (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 26) 110#define PD26_AOUT_USBOTG_RXDAT (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 26)
114#define PE9_AOUT_IR_RXD (GPIO_PORTE | GPIO_AOUT | GPIO_IN | 9) 111#define PE9_AOUT_IR_RXD (GPIO_PORTE | GPIO_AOUT | GPIO_IN | 9)
115#define PF6_AOUT_PC_BVD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 6) 112#define PF6_AOUT_PC_BVD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 6)
116#define PF7_AOUT_PC_BVD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 7) 113#define PF7_AOUT_PC_BVD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 7)
117#define PF8_AOUT_PC_VS2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 8) 114#define PF8_AOUT_PC_VS2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 8)
118#define PF9_AOUT_PC_VS1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 9) 115#define PF9_AOUT_PC_VS1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 9)
119#define PF10_AOUT_PC_WP (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 10) 116#define PF10_AOUT_PC_WP (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 10)
120#define PF11_AOUT_PC_READY (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 11) 117#define PF11_AOUT_PC_READY (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 11)
121#define PF12_AOUT_PC_WAIT (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 12) 118#define PF12_AOUT_PC_WAIT (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 12)
122#define PF13_AOUT_PC_CD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 13) 119#define PF13_AOUT_PC_CD2 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 13)
123#define PF14_AOUT_PC_CD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 14) 120#define PF14_AOUT_PC_CD1 (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 14)
124 121
125 122#endif /* ifndef __MACH_IOMUX_MX21_H__ */
126#endif
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx25.h b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
index 9af494f0ab3d..f39220d1b67a 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx25.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx25.h
@@ -7,7 +7,7 @@
7 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. 7 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
8 * and 8 * and
9 * arch/arm/plat-mxc/include/mach/iomux-mx35.h 9 * arch/arm/plat-mxc/include/mach/iomux-mx35.h
10 * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de> 10 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
11 * 11 *
12 * The code contained herein is licensed under the GNU General Public 12 * The code contained herein is licensed under the GNU General Public
13 * License. You may obtain a copy of the GNU General Public License 13 * License. You may obtain a copy of the GNU General Public License
@@ -16,24 +16,11 @@
16 * http://www.opensource.org/licenses/gpl-license.html 16 * http://www.opensource.org/licenses/gpl-license.html
17 * http://www.gnu.org/copyleft/gpl.html 17 * http://www.gnu.org/copyleft/gpl.html
18 */ 18 */
19#ifndef __IOMUX_MX25_H__ 19#ifndef __MACH_IOMUX_MX25_H__
20#define __IOMUX_MX25_H__ 20#define __MACH_IOMUX_MX25_H__
21 21
22#include <mach/iomux-v3.h> 22#include <mach/iomux-v3.h>
23 23
24#ifndef GPIO_PORTA
25#error Please include mach/iomux.h
26#endif
27
28/*
29 *
30 * @brief MX25 I/O Pin List
31 *
32 * @ingroup GPIO_MX25
33 */
34
35#ifndef __ASSEMBLY__
36
37/* 24/*
38 * IOMUX/PAD Bit field definitions 25 * IOMUX/PAD Bit field definitions
39 */ 26 */
@@ -462,9 +449,11 @@
462#define MX25_PAD_GPIO_C__CAN2_TX IOMUX_PAD(0x3f8, 0x1fc, 0x16, 0, 0, PAD_CTL_PUS_22K_UP) 449#define MX25_PAD_GPIO_C__CAN2_TX IOMUX_PAD(0x3f8, 0x1fc, 0x16, 0, 0, PAD_CTL_PUS_22K_UP)
463 450
464#define MX25_PAD_GPIO_D__GPIO_D IOMUX_PAD(0x3fc, 0x200, 0x10, 0, 0, NO_PAD_CTRL) 451#define MX25_PAD_GPIO_D__GPIO_D IOMUX_PAD(0x3fc, 0x200, 0x10, 0, 0, NO_PAD_CTRL)
452#define MX25_PAD_GPIO_E__LD16 IOMUX_PAD(0x400, 0x204, 0x02, 0, 0, NO_PAD_CTRL)
465#define MX25_PAD_GPIO_D__CAN2_RX IOMUX_PAD(0x3fc, 0x200, 0x16, 0x484, 1, PAD_CTL_PUS_22K_UP) 453#define MX25_PAD_GPIO_D__CAN2_RX IOMUX_PAD(0x3fc, 0x200, 0x16, 0x484, 1, PAD_CTL_PUS_22K_UP)
466 454
467#define MX25_PAD_GPIO_E__GPIO_E IOMUX_PAD(0x400, 0x204, 0x10, 0, 0, NO_PAD_CTRL) 455#define MX25_PAD_GPIO_E__GPIO_E IOMUX_PAD(0x400, 0x204, 0x10, 0, 0, NO_PAD_CTRL)
456#define MX25_PAD_GPIO_F__LD17 IOMUX_PAD(0x404, 0x208, 0x02, 0, 0, NO_PAD_CTRL)
468#define MX25_PAD_GPIO_E__AUD7_TXD IOMUX_PAD(0x400, 0x204, 0x14, 0, 0, NO_PAD_CTRL) 457#define MX25_PAD_GPIO_E__AUD7_TXD IOMUX_PAD(0x400, 0x204, 0x14, 0, 0, NO_PAD_CTRL)
469 458
470#define MX25_PAD_GPIO_F__GPIO_F IOMUX_PAD(0x404, 0x208, 0x10, 0, 0, NO_PAD_CTRL) 459#define MX25_PAD_GPIO_F__GPIO_F IOMUX_PAD(0x404, 0x208, 0x10, 0, 0, NO_PAD_CTRL)
@@ -513,5 +502,4 @@
513#define MX25_PAD_CTL_GRP_DVS_SDHC1 IOMUX_PAD(0x458, 0x000, 0, 0, 0, NO_PAD_CTRL) 502#define MX25_PAD_CTL_GRP_DVS_SDHC1 IOMUX_PAD(0x458, 0x000, 0, 0, 0, NO_PAD_CTRL)
514#define MX25_PAD_CTL_GRP_DVS_LCD IOMUX_PAD(0x45c, 0x000, 0, 0, 0, NO_PAD_CTRL) 503#define MX25_PAD_CTL_GRP_DVS_LCD IOMUX_PAD(0x45c, 0x000, 0, 0, 0, NO_PAD_CTRL)
515 504
516#endif // __ASSEMBLY__ 505#endif /* __MACH_IOMUX_MX25_H__ */
517#endif // __IOMUX_MX25_H__
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx27.h b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
index 5ac158b70f61..d9f9a6e32d80 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx27.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx27.h
@@ -1,207 +1,205 @@
1/* 1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> 3 * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
4* 4 *
5* This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
7* as published by the Free Software Foundation; either version 2 7 * as published by the Free Software Foundation; either version 2
8* of the License, or (at your option) any later version. 8 * of the License, or (at your option) any later version.
9* This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details. 12 * GNU General Public License for more details.
13* 13 *
14* You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15* along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301, USA. 17 * MA 02110-1301, USA.
18*/ 18 */
19 19#ifndef __MACH_IOMUX_MX27_H__
20#ifndef _MXC_IOMUX_MX27_H 20#define __MACH_IOMUX_MX27_H__
21#define _MXC_IOMUX_MX27_H 21
22 22#include <mach/iomux-mx2x.h>
23#ifndef GPIO_PORTA 23#include <mach/iomux-v1.h>
24#error Please include mach/iomux.h
25#endif
26
27 24
28/* Primary GPIO pin functions */ 25/* Primary GPIO pin functions */
29 26
30#define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0) 27#define PA0_PF_USBH2_CLK (GPIO_PORTA | GPIO_PF | 0)
31#define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1) 28#define PA1_PF_USBH2_DIR (GPIO_PORTA | GPIO_PF | 1)
32#define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2) 29#define PA2_PF_USBH2_DATA7 (GPIO_PORTA | GPIO_PF | 2)
33#define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3) 30#define PA3_PF_USBH2_NXT (GPIO_PORTA | GPIO_PF | 3)
34#define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4) 31#define PA4_PF_USBH2_STP (GPIO_PORTA | GPIO_PF | 4)
35#define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22) 32#define PB22_PF_USBH1_SUSP (GPIO_PORTB | GPIO_PF | 22)
36#define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25) 33#define PB25_PF_USBH1_RCV (GPIO_PORTB | GPIO_PF | 25)
37#define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_PF | GPIO_IN | 5) 34#define PC5_PF_I2C2_SDA (GPIO_PORTC | GPIO_PF | GPIO_IN | 5)
38#define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_PF | GPIO_IN | 6) 35#define PC6_PF_I2C2_SCL (GPIO_PORTC | GPIO_PF | GPIO_IN | 6)
39#define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 7) 36#define PC7_PF_USBOTG_DATA5 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 7)
40#define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 8) 37#define PC8_PF_USBOTG_DATA6 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 8)
41#define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9) 38#define PC9_PF_USBOTG_DATA0 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 9)
42#define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 10) 39#define PC10_PF_USBOTG_DATA2 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 10)
43#define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11) 40#define PC11_PF_USBOTG_DATA1 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 11)
44#define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 12) 41#define PC12_PF_USBOTG_DATA4 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 12)
45#define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 13) 42#define PC13_PF_USBOTG_DATA3 (GPIO_PORTC | GPIO_PF | GPIO_OUT | 13)
46#define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 16) 43#define PC16_PF_SSI4_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 16)
47#define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 17) 44#define PC17_PF_SSI4_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 17)
48#define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 18) 45#define PC18_PF_SSI4_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 18)
49#define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 19) 46#define PC19_PF_SSI4_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 19)
50#define PC25_AF_GPT5_TIN (GPIO_PORTC | GPIO_AF | 25) 47#define PD0_PF_SD3_CMD (GPIO_PORTD | GPIO_PF | 0)
51#define PC27_AF_GPT4_TIN (GPIO_PORTC | GPIO_AF | 27) 48#define PD1_PF_SD3_CLK (GPIO_PORTD | GPIO_PF | 1)
52#define PD0_PF_SD3_CMD (GPIO_PORTD | GPIO_PF | 0) 49#define PD2_PF_ATA_DATA0 (GPIO_PORTD | GPIO_PF | 2)
53#define PD1_PF_SD3_CLK (GPIO_PORTD | GPIO_PF | 1) 50#define PD3_PF_ATA_DATA1 (GPIO_PORTD | GPIO_PF | 3)
54#define PD2_PF_ATA_DATA0 (GPIO_PORTD | GPIO_PF | 2) 51#define PD4_PF_ATA_DATA2 (GPIO_PORTD | GPIO_PF | 4)
55#define PD3_PF_ATA_DATA1 (GPIO_PORTD | GPIO_PF | 3) 52#define PD5_PF_ATA_DATA3 (GPIO_PORTD | GPIO_PF | 5)
56#define PD4_PF_ATA_DATA2 (GPIO_PORTD | GPIO_PF | 4) 53#define PD6_PF_ATA_DATA4 (GPIO_PORTD | GPIO_PF | 6)
57#define PD5_PF_ATA_DATA3 (GPIO_PORTD | GPIO_PF | 5) 54#define PD7_PF_ATA_DATA5 (GPIO_PORTD | GPIO_PF | 7)
58#define PD6_PF_ATA_DATA4 (GPIO_PORTD | GPIO_PF | 6) 55#define PD8_PF_ATA_DATA6 (GPIO_PORTD | GPIO_PF | 8)
59#define PD7_PF_ATA_DATA5 (GPIO_PORTD | GPIO_PF | 7) 56#define PD9_PF_ATA_DATA7 (GPIO_PORTD | GPIO_PF | 9)
60#define PD8_PF_ATA_DATA6 (GPIO_PORTD | GPIO_PF | 8) 57#define PD10_PF_ATA_DATA8 (GPIO_PORTD | GPIO_PF | 10)
61#define PD9_PF_ATA_DATA7 (GPIO_PORTD | GPIO_PF | 9) 58#define PD11_PF_ATA_DATA9 (GPIO_PORTD | GPIO_PF | 11)
62#define PD10_PF_ATA_DATA8 (GPIO_PORTD | GPIO_PF | 10) 59#define PD12_PF_ATA_DATA10 (GPIO_PORTD | GPIO_PF | 12)
63#define PD11_PF_ATA_DATA9 (GPIO_PORTD | GPIO_PF | 11) 60#define PD13_PF_ATA_DATA11 (GPIO_PORTD | GPIO_PF | 13)
64#define PD12_PF_ATA_DATA10 (GPIO_PORTD | GPIO_PF | 12) 61#define PD14_PF_ATA_DATA12 (GPIO_PORTD | GPIO_PF | 14)
65#define PD13_PF_ATA_DATA11 (GPIO_PORTD | GPIO_PF | 13) 62#define PD15_PF_ATA_DATA13 (GPIO_PORTD | GPIO_PF | 15)
66#define PD14_PF_ATA_DATA12 (GPIO_PORTD | GPIO_PF | 14) 63#define PD16_PF_ATA_DATA14 (GPIO_PORTD | GPIO_PF | 16)
67#define PD15_PF_ATA_DATA13 (GPIO_PORTD | GPIO_PF | 15) 64#define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_PF | GPIO_OUT | 0)
68#define PD16_PF_ATA_DATA14 (GPIO_PORTD | GPIO_PF | 16) 65#define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_PF | GPIO_OUT | 1)
69#define PE0_PF_USBOTG_NXT (GPIO_PORTE | GPIO_PF | GPIO_OUT | 0) 66#define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_PF | GPIO_OUT | 2)
70#define PE1_PF_USBOTG_STP (GPIO_PORTE | GPIO_PF | GPIO_OUT | 1) 67#define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 24)
71#define PE2_PF_USBOTG_DIR (GPIO_PORTE | GPIO_PF | GPIO_OUT | 2) 68#define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_PF | GPIO_OUT | 25)
72#define PE24_PF_USBOTG_CLK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 24) 69#define PF1_PF_NFCLE (GPIO_PORTF | GPIO_PF | 1)
73#define PE25_PF_USBOTG_DATA7 (GPIO_PORTE | GPIO_PF | GPIO_OUT | 25) 70#define PF3_PF_NFCE (GPIO_PORTF | GPIO_PF | 3)
74#define PF1_PF_NFCLE (GPIO_PORTF | GPIO_PF | 1) 71#define PF7_PF_PC_POE (GPIO_PORTF | GPIO_PF | 7)
75#define PF3_PF_NFCE (GPIO_PORTF | GPIO_PF | 3) 72#define PF8_PF_PC_RW (GPIO_PORTF | GPIO_PF | 8)
76#define PF7_PF_PC_POE (GPIO_PORTF | GPIO_PF | 7) 73#define PF9_PF_PC_IOIS16 (GPIO_PORTF | GPIO_PF | 9)
77#define PF8_PF_PC_RW (GPIO_PORTF | GPIO_PF | 8) 74#define PF10_PF_PC_RST (GPIO_PORTF | GPIO_PF | 10)
78#define PF9_PF_PC_IOIS16 (GPIO_PORTF | GPIO_PF | 9) 75#define PF11_PF_PC_BVD2 (GPIO_PORTF | GPIO_PF | 11)
79#define PF10_PF_PC_RST (GPIO_PORTF | GPIO_PF | 10) 76#define PF12_PF_PC_BVD1 (GPIO_PORTF | GPIO_PF | 12)
80#define PF11_PF_PC_BVD2 (GPIO_PORTF | GPIO_PF | 11) 77#define PF13_PF_PC_VS2 (GPIO_PORTF | GPIO_PF | 13)
81#define PF12_PF_PC_BVD1 (GPIO_PORTF | GPIO_PF | 12) 78#define PF14_PF_PC_VS1 (GPIO_PORTF | GPIO_PF | 14)
82#define PF13_PF_PC_VS2 (GPIO_PORTF | GPIO_PF | 13) 79#define PF16_PF_PC_PWRON (GPIO_PORTF | GPIO_PF | 16)
83#define PF14_PF_PC_VS1 (GPIO_PORTF | GPIO_PF | 14) 80#define PF17_PF_PC_READY (GPIO_PORTF | GPIO_PF | 17)
84#define PF16_PF_PC_PWRON (GPIO_PORTF | GPIO_PF | 16) 81#define PF18_PF_PC_WAIT (GPIO_PORTF | GPIO_PF | 18)
85#define PF17_PF_PC_READY (GPIO_PORTF | GPIO_PF | 17) 82#define PF19_PF_PC_CD2 (GPIO_PORTF | GPIO_PF | 19)
86#define PF18_PF_PC_WAIT (GPIO_PORTF | GPIO_PF | 18) 83#define PF20_PF_PC_CD1 (GPIO_PORTF | GPIO_PF | 20)
87#define PF19_PF_PC_CD2 (GPIO_PORTF | GPIO_PF | 19) 84#define PF23_PF_ATA_DATA15 (GPIO_PORTF | GPIO_PF | 23)
88#define PF20_PF_PC_CD1 (GPIO_PORTF | GPIO_PF | 20)
89#define PF23_PF_ATA_DATA15 (GPIO_PORTF | GPIO_PF | 23)
90 85
91/* Alternate GPIO pin functions */ 86/* Alternate GPIO pin functions */
92 87
93#define PB4_AF_MSHC_DATA0 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 4) 88#define PB4_AF_MSHC_DATA0 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 4)
94#define PB5_AF_MSHC_DATA1 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 5) 89#define PB5_AF_MSHC_DATA1 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 5)
95#define PB6_AF_MSHC_DATA2 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 6) 90#define PB6_AF_MSHC_DATA2 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 6)
96#define PB7_AF_MSHC_DATA4 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 7) 91#define PB7_AF_MSHC_DATA4 (GPIO_PORTB | GPIO_AF | GPIO_OUT | 7)
97#define PB8_AF_MSHC_BS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 8) 92#define PB8_AF_MSHC_BS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 8)
98#define PB9_AF_MSHC_SCLK (GPIO_PORTB | GPIO_AF | GPIO_OUT | 9) 93#define PB9_AF_MSHC_SCLK (GPIO_PORTB | GPIO_AF | GPIO_OUT | 9)
99#define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 10) 94#define PB10_AF_UART6_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 10)
100#define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 11) 95#define PB11_AF_UART6_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 11)
101#define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 12) 96#define PB12_AF_UART6_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 12)
102#define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 13) 97#define PB13_AF_UART6_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 13)
103#define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 18) 98#define PB18_AF_UART5_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 18)
104#define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 19) 99#define PB19_AF_UART5_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 19)
105#define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 20) 100#define PB20_AF_UART5_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 20)
106#define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 21) 101#define PB21_AF_UART5_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 21)
107#define PC8_AF_FEC_MDIO (GPIO_PORTC | GPIO_AF | GPIO_IN | 8) 102#define PC8_AF_FEC_MDIO (GPIO_PORTC | GPIO_AF | GPIO_IN | 8)
108#define PC24_AF_GPT5_TOUT (GPIO_PORTC | GPIO_AF | 24) 103#define PC24_AF_GPT5_TOUT (GPIO_PORTC | GPIO_AF | 24)
109#define PC26_AF_GPT4_TOUT (GPIO_PORTC | GPIO_AF | 26) 104#define PC25_AF_GPT5_TIN (GPIO_PORTC | GPIO_AF | 25)
110#define PD1_AF_ETMTRACE_PKT15 (GPIO_PORTD | GPIO_AF | 1) 105#define PC26_AF_GPT4_TOUT (GPIO_PORTC | GPIO_AF | 26)
111#define PD6_AF_ETMTRACE_PKT14 (GPIO_PORTD | GPIO_AF | 6) 106#define PC27_AF_GPT4_TIN (GPIO_PORTC | GPIO_AF | 27)
112#define PD7_AF_ETMTRACE_PKT13 (GPIO_PORTD | GPIO_AF | 7) 107#define PD1_AF_ETMTRACE_PKT15 (GPIO_PORTD | GPIO_AF | 1)
113#define PD9_AF_ETMTRACE_PKT12 (GPIO_PORTD | GPIO_AF | 9) 108#define PD6_AF_ETMTRACE_PKT14 (GPIO_PORTD | GPIO_AF | 6)
114#define PD2_AF_SD3_D0 (GPIO_PORTD | GPIO_AF | 2) 109#define PD7_AF_ETMTRACE_PKT13 (GPIO_PORTD | GPIO_AF | 7)
115#define PD3_AF_SD3_D1 (GPIO_PORTD | GPIO_AF | 3) 110#define PD9_AF_ETMTRACE_PKT12 (GPIO_PORTD | GPIO_AF | 9)
116#define PD4_AF_SD3_D2 (GPIO_PORTD | GPIO_AF | 4) 111#define PD2_AF_SD3_D0 (GPIO_PORTD | GPIO_AF | 2)
117#define PD5_AF_SD3_D3 (GPIO_PORTD | GPIO_AF | 5) 112#define PD3_AF_SD3_D1 (GPIO_PORTD | GPIO_AF | 3)
118#define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_AF | GPIO_IN | 8) 113#define PD4_AF_SD3_D2 (GPIO_PORTD | GPIO_AF | 4)
119#define PD10_AF_ETMTRACE_PKT11 (GPIO_PORTD | GPIO_AF | 10) 114#define PD5_AF_SD3_D3 (GPIO_PORTD | GPIO_AF | 5)
120#define PD11_AF_ETMTRACE_PKT10 (GPIO_PORTD | GPIO_AF | 11) 115#define PD8_AF_FEC_MDIO (GPIO_PORTD | GPIO_AF | GPIO_IN | 8)
121#define PD12_AF_ETMTRACE_PKT9 (GPIO_PORTD | GPIO_AF | 12) 116#define PD10_AF_ETMTRACE_PKT11 (GPIO_PORTD | GPIO_AF | 10)
122#define PD13_AF_ETMTRACE_PKT8 (GPIO_PORTD | GPIO_AF | 13) 117#define PD11_AF_ETMTRACE_PKT10 (GPIO_PORTD | GPIO_AF | 11)
123#define PD14_AF_ETMTRACE_PKT7 (GPIO_PORTD | GPIO_AF | 14) 118#define PD12_AF_ETMTRACE_PKT9 (GPIO_PORTD | GPIO_AF | 12)
124#define PD15_AF_ETMTRACE_PKT6 (GPIO_PORTD | GPIO_AF | 15) 119#define PD13_AF_ETMTRACE_PKT8 (GPIO_PORTD | GPIO_AF | 13)
125#define PD16_AF_ETMTRACE_PKT5 (GPIO_PORTD | GPIO_AF | 16) 120#define PD14_AF_ETMTRACE_PKT7 (GPIO_PORTD | GPIO_AF | 14)
126#define PF1_AF_ETMTRACE_PKT0 (GPIO_PORTF | GPIO_AF | 1) 121#define PD15_AF_ETMTRACE_PKT6 (GPIO_PORTD | GPIO_AF | 15)
127#define PF3_AF_ETMTRACE_PKT2 (GPIO_PORTF | GPIO_AF | 3) 122#define PD16_AF_ETMTRACE_PKT5 (GPIO_PORTD | GPIO_AF | 16)
128#define PF5_AF_ETMPIPESTAT11 (GPIO_PORTF | GPIO_AF | 5) 123#define PF1_AF_ETMTRACE_PKT0 (GPIO_PORTF | GPIO_AF | 1)
129#define PF7_AF_ATA_BUFFER_EN (GPIO_PORTF | GPIO_AF | 7) 124#define PF3_AF_ETMTRACE_PKT2 (GPIO_PORTF | GPIO_AF | 3)
130#define PF8_AF_ATA_IORDY (GPIO_PORTF | GPIO_AF | 8) 125#define PF5_AF_ETMPIPESTAT11 (GPIO_PORTF | GPIO_AF | 5)
131#define PF9_AF_ATA_INTRQ (GPIO_PORTF | GPIO_AF | 9) 126#define PF7_AF_ATA_BUFFER_EN (GPIO_PORTF | GPIO_AF | 7)
132#define PF10_AF_ATA_RESET (GPIO_PORTF | GPIO_AF | 10) 127#define PF8_AF_ATA_IORDY (GPIO_PORTF | GPIO_AF | 8)
133#define PF11_AF_ATA_DMACK (GPIO_PORTF | GPIO_AF | 11) 128#define PF9_AF_ATA_INTRQ (GPIO_PORTF | GPIO_AF | 9)
134#define PF12_AF_ATA_DMAREQ (GPIO_PORTF | GPIO_AF | 12) 129#define PF10_AF_ATA_RESET (GPIO_PORTF | GPIO_AF | 10)
135#define PF13_AF_ATA_DA0 (GPIO_PORTF | GPIO_AF | 13) 130#define PF11_AF_ATA_DMACK (GPIO_PORTF | GPIO_AF | 11)
136#define PF14_AF_ATA_DA1 (GPIO_PORTF | GPIO_AF | 14) 131#define PF12_AF_ATA_DMAREQ (GPIO_PORTF | GPIO_AF | 12)
137#define PF15_AF_ETMTRACE_SYNC (GPIO_PORTF | GPIO_AF | 15) 132#define PF13_AF_ATA_DA0 (GPIO_PORTF | GPIO_AF | 13)
138#define PF16_AF_ATA_DA2 (GPIO_PORTF | GPIO_AF | 16) 133#define PF14_AF_ATA_DA1 (GPIO_PORTF | GPIO_AF | 14)
139#define PF17_AF_ATA_CS0 (GPIO_PORTF | GPIO_AF | 17) 134#define PF15_AF_ETMTRACE_SYNC (GPIO_PORTF | GPIO_AF | 15)
140#define PF18_AF_ATA_CS1 (GPIO_PORTF | GPIO_AF | 18) 135#define PF16_AF_ATA_DA2 (GPIO_PORTF | GPIO_AF | 16)
141#define PF19_AF_ATA_DIOW (GPIO_PORTF | GPIO_AF | 19) 136#define PF17_AF_ATA_CS0 (GPIO_PORTF | GPIO_AF | 17)
142#define PF20_AF_ATA_DIOR (GPIO_PORTF | GPIO_AF | 20) 137#define PF18_AF_ATA_CS1 (GPIO_PORTF | GPIO_AF | 18)
143#define PF22_AF_ETMTRACE_CLK (GPIO_PORTF | GPIO_AF | 22) 138#define PF19_AF_ATA_DIOW (GPIO_PORTF | GPIO_AF | 19)
144#define PF23_AF_ETMTRACE_PKT4 (GPIO_PORTF | GPIO_AF | 23) 139#define PF20_AF_ATA_DIOR (GPIO_PORTF | GPIO_AF | 20)
140#define PF22_AF_ETMTRACE_CLK (GPIO_PORTF | GPIO_AF | 22)
141#define PF23_AF_ETMTRACE_PKT4 (GPIO_PORTF | GPIO_AF | 23)
145 142
146/* AIN GPIO pin functions */ 143/* AIN GPIO pin functions */
147 144
148#define PC14_AIN_SSI1_MCLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14) 145#define PC14_AIN_SSI1_MCLK (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 14)
149#define PC15_AIN_GPT6_TOUT (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 15) 146#define PC15_AIN_GPT6_TOUT (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 15)
150#define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 0) 147#define PD0_AIN_FEC_TXD0 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 0)
151#define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 1) 148#define PD1_AIN_FEC_TXD1 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 1)
152#define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 2) 149#define PD2_AIN_FEC_TXD2 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 2)
153#define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 3) 150#define PD3_AIN_FEC_TXD3 (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 3)
154#define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 9) 151#define PD9_AIN_FEC_MDC (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 9)
155#define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 16) 152#define PD16_AIN_FEC_TX_ER (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 16)
156#define PD27_AIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 27) 153#define PD27_AIN_EXT_DMA_GRANT (GPIO_PORTD | GPIO_AIN | GPIO_OUT | 27)
157#define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 23) 154#define PF23_AIN_FEC_TX_EN (GPIO_PORTF | GPIO_AIN | GPIO_OUT | 23)
158 155
159/* BIN GPIO pin functions */ 156/* BIN GPIO pin functions */
160 157
161#define PC14_BIN_SSI2_MCLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14) 158#define PC14_BIN_SSI2_MCLK (GPIO_PORTC | GPIO_BIN | GPIO_OUT | 14)
162 159
163/* CIN GPIO pin functions */ 160/* CIN GPIO pin functions */
164 161
165#define PD2_CIN_SLCDC1_DAT0 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 2) 162#define PD2_CIN_SLCDC1_DAT0 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 2)
166#define PD3_CIN_SLCDC1_DAT1 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 3) 163#define PD3_CIN_SLCDC1_DAT1 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 3)
167#define PD4_CIN_SLCDC1_DAT2 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 4) 164#define PD4_CIN_SLCDC1_DAT2 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 4)
168#define PD5_CIN_SLCDC1_DAT3 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 5) 165#define PD5_CIN_SLCDC1_DAT3 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 5)
169#define PD6_CIN_SLCDC1_DAT4 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 6) 166#define PD6_CIN_SLCDC1_DAT4 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 6)
170#define PD7_CIN_SLCDC1_DAT5 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 7) 167#define PD7_CIN_SLCDC1_DAT5 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 7)
171#define PD8_CIN_SLCDC1_DAT6 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 8) 168#define PD8_CIN_SLCDC1_DAT6 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 8)
172#define PD9_CIN_SLCDC1_DAT7 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 9) 169#define PD9_CIN_SLCDC1_DAT7 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 9)
173#define PD10_CIN_SLCDC1_DAT8 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 10) 170#define PD10_CIN_SLCDC1_DAT8 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 10)
174#define PD11_CIN_SLCDC1_DAT9 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 11) 171#define PD11_CIN_SLCDC1_DAT9 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 11)
175#define PD12_CIN_SLCDC1_DAT10 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 12) 172#define PD12_CIN_SLCDC1_DAT10 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 12)
176#define PD13_CIN_SLCDC1_DAT11 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 13) 173#define PD13_CIN_SLCDC1_DAT11 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 13)
177#define PD14_CIN_SLCDC1_DAT12 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 14) 174#define PD14_CIN_SLCDC1_DAT12 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 14)
178#define PD15_CIN_SLCDC1_DAT13 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 15) 175#define PD15_CIN_SLCDC1_DAT13 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 15)
179#define PD16_CIN_SLCDC1_DAT14 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 16) 176#define PD16_CIN_SLCDC1_DAT14 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 16)
180#define PD23_CIN_SLCDC1_DAT15 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 23) 177#define PD23_CIN_SLCDC1_DAT15 (GPIO_PORTD | GPIO_CIN | GPIO_OUT | 23)
181#define PF27_CIN_EXT_DMA_GRANT (GPIO_PORTF | GPIO_CIN | GPIO_OUT | 27) 178#define PF27_CIN_EXT_DMA_GRANT (GPIO_PORTF | GPIO_CIN | GPIO_OUT | 27)
182/* LCDC_TESTx on PBxx omitted, because it's not clear what they do */ 179/* LCDC_TESTx on PBxx omitted, because it's not clear what they do */
183 180
184/* AOUT GPIO pin functions */ 181/* AOUT GPIO pin functions */
185 182
186#define PC14_AOUT_GPT6_TIN (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 14) 183#define PC14_AOUT_GPT6_TIN (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 14)
187#define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 4) 184#define PD4_AOUT_FEC_RX_ER (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 4)
188#define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 5) 185#define PD5_AOUT_FEC_RXD1 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 5)
189#define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 6) 186#define PD6_AOUT_FEC_RXD2 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 6)
190#define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 7) 187#define PD7_AOUT_FEC_RXD3 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 7)
191#define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 10) 188#define PD10_AOUT_FEC_CRS (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 10)
192#define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 11) 189#define PD11_AOUT_FEC_TX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 11)
193#define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 12) 190#define PD12_AOUT_FEC_RXD0 (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 12)
194#define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 13) 191#define PD13_AOUT_FEC_RX_DV (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 13)
195#define PD14_AOUT_FEC_RX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 14) 192#define PD14_AOUT_FEC_RX_CLK (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 14)
196#define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 15) 193#define PD15_AOUT_FEC_COL (GPIO_PORTD | GPIO_AOUT | GPIO_IN | 15)
197 194
198#define PC17_BOUT_PC_IOIS16 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 17) 195/* BOUT GPIO pin functions */
199#define PC18_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 18) 196
200#define PC19_BOUT_PC_BVD1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 19) 197#define PC17_BOUT_PC_IOIS16 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 17)
201#define PC28_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 28) 198#define PC18_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 18)
202#define PC29_BOUT_PC_VS1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 29) 199#define PC19_BOUT_PC_BVD1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 19)
203#define PC30_BOUT_PC_READY (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 30) 200#define PC28_BOUT_PC_BVD2 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 28)
204#define PC31_BOUT_PC_WAIT (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 31) 201#define PC29_BOUT_PC_VS1 (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 29)
205 202#define PC30_BOUT_PC_READY (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 30)
206 203#define PC31_BOUT_PC_WAIT (GPIO_PORTC | GPIO_BOUT | GPIO_IN | 31)
207#endif /* _MXC_GPIO_MX1_MX2_H */ 204
205#endif /* __MACH_IOMUX_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
index fb5ae638e79f..c4f116d214f2 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx2x.h
@@ -1,237 +1,230 @@
1/* 1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> 3 * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
4* 4 *
5* This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6* modify it under the terms of the GNU General Public License 6 * modify it under the terms of the GNU General Public License
7* as published by the Free Software Foundation; either version 2 7 * as published by the Free Software Foundation; either version 2
8* of the License, or (at your option) any later version. 8 * of the License, or (at your option) any later version.
9* This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details. 12 * GNU General Public License for more details.
13* 13 *
14* You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15* along with this program; if not, write to the Free Software 15 * along with this program; if not, write to the Free Software
16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301, USA. 17 * MA 02110-1301, USA.
18*/ 18 */
19 19#ifndef __MACH_IOMUX_MX2x_H__
20#ifndef _MXC_IOMUX_MX2x_H 20#define __MACH_IOMUX_MX2x_H__
21#define _MXC_IOMUX_MX2x_H
22
23#ifndef GPIO_PORTA
24#error Please include mach/iomux.h
25#endif
26
27 21
28/* Primary GPIO pin functions */ 22/* Primary GPIO pin functions */
29 23
30#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5) 24#define PA5_PF_LSCLK (GPIO_PORTA | GPIO_PF | GPIO_OUT | 5)
31#define PA6_PF_LD0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 6) 25#define PA6_PF_LD0 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 6)
32#define PA7_PF_LD1 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 7) 26#define PA7_PF_LD1 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 7)
33#define PA8_PF_LD2 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 8) 27#define PA8_PF_LD2 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 8)
34#define PA9_PF_LD3 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 9) 28#define PA9_PF_LD3 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 9)
35#define PA10_PF_LD4 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 10) 29#define PA10_PF_LD4 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 10)
36#define PA11_PF_LD5 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 11) 30#define PA11_PF_LD5 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 11)
37#define PA12_PF_LD6 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 12) 31#define PA12_PF_LD6 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 12)
38#define PA13_PF_LD7 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 13) 32#define PA13_PF_LD7 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 13)
39#define PA14_PF_LD8 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 14) 33#define PA14_PF_LD8 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 14)
40#define PA15_PF_LD9 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15) 34#define PA15_PF_LD9 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 15)
41#define PA16_PF_LD10 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16) 35#define PA16_PF_LD10 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 16)
42#define PA17_PF_LD11 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 17) 36#define PA17_PF_LD11 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 17)
43#define PA18_PF_LD12 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 18) 37#define PA18_PF_LD12 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 18)
44#define PA19_PF_LD13 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 19) 38#define PA19_PF_LD13 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 19)
45#define PA20_PF_LD14 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 20) 39#define PA20_PF_LD14 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 20)
46#define PA21_PF_LD15 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 21) 40#define PA21_PF_LD15 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 21)
47#define PA22_PF_LD16 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 22) 41#define PA22_PF_LD16 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 22)
48#define PA23_PF_LD17 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 23) 42#define PA23_PF_LD17 (GPIO_PORTA | GPIO_PF | GPIO_OUT | 23)
49#define PA24_PF_REV (GPIO_PORTA | GPIO_PF | GPIO_OUT | 24) 43#define PA24_PF_REV (GPIO_PORTA | GPIO_PF | GPIO_OUT | 24)
50#define PA25_PF_CLS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 25) 44#define PA25_PF_CLS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 25)
51#define PA26_PF_PS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 26) 45#define PA26_PF_PS (GPIO_PORTA | GPIO_PF | GPIO_OUT | 26)
52#define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_PF | GPIO_OUT | 27) 46#define PA27_PF_SPL_SPR (GPIO_PORTA | GPIO_PF | GPIO_OUT | 27)
53#define PA28_PF_HSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 28) 47#define PA28_PF_HSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 28)
54#define PA29_PF_VSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 29) 48#define PA29_PF_VSYNC (GPIO_PORTA | GPIO_PF | GPIO_OUT | 29)
55#define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_PF | GPIO_OUT | 30) 49#define PA30_PF_CONTRAST (GPIO_PORTA | GPIO_PF | GPIO_OUT | 30)
56#define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_PF | GPIO_OUT | 31) 50#define PA31_PF_OE_ACD (GPIO_PORTA | GPIO_PF | GPIO_OUT | 31)
57#define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4) 51#define PB4_PF_SD2_D0 (GPIO_PORTB | GPIO_PF | 4)
58#define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5) 52#define PB5_PF_SD2_D1 (GPIO_PORTB | GPIO_PF | 5)
59#define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6) 53#define PB6_PF_SD2_D2 (GPIO_PORTB | GPIO_PF | 6)
60#define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7) 54#define PB7_PF_SD2_D3 (GPIO_PORTB | GPIO_PF | 7)
61#define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8) 55#define PB8_PF_SD2_CMD (GPIO_PORTB | GPIO_PF | 8)
62#define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9) 56#define PB9_PF_SD2_CLK (GPIO_PORTB | GPIO_PF | 9)
63#define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 10) 57#define PB10_PF_CSI_D0 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 10)
64#define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 11) 58#define PB11_PF_CSI_D1 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 11)
65#define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 12) 59#define PB12_PF_CSI_D2 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 12)
66#define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 13) 60#define PB13_PF_CSI_D3 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 13)
67#define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 14) 61#define PB14_PF_CSI_D4 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 14)
68#define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 15) 62#define PB15_PF_CSI_MCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 15)
69#define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 16) 63#define PB16_PF_CSI_PIXCLK (GPIO_PORTB | GPIO_PF | GPIO_OUT | 16)
70#define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 17) 64#define PB17_PF_CSI_D5 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 17)
71#define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 18) 65#define PB18_PF_CSI_D6 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 18)
72#define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 19) 66#define PB19_PF_CSI_D7 (GPIO_PORTB | GPIO_PF | GPIO_OUT | 19)
73#define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 20) 67#define PB20_PF_CSI_VSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 20)
74#define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 21) 68#define PB21_PF_CSI_HSYNC (GPIO_PORTB | GPIO_PF | GPIO_OUT | 21)
75#define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23) 69#define PB23_PF_USB_PWR (GPIO_PORTB | GPIO_PF | 23)
76#define PB24_PF_USB_OC (GPIO_PORTB | GPIO_PF | 24) 70#define PB24_PF_USB_OC (GPIO_PORTB | GPIO_PF | 24)
77#define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26) 71#define PB26_PF_USBH1_FS (GPIO_PORTB | GPIO_PF | 26)
78#define PB27_PF_USBH1_OE (GPIO_PORTB | GPIO_PF | 27) 72#define PB27_PF_USBH1_OE (GPIO_PORTB | GPIO_PF | 27)
79#define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28) 73#define PB28_PF_USBH1_TXDM (GPIO_PORTB | GPIO_PF | 28)
80#define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29) 74#define PB29_PF_USBH1_TXDP (GPIO_PORTB | GPIO_PF | 29)
81#define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30) 75#define PB30_PF_USBH1_RXDM (GPIO_PORTB | GPIO_PF | 30)
82#define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31) 76#define PB31_PF_USBH1_RXDP (GPIO_PORTB | GPIO_PF | 31)
83#define PC14_PF_TOUT (GPIO_PORTC | GPIO_PF | 14) 77#define PC14_PF_TOUT (GPIO_PORTC | GPIO_PF | 14)
84#define PC15_PF_TIN (GPIO_PORTC | GPIO_PF | 15) 78#define PC15_PF_TIN (GPIO_PORTC | GPIO_PF | 15)
85#define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 20) 79#define PC20_PF_SSI1_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 20)
86#define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 21) 80#define PC21_PF_SSI1_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 21)
87#define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 22) 81#define PC22_PF_SSI1_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 22)
88#define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 23) 82#define PC23_PF_SSI1_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 23)
89#define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 24) 83#define PC24_PF_SSI2_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 24)
90#define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 25) 84#define PC25_PF_SSI2_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 25)
91#define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 26) 85#define PC26_PF_SSI2_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 26)
92#define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 27) 86#define PC27_PF_SSI2_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 27)
93#define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 28) 87#define PC28_PF_SSI3_FS (GPIO_PORTC | GPIO_PF | GPIO_IN | 28)
94#define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 29) 88#define PC29_PF_SSI3_RXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 29)
95#define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 30) 89#define PC30_PF_SSI3_TXD (GPIO_PORTC | GPIO_PF | GPIO_IN | 30)
96#define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 31) 90#define PC31_PF_SSI3_CLK (GPIO_PORTC | GPIO_PF | GPIO_IN | 31)
97#define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17) 91#define PD17_PF_I2C_DATA (GPIO_PORTD | GPIO_PF | GPIO_OUT | 17)
98#define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18) 92#define PD18_PF_I2C_CLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 18)
99#define PD19_PF_CSPI2_SS2 (GPIO_PORTD | GPIO_PF | 19) 93#define PD19_PF_CSPI2_SS2 (GPIO_PORTD | GPIO_PF | 19)
100#define PD20_PF_CSPI2_SS1 (GPIO_PORTD | GPIO_PF | 20) 94#define PD20_PF_CSPI2_SS1 (GPIO_PORTD | GPIO_PF | 20)
101#define PD21_PF_CSPI2_SS0 (GPIO_PORTD | GPIO_PF | 21) 95#define PD21_PF_CSPI2_SS0 (GPIO_PORTD | GPIO_PF | 21)
102#define PD22_PF_CSPI2_SCLK (GPIO_PORTD | GPIO_PF | 22) 96#define PD22_PF_CSPI2_SCLK (GPIO_PORTD | GPIO_PF | 22)
103#define PD23_PF_CSPI2_MISO (GPIO_PORTD | GPIO_PF | 23) 97#define PD23_PF_CSPI2_MISO (GPIO_PORTD | GPIO_PF | 23)
104#define PD24_PF_CSPI2_MOSI (GPIO_PORTD | GPIO_PF | 24) 98#define PD24_PF_CSPI2_MOSI (GPIO_PORTD | GPIO_PF | 24)
105#define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25) 99#define PD25_PF_CSPI1_RDY (GPIO_PORTD | GPIO_PF | GPIO_OUT | 25)
106#define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26) 100#define PD26_PF_CSPI1_SS2 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 26)
107#define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27) 101#define PD27_PF_CSPI1_SS1 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 27)
108#define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28) 102#define PD28_PF_CSPI1_SS0 (GPIO_PORTD | GPIO_PF | GPIO_OUT | 28)
109#define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29) 103#define PD29_PF_CSPI1_SCLK (GPIO_PORTD | GPIO_PF | GPIO_OUT | 29)
110#define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_PF | GPIO_IN | 30) 104#define PD30_PF_CSPI1_MISO (GPIO_PORTD | GPIO_PF | GPIO_IN | 30)
111#define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_PF | GPIO_OUT | 31) 105#define PD31_PF_CSPI1_MOSI (GPIO_PORTD | GPIO_PF | GPIO_OUT | 31)
112#define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 3) 106#define PE3_PF_UART2_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 3)
113#define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 4) 107#define PE4_PF_UART2_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 4)
114#define PE5_PF_PWMO (GPIO_PORTE | GPIO_PF | 5) 108#define PE5_PF_PWMO (GPIO_PORTE | GPIO_PF | 5)
115#define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 6) 109#define PE6_PF_UART2_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 6)
116#define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 7) 110#define PE7_PF_UART2_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 7)
117#define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 8) 111#define PE8_PF_UART3_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 8)
118#define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 9) 112#define PE9_PF_UART3_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 9)
119#define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 10) 113#define PE10_PF_UART3_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 10)
120#define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 11) 114#define PE11_PF_UART3_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 11)
121#define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 12) 115#define PE12_PF_UART1_TXD (GPIO_PORTE | GPIO_PF | GPIO_OUT | 12)
122#define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 13) 116#define PE13_PF_UART1_RXD (GPIO_PORTE | GPIO_PF | GPIO_IN | 13)
123#define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 14) 117#define PE14_PF_UART1_CTS (GPIO_PORTE | GPIO_PF | GPIO_OUT | 14)
124#define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 15) 118#define PE15_PF_UART1_RTS (GPIO_PORTE | GPIO_PF | GPIO_IN | 15)
125#define PE16_PF_RTCK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 16) 119#define PE16_PF_RTCK (GPIO_PORTE | GPIO_PF | GPIO_OUT | 16)
126#define PE17_PF_RESET_OUT (GPIO_PORTE | GPIO_PF | 17) 120#define PE17_PF_RESET_OUT (GPIO_PORTE | GPIO_PF | 17)
127#define PE18_PF_SD1_D0 (GPIO_PORTE | GPIO_PF | 18) 121#define PE18_PF_SD1_D0 (GPIO_PORTE | GPIO_PF | 18)
128#define PE19_PF_SD1_D1 (GPIO_PORTE | GPIO_PF | 19) 122#define PE19_PF_SD1_D1 (GPIO_PORTE | GPIO_PF | 19)
129#define PE20_PF_SD1_D2 (GPIO_PORTE | GPIO_PF | 20) 123#define PE20_PF_SD1_D2 (GPIO_PORTE | GPIO_PF | 20)
130#define PE21_PF_SD1_D3 (GPIO_PORTE | GPIO_PF | 21) 124#define PE21_PF_SD1_D3 (GPIO_PORTE | GPIO_PF | 21)
131#define PE22_PF_SD1_CMD (GPIO_PORTE | GPIO_PF | 22) 125#define PE22_PF_SD1_CMD (GPIO_PORTE | GPIO_PF | 22)
132#define PE23_PF_SD1_CLK (GPIO_PORTE | GPIO_PF | 23) 126#define PE23_PF_SD1_CLK (GPIO_PORTE | GPIO_PF | 23)
133#define PF0_PF_NRFB (GPIO_PORTF | GPIO_PF | 0) 127#define PF0_PF_NRFB (GPIO_PORTF | GPIO_PF | 0)
134#define PF2_PF_NFWP (GPIO_PORTF | GPIO_PF | 2) 128#define PF2_PF_NFWP (GPIO_PORTF | GPIO_PF | 2)
135#define PF4_PF_NFALE (GPIO_PORTF | GPIO_PF | 4) 129#define PF4_PF_NFALE (GPIO_PORTF | GPIO_PF | 4)
136#define PF5_PF_NFRE (GPIO_PORTF | GPIO_PF | 5) 130#define PF5_PF_NFRE (GPIO_PORTF | GPIO_PF | 5)
137#define PF6_PF_NFWE (GPIO_PORTF | GPIO_PF | 6) 131#define PF6_PF_NFWE (GPIO_PORTF | GPIO_PF | 6)
138#define PF15_PF_CLKO (GPIO_PORTF | GPIO_PF | 15) 132#define PF15_PF_CLKO (GPIO_PORTF | GPIO_PF | 15)
139#define PF21_PF_CS4 (GPIO_PORTF | GPIO_PF | 21) 133#define PF21_PF_CS4 (GPIO_PORTF | GPIO_PF | 21)
140#define PF22_PF_CS5 (GPIO_PORTF | GPIO_PF | 22) 134#define PF22_PF_CS5 (GPIO_PORTF | GPIO_PF | 22)
141 135
142/* Alternate GPIO pin functions */ 136/* Alternate GPIO pin functions */
143 137
144#define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 26) 138#define PB26_AF_UART4_RTS (GPIO_PORTB | GPIO_AF | GPIO_IN | 26)
145#define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 28) 139#define PB28_AF_UART4_TXD (GPIO_PORTB | GPIO_AF | GPIO_OUT | 28)
146#define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 29) 140#define PB29_AF_UART4_CTS (GPIO_PORTB | GPIO_AF | GPIO_OUT | 29)
147#define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 31) 141#define PB31_AF_UART4_RXD (GPIO_PORTB | GPIO_AF | GPIO_IN | 31)
148#define PC28_AF_SLCDC2_D0 (GPIO_PORTC | GPIO_AF | 28) 142#define PC28_AF_SLCDC2_D0 (GPIO_PORTC | GPIO_AF | 28)
149#define PC29_AF_SLCDC2_RS (GPIO_PORTC | GPIO_AF | 29) 143#define PC29_AF_SLCDC2_RS (GPIO_PORTC | GPIO_AF | 29)
150#define PC30_AF_SLCDC2_CS (GPIO_PORTC | GPIO_AF | 30) 144#define PC30_AF_SLCDC2_CS (GPIO_PORTC | GPIO_AF | 30)
151#define PC31_AF_SLCDC2_CLK (GPIO_PORTC | GPIO_AF | 31) 145#define PC31_AF_SLCDC2_CLK (GPIO_PORTC | GPIO_AF | 31)
152#define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19) 146#define PD19_AF_USBH2_DATA4 (GPIO_PORTD | GPIO_AF | 19)
153#define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20) 147#define PD20_AF_USBH2_DATA3 (GPIO_PORTD | GPIO_AF | 20)
154#define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21) 148#define PD21_AF_USBH2_DATA6 (GPIO_PORTD | GPIO_AF | 21)
155#define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22) 149#define PD22_AF_USBH2_DATA0 (GPIO_PORTD | GPIO_AF | 22)
156#define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23) 150#define PD23_AF_USBH2_DATA2 (GPIO_PORTD | GPIO_AF | 23)
157#define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24) 151#define PD24_AF_USBH2_DATA1 (GPIO_PORTD | GPIO_AF | 24)
158#define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26) 152#define PD26_AF_USBH2_DATA5 (GPIO_PORTD | GPIO_AF | 26)
159#define PE0_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 0) 153#define PE0_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 0)
160#define PE1_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 1) 154#define PE1_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 1)
161#define PE2_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 2) 155#define PE2_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 2)
162#define PE3_AF_KP_COL7 (GPIO_PORTE | GPIO_AF | 3) 156#define PE3_AF_KP_COL7 (GPIO_PORTE | GPIO_AF | 3)
163#define PE4_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 4) 157#define PE4_AF_KP_ROW7 (GPIO_PORTE | GPIO_AF | 4)
164#define PE6_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 6) 158#define PE6_AF_KP_COL6 (GPIO_PORTE | GPIO_AF | 6)
165#define PE7_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 7) 159#define PE7_AF_KP_ROW6 (GPIO_PORTE | GPIO_AF | 7)
166#define PE16_AF_OWIRE (GPIO_PORTE | GPIO_AF | 16) 160#define PE16_AF_OWIRE (GPIO_PORTE | GPIO_AF | 16)
167#define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_AF | GPIO_IN | 18) 161#define PE18_AF_CSPI3_MISO (GPIO_PORTE | GPIO_AF | GPIO_IN | 18)
168#define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_AF | GPIO_OUT | 21) 162#define PE21_AF_CSPI3_SS (GPIO_PORTE | GPIO_AF | GPIO_OUT | 21)
169#define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_AF | GPIO_OUT | 22) 163#define PE22_AF_CSPI3_MOSI (GPIO_PORTE | GPIO_AF | GPIO_OUT | 22)
170#define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_AF | GPIO_OUT | 23) 164#define PE23_AF_CSPI3_SCLK (GPIO_PORTE | GPIO_AF | GPIO_OUT | 23)
171 165
172/* AIN GPIO pin functions */ 166/* AIN GPIO pin functions */
173 167
174#define PA6_AIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 6) 168#define PA6_AIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 6)
175#define PA7_AIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 7) 169#define PA7_AIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 7)
176#define PA8_AIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 8) 170#define PA8_AIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 8)
177#define PA0_AIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0) 171#define PA0_AIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 0)
178#define PA11_AIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 11) 172#define PA11_AIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 11)
179#define PA13_AIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 13) 173#define PA13_AIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 13)
180#define PA15_AIN_SLCDC1_DAT9 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 15) 174#define PA15_AIN_SLCDC1_DAT9 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 15)
181#define PA17_AIN_SLCDC1_DAT11 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17) 175#define PA17_AIN_SLCDC1_DAT11 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 17)
182#define PA19_AIN_SLCDC1_DAT13 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 19) 176#define PA19_AIN_SLCDC1_DAT13 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 19)
183#define PA21_AIN_SLCDC1_DAT15 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 21) 177#define PA21_AIN_SLCDC1_DAT15 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 21)
184#define PA22_AIN_EXT_DMAGRANT (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 22) 178#define PA22_AIN_EXT_DMAGRANT (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 22)
185#define PA24_AIN_SLCDC1_D0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 24) 179#define PA24_AIN_SLCDC1_D0 (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 24)
186#define PA25_AIN_SLCDC1_RS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 25) 180#define PA25_AIN_SLCDC1_RS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 25)
187#define PA26_AIN_SLCDC1_CS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 26) 181#define PA26_AIN_SLCDC1_CS (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 26)
188#define PA27_AIN_SLCDC1_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 27) 182#define PA27_AIN_SLCDC1_CLK (GPIO_PORTA | GPIO_AIN | GPIO_OUT | 27)
189#define PB6_AIN_SLCDC1_D0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 6) 183#define PB6_AIN_SLCDC1_D0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 6)
190#define PB7_AIN_SLCDC1_RS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 7) 184#define PB7_AIN_SLCDC1_RS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 7)
191#define PB8_AIN_SLCDC1_CS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 8) 185#define PB8_AIN_SLCDC1_CS (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 8)
192#define PB9_AIN_SLCDC1_CLK (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 9) 186#define PB9_AIN_SLCDC1_CLK (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 9)
193#define PB25_AIN_SLCDC1_DAT0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 25) 187#define PB25_AIN_SLCDC1_DAT0 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 25)
194#define PB26_AIN_SLCDC1_DAT1 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 26) 188#define PB26_AIN_SLCDC1_DAT1 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 26)
195#define PB27_AIN_SLCDC1_DAT2 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 27) 189#define PB27_AIN_SLCDC1_DAT2 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 27)
196#define PB28_AIN_SLCDC1_DAT3 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 28) 190#define PB28_AIN_SLCDC1_DAT3 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 28)
197#define PB29_AIN_SLCDC1_DAT4 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 29) 191#define PB29_AIN_SLCDC1_DAT4 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 29)
198#define PB30_AIN_SLCDC1_DAT5 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 30) 192#define PB30_AIN_SLCDC1_DAT5 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 30)
199#define PB31_AIN_SLCDC1_DAT6 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 31) 193#define PB31_AIN_SLCDC1_DAT6 (GPIO_PORTB | GPIO_AIN | GPIO_OUT | 31)
200#define PC5_AIN_SLCDC1_DAT7 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 5) 194#define PC5_AIN_SLCDC1_DAT7 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 5)
201#define PC6_AIN_SLCDC1_DAT8 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 6) 195#define PC6_AIN_SLCDC1_DAT8 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 6)
202#define PC7_AIN_SLCDC1_DAT9 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 7) 196#define PC7_AIN_SLCDC1_DAT9 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 7)
203#define PC8_AIN_SLCDC1_DAT10 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 8) 197#define PC8_AIN_SLCDC1_DAT10 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 8)
204#define PC9_AIN_SLCDC1_DAT11 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 9) 198#define PC9_AIN_SLCDC1_DAT11 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 9)
205#define PC10_AIN_SLCDC1_DAT12 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 10) 199#define PC10_AIN_SLCDC1_DAT12 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 10)
206#define PC11_AIN_SLCDC1_DAT13 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 11) 200#define PC11_AIN_SLCDC1_DAT13 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 11)
207#define PC12_AIN_SLCDC1_DAT14 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 12) 201#define PC12_AIN_SLCDC1_DAT14 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 12)
208#define PC13_AIN_SLCDC1_DAT15 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 13) 202#define PC13_AIN_SLCDC1_DAT15 (GPIO_PORTC | GPIO_AIN | GPIO_OUT | 13)
209#define PE5_AIN_PC_SPKOUT (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 5) 203#define PE5_AIN_PC_SPKOUT (GPIO_PORTE | GPIO_AIN | GPIO_OUT | 5)
210 204
211/* BIN GPIO pin functions */ 205/* BIN GPIO pin functions */
212 206
213#define PE5_BIN_TOUT2 (GPIO_PORTE | GPIO_BIN | GPIO_OUT | 5) 207#define PE5_BIN_TOUT2 (GPIO_PORTE | GPIO_BIN | GPIO_OUT | 5)
214 208
215/* CIN GPIO pin functions */ 209/* CIN GPIO pin functions */
216 210
217#define PA14_CIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 14) 211#define PA14_CIN_SLCDC1_DAT0 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 14)
218#define PA15_CIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 15) 212#define PA15_CIN_SLCDC1_DAT1 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 15)
219#define PA16_CIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 16) 213#define PA16_CIN_SLCDC1_DAT2 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 16)
220#define PA17_CIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 17) 214#define PA17_CIN_SLCDC1_DAT3 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 17)
221#define PA18_CIN_SLCDC1_DAT4 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 18) 215#define PA18_CIN_SLCDC1_DAT4 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 18)
222#define PA19_CIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 19) 216#define PA19_CIN_SLCDC1_DAT5 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 19)
223#define PA20_CIN_SLCDC1_DAT6 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 20) 217#define PA20_CIN_SLCDC1_DAT6 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 20)
224#define PA21_CIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 21) 218#define PA21_CIN_SLCDC1_DAT7 (GPIO_PORTA | GPIO_CIN | GPIO_OUT | 21)
225#define PB30_CIN_UART4_CTS (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 30) 219#define PB30_CIN_UART4_CTS (GPIO_PORTB | GPIO_CIN | GPIO_OUT | 30)
226#define PE5_CIN_TOUT3 (GPIO_PORTE | GPIO_CIN | GPIO_OUT | 5) 220#define PE5_CIN_TOUT3 (GPIO_PORTE | GPIO_CIN | GPIO_OUT | 5)
227 221
228/* AOUT GPIO pin functions */ 222/* AOUT GPIO pin functions */
229 223
230#define PB29_AOUT_UART4_RXD (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 29) 224#define PB29_AOUT_UART4_RXD (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 29)
231#define PB31_AOUT_UART4_RTS (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 31) 225#define PB31_AOUT_UART4_RTS (GPIO_PORTB | GPIO_AOUT | GPIO_IN | 31)
232#define PC8_AOUT_USBOTG_TXR_INT (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 8) 226#define PC8_AOUT_USBOTG_TXR_INT (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 8)
233#define PC15_AOUT_WKGD (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 15) 227#define PC15_AOUT_WKGD (GPIO_PORTC | GPIO_AOUT | GPIO_IN | 15)
234#define PF21_AOUT_DTACK (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 21) 228#define PF21_AOUT_DTACK (GPIO_PORTF | GPIO_AOUT | GPIO_IN | 21)
235
236 229
237#endif 230#endif /* ifndef __MACH_IOMUX_MX2x_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx3.h b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
index e1fc6da1cd10..e51465d7b224 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx3.h
@@ -16,12 +16,10 @@
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA. 17 * MA 02110-1301, USA.
18 */ 18 */
19 19#ifndef __MACH_IOMUX_MX3_H__
20#ifndef __MACH_MX31_IOMUX_H__ 20#define __MACH_IOMUX_MX3_H__
21#define __MACH_MX31_IOMUX_H__
22 21
23#include <linux/types.h> 22#include <linux/types.h>
24
25/* 23/*
26 * various IOMUX output functions 24 * various IOMUX output functions
27 */ 25 */
@@ -34,7 +32,7 @@
34#define IOMUX_OCONFIG_ALT4 (5 << 4) /* used as alternate function 4 */ 32#define IOMUX_OCONFIG_ALT4 (5 << 4) /* used as alternate function 4 */
35#define IOMUX_OCONFIG_ALT5 (6 << 4) /* used as alternate function 5 */ 33#define IOMUX_OCONFIG_ALT5 (6 << 4) /* used as alternate function 5 */
36#define IOMUX_OCONFIG_ALT6 (7 << 4) /* used as alternate function 6 */ 34#define IOMUX_OCONFIG_ALT6 (7 << 4) /* used as alternate function 6 */
37#define IOMUX_ICONFIG_NONE 0 /* not configured for input */ 35#define IOMUX_ICONFIG_NONE 0 /* not configured for input */
38#define IOMUX_ICONFIG_GPIO 1 /* used as GPIO */ 36#define IOMUX_ICONFIG_GPIO 1 /* used as GPIO */
39#define IOMUX_ICONFIG_FUNC 2 /* used as function */ 37#define IOMUX_ICONFIG_FUNC 2 /* used as function */
40#define IOMUX_ICONFIG_ALT1 4 /* used as alternate function 1 */ 38#define IOMUX_ICONFIG_ALT1 4 /* used as alternate function 1 */
@@ -167,11 +165,6 @@ int mxc_iomux_mode(unsigned int pin_mode);
167 MXC_GPIO_IRQ_START) 165 MXC_GPIO_IRQ_START)
168 166
169/* 167/*
170 * The number of gpio devices among the pads
171 */
172#define GPIO_PORT_MAX 3
173
174/*
175 * This enumeration is constructed based on the Section 168 * This enumeration is constructed based on the Section
176 * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated 169 * "sw_pad_ctl & sw_mux_ctl details" of the MX31 IC Spec. Each enumerated
177 * value is constructed based on the rules described above. 170 * value is constructed based on the rules described above.
@@ -633,40 +626,40 @@ enum iomux_pins {
633#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO) 626#define MX31_PIN_TXD2__GPIO1_28 IOMUX_MODE(MX31_PIN_TXD2, IOMUX_CONFIG_GPIO)
634#define MX31_PIN_CSI_D4__GPIO3_4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_GPIO) 627#define MX31_PIN_CSI_D4__GPIO3_4 IOMUX_MODE(MX31_PIN_CSI_D4, IOMUX_CONFIG_GPIO)
635#define MX31_PIN_CSI_D5__GPIO3_5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO) 628#define MX31_PIN_CSI_D5__GPIO3_5 IOMUX_MODE(MX31_PIN_CSI_D5, IOMUX_CONFIG_GPIO)
636#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC) 629#define MX31_PIN_USBOTG_DATA0__USBOTG_DATA0 IOMUX_MODE(MX31_PIN_USBOTG_DATA0, IOMUX_CONFIG_FUNC)
637#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC) 630#define MX31_PIN_USBOTG_DATA1__USBOTG_DATA1 IOMUX_MODE(MX31_PIN_USBOTG_DATA1, IOMUX_CONFIG_FUNC)
638#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC) 631#define MX31_PIN_USBOTG_DATA2__USBOTG_DATA2 IOMUX_MODE(MX31_PIN_USBOTG_DATA2, IOMUX_CONFIG_FUNC)
639#define MX31_PIN_USBOTG_DATA3__USBOTG_DATA3 IOMUX_MODE(MX31_PIN_USBOTG_DATA3, IOMUX_CONFIG_FUNC) 632#define MX31_PIN_USBOTG_DATA3__USBOTG_DATA3 IOMUX_MODE(MX31_PIN_USBOTG_DATA3, IOMUX_CONFIG_FUNC)
640#define MX31_PIN_USBOTG_DATA4__USBOTG_DATA4 IOMUX_MODE(MX31_PIN_USBOTG_DATA4, IOMUX_CONFIG_FUNC) 633#define MX31_PIN_USBOTG_DATA4__USBOTG_DATA4 IOMUX_MODE(MX31_PIN_USBOTG_DATA4, IOMUX_CONFIG_FUNC)
641#define MX31_PIN_USBOTG_DATA5__USBOTG_DATA5 IOMUX_MODE(MX31_PIN_USBOTG_DATA5, IOMUX_CONFIG_FUNC) 634#define MX31_PIN_USBOTG_DATA5__USBOTG_DATA5 IOMUX_MODE(MX31_PIN_USBOTG_DATA5, IOMUX_CONFIG_FUNC)
642#define MX31_PIN_USBOTG_DATA6__USBOTG_DATA6 IOMUX_MODE(MX31_PIN_USBOTG_DATA6, IOMUX_CONFIG_FUNC) 635#define MX31_PIN_USBOTG_DATA6__USBOTG_DATA6 IOMUX_MODE(MX31_PIN_USBOTG_DATA6, IOMUX_CONFIG_FUNC)
643#define MX31_PIN_USBOTG_DATA7__USBOTG_DATA7 IOMUX_MODE(MX31_PIN_USBOTG_DATA7, IOMUX_CONFIG_FUNC) 636#define MX31_PIN_USBOTG_DATA7__USBOTG_DATA7 IOMUX_MODE(MX31_PIN_USBOTG_DATA7, IOMUX_CONFIG_FUNC)
644#define MX31_PIN_USBOTG_CLK__USBOTG_CLK IOMUX_MODE(MX31_PIN_USBOTG_CLK, IOMUX_CONFIG_FUNC) 637#define MX31_PIN_USBOTG_CLK__USBOTG_CLK IOMUX_MODE(MX31_PIN_USBOTG_CLK, IOMUX_CONFIG_FUNC)
645#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC) 638#define MX31_PIN_USBOTG_DIR__USBOTG_DIR IOMUX_MODE(MX31_PIN_USBOTG_DIR, IOMUX_CONFIG_FUNC)
646#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC) 639#define MX31_PIN_USBOTG_NXT__USBOTG_NXT IOMUX_MODE(MX31_PIN_USBOTG_NXT, IOMUX_CONFIG_FUNC)
647#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC) 640#define MX31_PIN_USBOTG_STP__USBOTG_STP IOMUX_MODE(MX31_PIN_USBOTG_STP, IOMUX_CONFIG_FUNC)
648#define MX31_PIN_CSPI1_MOSI__USBH1_RXDM IOMUX_MODE(MX31_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT1) 641#define MX31_PIN_CSPI1_MOSI__USBH1_RXDM IOMUX_MODE(MX31_PIN_CSPI1_MOSI, IOMUX_CONFIG_ALT1)
649#define MX31_PIN_CSPI1_MISO__USBH1_RXDP IOMUX_MODE(MX31_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT1) 642#define MX31_PIN_CSPI1_MISO__USBH1_RXDP IOMUX_MODE(MX31_PIN_CSPI1_MISO, IOMUX_CONFIG_ALT1)
650#define MX31_PIN_CSPI1_SS0__USBH1_TXDM IOMUX_MODE(MX31_PIN_CSPI1_SS0, IOMUX_CONFIG_ALT1) 643#define MX31_PIN_CSPI1_SS0__USBH1_TXDM IOMUX_MODE(MX31_PIN_CSPI1_SS0, IOMUX_CONFIG_ALT1)
651#define MX31_PIN_CSPI1_SS1__USBH1_TXDP IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_ALT1) 644#define MX31_PIN_CSPI1_SS1__USBH1_TXDP IOMUX_MODE(MX31_PIN_CSPI1_SS1, IOMUX_CONFIG_ALT1)
652#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1) 645#define MX31_PIN_CSPI1_SS2__USBH1_RCV IOMUX_MODE(MX31_PIN_CSPI1_SS2, IOMUX_CONFIG_ALT1)
653#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1) 646#define MX31_PIN_CSPI1_SCLK__USBH1_OEB IOMUX_MODE(MX31_PIN_CSPI1_SCLK, IOMUX_CONFIG_ALT1)
654#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1) 647#define MX31_PIN_CSPI1_SPI_RDY__USBH1_FS IOMUX_MODE(MX31_PIN_CSPI1_SPI_RDY, IOMUX_CONFIG_ALT1)
655#define MX31_PIN_SFS6__USBH1_SUSPEND IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_FUNC) 648#define MX31_PIN_SFS6__USBH1_SUSPEND IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_FUNC)
656#define MX31_PIN_NFRE_B__GPIO1_11 IOMUX_MODE(MX31_PIN_NFRE_B, IOMUX_CONFIG_GPIO) 649#define MX31_PIN_NFRE_B__GPIO1_11 IOMUX_MODE(MX31_PIN_NFRE_B, IOMUX_CONFIG_GPIO)
657#define MX31_PIN_NFALE__GPIO1_12 IOMUX_MODE(MX31_PIN_NFALE, IOMUX_CONFIG_GPIO) 650#define MX31_PIN_NFALE__GPIO1_12 IOMUX_MODE(MX31_PIN_NFALE, IOMUX_CONFIG_GPIO)
658#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC) 651#define MX31_PIN_USBH2_DATA0__USBH2_DATA0 IOMUX_MODE(MX31_PIN_USBH2_DATA0, IOMUX_CONFIG_FUNC)
659#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC) 652#define MX31_PIN_USBH2_DATA1__USBH2_DATA1 IOMUX_MODE(MX31_PIN_USBH2_DATA1, IOMUX_CONFIG_FUNC)
660#define MX31_PIN_STXD3__USBH2_DATA2 IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC) 653#define MX31_PIN_STXD3__USBH2_DATA2 IOMUX_MODE(MX31_PIN_STXD3, IOMUX_CONFIG_FUNC)
661#define MX31_PIN_SRXD3__USBH2_DATA3 IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC) 654#define MX31_PIN_SRXD3__USBH2_DATA3 IOMUX_MODE(MX31_PIN_SRXD3, IOMUX_CONFIG_FUNC)
662#define MX31_PIN_SCK3__USBH2_DATA4 IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC) 655#define MX31_PIN_SCK3__USBH2_DATA4 IOMUX_MODE(MX31_PIN_SCK3, IOMUX_CONFIG_FUNC)
663#define MX31_PIN_SFS3__USBH2_DATA5 IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC) 656#define MX31_PIN_SFS3__USBH2_DATA5 IOMUX_MODE(MX31_PIN_SFS3, IOMUX_CONFIG_FUNC)
664#define MX31_PIN_STXD6__USBH2_DATA6 IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC) 657#define MX31_PIN_STXD6__USBH2_DATA6 IOMUX_MODE(MX31_PIN_STXD6, IOMUX_CONFIG_FUNC)
665#define MX31_PIN_SRXD6__USBH2_DATA7 IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC) 658#define MX31_PIN_SRXD6__USBH2_DATA7 IOMUX_MODE(MX31_PIN_SRXD6, IOMUX_CONFIG_FUNC)
666#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC) 659#define MX31_PIN_USBH2_CLK__USBH2_CLK IOMUX_MODE(MX31_PIN_USBH2_CLK, IOMUX_CONFIG_FUNC)
667#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC) 660#define MX31_PIN_USBH2_DIR__USBH2_DIR IOMUX_MODE(MX31_PIN_USBH2_DIR, IOMUX_CONFIG_FUNC)
668#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC) 661#define MX31_PIN_USBH2_NXT__USBH2_NXT IOMUX_MODE(MX31_PIN_USBH2_NXT, IOMUX_CONFIG_FUNC)
669#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC) 662#define MX31_PIN_USBH2_STP__USBH2_STP IOMUX_MODE(MX31_PIN_USBH2_STP, IOMUX_CONFIG_FUNC)
670#define MX31_PIN_SCK6__GPIO1_25 IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO) 663#define MX31_PIN_SCK6__GPIO1_25 IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO)
671#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO) 664#define MX31_PIN_USB_OC__GPIO1_30 IOMUX_MODE(MX31_PIN_USB_OC, IOMUX_CONFIG_GPIO)
672#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC) 665#define MX31_PIN_I2C_DAT__I2C1_SDA IOMUX_MODE(MX31_PIN_I2C_DAT, IOMUX_CONFIG_FUNC)
@@ -711,8 +704,8 @@ enum iomux_pins {
711#define MX31_PIN_DSR_DCE1__GPIO2_9 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_GPIO) 704#define MX31_PIN_DSR_DCE1__GPIO2_9 IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_GPIO)
712#define MX31_PIN_RI_DCE1__GPIO2_10 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_GPIO) 705#define MX31_PIN_RI_DCE1__GPIO2_10 IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_GPIO)
713#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO) 706#define MX31_PIN_DCD_DCE1__GPIO2_11 IOMUX_MODE(MX31_PIN_DCD_DCE1, IOMUX_CONFIG_GPIO)
714#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO) 707#define MX31_PIN_STXD5__GPIO1_21 IOMUX_MODE(MX31_PIN_STXD5, IOMUX_CONFIG_GPIO)
715#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO) 708#define MX31_PIN_SRXD5__GPIO1_22 IOMUX_MODE(MX31_PIN_SRXD5, IOMUX_CONFIG_GPIO)
716#define MX31_PIN_GPIO1_3__GPIO1_3 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO) 709#define MX31_PIN_GPIO1_3__GPIO1_3 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO)
717#define MX31_PIN_CSPI2_SS1__CSPI3_SS1 IOMUX_MODE(MX31_PIN_CSPI2_SS1, IOMUX_CONFIG_ALT1) 710#define MX31_PIN_CSPI2_SS1__CSPI3_SS1 IOMUX_MODE(MX31_PIN_CSPI2_SS1, IOMUX_CONFIG_ALT1)
718#define MX31_PIN_RTS1__GPIO2_6 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO) 711#define MX31_PIN_RTS1__GPIO2_6 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO)
@@ -727,13 +720,14 @@ enum iomux_pins {
727#define MX31_PIN_SCK5__SCK5 IOMUX_MODE(MX31_PIN_SCK5, IOMUX_CONFIG_FUNC) 720#define MX31_PIN_SCK5__SCK5 IOMUX_MODE(MX31_PIN_SCK5, IOMUX_CONFIG_FUNC)
728#define MX31_PIN_SFS5__SFS5 IOMUX_MODE(MX31_PIN_SFS5, IOMUX_CONFIG_FUNC) 721#define MX31_PIN_SFS5__SFS5 IOMUX_MODE(MX31_PIN_SFS5, IOMUX_CONFIG_FUNC)
729 722
730/*XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed by cspi2_ss0, cspi2_ss1, cspi1_ss0 723/*
731 * cspi1_ss1*/ 724 * XXX: The SS0, SS1, SS2, SS3 lines of spi3 are multiplexed with cspi2_ss0,
725 * cspi2_ss1, cspi1_ss0 cspi1_ss1
726 */
732 727
733/* 728/*
734 * This function configures the pad value for a IOMUX pin. 729 * This function configures the pad value for a IOMUX pin.
735 */ 730 */
736void mxc_iomux_set_pad(enum iomux_pins, u32); 731void mxc_iomux_set_pad(enum iomux_pins, u32);
737 732
738#endif 733#endif /* ifndef __MACH_IOMUX_MX3_H__ */
739
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx35.h b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
index c88d40795f7a..2a24bae1b878 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx35.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx35.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de> 2 * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH <armlinux@phytec.de>
3 * 3 *
4 * This program is free software; you can redistribute it and/or 4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License 5 * modify it under the terms of the GNU General Public License
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
new file mode 100644
index 000000000000..b4f975e6a665
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
@@ -0,0 +1,326 @@
1/*
2 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12#ifndef __MACH_IOMUX_MX51_H__
13#define __MACH_IOMUX_MX51_H__
14
15#include <mach/iomux-v3.h>
16
17/*
18 * various IOMUX alternate output functions (1-7)
19 */
20typedef enum iomux_config {
21 IOMUX_CONFIG_ALT0,
22 IOMUX_CONFIG_ALT1,
23 IOMUX_CONFIG_ALT2,
24 IOMUX_CONFIG_ALT3,
25 IOMUX_CONFIG_ALT4,
26 IOMUX_CONFIG_ALT5,
27 IOMUX_CONFIG_ALT6,
28 IOMUX_CONFIG_ALT7,
29 IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */
30 IOMUX_CONFIG_SION = 0x1 << 4, /* LOOPBACK:MUX SION bit */
31} iomux_pin_cfg_t;
32
33/* Pad control groupings */
34#define MX51_UART1_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_PKE | PAD_CTL_PUE | \
35 PAD_CTL_DSE_HIGH)
36#define MX51_UART2_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_DSE_HIGH | \
37 PAD_CTL_SRE_FAST)
38#define MX51_UART3_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_DSE_HIGH | \
39 PAD_CTL_SRE_FAST)
40
41/*
42 * The naming convention for the pad modes is MX51_PAD_<padname>__<padmode>
43 * If <padname> or <padmode> refers to a GPIO, it is named
44 * GPIO_<unit>_<num> see also iomux-v3.h
45 */
46
47/*
48 * FIXME: This was converted using scripts from existing Freescale code to
49 * this form used upstream. Need to verify the name format.
50 */
51
52/* PAD MUX ALT INPSE PATH PADCTRL */
53
54#define MX51_PAD_GPIO_2_0__EIM_D16 IOMUX_PAD(0x3f0, 0x05c, 1, 0x0, 0, NO_PAD_CTRL)
55#define MX51_PAD_GPIO_2_1__EIM_D17 IOMUX_PAD(0x3f4, 0x060, 1, 0x0, 0, NO_PAD_CTRL)
56#define MX51_PAD_GPIO_2_2__EIM_D18 IOMUX_PAD(0x3f8, 0x064, 1, 0x0, 0, NO_PAD_CTRL)
57#define MX51_PAD_GPIO_2_3__EIM_D19 IOMUX_PAD(0x3fc, 0x068, 1, 0x0, 0, NO_PAD_CTRL)
58#define MX51_PAD_GPIO_2_4__EIM_D20 IOMUX_PAD(0x400, 0x06c, 1, 0x0, 0, NO_PAD_CTRL)
59#define MX51_PAD_GPIO_2_5__EIM_D21 IOMUX_PAD(0x404, 0x070, 1, 0x0, 0, NO_PAD_CTRL)
60#define MX51_PAD_GPIO_2_6__EIM_D22 IOMUX_PAD(0x408, 0x074, 1, 0x0, 0, NO_PAD_CTRL)
61#define MX51_PAD_GPIO_2_7__EIM_D23 IOMUX_PAD(0x40c, 0x078, 1, 0x0, 0, NO_PAD_CTRL)
62
63/* Babbage UART3 */
64#define MX51_PAD_EIM_D24__UART3_CTS IOMUX_PAD(0x410, 0x07c, IOMUX_CONFIG_ALT3, 0x0, 0, MX51_UART3_PAD_CTRL)
65#define MX51_PAD_EIM_D25__UART3_RXD IOMUX_PAD(0x414, 0x080, IOMUX_CONFIG_ALT3, 0x9f4, 0, MX51_UART3_PAD_CTRL)
66#define MX51_PAD_EIM_D26__UART3_TXD IOMUX_PAD(0x418, 0x084, IOMUX_CONFIG_ALT3, 0x0, 0, MX51_UART3_PAD_CTRL)
67#define MX51_PAD_EIM_D27__UART3_RTS IOMUX_PAD(0x41c, 0x088, IOMUX_CONFIG_ALT3, 0x9f0, 0, MX51_UART3_PAD_CTRL)
68
69#define MX51_PAD_EIM_D28__EIM_D28 IOMUX_PAD(0x420, 0x08c, 0, 0x0, 0, NO_PAD_CTRL)
70#define MX51_PAD_EIM_D29__EIM_D29 IOMUX_PAD(0x424, 0x090, 0, 0x0, 0, NO_PAD_CTRL)
71#define MX51_PAD_EIM_D30__EIM_D30 IOMUX_PAD(0x428, 0x094, 0, 0x0, 0, NO_PAD_CTRL)
72#define MX51_PAD_EIM_D31__EIM_D31 IOMUX_PAD(0x42c, 0x09c, 0, 0x0, 0, NO_PAD_CTRL)
73
74#define MX51_PAD_GPIO_2_10__EIM_A16 IOMUX_PAD(0x430, 0x09c, 1, 0x0, 0, NO_PAD_CTRL)
75#define MX51_PAD_GPIO_2_11__EIM_A17 IOMUX_PAD(0x434, 0x0a0, 1, 0x0, 0, NO_PAD_CTRL)
76#define MX51_PAD_GPIO_2_12__EIM_A18 IOMUX_PAD(0x438, 0x0a4, 1, 0x0, 0, NO_PAD_CTRL)
77#define MX51_PAD_GPIO_2_13__EIM_A19 IOMUX_PAD(0x43c, 0x0a8, 1, 0x0, 0, NO_PAD_CTRL)
78#define MX51_PAD_GPIO_2_14__EIM_A20 IOMUX_PAD(0x440, 0x0ac, 1, 0x0, 0, NO_PAD_CTRL)
79#define MX51_PAD_GPIO_2_15__EIM_A21 IOMUX_PAD(0x444, 0x0b0, 1, 0x0, 0, NO_PAD_CTRL)
80#define MX51_PAD_GPIO_2_16__EIM_A22 IOMUX_PAD(0x448, 0x0b4, 1, 0x0, 0, NO_PAD_CTRL)
81#define MX51_PAD_GPIO_2_17__EIM_A23 IOMUX_PAD(0x44c, 0x0b8, 1, 0x0, 0, NO_PAD_CTRL)
82
83#define MX51_PAD_GPIO_2_18__EIM_A24 IOMUX_PAD(0x450, 0x0bc, 1, 0x0, 0, NO_PAD_CTRL)
84#define MX51_PAD_GPIO_2_19__EIM_A25 IOMUX_PAD(0x454, 0x0c0, 1, 0x0, 0, NO_PAD_CTRL)
85#define MX51_PAD_GPIO_2_20__EIM_A26 IOMUX_PAD(0x458, 0x0c4, 1, 0x0, 0, NO_PAD_CTRL)
86#define MX51_PAD_GPIO_2_21__EIM_A27 IOMUX_PAD(0x45c, 0x0c8, 1, 0x0, 0, NO_PAD_CTRL)
87#define MX51_PAD_EIM_EB0__EIM_EB0 IOMUX_PAD(0x460, 0x0cc, 0, 0x0, 0, NO_PAD_CTRL)
88#define MX51_PAD_EIM_EB1__EIM_EB1 IOMUX_PAD(0x464, 0x0d0, 0, 0x0, 0, NO_PAD_CTRL)
89#define MX51_PAD_GPIO_2_22__EIM_EB2 IOMUX_PAD(0x468, 0x0d4, 1, 0x0, 0, NO_PAD_CTRL)
90#define MX51_PAD_GPIO_2_23__EIM_EB3 IOMUX_PAD(0x46c, 0x0d8, 1, 0x0, 0, NO_PAD_CTRL)
91
92#define MX51_PAD_GPIO_2_24__EIM_OE IOMUX_PAD(0x470, 0x0dc, 1, 0x0, 0, NO_PAD_CTRL)
93#define MX51_PAD_GPIO_2_25__EIM_CS0 IOMUX_PAD(0x474, 0x0e0, 1, 0x0, 0, NO_PAD_CTRL)
94#define MX51_PAD_GPIO_2_26__EIM_CS1 IOMUX_PAD(0x478, 0x0e4, 1, 0x0, 0, NO_PAD_CTRL)
95#define MX51_PAD_GPIO_2_27__EIM_CS2 IOMUX_PAD(0x47c, 0x0e8, 1, 0x0, 0, NO_PAD_CTRL)
96#define MX51_PAD_GPIO_2_28__EIM_CS3 IOMUX_PAD(0x480, 0x0ec, 1, 0x0, 0, NO_PAD_CTRL)
97#define MX51_PAD_GPIO_2_29__EIM_CS4 IOMUX_PAD(0x484, 0x0f0, 1, 0x0, 0, NO_PAD_CTRL)
98#define MX51_PAD_GPIO_2_30__EIM_CS5 IOMUX_PAD(0x488, 0x0f4, 1, 0x0, 0, NO_PAD_CTRL)
99#define MX51_PAD_GPIO_2_31__EIM_DTACK IOMUX_PAD(0x48c, 0x0f8, 1, 0x0, 0, NO_PAD_CTRL)
100
101#define MX51_PAD_GPIO_3_1__EIM_LBA IOMUX_PAD(0x494, 0xFC, 1, 0x0, 0, NO_PAD_CTRL)
102#define MX51_PAD_GPIO_3_2__EIM_CRE IOMUX_PAD(0x4A0, 0x100, 1, 0x0, 0, NO_PAD_CTRL)
103#define MX51_PAD_DRAM_CS1__DRAM_CS1 IOMUX_PAD(0x4D0, 0x104, 0, 0x0, 0, NO_PAD_CTRL)
104#define MX51_PAD_GPIO_3_3__NANDF_WE_B IOMUX_PAD(0x4E4, 0x108, 3, 0x0, 0, NO_PAD_CTRL)
105#define MX51_PAD_GPIO_3_4__NANDF_RE_B IOMUX_PAD(0x4E8, 0x10C, 3, 0x0, 0, NO_PAD_CTRL)
106#define MX51_PAD_GPIO_3_5__NANDF_ALE IOMUX_PAD(0x4EC, 0x110, 3, 0x0, 0, NO_PAD_CTRL)
107#define MX51_PAD_GPIO_3_6__NANDF_CLE IOMUX_PAD(0x4F0, 0x114, 3, 0x0, 0, NO_PAD_CTRL)
108#define MX51_PAD_GPIO_3_7__NANDF_WP_B IOMUX_PAD(0x4F4, 0x118, 3, 0x0, 0, NO_PAD_CTRL)
109#define MX51_PAD_GPIO_3_8__NANDF_RB0 IOMUX_PAD(0x4F8, 0x11C, 3, 0x0, 0, NO_PAD_CTRL)
110#define MX51_PAD_GPIO_3_9__NANDF_RB1 IOMUX_PAD(0x4FC, 0x120, 3, 0x0, 0, NO_PAD_CTRL)
111#define MX51_PAD_GPIO_3_10__NANDF_RB2 IOMUX_PAD(0x500, 0x124, 3, 0x0, 0, NO_PAD_CTRL)
112#define MX51_PAD_GPIO_3_11__NANDF_RB3 IOMUX_PAD(0x504, 0x128, 3, 0x0, 0, NO_PAD_CTRL)
113#define MX51_PAD_GPIO_3_12__GPIO_NAND IOMUX_PAD(0x514, 0x12C, 3, 0x0, 0, NO_PAD_CTRL)
114/* REVISIT: Not sure of these values
115
116 #define MX51_PAD_GPIO_1___NANDF_RB4 IOMUX_PAD(, , , 0x0, 0, NO_PAD_CTRL)
117 #define MX51_PAD_GPIO_3_13__NANDF_RB5 IOMUX_PAD(0x5D8, 0x130, 3, 0x0, 0, NO_PAD_CTRL)
118 #define MX51_PAD_GPIO_3_15__NANDF_RB7 IOMUX_PAD(0x5E0, 0x138, 3, 0x0, 0, NO_PAD_CTRL)
119*/
120#define MX51_PAD_GPIO_3_14__NANDF_RB6 IOMUX_PAD(0x5DC, 0x134, 3, 0x0, 0, NO_PAD_CTRL)
121#define MX51_PAD_GPIO_3_16__NANDF_CS0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, NO_PAD_CTRL)
122#define MX51_PAD_GPIO_3_17__NANDF_CS1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, NO_PAD_CTRL)
123#define MX51_PAD_GPIO_3_18__NANDF_CS2 IOMUX_PAD(0x520, 0x138, 3, 0x0, 0, NO_PAD_CTRL)
124#define MX51_PAD_GPIO_3_19__NANDF_CS3 IOMUX_PAD(0x524, 0x13C, 3, 0x0, 0, NO_PAD_CTRL)
125#define MX51_PAD_GPIO_3_20__NANDF_CS4 IOMUX_PAD(0x528, 0x140, 3, 0x0, 0, NO_PAD_CTRL)
126#define MX51_PAD_GPIO_3_21__NANDF_CS5 IOMUX_PAD(0x52C, 0x144, 3, 0x0, 0, NO_PAD_CTRL)
127#define MX51_PAD_GPIO_3_22__NANDF_CS6 IOMUX_PAD(0x530, 0x148, 3, 0x0, 0, NO_PAD_CTRL)
128#define MX51_PAD_GPIO_3_23__NANDF_CS7 IOMUX_PAD(0x534, 0x14C, 3, 0x0, 0, NO_PAD_CTRL)
129#define MX51_PAD_GPIO_3_24__NANDF_RDY_INT IOMUX_PAD(0x538, 0x150, 3, 0x0, 0, NO_PAD_CTRL)
130#define MX51_PAD_GPIO_3_25__NANDF_D15 IOMUX_PAD(0x53C, 0x154, 3, 0x0, 0, NO_PAD_CTRL)
131#define MX51_PAD_GPIO_3_26__NANDF_D14 IOMUX_PAD(0x540, 0x158, 3, 0x0, 0, NO_PAD_CTRL)
132#define MX51_PAD_GPIO_3_27__NANDF_D13 IOMUX_PAD(0x544, 0x15C, 3, 0x0, 0, NO_PAD_CTRL)
133#define MX51_PAD_GPIO_3_28__NANDF_D12 IOMUX_PAD(0x548, 0x160, 3, 0x0, 0, NO_PAD_CTRL)
134#define MX51_PAD_GPIO_3_29__NANDF_D11 IOMUX_PAD(0x54C, 0x164, 3, 0x0, 0, NO_PAD_CTRL)
135#define MX51_PAD_GPIO_3_30__NANDF_D10 IOMUX_PAD(0x550, 0x168, 3, 0x0, 0, NO_PAD_CTRL)
136#define MX51_PAD_GPIO_3_31__NANDF_D9 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, NO_PAD_CTRL)
137#define MX51_PAD_GPIO_4_0__NANDF_D8 IOMUX_PAD(0x558, 0x170, 3, 0x0, 0, NO_PAD_CTRL)
138#define MX51_PAD_GPIO_4_1__NANDF_D7 IOMUX_PAD(0x55C, 0x174, 3, 0x0, 0, NO_PAD_CTRL)
139#define MX51_PAD_GPIO_4_2__NANDF_D6 IOMUX_PAD(0x560, 0x178, 3, 0x0, 0, NO_PAD_CTRL)
140#define MX51_PAD_GPIO_4_3__NANDF_D5 IOMUX_PAD(0x564, 0x17C, 3, 0x0, 0, NO_PAD_CTRL)
141#define MX51_PAD_GPIO_4_4__NANDF_D4 IOMUX_PAD(0x568, 0x180, 3, 0x0, 0, NO_PAD_CTRL)
142#define MX51_PAD_GPIO_4_5__NANDF_D3 IOMUX_PAD(0x56C, 0x184, 3, 0x0, 0, NO_PAD_CTRL)
143#define MX51_PAD_GPIO_4_6__NANDF_D2 IOMUX_PAD(0x570, 0x188, 3, 0x0, 0, NO_PAD_CTRL)
144#define MX51_PAD_GPIO_4_7__NANDF_D1 IOMUX_PAD(0x574, 0x18C, 3, 0x0, 0, NO_PAD_CTRL)
145#define MX51_PAD_GPIO_4_8__NANDF_D0 IOMUX_PAD(0x578, 0x190, 3, 0x0, 0, NO_PAD_CTRL)
146#define MX51_PAD_GPIO_3_12__CSI1_D8 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, NO_PAD_CTRL)
147#define MX51_PAD_GPIO_3_13__CSI1_D9 IOMUX_PAD(0x580, 0x198, 3, 0x0, 0, NO_PAD_CTRL)
148#define MX51_PAD_CSI1_D10__CSI1_D10 IOMUX_PAD(0x584, 0x19C, 0, 0x0, 0, NO_PAD_CTRL)
149#define MX51_PAD_CSI1_D11__CSI1_D11 IOMUX_PAD(0x588, 0x1A0, 0, 0x0, 0, NO_PAD_CTRL)
150#define MX51_PAD_CSI1_D12__CSI1_D12 IOMUX_PAD(0x58C, 0x1A4, 0, 0x0, 0, NO_PAD_CTRL)
151#define MX51_PAD_CSI1_D13__CSI1_D13 IOMUX_PAD(0x590, 0x1A8, 0, 0x0, 0, NO_PAD_CTRL)
152#define MX51_PAD_CSI1_D14__CSI1_D14 IOMUX_PAD(0x594, 0x1AC, 0, 0x0, 0, NO_PAD_CTRL)
153#define MX51_PAD_CSI1_D15__CSI1_D15 IOMUX_PAD(0x598, 0x1B0, 0, 0x0, 0, NO_PAD_CTRL)
154#define MX51_PAD_CSI1_D16__CSI1_D16 IOMUX_PAD(0x59C, 0x1B4, 0, 0x0, 0, NO_PAD_CTRL)
155#define MX51_PAD_CSI1_D17__CSI1_D17 IOMUX_PAD(0x5A0, 0x1B8, 0, 0x0, 0, NO_PAD_CTRL)
156#define MX51_PAD_CSI1_D18__CSI1_D18 IOMUX_PAD(0x5A4, 0x1BC, 0, 0x0, 0, NO_PAD_CTRL)
157#define MX51_PAD_CSI1_D19__CSI1_D19 IOMUX_PAD(0x5A8, 0x1C0, 0, 0x0, 0, NO_PAD_CTRL)
158#define MX51_PAD_CSI1_VSYNC__CSI1_VSYNC IOMUX_PAD(0x5AC, 0x1C4, 0, 0x0, 0, NO_PAD_CTRL)
159#define MX51_PAD_CSI1_HSYNC__CSI1_HSYNC IOMUX_PAD(0x5B0, 0x1C8, 0, 0x0, 0, NO_PAD_CTRL)
160#define MX51_PAD_CSI1_PIXCLK__CSI1_PIXCLK IOMUX_PAD(0x5B4, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
161#define MX51_PAD_CSI1_MCLK__CSI1_MCLK IOMUX_PAD(0x5B8, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
162#define MX51_PAD_CSI1_PKE0__CSI1_PKE0 IOMUX_PAD(0x860, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
163#define MX51_PAD_GPIO_4_9__CSI2_D12 IOMUX_PAD(0x5BC, 0x1CC, 3, 0x0, 0, NO_PAD_CTRL)
164#define MX51_PAD_GPIO_4_10__CSI2_D13 IOMUX_PAD(0x5C0, 0x1D0, 3, 0x0, 0, NO_PAD_CTRL)
165#define MX51_PAD_GPIO_4_11__CSI2_D14 IOMUX_PAD(0x5C4, 0x1D4, 3, 0x0, 0, NO_PAD_CTRL)
166#define MX51_PAD_GPIO_4_12__CSI2_D15 IOMUX_PAD(0x5C8, 0x1D8, 3, 0x0, 0, NO_PAD_CTRL)
167#define MX51_PAD_GPIO_4_11__CSI2_D16 IOMUX_PAD(0x5CC, 0x1DC, 3, 0x0, 0, NO_PAD_CTRL)
168#define MX51_PAD_GPIO_4_12__CSI2_D17 IOMUX_PAD(0x5D0, 0x1E0, 3, 0x0, 0, NO_PAD_CTRL)
169#define MX51_PAD_GPIO_4_11__CSI2_D18 IOMUX_PAD(0x5D4, 0x1E4, 3, 0x0, 0, NO_PAD_CTRL)
170#define MX51_PAD_GPIO_4_12__CSI2_D19 IOMUX_PAD(0x5D8, 0x1E8, 3, 0x0, 0, NO_PAD_CTRL)
171#define MX51_PAD_GPIO_4_13__CSI2_VSYNC IOMUX_PAD(0x5DC, 0x1EC, 3, 0x0, 0, NO_PAD_CTRL)
172#define MX51_PAD_GPIO_4_14__CSI2_HSYNC IOMUX_PAD(0x5E0, 0x1F0, 3, 0x0, 0, NO_PAD_CTRL)
173#define MX51_PAD_GPIO_4_15__CSI2_PIXCLK IOMUX_PAD(0x5E4, 0x1F4, 3, 0x0, 0, NO_PAD_CTRL)
174#define MX51_PAD_CSI2_PKE0__CSI2_PKE0 IOMUX_PAD(0x81C, 0x0, 0, 0x0, 0, NO_PAD_CTRL)
175#define MX51_PAD_GPIO_4_16__I2C1_CLK IOMUX_PAD(0x5E8, 0x1F8, 3, 0x0, 0, NO_PAD_CTRL)
176#define MX51_PAD_GPIO_4_17__I2C1_DAT IOMUX_PAD(0x5EC, 0x1FC, 3, 0x0, 0, NO_PAD_CTRL)
177#define MX51_PAD_GPIO_4_18__AUD3_BB_TXD IOMUX_PAD(0x5F0, 0x200, 3, 0x0, 0, NO_PAD_CTRL)
178#define MX51_PAD_GPIO_4_19__AUD3_BB_RXD IOMUX_PAD(0x5F4, 0x204, 3, 0x0, 0, NO_PAD_CTRL)
179#define MX51_PAD_GPIO_4_20__AUD3_BB_CK IOMUX_PAD(0x5F8, 0x208, 3, 0x0, 0, NO_PAD_CTRL)
180#define MX51_PAD_GPIO_4_21__AUD3_BB_FS IOMUX_PAD(0x5FC, 0x20C, 3, 0x0, 0, NO_PAD_CTRL)
181#define MX51_PAD_GPIO_4_22__CSPI1_MOSI IOMUX_PAD(0x600, 0x210, 3, 0x0, 0, NO_PAD_CTRL)
182#define MX51_PAD_GPIO_4_23__CSPI1_MISO IOMUX_PAD(0x604, 0x214, 3, 0x0, 0, NO_PAD_CTRL)
183#define MX51_PAD_GPIO_4_24__CSPI1_SS0 IOMUX_PAD(0x608, 0x218, 3, 0x0, 0, NO_PAD_CTRL)
184#define MX51_PAD_GPIO_4_25__CSPI1_SS1 IOMUX_PAD(0x60C, 0x21C, 3, 0x0, 0, NO_PAD_CTRL)
185#define MX51_PAD_GPIO_4_26__CSPI1_RDY IOMUX_PAD(0x610, 0x220, 3, 0x0, 0, NO_PAD_CTRL)
186#define MX51_PAD_GPIO_4_27__CSPI1_SCLK IOMUX_PAD(0x614, 0x224, 3, 0x0, 0, NO_PAD_CTRL)
187
188/* Babbage UART1 */
189#define MX51_PAD_UART1_RXD__UART1_RXD IOMUX_PAD(0x618, 0x228, IOMUX_CONFIG_ALT0, 0x9e4, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST)
190#define MX51_PAD_UART1_TXD__UART1_TXD IOMUX_PAD(0x61C, 0x22C, IOMUX_CONFIG_ALT0, 0x0, 0, MX51_UART1_PAD_CTRL | PAD_CTL_SRE_FAST)
191#define MX51_PAD_UART1_RTS__UART1_RTS IOMUX_PAD(0x620, 0x230, IOMUX_CONFIG_ALT0, 0x9e0, 0, MX51_UART1_PAD_CTRL)
192#define MX51_PAD_UART1_CTS__UART1_CTS IOMUX_PAD(0x624, 0x234, IOMUX_CONFIG_ALT0, 0x0, 0, MX51_UART1_PAD_CTRL)
193
194/* Babbage UART2 */
195#define MX51_PAD_UART2_RXD__UART2_RXD IOMUX_PAD(0x628, 0x238, IOMUX_CONFIG_ALT0, 0x9ec, 2, MX51_UART2_PAD_CTRL)
196#define MX51_PAD_UART2_TXD__UART2_TXD IOMUX_PAD(0x62C, 0x23C, IOMUX_CONFIG_ALT0, 0x0, 0, MX51_UART2_PAD_CTRL)
197
198#define MX51_PAD_GPIO_1_22__UART3_RXD IOMUX_PAD(0x630, 0x240, 3, 0x0, 0, NO_PAD_CTRL)
199#define MX51_PAD_GPIO_1_23__UART3_TXD IOMUX_PAD(0x634, 0x244, 3, 0x0, 0, NO_PAD_CTRL)
200#define MX51_PAD_GPIO_1_24__OWIRE_LINE IOMUX_PAD(0x638, 0x248, 3, 0x0, 0, NO_PAD_CTRL)
201#define MX51_PAD_KEY_ROW0__KEY_ROW0 IOMUX_PAD(0x63C, 0x24C, 0, 0x0, 0, NO_PAD_CTRL)
202#define MX51_PAD_KEY_ROW1__KEY_ROW1 IOMUX_PAD(0x640, 0x250, 0, 0x0, 0, NO_PAD_CTRL)
203#define MX51_PAD_KEY_ROW2__KEY_ROW2 IOMUX_PAD(0x644, 0x254, 0, 0x0, 0, NO_PAD_CTRL)
204#define MX51_PAD_KEY_ROW3__KEY_ROW3 IOMUX_PAD(0x648, 0x258, 0, 0x0, 0, NO_PAD_CTRL)
205#define MX51_PAD_KEY_COL0__KEY_COL0 IOMUX_PAD(0x64C, 0x25C, 0, 0x0, 0, NO_PAD_CTRL)
206#define MX51_PAD_KEY_COL1__KEY_COL1 IOMUX_PAD(0x650, 0x260, 0, 0x0, 0, NO_PAD_CTRL)
207#define MX51_PAD_KEY_COL2__KEY_COL2 IOMUX_PAD(0x654, 0x264, 0, 0x0, 0, NO_PAD_CTRL)
208#define MX51_PAD_KEY_COL3__KEY_COL3 IOMUX_PAD(0x658, 0x268, 0, 0x0, 0, NO_PAD_CTRL)
209#define MX51_PAD_KEY_COL4__KEY_COL4 IOMUX_PAD(0x65C, 0x26C, 0, 0x0, 0, NO_PAD_CTRL)
210#define MX51_PAD_KEY_COL5__KEY_COL5 IOMUX_PAD(0x660, 0x270, 0, 0x0, 0, NO_PAD_CTRL)
211#define MX51_PAD_GPIO_1_25__USBH1_CLK IOMUX_PAD(0x678, 0x278, 2, 0x0, 0, NO_PAD_CTRL)
212#define MX51_PAD_GPIO_1_26__USBH1_DIR IOMUX_PAD(0x67C, 0x27C, 2, 0x0, 0, NO_PAD_CTRL)
213#define MX51_PAD_GPIO_1_27__USBH1_STP IOMUX_PAD(0x680, 0x280, 2, 0x0, 0, NO_PAD_CTRL)
214#define MX51_PAD_GPIO_1_28__USBH1_NXT IOMUX_PAD(0x684, 0x284, 2, 0x0, 0, NO_PAD_CTRL)
215#define MX51_PAD_GPIO_1_11__USBH1_DATA0 IOMUX_PAD(0x688, 0x288, 2, 0x0, 0, NO_PAD_CTRL)
216#define MX51_PAD_GPIO_1_12__USBH1_DATA1 IOMUX_PAD(0x68C, 0x28C, 2, 0x0, 0, NO_PAD_CTRL)
217#define MX51_PAD_GPIO_1_13__USBH1_DATA2 IOMUX_PAD(0x690, 0x290, 2, 0x0, 0, NO_PAD_CTRL)
218#define MX51_PAD_GPIO_1_14__USBH1_DATA3 IOMUX_PAD(0x694, 0x294, 2, 0x0, 0, NO_PAD_CTRL)
219#define MX51_PAD_GPIO_1_15__USBH1_DATA4 IOMUX_PAD(0x698, 0x298, 2, 0x0, 0, NO_PAD_CTRL)
220#define MX51_PAD_GPIO_1_16__USBH1_DATA5 IOMUX_PAD(0x69C, 0x29C, 2, 0x0, 0, NO_PAD_CTRL)
221#define MX51_PAD_GPIO_1_17__USBH1_DATA6 IOMUX_PAD(0x6A0, 0x2A0, 2, 0x0, 0, NO_PAD_CTRL)
222#define MX51_PAD_GPIO_1_18__USBH1_DATA7 IOMUX_PAD(0x6A4, 0x2A4, 2, 0x0, 0, NO_PAD_CTRL)
223#define MX51_PAD_GPIO_3_0__DI1_PIN11 IOMUX_PAD(0x6A8, 0x2A8, 4, 0x0, 0, NO_PAD_CTRL)
224#define MX51_PAD_GPIO_3_1__DI1_PIN12 IOMUX_PAD(0x6AC, 0x2AC, 4, 0x0, 0, NO_PAD_CTRL)
225#define MX51_PAD_GPIO_3_2__DI1_PIN13 IOMUX_PAD(0x6B0, 0x2B0, 4, 0x0, 0, NO_PAD_CTRL)
226#define MX51_PAD_GPIO_3_3__DI1_D0_CS IOMUX_PAD(0x6B4, 0x2B4, 4, 0x0, 0, NO_PAD_CTRL)
227#define MX51_PAD_GPIO_3_4__DI1_D1_CS IOMUX_PAD(0x6B8, 0x2B8, 4, 0x0, 0, NO_PAD_CTRL)
228#define MX51_PAD_GPIO_3_5__DISPB2_SER_DIN IOMUX_PAD(0x6BC, 0x2BC, 4, 0x0, 0, NO_PAD_CTRL)
229#define MX51_PAD_GPIO_3_6__DISPB2_SER_DIO IOMUX_PAD(0x6C0, 0x2C0, 4, 0x0, 0, NO_PAD_CTRL)
230#define MX51_PAD_GPIO_3_7__DISPB2_SER_CLK IOMUX_PAD(0x6C4, 0x2C4, 4, 0x0, 0, NO_PAD_CTRL)
231#define MX51_PAD_GPIO_3_8__DISPB2_SER_RS IOMUX_PAD(0x6C8, 0x2C8, 4, 0x0, 0, NO_PAD_CTRL)
232#define MX51_PAD_DISP1_DAT0__DISP1_DAT0 IOMUX_PAD(0x6CC, 0x2CC, 0, 0x0, 0, NO_PAD_CTRL)
233#define MX51_PAD_DISP1_DAT1__DISP1_DAT1 IOMUX_PAD(0x6D0, 0x2D0, 0, 0x0, 0, NO_PAD_CTRL)
234#define MX51_PAD_DISP1_DAT2__DISP1_DAT2 IOMUX_PAD(0x6D4, 0x2D4, 0, 0x0, 0, NO_PAD_CTRL)
235#define MX51_PAD_DISP1_DAT3__DISP1_DAT3 IOMUX_PAD(0x6D8, 0x2D8, 0, 0x0, 0, NO_PAD_CTRL)
236#define MX51_PAD_DISP1_DAT4__DISP1_DAT4 IOMUX_PAD(0x6DC, 0x2DC, 0, 0x0, 0, NO_PAD_CTRL)
237#define MX51_PAD_DISP1_DAT5__DISP1_DAT5 IOMUX_PAD(0x6E0, 0x2E0, 0, 0x0, 0, NO_PAD_CTRL)
238#define MX51_PAD_DISP1_DAT6__DISP1_DAT6 IOMUX_PAD(0x6E4, 0x2E4, 0, 0x0, 0, NO_PAD_CTRL)
239#define MX51_PAD_DISP1_DAT7__DISP1_DAT7 IOMUX_PAD(0x6E8, 0x2E8, 0, 0x0, 0, NO_PAD_CTRL)
240#define MX51_PAD_DISP1_DAT8__DISP1_DAT8 IOMUX_PAD(0x6EC, 0x2EC, 0, 0x0, 0, NO_PAD_CTRL)
241#define MX51_PAD_DISP1_DAT9__DISP1_DAT9 IOMUX_PAD(0x6F0, 0x2F0, 0, 0x0, 0, NO_PAD_CTRL)
242#define MX51_PAD_DISP1_DAT10__DISP1_DAT10 IOMUX_PAD(0x6F4, 0x2F4, 0, 0x0, 0, NO_PAD_CTRL)
243#define MX51_PAD_DISP1_DAT11__DISP1_DAT11 IOMUX_PAD(0x6F8, 0x2F8, 0, 0x0, 0, NO_PAD_CTRL)
244#define MX51_PAD_DISP1_DAT12__DISP1_DAT12 IOMUX_PAD(0x6FC, 0x2FC, 0, 0x0, 0, NO_PAD_CTRL)
245#define MX51_PAD_DISP1_DAT13__DISP1_DAT13 IOMUX_PAD(0x700, 0x300, 0, 0x0, 0, NO_PAD_CTRL)
246#define MX51_PAD_DISP1_DAT14__DISP1_DAT14 IOMUX_PAD(0x704, 0x304, 0, 0x0, 0, NO_PAD_CTRL)
247#define MX51_PAD_DISP1_DAT15__DISP1_DAT15 IOMUX_PAD(0x708, 0x308, 0, 0x0, 0, NO_PAD_CTRL)
248#define MX51_PAD_DISP1_DAT16__DISP1_DAT16 IOMUX_PAD(0x70C, 0x30C, 0, 0x0, 0, NO_PAD_CTRL)
249#define MX51_PAD_DISP1_DAT17__DISP1_DAT17 IOMUX_PAD(0x710, 0x310, 0, 0x0, 0, NO_PAD_CTRL)
250#define MX51_PAD_DISP1_DAT18__DISP1_DAT18 IOMUX_PAD(0x714, 0x314, 0, 0x0, 0, NO_PAD_CTRL)
251#define MX51_PAD_DISP1_DAT19__DISP1_DAT19 IOMUX_PAD(0x718, 0x318, 0, 0x0, 0, NO_PAD_CTRL)
252#define MX51_PAD_DISP1_DAT20__DISP1_DAT20 IOMUX_PAD(0x71C, 0x31C, 0, 0x0, 0, NO_PAD_CTRL)
253#define MX51_PAD_DISP1_DAT21__DISP1_DAT21 IOMUX_PAD(0x720, 0x320, 0, 0x0, 0, NO_PAD_CTRL)
254#define MX51_PAD_DISP1_DAT22__DISP1_DAT22 IOMUX_PAD(0x724, 0x324, 0, 0x0, 0, NO_PAD_CTRL)
255#define MX51_PAD_DISP1_DAT23__DISP1_DAT23 IOMUX_PAD(0x728, 0x328, 0, 0x0, 0, NO_PAD_CTRL)
256#define MX51_PAD_DI1_PIN3__DI1_PIN3 IOMUX_PAD(0x72C, 0x32C, 0, 0x0, 0, NO_PAD_CTRL)
257#define MX51_PAD_DI1_PIN2__DI1_PIN2 IOMUX_PAD(0x734, 0x330, 0, 0x0, 0, NO_PAD_CTRL)
258#define MX51_PAD_DI_GP1__DI_GP1 IOMUX_PAD(0x73C, 0x334, 0, 0x0, 0, NO_PAD_CTRL)
259#define MX51_PAD_DI_GP2__DI_GP2 IOMUX_PAD(0x740, 0x338, 0, 0x0, 0, NO_PAD_CTRL)
260#define MX51_PAD_DI_GP3__DI_GP3 IOMUX_PAD(0x744, 0x33C, 0, 0x0, 0, NO_PAD_CTRL)
261#define MX51_PAD_DI2_PIN4__DI2_PIN4 IOMUX_PAD(0x748, 0x340, 0, 0x0, 0, NO_PAD_CTRL)
262#define MX51_PAD_DI2_PIN2__DI2_PIN2 IOMUX_PAD(0x74C, 0x344, 0, 0x0, 0, NO_PAD_CTRL)
263#define MX51_PAD_DI2_PIN3__DI2_PIN3 IOMUX_PAD(0x750, 0x348, 0, 0x0, 0, NO_PAD_CTRL)
264#define MX51_PAD_DI2_DISP_CLK__DI2_DISP_CLK IOMUX_PAD(0x754, 0x34C, 0, 0x0, 0, NO_PAD_CTRL)
265#define MX51_PAD_DI_GP4__DI_GP4 IOMUX_PAD(0x758, 0x350, 0, 0x0, 0, NO_PAD_CTRL)
266#define MX51_PAD_DISP2_DAT0__DISP2_DAT0 IOMUX_PAD(0x75C, 0x354, 0, 0x0, 0, NO_PAD_CTRL)
267#define MX51_PAD_DISP2_DAT1__DISP2_DAT1 IOMUX_PAD(0x760, 0x358, 0, 0x0, 0, NO_PAD_CTRL)
268#define MX51_PAD_DISP2_DAT2__DISP2_DAT2 IOMUX_PAD(0x764, 0x35C, 0, 0x0, 0, NO_PAD_CTRL)
269#define MX51_PAD_DISP2_DAT3__DISP2_DAT3 IOMUX_PAD(0x768, 0x360, 0, 0x0, 0, NO_PAD_CTRL)
270#define MX51_PAD_DISP2_DAT4__DISP2_DAT4 IOMUX_PAD(0x76C, 0x364, 0, 0x0, 0, NO_PAD_CTRL)
271#define MX51_PAD_DISP2_DAT5__DISP2_DAT5 IOMUX_PAD(0x770, 0x368, 0, 0x0, 0, NO_PAD_CTRL)
272#define MX51_PAD_GPIO_1_19__DISP2_DAT6 IOMUX_PAD(0x774, 0x36C, 5, 0x0, 0, NO_PAD_CTRL)
273#define MX51_PAD_GPIO_1_29__DISP2_DAT7 IOMUX_PAD(0x778, 0x370, 5, 0x0, 0, NO_PAD_CTRL)
274#define MX51_PAD_GPIO_1_30__DISP2_DAT8 IOMUX_PAD(0x77C, 0x374, 5, 0x0, 0, NO_PAD_CTRL)
275#define MX51_PAD_GPIO_1_31__DISP2_DAT9 IOMUX_PAD(0x780, 0x378, 5, 0x0, 0, NO_PAD_CTRL)
276#define MX51_PAD_DISP2_DAT10__DISP2_DAT10 IOMUX_PAD(0x784, 0x37C, 0, 0x0, 0, NO_PAD_CTRL)
277#define MX51_PAD_DISP2_DAT11__DISP2_DAT11 IOMUX_PAD(0x788, 0x380, 0, 0x0, 0, NO_PAD_CTRL)
278#define MX51_PAD_DISP2_DAT12__DISP2_DAT12 IOMUX_PAD(0x78C, 0x384, 0, 0x0, 0, NO_PAD_CTRL)
279#define MX51_PAD_DISP2_DAT13__DISP2_DAT13 IOMUX_PAD(0x790, 0x388, 0, 0x0, 0, NO_PAD_CTRL)
280#define MX51_PAD_DISP2_DAT14__DISP2_DAT14 IOMUX_PAD(0x794, 0x38C, 0, 0x0, 0, NO_PAD_CTRL)
281#define MX51_PAD_DISP2_DAT15__DISP2_DAT15 IOMUX_PAD(0x798, 0x390, 0, 0x0, 0, NO_PAD_CTRL)
282#define MX51_PAD_SD1_CMD__SD1_CMD IOMUX_PAD(0x79C, 0x394, 0, 0x0, 0, NO_PAD_CTRL)
283#define MX51_PAD_SD1_CLK__SD1_CLK IOMUX_PAD(0x7A0, 0x398, 0, 0x0, 0, NO_PAD_CTRL)
284#define MX51_PAD_SD1_DATA0__SD1_DATA0 IOMUX_PAD(0x7A4, 0x39C, 0, 0x0, 0, NO_PAD_CTRL)
285#define MX51_PAD_SD1_DATA1__SD1_DATA1 IOMUX_PAD(0x7A8, 0x3A0, 0, 0x0, 0, NO_PAD_CTRL)
286#define MX51_PAD_SD1_DATA2__SD1_DATA2 IOMUX_PAD(0x7AC, 0x3A4, 0, 0x0, 0, NO_PAD_CTRL)
287#define MX51_PAD_SD1_DATA3__SD1_DATA3 IOMUX_PAD(0x7B0, 0x3A8, 0, 0x0, 0, NO_PAD_CTRL)
288#define MX51_PAD_GPIO_1_0__GPIO1_0 IOMUX_PAD(0x7B4, 0x3AC, 1, 0x0, 0, NO_PAD_CTRL)
289#define MX51_PAD_GPIO_1_1__GPIO1_1 IOMUX_PAD(0x7B8, 0x3B0, 1, 0x0, 0, NO_PAD_CTRL)
290#define MX51_PAD_SD2_CMD__SD2_CMD IOMUX_PAD(0x7BC, 0x3B4, 0, 0x0, 0, NO_PAD_CTRL)
291#define MX51_PAD_SD2_CLK__SD2_CLK IOMUX_PAD(0x7C0, 0x3B8, 0, 0x0, 0, NO_PAD_CTRL)
292#define MX51_PAD_SD2_DATA0__SD2_DATA0 IOMUX_PAD(0x7C4, 0x3BC, 0, 0x0, 0, NO_PAD_CTRL)
293#define MX51_PAD_SD2_DATA1__SD2_DATA1 IOMUX_PAD(0x7C8, 0x3C0, 0, 0x0, 0, NO_PAD_CTRL)
294#define MX51_PAD_SD2_DATA2__SD2_DATA2 IOMUX_PAD(0x7CC, 0x3C4, 0, 0x0, 0, NO_PAD_CTRL)
295#define MX51_PAD_SD2_DATA3__SD2_DATA3 IOMUX_PAD(0x7D0, 0x3C8, 0, 0x0, 0, NO_PAD_CTRL)
296#define MX51_PAD_GPIO_1_2__GPIO1_2 IOMUX_PAD(0x7D4, 0x3CC, 0, 0x0, 0, NO_PAD_CTRL)
297#define MX51_PAD_GPIO_1_3__GPIO1_3 IOMUX_PAD(0x7D8, 0x3D0, 0, 0x0, 0, NO_PAD_CTRL)
298#define MX51_PAD_PMIC_INT_REQ__PMIC_INT_REQ IOMUX_PAD(0x7FC, 0x3D4, 0, 0x0, 0, NO_PAD_CTRL)
299#define MX51_PAD_GPIO_1_4__GPIO1_4 IOMUX_PAD(0x804, 0x3D8, 0, 0x0, 0, NO_PAD_CTRL)
300#define MX51_PAD_GPIO_1_5__GPIO1_5 IOMUX_PAD(0x808, 0x3DC, 0, 0x0, 0, NO_PAD_CTRL)
301#define MX51_PAD_GPIO_1_6__GPIO1_6 IOMUX_PAD(0x80C, 0x3E0, 0, 0x0, 0, NO_PAD_CTRL)
302#define MX51_PAD_GPIO_1_7__GPIO1_7 IOMUX_PAD(0x810, 0x3E4, 0, 0x0, 0, NO_PAD_CTRL)
303#define MX51_PAD_GPIO_1_8__GPIO1_8 IOMUX_PAD(0x814, 0x3E8, 0, 0x0, 1, \
304 (PAD_CTL_SRE_SLOW | PAD_CTL_DSE_MED | PAD_CTL_PUS_100K_UP | PAD_CTL_HYS))
305#define MX51_PAD_GPIO_1_9__GPIO1_9 IOMUX_PAD(0x818, 0x3EC, 0, 0x0, 0, NO_PAD_CTRL)
306
307/* EIM */
308#define MX51_PAD_EIM_DA0__EIM_DA0 IOMUX_PAD(0x7a8, 0x01c, 0, 0x0, 0, NO_PAD_CTRL)
309#define MX51_PAD_EIM_DA1__EIM_DA1 IOMUX_PAD(0x7a8, 0x020, 0, 0x0, 0, NO_PAD_CTRL)
310#define MX51_PAD_EIM_DA2__EIM_DA2 IOMUX_PAD(0x7a8, 0x024, 0, 0x0, 0, NO_PAD_CTRL)
311#define MX51_PAD_EIM_DA3__EIM_DA3 IOMUX_PAD(0x7a8, 0x028, 0, 0x0, 0, NO_PAD_CTRL)
312#define MX51_PAD_EIM_DA4__EIM_DA4 IOMUX_PAD(0x7ac, 0x02c, 0, 0x0, 0, NO_PAD_CTRL)
313#define MX51_PAD_EIM_DA5__EIM_DA5 IOMUX_PAD(0x7ac, 0x030, 0, 0x0, 0, NO_PAD_CTRL)
314#define MX51_PAD_EIM_DA6__EIM_DA6 IOMUX_PAD(0x7ac, 0x034, 0, 0x0, 0, NO_PAD_CTRL)
315#define MX51_PAD_EIM_DA7__EIM_DA7 IOMUX_PAD(0x7ac, 0x038, 0, 0x0, 0, NO_PAD_CTRL)
316
317#define MX51_PAD_EIM_DA8__EIM_DA8 IOMUX_PAD(0x7b0, 0x03c, 0, 0x0, 0, NO_PAD_CTRL)
318#define MX51_PAD_EIM_DA9__EIM_DA9 IOMUX_PAD(0x7b0, 0x040, 0, 0x0, 0, NO_PAD_CTRL)
319#define MX51_PAD_EIM_DA10__EIM_DA10 IOMUX_PAD(0x7b0, 0x044, 0, 0x0, 0, NO_PAD_CTRL)
320#define MX51_PAD_EIM_DA11__EIM_DA11 IOMUX_PAD(0x7b0, 0x048, 0, 0x0, 0, NO_PAD_CTRL)
321#define MX51_PAD_EIM_DA12__EIM_DA12 IOMUX_PAD(0x7bc, 0x04c, 0, 0x0, 0, NO_PAD_CTRL)
322#define MX51_PAD_EIM_DA13__EIM_DA13 IOMUX_PAD(0x7bc, 0x050, 0, 0x0, 0, NO_PAD_CTRL)
323#define MX51_PAD_EIM_DA14__EIM_DA14 IOMUX_PAD(0x7bc, 0x054, 0, 0x0, 0, NO_PAD_CTRL)
324#define MX51_PAD_EIM_DA15__EIM_DA15 IOMUX_PAD(0x7bc, 0x058, 0, 0x0, 0, NO_PAD_CTRL)
325
326#endif /* __MACH_IOMUX_MX51_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h
new file mode 100644
index 000000000000..884f5753f279
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
3 * Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301, USA.
18 */
19#ifndef __MACH_IOMUX_V1_H__
20#define __MACH_IOMUX_V1_H__
21
22/*
23* GPIO Module and I/O Multiplexer
24* x = 0..3 for reg_A, reg_B, reg_C, reg_D
25*/
26#define MXC_DDIR(x) (0x00 + ((x) << 8))
27#define MXC_OCR1(x) (0x04 + ((x) << 8))
28#define MXC_OCR2(x) (0x08 + ((x) << 8))
29#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
30#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
31#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
32#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
33#define MXC_DR(x) (0x1c + ((x) << 8))
34#define MXC_GIUS(x) (0x20 + ((x) << 8))
35#define MXC_SSR(x) (0x24 + ((x) << 8))
36#define MXC_ICR1(x) (0x28 + ((x) << 8))
37#define MXC_ICR2(x) (0x2c + ((x) << 8))
38#define MXC_IMR(x) (0x30 + ((x) << 8))
39#define MXC_ISR(x) (0x34 + ((x) << 8))
40#define MXC_GPR(x) (0x38 + ((x) << 8))
41#define MXC_SWR(x) (0x3c + ((x) << 8))
42#define MXC_PUEN(x) (0x40 + ((x) << 8))
43
44#define MX1_NUM_GPIO_PORT 4
45#define MX21_NUM_GPIO_PORT 6
46#define MX27_NUM_GPIO_PORT 6
47
48#define GPIO_PIN_MASK 0x1f
49
50#define GPIO_PORT_SHIFT 5
51#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
52
53#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
54#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
55#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
56#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
57#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
58#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
59
60#define GPIO_OUT (1 << 8)
61#define GPIO_IN (0 << 8)
62#define GPIO_PUEN (1 << 9)
63
64#define GPIO_PF (1 << 10)
65#define GPIO_AF (1 << 11)
66
67#define GPIO_OCR_SHIFT 12
68#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
69#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
70#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
71#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
72#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
73
74#define GPIO_AOUT_SHIFT 14
75#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
76#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
77#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
78#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
79#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
80
81#define GPIO_BOUT_SHIFT 16
82#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
83#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
84#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
85#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
86#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
87
88/* decode irq number to use with IMR(x), ISR(x) and friends */
89#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
90
91#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
92#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
93#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
94#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
95#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
96#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
97
98extern int mxc_gpio_mode(int gpio_mode);
99extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
100 const char *label);
101extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
102
103#endif /* __MACH_IOMUX_V1_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index 1deda0184892..f2f73d31d5ba 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -81,11 +81,13 @@ struct pad_desc {
81 81
82#define PAD_CTL_ODE (1 << 3) 82#define PAD_CTL_ODE (1 << 3)
83 83
84#define PAD_CTL_DSE_STANDARD (0 << 1) 84#define PAD_CTL_DSE_LOW (0 << 1)
85#define PAD_CTL_DSE_HIGH (1 << 1) 85#define PAD_CTL_DSE_MED (1 << 1)
86#define PAD_CTL_DSE_MAX (2 << 1) 86#define PAD_CTL_DSE_HIGH (2 << 1)
87#define PAD_CTL_DSE_MAX (3 << 1)
87 88
88#define PAD_CTL_SRE_FAST (1 << 0) 89#define PAD_CTL_SRE_FAST (1 << 0)
90#define PAD_CTL_SRE_SLOW (0 << 0)
89 91
90/* 92/*
91 * setups a single pad in the iomuxer 93 * setups a single pad in the iomuxer
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
index 011cfcd8b820..3d226d7e7be2 100644
--- a/arch/arm/plat-mxc/include/mach/iomux.h
+++ b/arch/arm/plat-mxc/include/mach/iomux.h
@@ -1,102 +1,14 @@
1/* 1/*
2* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de> 2 * Copyright (C) 2010 Uwe Kleine-Koenig, Pengutronix
3* Copyright (C) 2009 by Holger Schurig <hs4233@mail.mn-solutions.de> 3 *
4* 4 * This program is free software; you can redistribute it and/or modify it
5* This program is free software; you can redistribute it and/or 5 * under the terms of the GNU General Public License version 2 as published by
6* modify it under the terms of the GNU General Public License 6 * the Free Software Foundation.
7* as published by the Free Software Foundation; either version 2 7 */
8* of the License, or (at your option) any later version. 8#ifndef __MACH_IOMUX_H__
9* This program is distributed in the hope that it will be useful, 9#define __MACH_IOMUX_H__
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program; if not, write to the Free Software
16* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17* MA 02110-1301, USA.
18*/
19
20#ifndef _MXC_IOMUX_H
21#define _MXC_IOMUX_H
22
23/*
24* GPIO Module and I/O Multiplexer
25* x = 0..3 for reg_A, reg_B, reg_C, reg_D
26*/
27#define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR)
28#define MXC_DDIR(x) (0x00 + ((x) << 8))
29#define MXC_OCR1(x) (0x04 + ((x) << 8))
30#define MXC_OCR2(x) (0x08 + ((x) << 8))
31#define MXC_ICONFA1(x) (0x0c + ((x) << 8))
32#define MXC_ICONFA2(x) (0x10 + ((x) << 8))
33#define MXC_ICONFB1(x) (0x14 + ((x) << 8))
34#define MXC_ICONFB2(x) (0x18 + ((x) << 8))
35#define MXC_DR(x) (0x1c + ((x) << 8))
36#define MXC_GIUS(x) (0x20 + ((x) << 8))
37#define MXC_SSR(x) (0x24 + ((x) << 8))
38#define MXC_ICR1(x) (0x28 + ((x) << 8))
39#define MXC_ICR2(x) (0x2c + ((x) << 8))
40#define MXC_IMR(x) (0x30 + ((x) << 8))
41#define MXC_ISR(x) (0x34 + ((x) << 8))
42#define MXC_GPR(x) (0x38 + ((x) << 8))
43#define MXC_SWR(x) (0x3c + ((x) << 8))
44#define MXC_PUEN(x) (0x40 + ((x) << 8))
45
46#ifdef CONFIG_ARCH_MX1
47# define GPIO_PORT_MAX 3
48#endif
49#ifdef CONFIG_ARCH_MX2
50# define GPIO_PORT_MAX 5
51#endif
52#ifdef CONFIG_ARCH_MX25
53# define GPIO_PORT_MAX 3
54#endif
55
56#ifndef GPIO_PORT_MAX
57# error "GPIO config port count unknown!"
58#endif
59
60#define GPIO_PIN_MASK 0x1f
61
62#define GPIO_PORT_SHIFT 5
63#define GPIO_PORT_MASK (0x7 << GPIO_PORT_SHIFT)
64
65#define GPIO_PORTA (0 << GPIO_PORT_SHIFT)
66#define GPIO_PORTB (1 << GPIO_PORT_SHIFT)
67#define GPIO_PORTC (2 << GPIO_PORT_SHIFT)
68#define GPIO_PORTD (3 << GPIO_PORT_SHIFT)
69#define GPIO_PORTE (4 << GPIO_PORT_SHIFT)
70#define GPIO_PORTF (5 << GPIO_PORT_SHIFT)
71
72#define GPIO_OUT (1 << 8)
73#define GPIO_IN (0 << 8)
74#define GPIO_PUEN (1 << 9)
75
76#define GPIO_PF (1 << 10)
77#define GPIO_AF (1 << 11)
78
79#define GPIO_OCR_SHIFT 12
80#define GPIO_OCR_MASK (3 << GPIO_OCR_SHIFT)
81#define GPIO_AIN (0 << GPIO_OCR_SHIFT)
82#define GPIO_BIN (1 << GPIO_OCR_SHIFT)
83#define GPIO_CIN (2 << GPIO_OCR_SHIFT)
84#define GPIO_GPIO (3 << GPIO_OCR_SHIFT)
85
86#define GPIO_AOUT_SHIFT 14
87#define GPIO_AOUT_MASK (3 << GPIO_AOUT_SHIFT)
88#define GPIO_AOUT (0 << GPIO_AOUT_SHIFT)
89#define GPIO_AOUT_ISR (1 << GPIO_AOUT_SHIFT)
90#define GPIO_AOUT_0 (2 << GPIO_AOUT_SHIFT)
91#define GPIO_AOUT_1 (3 << GPIO_AOUT_SHIFT)
92
93#define GPIO_BOUT_SHIFT 16
94#define GPIO_BOUT_MASK (3 << GPIO_BOUT_SHIFT)
95#define GPIO_BOUT (0 << GPIO_BOUT_SHIFT)
96#define GPIO_BOUT_ISR (1 << GPIO_BOUT_SHIFT)
97#define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT)
98#define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT)
99 10
11/* This file will go away, please include mach/iomux-mx... directly */
100 12
101#ifdef CONFIG_ARCH_MX1 13#ifdef CONFIG_ARCH_MX1
102#include <mach/iomux-mx1.h> 14#include <mach/iomux-mx1.h>
@@ -110,25 +22,5 @@
110#include <mach/iomux-mx27.h> 22#include <mach/iomux-mx27.h>
111#endif 23#endif
112#endif 24#endif
113#ifdef CONFIG_ARCH_MX25
114#include <mach/iomux-mx25.h>
115#endif
116 25
117 26#endif /* __MACH_IOMUX_H__ */
118/* decode irq number to use with IMR(x), ISR(x) and friends */
119#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
120
121#define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x)
122#define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x)
123#define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x)
124#define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x)
125#define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x)
126#define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x)
127
128
129extern void mxc_gpio_mode(int gpio_mode);
130extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
131 const char *label);
132extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
133
134#endif
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h
index 0cb347645db4..86781f7b0c0c 100644
--- a/arch/arm/plat-mxc/include/mach/irqs.h
+++ b/arch/arm/plat-mxc/include/mach/irqs.h
@@ -12,22 +12,29 @@
12#define __ASM_ARCH_MXC_IRQS_H__ 12#define __ASM_ARCH_MXC_IRQS_H__
13 13
14/* 14/*
15 * So far all i.MX SoCs have 64 internal interrupts 15 * SoCs with TZIC interrupt controller have 128 IRQs, those with AVIC have 64
16 */ 16 */
17#ifdef CONFIG_MXC_TZIC
18#define MXC_INTERNAL_IRQS 128
19#else
17#define MXC_INTERNAL_IRQS 64 20#define MXC_INTERNAL_IRQS 64
21#endif
18 22
19#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS 23#define MXC_GPIO_IRQ_START MXC_INTERNAL_IRQS
20 24
21#if defined CONFIG_ARCH_MX1 25/* these are ordered by size to support multi-SoC kernels */
22#define MXC_GPIO_IRQS (32 * 4) 26#if defined CONFIG_ARCH_MX2
23#elif defined CONFIG_ARCH_MX2
24#define MXC_GPIO_IRQS (32 * 6) 27#define MXC_GPIO_IRQS (32 * 6)
25#elif defined CONFIG_ARCH_MX3 28#elif defined CONFIG_ARCH_MX1
26#define MXC_GPIO_IRQS (32 * 3) 29#define MXC_GPIO_IRQS (32 * 4)
27#elif defined CONFIG_ARCH_MX25 30#elif defined CONFIG_ARCH_MX25
28#define MXC_GPIO_IRQS (32 * 4) 31#define MXC_GPIO_IRQS (32 * 4)
32#elif defined CONFIG_ARCH_MX5
33#define MXC_GPIO_IRQS (32 * 4)
29#elif defined CONFIG_ARCH_MXC91231 34#elif defined CONFIG_ARCH_MXC91231
30#define MXC_GPIO_IRQS (32 * 4) 35#define MXC_GPIO_IRQS (32 * 4)
36#elif defined CONFIG_ARCH_MX3
37#define MXC_GPIO_IRQS (32 * 3)
31#endif 38#endif
32 39
33/* 40/*
@@ -51,6 +58,7 @@
51#else 58#else
52#define MX3_IPU_IRQS 0 59#define MX3_IPU_IRQS 0
53#endif 60#endif
61/* REVISIT: Add IPU irqs on IMX51 */
54 62
55#define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS) 63#define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS)
56 64
diff --git a/arch/arm/plat-mxc/include/mach/memory.h b/arch/arm/plat-mxc/include/mach/memory.h
index d3afafdcc0e5..c4b40c35a6a1 100644
--- a/arch/arm/plat-mxc/include/mach/memory.h
+++ b/arch/arm/plat-mxc/include/mach/memory.h
@@ -11,37 +11,45 @@
11#ifndef __ASM_ARCH_MXC_MEMORY_H__ 11#ifndef __ASM_ARCH_MXC_MEMORY_H__
12#define __ASM_ARCH_MXC_MEMORY_H__ 12#define __ASM_ARCH_MXC_MEMORY_H__
13 13
14#if defined CONFIG_ARCH_MX1 14#define MX1_PHYS_OFFSET UL(0x08000000)
15#define PHYS_OFFSET UL(0x08000000) 15#define MX21_PHYS_OFFSET UL(0xc0000000)
16#elif defined CONFIG_ARCH_MX2 16#define MX25_PHYS_OFFSET UL(0x80000000)
17#ifdef CONFIG_MACH_MX21 17#define MX27_PHYS_OFFSET UL(0xa0000000)
18#define PHYS_OFFSET UL(0xC0000000) 18#define MX3x_PHYS_OFFSET UL(0x80000000)
19#endif 19#define MX51_PHYS_OFFSET UL(0x90000000)
20#ifdef CONFIG_MACH_MX27 20#define MXC91231_PHYS_OFFSET UL(0x90000000)
21#define PHYS_OFFSET UL(0xA0000000) 21
22#endif 22#if !defined(CONFIG_RUNTIME_PHYS_OFFSET)
23#elif defined CONFIG_ARCH_MX3 23# if defined CONFIG_ARCH_MX1
24#define PHYS_OFFSET UL(0x80000000) 24# define PHYS_OFFSET MX1_PHYS_OFFSET
25#elif defined CONFIG_ARCH_MX25 25# elif defined CONFIG_MACH_MX21
26#define PHYS_OFFSET UL(0x80000000) 26# define PHYS_OFFSET MX21_PHYS_OFFSET
27#elif defined CONFIG_ARCH_MXC91231 27# elif defined CONFIG_ARCH_MX25
28#define PHYS_OFFSET UL(0x90000000) 28# define PHYS_OFFSET MX25_PHYS_OFFSET
29# elif defined CONFIG_MACH_MX27
30# define PHYS_OFFSET MX27_PHYS_OFFSET
31# elif defined CONFIG_ARCH_MX3
32# define PHYS_OFFSET MX3x_PHYS_OFFSET
33# elif defined CONFIG_ARCH_MXC91231
34# define PHYS_OFFSET MXC91231_PHYS_OFFSET
35# elif defined CONFIG_ARCH_MX5
36# define PHYS_OFFSET MX51_PHYS_OFFSET
37# endif
29#endif 38#endif
30 39
31#if defined(CONFIG_MX1_VIDEO) 40#if defined(CONFIG_MX3_VIDEO)
32/* 41/*
33 * Increase size of DMA-consistent memory region. 42 * Increase size of DMA-consistent memory region.
34 * This is required for i.MX camera driver to capture at least four VGA frames. 43 * This is required for mx3 camera driver to capture at least two QXGA frames.
35 */ 44 */
36#define CONSISTENT_DMA_SIZE SZ_4M 45#define CONSISTENT_DMA_SIZE SZ_8M
37#endif /* CONFIG_MX1_VIDEO */
38 46
39#if defined(CONFIG_MX3_VIDEO) 47#elif defined(CONFIG_MX1_VIDEO)
40/* 48/*
41 * Increase size of DMA-consistent memory region. 49 * Increase size of DMA-consistent memory region.
42 * This is required for mx3 camera driver to capture at least two QXGA frames. 50 * This is required for i.MX camera driver to capture at least four VGA frames.
43 */ 51 */
44#define CONSISTENT_DMA_SIZE SZ_8M 52#define CONSISTENT_DMA_SIZE SZ_4M
45#endif /* CONFIG_MX3_VIDEO */ 53#endif /* CONFIG_MX1_VIDEO */
46 54
47#endif /* __ASM_ARCH_MXC_MEMORY_H__ */ 55#endif /* __ASM_ARCH_MXC_MEMORY_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mtd-xip.h b/arch/arm/plat-mxc/include/mach/mtd-xip.h
deleted file mode 100644
index 1ab1bba5688d..000000000000
--- a/arch/arm/plat-mxc/include/mach/mtd-xip.h
+++ /dev/null
@@ -1,34 +0,0 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com>, Teltonika, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#include <mach/mxc_timer.h>
15
16#ifndef __ARCH_IMX_MTD_XIP_H__
17#define __ARCH_IMX_MTD_XIP_H__
18
19#ifdef CONFIG_ARCH_MX1
20/* AITC registers */
21#define AITC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
22#define NIPNDH (AITC_BASE + 0x58)
23#define NIPNDL (AITC_BASE + 0x5C)
24#define INTENABLEH (AITC_BASE + 0x10)
25#define INTENABLEL (AITC_BASE + 0x14)
26/* MTD macros */
27#define xip_irqpending() ((__raw_readl(INTENABLEH) & __raw_readl(NIPNDH)) \
28 || (__raw_readl(INTENABLEL) & __raw_readl(NIPNDL)))
29#define xip_currtime() (__raw_readl(TIMER_BASE + MXC_TCN))
30#define xip_elapsed_since(x) (signed)((__raw_readl(TIMER_BASE + MXC_TCN) - (x)) / 96)
31#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (0))
32#endif /* CONFIG_ARCH_MX1 */
33
34#endif /* __ARCH_IMX_MTD_XIP_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx1.h b/arch/arm/plat-mxc/include/mach/mx1.h
index 1b2890a5c452..5eba7e6785de 100644
--- a/arch/arm/plat-mxc/include/mach/mx1.h
+++ b/arch/arm/plat-mxc/include/mach/mx1.h
@@ -9,156 +9,289 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#ifndef __ASM_ARCH_MXC_MX1_H__ 12#ifndef __MACH_MX1_H__
13#define __ASM_ARCH_MXC_MX1_H__ 13#define __MACH_MX1_H__
14 14
15#include <mach/vmalloc.h> 15#include <mach/vmalloc.h>
16 16
17/* 17/*
18 * Memory map 18 * Memory map
19 */ 19 */
20#define IMX_IO_PHYS 0x00200000 20#define MX1_IO_BASE_ADDR 0x00200000
21#define IMX_IO_SIZE 0x00100000 21#define MX1_IO_SIZE SZ_1M
22#define IMX_IO_BASE VMALLOC_END 22#define MX1_IO_BASE_ADDR_VIRT VMALLOC_END
23 23
24#define IMX_CS0_PHYS 0x10000000 24#define MX1_CS0_PHYS 0x10000000
25#define IMX_CS0_SIZE 0x02000000 25#define MX1_CS0_SIZE 0x02000000
26 26
27#define IMX_CS1_PHYS 0x12000000 27#define MX1_CS1_PHYS 0x12000000
28#define IMX_CS1_SIZE 0x01000000 28#define MX1_CS1_SIZE 0x01000000
29 29
30#define IMX_CS2_PHYS 0x13000000 30#define MX1_CS2_PHYS 0x13000000
31#define IMX_CS2_SIZE 0x01000000 31#define MX1_CS2_SIZE 0x01000000
32 32
33#define IMX_CS3_PHYS 0x14000000 33#define MX1_CS3_PHYS 0x14000000
34#define IMX_CS3_SIZE 0x01000000 34#define MX1_CS3_SIZE 0x01000000
35 35
36#define IMX_CS4_PHYS 0x15000000 36#define MX1_CS4_PHYS 0x15000000
37#define IMX_CS4_SIZE 0x01000000 37#define MX1_CS4_SIZE 0x01000000
38 38
39#define IMX_CS5_PHYS 0x16000000 39#define MX1_CS5_PHYS 0x16000000
40#define IMX_CS5_SIZE 0x01000000 40#define MX1_CS5_SIZE 0x01000000
41 41
42/* 42/*
43 * Register BASEs, based on OFFSETs 43 * Register BASEs, based on OFFSETs
44 */ 44 */
45#define AIPI1_BASE_ADDR (0x00000 + IMX_IO_PHYS) 45#define MX1_AIPI1_BASE_ADDR (0x00000 + MX1_IO_BASE_ADDR)
46#define WDT_BASE_ADDR (0x01000 + IMX_IO_PHYS) 46#define MX1_WDT_BASE_ADDR (0x01000 + MX1_IO_BASE_ADDR)
47#define TIM1_BASE_ADDR (0x02000 + IMX_IO_PHYS) 47#define MX1_TIM1_BASE_ADDR (0x02000 + MX1_IO_BASE_ADDR)
48#define TIM2_BASE_ADDR (0x03000 + IMX_IO_PHYS) 48#define MX1_TIM2_BASE_ADDR (0x03000 + MX1_IO_BASE_ADDR)
49#define RTC_BASE_ADDR (0x04000 + IMX_IO_PHYS) 49#define MX1_RTC_BASE_ADDR (0x04000 + MX1_IO_BASE_ADDR)
50#define LCDC_BASE_ADDR (0x05000 + IMX_IO_PHYS) 50#define MX1_LCDC_BASE_ADDR (0x05000 + MX1_IO_BASE_ADDR)
51#define UART1_BASE_ADDR (0x06000 + IMX_IO_PHYS) 51#define MX1_UART1_BASE_ADDR (0x06000 + MX1_IO_BASE_ADDR)
52#define UART2_BASE_ADDR (0x07000 + IMX_IO_PHYS) 52#define MX1_UART2_BASE_ADDR (0x07000 + MX1_IO_BASE_ADDR)
53#define PWM_BASE_ADDR (0x08000 + IMX_IO_PHYS) 53#define MX1_PWM_BASE_ADDR (0x08000 + MX1_IO_BASE_ADDR)
54#define DMA_BASE_ADDR (0x09000 + IMX_IO_PHYS) 54#define MX1_DMA_BASE_ADDR (0x09000 + MX1_IO_BASE_ADDR)
55#define AIPI2_BASE_ADDR (0x10000 + IMX_IO_PHYS) 55#define MX1_AIPI2_BASE_ADDR (0x10000 + MX1_IO_BASE_ADDR)
56#define SIM_BASE_ADDR (0x11000 + IMX_IO_PHYS) 56#define MX1_SIM_BASE_ADDR (0x11000 + MX1_IO_BASE_ADDR)
57#define USBD_BASE_ADDR (0x12000 + IMX_IO_PHYS) 57#define MX1_USBD_BASE_ADDR (0x12000 + MX1_IO_BASE_ADDR)
58#define SPI1_BASE_ADDR (0x13000 + IMX_IO_PHYS) 58#define MX1_SPI1_BASE_ADDR (0x13000 + MX1_IO_BASE_ADDR)
59#define MMC_BASE_ADDR (0x14000 + IMX_IO_PHYS) 59#define MX1_MMC_BASE_ADDR (0x14000 + MX1_IO_BASE_ADDR)
60#define ASP_BASE_ADDR (0x15000 + IMX_IO_PHYS) 60#define MX1_ASP_BASE_ADDR (0x15000 + MX1_IO_BASE_ADDR)
61#define BTA_BASE_ADDR (0x16000 + IMX_IO_PHYS) 61#define MX1_BTA_BASE_ADDR (0x16000 + MX1_IO_BASE_ADDR)
62#define I2C_BASE_ADDR (0x17000 + IMX_IO_PHYS) 62#define MX1_I2C_BASE_ADDR (0x17000 + MX1_IO_BASE_ADDR)
63#define SSI_BASE_ADDR (0x18000 + IMX_IO_PHYS) 63#define MX1_SSI_BASE_ADDR (0x18000 + MX1_IO_BASE_ADDR)
64#define SPI2_BASE_ADDR (0x19000 + IMX_IO_PHYS) 64#define MX1_SPI2_BASE_ADDR (0x19000 + MX1_IO_BASE_ADDR)
65#define MSHC_BASE_ADDR (0x1A000 + IMX_IO_PHYS) 65#define MX1_MSHC_BASE_ADDR (0x1A000 + MX1_IO_BASE_ADDR)
66#define CCM_BASE_ADDR (0x1B000 + IMX_IO_PHYS) 66#define MX1_CCM_BASE_ADDR (0x1B000 + MX1_IO_BASE_ADDR)
67#define SCM_BASE_ADDR (0x1B804 + IMX_IO_PHYS) 67#define MX1_SCM_BASE_ADDR (0x1B804 + MX1_IO_BASE_ADDR)
68#define GPIO_BASE_ADDR (0x1C000 + IMX_IO_PHYS) 68#define MX1_GPIO_BASE_ADDR (0x1C000 + MX1_IO_BASE_ADDR)
69#define EIM_BASE_ADDR (0x20000 + IMX_IO_PHYS) 69#define MX1_EIM_BASE_ADDR (0x20000 + MX1_IO_BASE_ADDR)
70#define SDRAMC_BASE_ADDR (0x21000 + IMX_IO_PHYS) 70#define MX1_SDRAMC_BASE_ADDR (0x21000 + MX1_IO_BASE_ADDR)
71#define MMA_BASE_ADDR (0x22000 + IMX_IO_PHYS) 71#define MX1_MMA_BASE_ADDR (0x22000 + MX1_IO_BASE_ADDR)
72#define AVIC_BASE_ADDR (0x23000 + IMX_IO_PHYS) 72#define MX1_AVIC_BASE_ADDR (0x23000 + MX1_IO_BASE_ADDR)
73#define CSI_BASE_ADDR (0x24000 + IMX_IO_PHYS) 73#define MX1_CSI_BASE_ADDR (0x24000 + MX1_IO_BASE_ADDR)
74 74
75/* macro to get at IO space when running virtually */ 75/* macro to get at IO space when running virtually */
76#define IO_ADDRESS(x) ((x) - IMX_IO_PHYS + IMX_IO_BASE) 76#define MX1_IO_ADDRESS(x) ( \
77 77 IMX_IO_ADDRESS(x, MX1_IO))
78/* define macros needed for entry-macro.S */
79#define AVIC_IO_ADDRESS(x) IO_ADDRESS(x)
80 78
81/* fixed interrput numbers */ 79/* fixed interrput numbers */
82#define INT_SOFTINT 0 80#define MX1_INT_SOFTINT 0
83#define CSI_INT 6 81#define MX1_CSI_INT 6
84#define DSPA_MAC_INT 7 82#define MX1_DSPA_MAC_INT 7
85#define DSPA_INT 8 83#define MX1_DSPA_INT 8
86#define COMP_INT 9 84#define MX1_COMP_INT 9
87#define MSHC_XINT 10 85#define MX1_MSHC_XINT 10
88#define GPIO_INT_PORTA 11 86#define MX1_GPIO_INT_PORTA 11
89#define GPIO_INT_PORTB 12 87#define MX1_GPIO_INT_PORTB 12
90#define GPIO_INT_PORTC 13 88#define MX1_GPIO_INT_PORTC 13
91#define LCDC_INT 14 89#define MX1_LCDC_INT 14
92#define SIM_INT 15 90#define MX1_SIM_INT 15
93#define SIM_DATA_INT 16 91#define MX1_SIM_DATA_INT 16
94#define RTC_INT 17 92#define MX1_RTC_INT 17
95#define RTC_SAMINT 18 93#define MX1_RTC_SAMINT 18
96#define UART2_MINT_PFERR 19 94#define MX1_UART2_MINT_PFERR 19
97#define UART2_MINT_RTS 20 95#define MX1_UART2_MINT_RTS 20
98#define UART2_MINT_DTR 21 96#define MX1_UART2_MINT_DTR 21
99#define UART2_MINT_UARTC 22 97#define MX1_UART2_MINT_UARTC 22
100#define UART2_MINT_TX 23 98#define MX1_UART2_MINT_TX 23
101#define UART2_MINT_RX 24 99#define MX1_UART2_MINT_RX 24
102#define UART1_MINT_PFERR 25 100#define MX1_UART1_MINT_PFERR 25
103#define UART1_MINT_RTS 26 101#define MX1_UART1_MINT_RTS 26
104#define UART1_MINT_DTR 27 102#define MX1_UART1_MINT_DTR 27
105#define UART1_MINT_UARTC 28 103#define MX1_UART1_MINT_UARTC 28
106#define UART1_MINT_TX 29 104#define MX1_UART1_MINT_TX 29
107#define UART1_MINT_RX 30 105#define MX1_UART1_MINT_RX 30
108#define VOICE_DAC_INT 31 106#define MX1_VOICE_DAC_INT 31
109#define VOICE_ADC_INT 32 107#define MX1_VOICE_ADC_INT 32
110#define PEN_DATA_INT 33 108#define MX1_PEN_DATA_INT 33
111#define PWM_INT 34 109#define MX1_PWM_INT 34
112#define SDHC_INT 35 110#define MX1_SDHC_INT 35
113#define I2C_INT 39 111#define MX1_I2C_INT 39
114#define CSPI_INT 41 112#define MX1_CSPI_INT 41
115#define SSI_TX_INT 42 113#define MX1_SSI_TX_INT 42
116#define SSI_TX_ERR_INT 43 114#define MX1_SSI_TX_ERR_INT 43
117#define SSI_RX_INT 44 115#define MX1_SSI_RX_INT 44
118#define SSI_RX_ERR_INT 45 116#define MX1_SSI_RX_ERR_INT 45
119#define TOUCH_INT 46 117#define MX1_TOUCH_INT 46
120#define USBD_INT0 47 118#define MX1_USBD_INT0 47
121#define USBD_INT1 48 119#define MX1_USBD_INT1 48
122#define USBD_INT2 49 120#define MX1_USBD_INT2 49
123#define USBD_INT3 50 121#define MX1_USBD_INT3 50
124#define USBD_INT4 51 122#define MX1_USBD_INT4 51
125#define USBD_INT5 52 123#define MX1_USBD_INT5 52
126#define USBD_INT6 53 124#define MX1_USBD_INT6 53
127#define BTSYS_INT 55 125#define MX1_BTSYS_INT 55
128#define BTTIM_INT 56 126#define MX1_BTTIM_INT 56
129#define BTWUI_INT 57 127#define MX1_BTWUI_INT 57
130#define TIM2_INT 58 128#define MX1_TIM2_INT 58
131#define TIM1_INT 59 129#define MX1_TIM1_INT 59
132#define DMA_ERR 60 130#define MX1_DMA_ERR 60
133#define DMA_INT 61 131#define MX1_DMA_INT 61
134#define GPIO_INT_PORTD 62 132#define MX1_GPIO_INT_PORTD 62
135#define WDT_INT 63 133#define MX1_WDT_INT 63
136 134
137/* DMA */ 135/* DMA */
138#define DMA_REQ_UART3_T 2 136#define MX1_DMA_REQ_UART3_T 2
139#define DMA_REQ_UART3_R 3 137#define MX1_DMA_REQ_UART3_R 3
140#define DMA_REQ_SSI2_T 4 138#define MX1_DMA_REQ_SSI2_T 4
141#define DMA_REQ_SSI2_R 5 139#define MX1_DMA_REQ_SSI2_R 5
142#define DMA_REQ_CSI_STAT 6 140#define MX1_DMA_REQ_CSI_STAT 6
143#define DMA_REQ_CSI_R 7 141#define MX1_DMA_REQ_CSI_R 7
144#define DMA_REQ_MSHC 8 142#define MX1_DMA_REQ_MSHC 8
145#define DMA_REQ_DSPA_DCT_DOUT 9 143#define MX1_DMA_REQ_DSPA_DCT_DOUT 9
146#define DMA_REQ_DSPA_DCT_DIN 10 144#define MX1_DMA_REQ_DSPA_DCT_DIN 10
147#define DMA_REQ_DSPA_MAC 11 145#define MX1_DMA_REQ_DSPA_MAC 11
148#define DMA_REQ_EXT 12 146#define MX1_DMA_REQ_EXT 12
149#define DMA_REQ_SDHC 13 147#define MX1_DMA_REQ_SDHC 13
150#define DMA_REQ_SPI1_R 14 148#define MX1_DMA_REQ_SPI1_R 14
151#define DMA_REQ_SPI1_T 15 149#define MX1_DMA_REQ_SPI1_T 15
152#define DMA_REQ_SSI_T 16 150#define MX1_DMA_REQ_SSI_T 16
153#define DMA_REQ_SSI_R 17 151#define MX1_DMA_REQ_SSI_R 17
154#define DMA_REQ_ASP_DAC 18 152#define MX1_DMA_REQ_ASP_DAC 18
155#define DMA_REQ_ASP_ADC 19 153#define MX1_DMA_REQ_ASP_ADC 19
156#define DMA_REQ_USP_EP(x) (20 + (x)) 154#define MX1_DMA_REQ_USP_EP(x) (20 + (x))
157#define DMA_REQ_SPI2_R 26 155#define MX1_DMA_REQ_SPI2_R 26
158#define DMA_REQ_SPI2_T 27 156#define MX1_DMA_REQ_SPI2_T 27
159#define DMA_REQ_UART2_T 28 157#define MX1_DMA_REQ_UART2_T 28
160#define DMA_REQ_UART2_R 29 158#define MX1_DMA_REQ_UART2_R 29
161#define DMA_REQ_UART1_T 30 159#define MX1_DMA_REQ_UART1_T 30
162#define DMA_REQ_UART1_R 31 160#define MX1_DMA_REQ_UART1_R 31
163 161
164#endif /* __ASM_ARCH_MXC_MX1_H__ */ 162/*
163 * This doesn't depend on IMX_NEEDS_DEPRECATED_SYMBOLS
164 * to not break drivers/usb/gadget/imx_udc. Should go
165 * away after this driver uses the new name.
166 */
167#define USBD_INT0 MX1_USBD_INT0
168
169#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
170/* these should go away */
171#define IMX_IO_PHYS MX1_IO_BASE_ADDR
172#define IMX_IO_SIZE MX1_IO_SIZE
173#define IMX_IO_BASE MX1_IO_BASE_ADDR_VIRT
174#define IMX_CS0_PHYS MX1_CS0_PHYS
175#define IMX_CS0_SIZE MX1_CS0_SIZE
176#define IMX_CS1_PHYS MX1_CS1_PHYS
177#define IMX_CS1_SIZE MX1_CS1_SIZE
178#define IMX_CS2_PHYS MX1_CS2_PHYS
179#define IMX_CS2_SIZE MX1_CS2_SIZE
180#define IMX_CS3_PHYS MX1_CS3_PHYS
181#define IMX_CS3_SIZE MX1_CS3_SIZE
182#define IMX_CS4_PHYS MX1_CS4_PHYS
183#define IMX_CS4_SIZE MX1_CS4_SIZE
184#define IMX_CS5_PHYS MX1_CS5_PHYS
185#define IMX_CS5_SIZE MX1_CS5_SIZE
186#define AIPI1_BASE_ADDR MX1_AIPI1_BASE_ADDR
187#define WDT_BASE_ADDR MX1_WDT_BASE_ADDR
188#define TIM1_BASE_ADDR MX1_TIM1_BASE_ADDR
189#define TIM2_BASE_ADDR MX1_TIM2_BASE_ADDR
190#define RTC_BASE_ADDR MX1_RTC_BASE_ADDR
191#define LCDC_BASE_ADDR MX1_LCDC_BASE_ADDR
192#define UART1_BASE_ADDR MX1_UART1_BASE_ADDR
193#define UART2_BASE_ADDR MX1_UART2_BASE_ADDR
194#define PWM_BASE_ADDR MX1_PWM_BASE_ADDR
195#define DMA_BASE_ADDR MX1_DMA_BASE_ADDR
196#define AIPI2_BASE_ADDR MX1_AIPI2_BASE_ADDR
197#define SIM_BASE_ADDR MX1_SIM_BASE_ADDR
198#define USBD_BASE_ADDR MX1_USBD_BASE_ADDR
199#define SPI1_BASE_ADDR MX1_SPI1_BASE_ADDR
200#define MMC_BASE_ADDR MX1_MMC_BASE_ADDR
201#define ASP_BASE_ADDR MX1_ASP_BASE_ADDR
202#define BTA_BASE_ADDR MX1_BTA_BASE_ADDR
203#define I2C_BASE_ADDR MX1_I2C_BASE_ADDR
204#define SSI_BASE_ADDR MX1_SSI_BASE_ADDR
205#define SPI2_BASE_ADDR MX1_SPI2_BASE_ADDR
206#define MSHC_BASE_ADDR MX1_MSHC_BASE_ADDR
207#define CCM_BASE_ADDR MX1_CCM_BASE_ADDR
208#define SCM_BASE_ADDR MX1_SCM_BASE_ADDR
209#define GPIO_BASE_ADDR MX1_GPIO_BASE_ADDR
210#define EIM_BASE_ADDR MX1_EIM_BASE_ADDR
211#define SDRAMC_BASE_ADDR MX1_SDRAMC_BASE_ADDR
212#define MMA_BASE_ADDR MX1_MMA_BASE_ADDR
213#define AVIC_BASE_ADDR MX1_AVIC_BASE_ADDR
214#define CSI_BASE_ADDR MX1_CSI_BASE_ADDR
215#define IO_ADDRESS(x) MX1_IO_ADDRESS(x)
216#define AVIC_IO_ADDRESS(x) IO_ADDRESS(x)
217#define INT_SOFTINT MX1_INT_SOFTINT
218#define CSI_INT MX1_CSI_INT
219#define DSPA_MAC_INT MX1_DSPA_MAC_INT
220#define DSPA_INT MX1_DSPA_INT
221#define COMP_INT MX1_COMP_INT
222#define MSHC_XINT MX1_MSHC_XINT
223#define GPIO_INT_PORTA MX1_GPIO_INT_PORTA
224#define GPIO_INT_PORTB MX1_GPIO_INT_PORTB
225#define GPIO_INT_PORTC MX1_GPIO_INT_PORTC
226#define LCDC_INT MX1_LCDC_INT
227#define SIM_INT MX1_SIM_INT
228#define SIM_DATA_INT MX1_SIM_DATA_INT
229#define RTC_INT MX1_RTC_INT
230#define RTC_SAMINT MX1_RTC_SAMINT
231#define UART2_MINT_PFERR MX1_UART2_MINT_PFERR
232#define UART2_MINT_RTS MX1_UART2_MINT_RTS
233#define UART2_MINT_DTR MX1_UART2_MINT_DTR
234#define UART2_MINT_UARTC MX1_UART2_MINT_UARTC
235#define UART2_MINT_TX MX1_UART2_MINT_TX
236#define UART2_MINT_RX MX1_UART2_MINT_RX
237#define UART1_MINT_PFERR MX1_UART1_MINT_PFERR
238#define UART1_MINT_RTS MX1_UART1_MINT_RTS
239#define UART1_MINT_DTR MX1_UART1_MINT_DTR
240#define UART1_MINT_UARTC MX1_UART1_MINT_UARTC
241#define UART1_MINT_TX MX1_UART1_MINT_TX
242#define UART1_MINT_RX MX1_UART1_MINT_RX
243#define VOICE_DAC_INT MX1_VOICE_DAC_INT
244#define VOICE_ADC_INT MX1_VOICE_ADC_INT
245#define PEN_DATA_INT MX1_PEN_DATA_INT
246#define PWM_INT MX1_PWM_INT
247#define SDHC_INT MX1_SDHC_INT
248#define I2C_INT MX1_I2C_INT
249#define CSPI_INT MX1_CSPI_INT
250#define SSI_TX_INT MX1_SSI_TX_INT
251#define SSI_TX_ERR_INT MX1_SSI_TX_ERR_INT
252#define SSI_RX_INT MX1_SSI_RX_INT
253#define SSI_RX_ERR_INT MX1_SSI_RX_ERR_INT
254#define TOUCH_INT MX1_TOUCH_INT
255#define USBD_INT1 MX1_USBD_INT1
256#define USBD_INT2 MX1_USBD_INT2
257#define USBD_INT3 MX1_USBD_INT3
258#define USBD_INT4 MX1_USBD_INT4
259#define USBD_INT5 MX1_USBD_INT5
260#define USBD_INT6 MX1_USBD_INT6
261#define BTSYS_INT MX1_BTSYS_INT
262#define BTTIM_INT MX1_BTTIM_INT
263#define BTWUI_INT MX1_BTWUI_INT
264#define TIM2_INT MX1_TIM2_INT
265#define TIM1_INT MX1_TIM1_INT
266#define DMA_ERR MX1_DMA_ERR
267#define DMA_INT MX1_DMA_INT
268#define GPIO_INT_PORTD MX1_GPIO_INT_PORTD
269#define WDT_INT MX1_WDT_INT
270#define DMA_REQ_UART3_T MX1_DMA_REQ_UART3_T
271#define DMA_REQ_UART3_R MX1_DMA_REQ_UART3_R
272#define DMA_REQ_SSI2_T MX1_DMA_REQ_SSI2_T
273#define DMA_REQ_SSI2_R MX1_DMA_REQ_SSI2_R
274#define DMA_REQ_CSI_STAT MX1_DMA_REQ_CSI_STAT
275#define DMA_REQ_CSI_R MX1_DMA_REQ_CSI_R
276#define DMA_REQ_MSHC MX1_DMA_REQ_MSHC
277#define DMA_REQ_DSPA_DCT_DOUT MX1_DMA_REQ_DSPA_DCT_DOUT
278#define DMA_REQ_DSPA_DCT_DIN MX1_DMA_REQ_DSPA_DCT_DIN
279#define DMA_REQ_DSPA_MAC MX1_DMA_REQ_DSPA_MAC
280#define DMA_REQ_EXT MX1_DMA_REQ_EXT
281#define DMA_REQ_SDHC MX1_DMA_REQ_SDHC
282#define DMA_REQ_SPI1_R MX1_DMA_REQ_SPI1_R
283#define DMA_REQ_SPI1_T MX1_DMA_REQ_SPI1_T
284#define DMA_REQ_SSI_T MX1_DMA_REQ_SSI_T
285#define DMA_REQ_SSI_R MX1_DMA_REQ_SSI_R
286#define DMA_REQ_ASP_DAC MX1_DMA_REQ_ASP_DAC
287#define DMA_REQ_ASP_ADC MX1_DMA_REQ_ASP_ADC
288#define DMA_REQ_USP_EP(x) MX1_DMA_REQ_USP_EP(x)
289#define DMA_REQ_SPI2_R MX1_DMA_REQ_SPI2_R
290#define DMA_REQ_SPI2_T MX1_DMA_REQ_SPI2_T
291#define DMA_REQ_UART2_T MX1_DMA_REQ_UART2_T
292#define DMA_REQ_UART2_R MX1_DMA_REQ_UART2_R
293#define DMA_REQ_UART1_T MX1_DMA_REQ_UART1_T
294#define DMA_REQ_UART1_R MX1_DMA_REQ_UART1_R
295#endif /* ifdef IMX_NEEDS_DEPRECATED_SYMBOLS */
296
297#endif /* ifndef __MACH_MX1_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx21.h b/arch/arm/plat-mxc/include/mach/mx21.h
index bb297d8765a7..ed98b9c9f389 100644
--- a/arch/arm/plat-mxc/include/mach/mx21.h
+++ b/arch/arm/plat-mxc/include/mach/mx21.h
@@ -22,8 +22,8 @@
22 * MA 02110-1301, USA. 22 * MA 02110-1301, USA.
23 */ 23 */
24 24
25#ifndef __ASM_ARCH_MXC_MX21_H__ 25#ifndef __MACH_MX21_H__
26#define __ASM_ARCH_MXC_MX21_H__ 26#define __MACH_MX21_H__
27 27
28#define MX21_AIPI_BASE_ADDR 0x10000000 28#define MX21_AIPI_BASE_ADDR 0x10000000
29#define MX21_AIPI_BASE_ADDR_VIRT 0xf4000000 29#define MX21_AIPI_BASE_ADDR_VIRT 0xf4000000
@@ -92,6 +92,11 @@
92 92
93#define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */ 93#define MX21_IRAM_BASE_ADDR 0xffffe800 /* internal ram */
94 94
95#define MX21_IO_ADDRESS(x) ( \
96 IMX_IO_ADDRESS(x, MX21_AIPI) ?: \
97 IMX_IO_ADDRESS(x, MX21_SAHB1) ?: \
98 IMX_IO_ADDRESS(x, MX21_X_MEMC))
99
95/* fixed interrupt numbers */ 100/* fixed interrupt numbers */
96#define MX21_INT_CSPI3 6 101#define MX21_INT_CSPI3 6
97#define MX21_INT_GPIO 8 102#define MX21_INT_GPIO 8
@@ -179,6 +184,7 @@
179#define MX21_DMA_REQ_CSI_STAT 30 184#define MX21_DMA_REQ_CSI_STAT 30
180#define MX21_DMA_REQ_CSI_RX 31 185#define MX21_DMA_REQ_CSI_RX 31
181 186
187#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
182/* these should go away */ 188/* these should go away */
183#define SDRAM_BASE_ADDR MX21_SDRAM_BASE_ADDR 189#define SDRAM_BASE_ADDR MX21_SDRAM_BASE_ADDR
184#define CSD1_BASE_ADDR MX21_CSD1_BASE_ADDR 190#define CSD1_BASE_ADDR MX21_CSD1_BASE_ADDR
@@ -211,5 +217,6 @@
211#define DMA_REQ_FIRI_RX MX21_DMA_REQ_FIRI_RX 217#define DMA_REQ_FIRI_RX MX21_DMA_REQ_FIRI_RX
212#define DMA_REQ_BMI_TX MX21_DMA_REQ_BMI_TX 218#define DMA_REQ_BMI_TX MX21_DMA_REQ_BMI_TX
213#define DMA_REQ_BMI_RX MX21_DMA_REQ_BMI_RX 219#define DMA_REQ_BMI_RX MX21_DMA_REQ_BMI_RX
220#endif
214 221
215#endif /* __ASM_ARCH_MXC_MX21_H__ */ 222#endif /* ifndef __MACH_MX21_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx25.h b/arch/arm/plat-mxc/include/mach/mx25.h
index 854e2dc58481..4eb6e334bda5 100644
--- a/arch/arm/plat-mxc/include/mach/mx25.h
+++ b/arch/arm/plat-mxc/include/mach/mx25.h
@@ -22,27 +22,27 @@
22#define MX25_GPIO3_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xa4000) 22#define MX25_GPIO3_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xa4000)
23#define MX25_GPIO4_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0x9c000) 23#define MX25_GPIO4_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0x9c000)
24 24
25#define MX25_AIPS1_IO_ADDRESS(x) \ 25#define MX25_IO_ADDRESS(x) ( \
26 (((x) - MX25_AIPS1_BASE_ADDR) + MX25_AIPS1_BASE_ADDR_VIRT) 26 IMX_IO_ADDRESS(x, MX25_AIPS1) ?: \
27#define MX25_AIPS2_IO_ADDRESS(x) \ 27 IMX_IO_ADDRESS(x, MX25_AIPS2) ?: \
28 (((x) - MX25_AIPS2_BASE_ADDR) + MX25_AIPS2_BASE_ADDR_VIRT) 28 IMX_IO_ADDRESS(x, MX25_AVIC))
29#define MX25_AVIC_IO_ADDRESS(x) \
30 (((x) - MX25_AVIC_BASE_ADDR) + MX25_AVIC_BASE_ADDR_VIRT)
31 29
32#define __in_range(addr, name) ((addr) >= name##_BASE_ADDR && (addr) < name##_BASE_ADDR + name##_SIZE) 30#define MX25_UART1_BASE_ADDR 0x43f90000
33 31#define MX25_UART2_BASE_ADDR 0x43f94000
34#define MX25_IO_ADDRESS(x) \
35 (void __force __iomem *) \
36 (__in_range(x, MX25_AIPS1) ? MX25_AIPS1_IO_ADDRESS(x) : \
37 __in_range(x, MX25_AIPS2) ? MX25_AIPS2_IO_ADDRESS(x) : \
38 __in_range(x, MX25_AVIC) ? MX25_AVIC_IO_ADDRESS(x) : \
39 0xDEADBEEF)
40
41#define UART1_BASE_ADDR 0x43f90000
42#define UART2_BASE_ADDR 0x43f94000
43 32
44#define MX25_FEC_BASE_ADDR 0x50038000 33#define MX25_FEC_BASE_ADDR 0x50038000
34#define MX25_NFC_BASE_ADDR 0xbb000000
35#define MX25_DRYICE_BASE_ADDR 0x53ffc000
36#define MX25_LCDC_BASE_ADDR 0x53fbc000
45 37
38#define MX25_INT_DRYICE 25
46#define MX25_INT_FEC 57 39#define MX25_INT_FEC 57
40#define MX25_INT_NANDFC 33
41#define MX25_INT_LCDC 39
42
43#if defined(IMX_NEEDS_DEPRECATED_SYMBOLS)
44#define UART1_BASE_ADDR MX25_UART1_BASE_ADDR
45#define UART2_BASE_ADDR MX25_UART2_BASE_ADDR
46#endif
47 47
48#endif /* __MACH_MX25_H__ */ 48#endif /* ifndef __MACH_MX25_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h
index e2ae19f51710..bae9cd75beee 100644
--- a/arch/arm/plat-mxc/include/mach/mx27.h
+++ b/arch/arm/plat-mxc/include/mach/mx27.h
@@ -21,8 +21,12 @@
21 * MA 02110-1301, USA. 21 * MA 02110-1301, USA.
22 */ 22 */
23 23
24#ifndef __ASM_ARCH_MXC_MX27_H__ 24#ifndef __MACH_MX27_H__
25#define __ASM_ARCH_MXC_MX27_H__ 25#define __MACH_MX27_H__
26
27#ifndef __ASSEMBLER__
28#include <linux/io.h>
29#endif
26 30
27#define MX27_AIPI_BASE_ADDR 0x10000000 31#define MX27_AIPI_BASE_ADDR 0x10000000
28#define MX27_AIPI_BASE_ADDR_VIRT 0xf4000000 32#define MX27_AIPI_BASE_ADDR_VIRT 0xf4000000
@@ -109,11 +113,31 @@
109#define MX27_M3IF_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x3000) 113#define MX27_M3IF_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x3000)
110#define MX27_PCMCIA_CTL_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x4000) 114#define MX27_PCMCIA_CTL_BASE_ADDR (MX27_X_MEMC_BASE_ADDR + 0x4000)
111 115
116#define MX27_WEIM_CSCRx_BASE_ADDR(cs) (MX27_WEIM_BASE_ADDR + (cs) * 0x10)
117#define MX27_WEIM_CSCRxU(cs) (MX27_WEIM_CSCRx_BASE_ADDR(cs))
118#define MX27_WEIM_CSCRxL(cs) (MX27_WEIM_CSCRx_BASE_ADDR(cs) + 0x4)
119#define MX27_WEIM_CSCRxA(cs) (MX27_WEIM_CSCRx_BASE_ADDR(cs) + 0x8)
120
112#define MX27_PCMCIA_MEM_BASE_ADDR 0xdc000000 121#define MX27_PCMCIA_MEM_BASE_ADDR 0xdc000000
113 122
114/* IRAM */ 123/* IRAM */
115#define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */ 124#define MX27_IRAM_BASE_ADDR 0xffff4c00 /* internal ram */
116 125
126#define MX27_IO_ADDRESS(x) ( \
127 IMX_IO_ADDRESS(x, MX27_AIPI) ?: \
128 IMX_IO_ADDRESS(x, MX27_SAHB1) ?: \
129 IMX_IO_ADDRESS(x, MX27_X_MEMC))
130
131#ifndef __ASSEMBLER__
132static inline void mx27_setup_weimcs(size_t cs,
133 unsigned upper, unsigned lower, unsigned addional)
134{
135 __raw_writel(upper, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(cs)));
136 __raw_writel(lower, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(cs)));
137 __raw_writel(addional, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(cs)));
138}
139#endif
140
117/* fixed interrupt numbers */ 141/* fixed interrupt numbers */
118#define MX27_INT_I2C2 1 142#define MX27_INT_I2C2 1
119#define MX27_INT_GPT6 2 143#define MX27_INT_GPT6 2
@@ -225,6 +249,7 @@
225extern int mx27_revision(void); 249extern int mx27_revision(void);
226#endif 250#endif
227 251
252#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
228/* these should go away */ 253/* these should go away */
229#define MSHC_BASE_ADDR MX27_MSHC_BASE_ADDR 254#define MSHC_BASE_ADDR MX27_MSHC_BASE_ADDR
230#define GPT5_BASE_ADDR MX27_GPT5_BASE_ADDR 255#define GPT5_BASE_ADDR MX27_GPT5_BASE_ADDR
@@ -292,5 +317,6 @@ extern int mx27_revision(void);
292#define DMA_REQ_UART6_RX MX27_DMA_REQ_UART6_RX 317#define DMA_REQ_UART6_RX MX27_DMA_REQ_UART6_RX
293#define DMA_REQ_SDHC3 MX27_DMA_REQ_SDHC3 318#define DMA_REQ_SDHC3 MX27_DMA_REQ_SDHC3
294#define DMA_REQ_NFC MX27_DMA_REQ_NFC 319#define DMA_REQ_NFC MX27_DMA_REQ_NFC
320#endif
295 321
296#endif /* __ASM_ARCH_MXC_MX27_H__ */ 322#endif /* ifndef __MACH_MX27_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx2x.h b/arch/arm/plat-mxc/include/mach/mx2x.h
index f2eaf140ed02..afb895a0b5b8 100644
--- a/arch/arm/plat-mxc/include/mach/mx2x.h
+++ b/arch/arm/plat-mxc/include/mach/mx2x.h
@@ -20,8 +20,8 @@
20 * MA 02110-1301, USA. 20 * MA 02110-1301, USA.
21 */ 21 */
22 22
23#ifndef __ASM_ARCH_MXC_MX2x_H__ 23#ifndef __MACH_MX2x_H__
24#define __ASM_ARCH_MXC_MX2x_H__ 24#define __MACH_MX2x_H__
25 25
26/* The following addresses are common between i.MX21 and i.MX27 */ 26/* The following addresses are common between i.MX21 and i.MX27 */
27 27
@@ -176,6 +176,7 @@
176#define MX2x_DMA_REQ_CSI_STAT 30 176#define MX2x_DMA_REQ_CSI_STAT 30
177#define MX2x_DMA_REQ_CSI_RX 31 177#define MX2x_DMA_REQ_CSI_RX 31
178 178
179#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
179/* these should go away */ 180/* these should go away */
180#define AIPI_BASE_ADDR MX2x_AIPI_BASE_ADDR 181#define AIPI_BASE_ADDR MX2x_AIPI_BASE_ADDR
181#define AIPI_BASE_ADDR_VIRT MX2x_AIPI_BASE_ADDR_VIRT 182#define AIPI_BASE_ADDR_VIRT MX2x_AIPI_BASE_ADDR_VIRT
@@ -287,5 +288,6 @@
287#define DMA_REQ_UART1_TX MX2x_DMA_REQ_UART1_TX 288#define DMA_REQ_UART1_TX MX2x_DMA_REQ_UART1_TX
288#define DMA_REQ_CSI_STAT MX2x_DMA_REQ_CSI_STAT 289#define DMA_REQ_CSI_STAT MX2x_DMA_REQ_CSI_STAT
289#define DMA_REQ_CSI_RX MX2x_DMA_REQ_CSI_RX 290#define DMA_REQ_CSI_RX MX2x_DMA_REQ_CSI_RX
291#endif
290 292
291#endif /* __ASM_ARCH_MXC_MX2x_H__ */ 293#endif /* ifndef __MACH_MX2x_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx31.h b/arch/arm/plat-mxc/include/mach/mx31.h
index b8b47d139eb5..fb90e119c2b5 100644
--- a/arch/arm/plat-mxc/include/mach/mx31.h
+++ b/arch/arm/plat-mxc/include/mach/mx31.h
@@ -1,3 +1,10 @@
1#ifndef __MACH_MX31_H__
2#define __MACH_MX31_H__
3
4#ifndef __ASSEMBLER__
5#include <linux/io.h>
6#endif
7
1/* 8/*
2 * IRAM 9 * IRAM
3 */ 10 */
@@ -107,8 +114,30 @@
107#define MX31_EMI_CTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x4000) 114#define MX31_EMI_CTL_BASE_ADDR (MX31_X_MEMC_BASE_ADDR + 0x4000)
108#define MX31_PCMCIA_CTL_BASE_ADDR MX31_EMI_CTL_BASE_ADDR 115#define MX31_PCMCIA_CTL_BASE_ADDR MX31_EMI_CTL_BASE_ADDR
109 116
117#define MX31_WEIM_CSCRx_BASE_ADDR(cs) (MX31_WEIM_BASE_ADDR + (cs) * 0x10)
118#define MX31_WEIM_CSCRxU(cs) (MX31_WEIM_CSCRx_BASE_ADDR(cs))
119#define MX31_WEIM_CSCRxL(cs) (MX31_WEIM_CSCRx_BASE_ADDR(cs) + 0x4)
120#define MX31_WEIM_CSCRxA(cs) (MX31_WEIM_CSCRx_BASE_ADDR(cs) + 0x8)
121
110#define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000 122#define MX31_PCMCIA_MEM_BASE_ADDR 0xbc000000
111 123
124#define MX31_IO_ADDRESS(x) ( \
125 IMX_IO_ADDRESS(x, MX31_AIPS1) ?: \
126 IMX_IO_ADDRESS(x, MX31_AIPS2) ?: \
127 IMX_IO_ADDRESS(x, MX31_AVIC) ?: \
128 IMX_IO_ADDRESS(x, MX31_X_MEMC) ?: \
129 IMX_IO_ADDRESS(x, MX31_SPBA0))
130
131#ifndef __ASSEMBLER__
132static inline void mx31_setup_weimcs(size_t cs,
133 unsigned upper, unsigned lower, unsigned addional)
134{
135 __raw_writel(upper, MX31_IO_ADDRESS(MX31_WEIM_CSCRxU(cs)));
136 __raw_writel(lower, MX31_IO_ADDRESS(MX31_WEIM_CSCRxL(cs)));
137 __raw_writel(addional, MX31_IO_ADDRESS(MX31_WEIM_CSCRxA(cs)));
138}
139#endif
140
112#define MX31_INT_I2C3 3 141#define MX31_INT_I2C3 3
113#define MX31_INT_I2C2 4 142#define MX31_INT_I2C2 4
114#define MX31_INT_MPEG4_ENCODER 5 143#define MX31_INT_MPEG4_ENCODER 5
@@ -186,6 +215,7 @@
186#define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0 215#define MX31_SYSTEM_REV_MIN MX31_CHIP_REV_1_0
187#define MX31_SYSTEM_REV_NUM 3 216#define MX31_SYSTEM_REV_NUM 3
188 217
218#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
189/* these should go away */ 219/* these should go away */
190#define ATA_BASE_ADDR MX31_ATA_BASE_ADDR 220#define ATA_BASE_ADDR MX31_ATA_BASE_ADDR
191#define UART4_BASE_ADDR MX31_UART4_BASE_ADDR 221#define UART4_BASE_ADDR MX31_UART4_BASE_ADDR
@@ -216,3 +246,6 @@
216#define MXC_INT_UART5 MX31_INT_UART5 246#define MXC_INT_UART5 MX31_INT_UART5
217#define MXC_INT_CCM MX31_INT_CCM 247#define MXC_INT_CCM MX31_INT_CCM
218#define MXC_INT_PCMCIA MX31_INT_PCMCIA 248#define MXC_INT_PCMCIA MX31_INT_PCMCIA
249#endif
250
251#endif /* ifndef __MACH_MX31_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx35.h b/arch/arm/plat-mxc/include/mach/mx35.h
index af871bce35b6..526a55842ae5 100644
--- a/arch/arm/plat-mxc/include/mach/mx35.h
+++ b/arch/arm/plat-mxc/include/mach/mx35.h
@@ -1,3 +1,5 @@
1#ifndef __MACH_MX35_H__
2#define __MACH_MX35_H__
1/* 3/*
2 * IRAM 4 * IRAM
3 */ 5 */
@@ -104,6 +106,13 @@
104#define MX35_NFC_BASE_ADDR 0xbb000000 106#define MX35_NFC_BASE_ADDR 0xbb000000
105#define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000 107#define MX35_PCMCIA_MEM_BASE_ADDR 0xbc000000
106 108
109#define MX35_IO_ADDRESS(x) ( \
110 IMX_IO_ADDRESS(x, MX35_AIPS1) ?: \
111 IMX_IO_ADDRESS(x, MX35_AIPS2) ?: \
112 IMX_IO_ADDRESS(x, MX35_AVIC) ?: \
113 IMX_IO_ADDRESS(x, MX35_X_MEMC) ?: \
114 IMX_IO_ADDRESS(x, MX35_SPBA0))
115
107/* 116/*
108 * Interrupt numbers 117 * Interrupt numbers
109 */ 118 */
@@ -180,6 +189,7 @@
180#define MX35_SYSTEM_REV_MIN MX35_CHIP_REV_1_0 189#define MX35_SYSTEM_REV_MIN MX35_CHIP_REV_1_0
181#define MX35_SYSTEM_REV_NUM 3 190#define MX35_SYSTEM_REV_NUM 3
182 191
192#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
183/* these should go away */ 193/* these should go away */
184#define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR 194#define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR
185#define MXC_INT_OWIRE MX35_INT_OWIRE 195#define MXC_INT_OWIRE MX35_INT_OWIRE
@@ -195,3 +205,6 @@
195#define MXC_INT_MLB MX35_INT_MLB 205#define MXC_INT_MLB MX35_INT_MLB
196#define MXC_INT_SPDIF MX35_INT_SPDIF 206#define MXC_INT_SPDIF MX35_INT_SPDIF
197#define MXC_INT_FEC MX35_INT_FEC 207#define MXC_INT_FEC MX35_INT_FEC
208#endif
209
210#endif /* ifndef __MACH_MX35_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx3x.h b/arch/arm/plat-mxc/include/mach/mx3x.h
index be69272407ad..7a356de385f5 100644
--- a/arch/arm/plat-mxc/include/mach/mx3x.h
+++ b/arch/arm/plat-mxc/include/mach/mx3x.h
@@ -8,8 +8,8 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef __ASM_ARCH_MXC_MX31_H__ 11#ifndef __MACH_MX3x_H__
12#define __ASM_ARCH_MXC_MX31_H__ 12#define __MACH_MX3x_H__
13 13
14/* 14/*
15 * MX31 memory map: 15 * MX31 memory map:
@@ -269,6 +269,7 @@ static inline int mx31_revision(void)
269} 269}
270#endif 270#endif
271 271
272#ifdef IMX_NEEDS_DEPRECATED_SYMBOLS
272/* these should go away */ 273/* these should go away */
273#define L2CC_BASE_ADDR MX3x_L2CC_BASE_ADDR 274#define L2CC_BASE_ADDR MX3x_L2CC_BASE_ADDR
274#define L2CC_SIZE MX3x_L2CC_SIZE 275#define L2CC_SIZE MX3x_L2CC_SIZE
@@ -401,5 +402,6 @@ static inline int mx31_revision(void)
401#define CHIP_REV_3_2 MX3x_CHIP_REV_3_2 402#define CHIP_REV_3_2 MX3x_CHIP_REV_3_2
402#define SYSTEM_REV_MIN MX3x_SYSTEM_REV_MIN 403#define SYSTEM_REV_MIN MX3x_SYSTEM_REV_MIN
403#define SYSTEM_REV_NUM MX3x_SYSTEM_REV_NUM 404#define SYSTEM_REV_NUM MX3x_SYSTEM_REV_NUM
405#endif
404 406
405#endif /* __ASM_ARCH_MXC_MX31_H__ */ 407#endif /* ifndef __MACH_MX3x_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mx51.h b/arch/arm/plat-mxc/include/mach/mx51.h
new file mode 100644
index 000000000000..771532b6b4a6
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/mx51.h
@@ -0,0 +1,454 @@
1#ifndef __ASM_ARCH_MXC_MX51_H__
2#define __ASM_ARCH_MXC_MX51_H__
3
4/*
5 * MX51 memory map:
6 *
7 *
8 * Virt Phys Size What
9 * ---------------------------------------------------------------------------
10 * FA3E0000 1FFE0000 128K IRAM (SCCv2 RAM)
11 * 30000000 256M GPU
12 * 40000000 512M IPU
13 * FA200000 60000000 1M DEBUG
14 * FB100000 70000000 1M SPBA 0
15 * FB000000 73F00000 1M AIPS 1
16 * FB200000 83F00000 1M AIPS 2
17 * FA100000 8FFFC000 16K TZIC (interrupt controller)
18 * 90000000 256M CSD0 SDRAM/DDR
19 * A0000000 256M CSD1 SDRAM/DDR
20 * B0000000 128M CS0 Flash
21 * B8000000 128M CS1 Flash
22 * C0000000 128M CS2 Flash
23 * C8000000 64M CS3 Flash
24 * CC000000 32M CS4 SRAM
25 * CE000000 32M CS5 SRAM
26 * F9000000 CFFF0000 64K NFC (NAND Flash AXI)
27 *
28 */
29
30/*
31 * IRAM
32 */
33#define MX51_IRAM_BASE_ADDR 0x1FFE0000 /* internal ram */
34#define MX51_IRAM_BASE_ADDR_VIRT 0xFA3E0000
35#define MX51_IRAM_PARTITIONS 16
36#define MX51_IRAM_PARTITIONS_TO1 12
37#define MX51_IRAM_SIZE (MX51_IRAM_PARTITIONS * SZ_8K) /* 128KB */
38
39/*
40 * NFC
41 */
42#define MX51_NFC_AXI_BASE_ADDR 0xCFFF0000 /* NAND flash AXI */
43#define MX51_NFC_AXI_BASE_ADDR_VIRT 0xF9000000
44#define MX51_NFC_AXI_SIZE SZ_64K
45
46/*
47 * Graphics Memory of GPU
48 */
49#define MX51_GPU_BASE_ADDR 0x20000000
50#define MX51_GPU2D_BASE_ADDR 0xD0000000
51
52#define MX51_TZIC_BASE_ADDR 0x8FFFC000
53#define MX51_TZIC_BASE_ADDR_VIRT 0xFA100000
54#define MX51_TZIC_SIZE SZ_16K
55
56#define MX51_DEBUG_BASE_ADDR 0x60000000
57#define MX51_DEBUG_BASE_ADDR_VIRT 0xFA200000
58#define MX51_DEBUG_SIZE SZ_1M
59#define MX51_ETB_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00001000)
60#define MX51_ETM_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00002000)
61#define MX51_TPIU_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00003000)
62#define MX51_CTI0_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00004000)
63#define MX51_CTI1_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00005000)
64#define MX51_CTI2_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00006000)
65#define MX51_CTI3_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00007000)
66#define MX51_CORTEX_DBG_BASE_ADDR (MX51_DEBUG_BASE_ADDR + 0x00008000)
67
68/*
69 * SPBA global module enabled #0
70 */
71#define MX51_SPBA0_BASE_ADDR 0x70000000
72#define MX51_SPBA0_BASE_ADDR_VIRT 0xFB100000
73#define MX51_SPBA0_SIZE SZ_1M
74
75#define MX51_MMC_SDHC1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00004000)
76#define MX51_MMC_SDHC2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00008000)
77#define MX51_UART3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0000C000)
78#define MX51_CSPI1_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00010000)
79#define MX51_SSI2_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00014000)
80#define MX51_MMC_SDHC3_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00020000)
81#define MX51_MMC_SDHC4_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00024000)
82#define MX51_SPDIF_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00028000)
83#define MX51_ATA_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00030000)
84#define MX51_SLIM_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00034000)
85#define MX51_HSI2C_DMA_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x00038000)
86#define MX51_SPBA_CTRL_BASE_ADDR (MX51_SPBA0_BASE_ADDR + 0x0003C000)
87
88/*
89 * defines for SPBA modules
90 */
91#define MX51_SPBA_SDHC1 0x04
92#define MX51_SPBA_SDHC2 0x08
93#define MX51_SPBA_UART3 0x0C
94#define MX51_SPBA_CSPI1 0x10
95#define MX51_SPBA_SSI2 0x14
96#define MX51_SPBA_SDHC3 0x20
97#define MX51_SPBA_SDHC4 0x24
98#define MX51_SPBA_SPDIF 0x28
99#define MX51_SPBA_ATA 0x30
100#define MX51_SPBA_SLIM 0x34
101#define MX51_SPBA_HSI2C 0x38
102#define MX51_SPBA_CTRL 0x3C
103
104/*
105 * AIPS 1
106 */
107#define MX51_AIPS1_BASE_ADDR 0x73F00000
108#define MX51_AIPS1_BASE_ADDR_VIRT 0xFB000000
109#define MX51_AIPS1_SIZE SZ_1M
110
111#define MX51_OTG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00080000)
112#define MX51_GPIO1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00084000)
113#define MX51_GPIO2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00088000)
114#define MX51_GPIO3_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x0008C000)
115#define MX51_GPIO4_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00090000)
116#define MX51_KPP_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00094000)
117#define MX51_WDOG_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x00098000)
118#define MX51_WDOG2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x0009C000)
119#define MX51_GPT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A0000)
120#define MX51_SRTC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A4000)
121#define MX51_IOMUXC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000A8000)
122#define MX51_EPIT1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000AC000)
123#define MX51_EPIT2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B0000)
124#define MX51_PWM1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B4000)
125#define MX51_PWM2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000B8000)
126#define MX51_UART1_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000BC000)
127#define MX51_UART2_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000C0000)
128#define MX51_SRC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D0000)
129#define MX51_CCM_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D4000)
130#define MX51_GPC_BASE_ADDR (MX51_AIPS1_BASE_ADDR + 0x000D8000)
131
132/*
133 * Defines for modules using static and dynamic DMA channels
134 */
135#define MX51_MXC_DMA_CHANNEL_IRAM 30
136#define MX51_MXC_DMA_CHANNEL_SPDIF_TX MXC_DMA_DYNAMIC_CHANNEL
137#define MX51_MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL
138#define MX51_MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL
139#define MX51_MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL
140#define MX51_MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL
141#define MX51_MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL
142#define MX51_MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL
143#define MX51_MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL
144#define MX51_MXC_DMA_CHANNEL_MMC2 MXC_DMA_DYNAMIC_CHANNEL
145#define MX51_MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL
146#define MX51_MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL
147#define MX51_MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL
148#ifdef CONFIG_SDMA_IRAM
149#define MX51_MXC_DMA_CHANNEL_SSI2_TX (MX51_MXC_DMA_CHANNEL_IRAM + 1)
150#else /*CONFIG_SDMA_IRAM */
151#define MX51_MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL
152#endif /*CONFIG_SDMA_IRAM */
153#define MX51_MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL
154#define MX51_MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL
155#define MX51_MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL
156#define MX51_MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL
157#define MX51_MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL
158#define MX51_MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL
159#define MX51_MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL
160#define MX51_MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL
161#define MX51_MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL
162
163/*
164 * AIPS 2
165 */
166#define MX51_AIPS2_BASE_ADDR 0x83F00000
167#define MX51_AIPS2_BASE_ADDR_VIRT 0xFB200000
168#define MX51_AIPS2_SIZE SZ_1M
169
170#define MX51_PLL1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00080000)
171#define MX51_PLL2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00084000)
172#define MX51_PLL3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00088000)
173#define MX51_AHBMAX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00094000)
174#define MX51_IIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x00098000)
175#define MX51_CSU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x0009C000)
176#define MX51_ARM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A0000)
177#define MX51_OWIRE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A4000)
178#define MX51_FIRI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000A8000)
179#define MX51_CSPI2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000AC000)
180#define MX51_SDMA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B0000)
181#define MX51_SCC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B4000)
182#define MX51_ROMCP_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000B8000)
183#define MX51_RTIC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000BC000)
184#define MX51_CSPI3_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C0000)
185#define MX51_I2C2_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C4000)
186#define MX51_I2C1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000C8000)
187#define MX51_SSI1_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000CC000)
188#define MX51_AUDMUX_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D0000)
189#define MX51_M4IF_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D8000)
190#define MX51_ESDCTL_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000D9000)
191#define MX51_WEIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DA000)
192#define MX51_NFC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DB000)
193#define MX51_EMI_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DBF00)
194#define MX51_MIPI_HSC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000DC000)
195#define MX51_ATA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E0000)
196#define MX51_SIM_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E4000)
197#define MX51_SSI3BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000E8000)
198#define MX51_MXC_FEC_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000EC000)
199#define MX51_TVE_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F0000)
200#define MX51_VPU_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F4000)
201#define MX51_SAHARA_BASE_ADDR (MX51_AIPS2_BASE_ADDR + 0x000F8000)
202
203/*
204 * Memory regions and CS
205 */
206#define MX51_GPU_CTRL_BASE_ADDR 0x30000000
207#define MX51_IPU_CTRL_BASE_ADDR 0x40000000
208#define MX51_CSD0_BASE_ADDR 0x90000000
209#define MX51_CSD1_BASE_ADDR 0xA0000000
210#define MX51_CS0_BASE_ADDR 0xB0000000
211#define MX51_CS1_BASE_ADDR 0xB8000000
212#define MX51_CS2_BASE_ADDR 0xC0000000
213#define MX51_CS3_BASE_ADDR 0xC8000000
214#define MX51_CS4_BASE_ADDR 0xCC000000
215#define MX51_CS5_BASE_ADDR 0xCE000000
216
217/* Does given address belongs to the specified memory region? */
218#define ADDRESS_IN_REGION(addr, start, size) \
219 (((addr) >= (start)) && ((addr) < (start)+(size)))
220
221/* Does given address belongs to the specified named `module'? */
222#define MX51_IS_MODULE(addr, module) \
223 ADDRESS_IN_REGION(addr, MX51_ ## module ## _BASE_ADDR, \
224 MX51_ ## module ## _SIZE)
225/*
226 * This macro defines the physical to virtual address mapping for all the
227 * peripheral modules. It is used by passing in the physical address as x
228 * and returning the virtual address. If the physical address is not mapped,
229 * it returns 0xDEADBEEF
230 */
231
232#define MX51_IO_ADDRESS(x) \
233 (void __iomem *) \
234 (MX51_IS_MODULE(x, IRAM) ? MX51_IRAM_IO_ADDRESS(x) : \
235 MX51_IS_MODULE(x, TZIC) ? MX51_TZIC_IO_ADDRESS(x) : \
236 MX51_IS_MODULE(x, DEBUG) ? MX51_DEBUG_IO_ADDRESS(x) : \
237 MX51_IS_MODULE(x, SPBA0) ? MX51_SPBA0_IO_ADDRESS(x) : \
238 MX51_IS_MODULE(x, AIPS1) ? MX51_AIPS1_IO_ADDRESS(x) : \
239 MX51_IS_MODULE(x, AIPS2) ? MX51_AIPS2_IO_ADDRESS(x) : \
240 MX51_IS_MODULE(x, NFC_AXI) ? MX51_NFC_AXI_IO_ADDRESS(x) : \
241 0xDEADBEEF)
242
243/*
244 * define the address mapping macros: in physical address order
245 */
246#define MX51_IRAM_IO_ADDRESS(x) \
247 (((x) - MX51_IRAM_BASE_ADDR) + MX51_IRAM_BASE_ADDR_VIRT)
248
249#define MX51_TZIC_IO_ADDRESS(x) \
250 (((x) - MX51_TZIC_BASE_ADDR) + MX51_TZIC_BASE_ADDR_VIRT)
251
252#define MX51_DEBUG_IO_ADDRESS(x) \
253 (((x) - MX51_DEBUG_BASE_ADDR) + MX51_DEBUG_BASE_ADDR_VIRT)
254
255#define MX51_SPBA0_IO_ADDRESS(x) \
256 (((x) - MX51_SPBA0_BASE_ADDR) + MX51_SPBA0_BASE_ADDR_VIRT)
257
258#define MX51_AIPS1_IO_ADDRESS(x) \
259 (((x) - MX51_AIPS1_BASE_ADDR) + MX51_AIPS1_BASE_ADDR_VIRT)
260
261#define MX51_AIPS2_IO_ADDRESS(x) \
262 (((x) - MX51_AIPS2_BASE_ADDR) + MX51_AIPS2_BASE_ADDR_VIRT)
263
264#define MX51_NFC_AXI_IO_ADDRESS(x) \
265 (((x) - MX51_NFC_AXI_BASE_ADDR) + MX51_NFC_AXI_BASE_ADDR_VIRT)
266
267#define MX51_IS_MEM_DEVICE_NONSHARED(x) 0
268
269/*
270 * DMA request assignments
271 */
272#define MX51_DMA_REQ_SSI3_TX1 47
273#define MX51_DMA_REQ_SSI3_RX1 46
274#define MX51_DMA_REQ_SPDIF 45
275#define MX51_DMA_REQ_UART3_TX 44
276#define MX51_DMA_REQ_UART3_RX 43
277#define MX51_DMA_REQ_SLIM_B_TX 42
278#define MX51_DMA_REQ_SDHC4 41
279#define MX51_DMA_REQ_SDHC3 40
280#define MX51_DMA_REQ_CSPI_TX 39
281#define MX51_DMA_REQ_CSPI_RX 38
282#define MX51_DMA_REQ_SSI3_TX2 37
283#define MX51_DMA_REQ_IPU 36
284#define MX51_DMA_REQ_SSI3_RX2 35
285#define MX51_DMA_REQ_EPIT2 34
286#define MX51_DMA_REQ_CTI2_1 33
287#define MX51_DMA_REQ_EMI_WR 32
288#define MX51_DMA_REQ_CTI2_0 31
289#define MX51_DMA_REQ_EMI_RD 30
290#define MX51_DMA_REQ_SSI1_TX1 29
291#define MX51_DMA_REQ_SSI1_RX1 28
292#define MX51_DMA_REQ_SSI1_TX2 27
293#define MX51_DMA_REQ_SSI1_RX2 26
294#define MX51_DMA_REQ_SSI2_TX1 25
295#define MX51_DMA_REQ_SSI2_RX1 24
296#define MX51_DMA_REQ_SSI2_TX2 23
297#define MX51_DMA_REQ_SSI2_RX2 22
298#define MX51_DMA_REQ_SDHC2 21
299#define MX51_DMA_REQ_SDHC1 20
300#define MX51_DMA_REQ_UART1_TX 19
301#define MX51_DMA_REQ_UART1_RX 18
302#define MX51_DMA_REQ_UART2_TX 17
303#define MX51_DMA_REQ_UART2_RX 16
304#define MX51_DMA_REQ_GPU 15
305#define MX51_DMA_REQ_EXTREQ1 14
306#define MX51_DMA_REQ_FIRI_TX 13
307#define MX51_DMA_REQ_FIRI_RX 12
308#define MX51_DMA_REQ_HS_I2C_RX 11
309#define MX51_DMA_REQ_HS_I2C_TX 10
310#define MX51_DMA_REQ_CSPI2_TX 9
311#define MX51_DMA_REQ_CSPI2_RX 8
312#define MX51_DMA_REQ_CSPI1_TX 7
313#define MX51_DMA_REQ_CSPI1_RX 6
314#define MX51_DMA_REQ_SLIM_B 5
315#define MX51_DMA_REQ_ATA_TX_END 4
316#define MX51_DMA_REQ_ATA_TX 3
317#define MX51_DMA_REQ_ATA_RX 2
318#define MX51_DMA_REQ_GPC 1
319#define MX51_DMA_REQ_VPU 0
320
321/*
322 * Interrupt numbers
323 */
324#define MX51_MXC_INT_BASE 0
325#define MX51_MXC_INT_RESV0 0
326#define MX51_MXC_INT_MMC_SDHC1 1
327#define MX51_MXC_INT_MMC_SDHC2 2
328#define MX51_MXC_INT_MMC_SDHC3 3
329#define MX51_MXC_INT_MMC_SDHC4 4
330#define MX51_MXC_INT_RESV5 5
331#define MX51_MXC_INT_SDMA 6
332#define MX51_MXC_INT_IOMUX 7
333#define MX51_MXC_INT_NFC 8
334#define MX51_MXC_INT_VPU 9
335#define MX51_MXC_INT_IPU_ERR 10
336#define MX51_MXC_INT_IPU_SYN 11
337#define MX51_MXC_INT_GPU 12
338#define MX51_MXC_INT_RESV13 13
339#define MX51_MXC_INT_USB_H1 14
340#define MX51_MXC_INT_EMI 15
341#define MX51_MXC_INT_USB_H2 16
342#define MX51_MXC_INT_USB_H3 17
343#define MX51_MXC_INT_USB_OTG 18
344#define MX51_MXC_INT_SAHARA_H0 19
345#define MX51_MXC_INT_SAHARA_H1 20
346#define MX51_MXC_INT_SCC_SMN 21
347#define MX51_MXC_INT_SCC_STZ 22
348#define MX51_MXC_INT_SCC_SCM 23
349#define MX51_MXC_INT_SRTC_NTZ 24
350#define MX51_MXC_INT_SRTC_TZ 25
351#define MX51_MXC_INT_RTIC 26
352#define MX51_MXC_INT_CSU 27
353#define MX51_MXC_INT_SLIM_B 28
354#define MX51_MXC_INT_SSI1 29
355#define MX51_MXC_INT_SSI2 30
356#define MX51_MXC_INT_UART1 31
357#define MX51_MXC_INT_UART2 32
358#define MX51_MXC_INT_UART3 33
359#define MX51_MXC_INT_RESV34 34
360#define MX51_MXC_INT_RESV35 35
361#define MX51_MXC_INT_CSPI1 36
362#define MX51_MXC_INT_CSPI2 37
363#define MX51_MXC_INT_CSPI 38
364#define MX51_MXC_INT_GPT 39
365#define MX51_MXC_INT_EPIT1 40
366#define MX51_MXC_INT_EPIT2 41
367#define MX51_MXC_INT_GPIO1_INT7 42
368#define MX51_MXC_INT_GPIO1_INT6 43
369#define MX51_MXC_INT_GPIO1_INT5 44
370#define MX51_MXC_INT_GPIO1_INT4 45
371#define MX51_MXC_INT_GPIO1_INT3 46
372#define MX51_MXC_INT_GPIO1_INT2 47
373#define MX51_MXC_INT_GPIO1_INT1 48
374#define MX51_MXC_INT_GPIO1_INT0 49
375#define MX51_MXC_INT_GPIO1_LOW 50
376#define MX51_MXC_INT_GPIO1_HIGH 51
377#define MX51_MXC_INT_GPIO2_LOW 52
378#define MX51_MXC_INT_GPIO2_HIGH 53
379#define MX51_MXC_INT_GPIO3_LOW 54
380#define MX51_MXC_INT_GPIO3_HIGH 55
381#define MX51_MXC_INT_GPIO4_LOW 56
382#define MX51_MXC_INT_GPIO4_HIGH 57
383#define MX51_MXC_INT_WDOG1 58
384#define MX51_MXC_INT_WDOG2 59
385#define MX51_MXC_INT_KPP 60
386#define MX51_MXC_INT_PWM1 61
387#define MX51_MXC_INT_I2C1 62
388#define MX51_MXC_INT_I2C2 63
389#define MX51_MXC_INT_HS_I2C 64
390#define MX51_MXC_INT_RESV65 65
391#define MX51_MXC_INT_RESV66 66
392#define MX51_MXC_INT_SIM_IPB 67
393#define MX51_MXC_INT_SIM_DAT 68
394#define MX51_MXC_INT_IIM 69
395#define MX51_MXC_INT_ATA 70
396#define MX51_MXC_INT_CCM1 71
397#define MX51_MXC_INT_CCM2 72
398#define MX51_MXC_INT_GPC1 73
399#define MX51_MXC_INT_GPC2 74
400#define MX51_MXC_INT_SRC 75
401#define MX51_MXC_INT_NM 76
402#define MX51_MXC_INT_PMU 77
403#define MX51_MXC_INT_CTI_IRQ 78
404#define MX51_MXC_INT_CTI1_TG0 79
405#define MX51_MXC_INT_CTI1_TG1 80
406#define MX51_MXC_INT_MCG_ERR 81
407#define MX51_MXC_INT_MCG_TMR 82
408#define MX51_MXC_INT_MCG_FUNC 83
409#define MX51_MXC_INT_GPU2_IRQ 84
410#define MX51_MXC_INT_GPU2_BUSY 85
411#define MX51_MXC_INT_RESV86 86
412#define MX51_MXC_INT_FEC 87
413#define MX51_MXC_INT_OWIRE 88
414#define MX51_MXC_INT_CTI1_TG2 89
415#define MX51_MXC_INT_SJC 90
416#define MX51_MXC_INT_SPDIF 91
417#define MX51_MXC_INT_TVE 92
418#define MX51_MXC_INT_FIRI 93
419#define MX51_MXC_INT_PWM2 94
420#define MX51_MXC_INT_SLIM_EXP 95
421#define MX51_MXC_INT_SSI3 96
422#define MX51_MXC_INT_EMI_BOOT 97
423#define MX51_MXC_INT_CTI1_TG3 98
424#define MX51_MXC_INT_SMC_RX 99
425#define MX51_MXC_INT_VPU_IDLE 100
426#define MX51_MXC_INT_EMI_NFC 101
427#define MX51_MXC_INT_GPU_IDLE 102
428
429/* silicon revisions specific to i.MX51 */
430#define MX51_CHIP_REV_1_0 0x10
431#define MX51_CHIP_REV_1_1 0x11
432#define MX51_CHIP_REV_1_2 0x12
433#define MX51_CHIP_REV_1_3 0x13
434#define MX51_CHIP_REV_2_0 0x20
435#define MX51_CHIP_REV_2_1 0x21
436#define MX51_CHIP_REV_2_2 0x22
437#define MX51_CHIP_REV_2_3 0x23
438#define MX51_CHIP_REV_3_0 0x30
439#define MX51_CHIP_REV_3_1 0x31
440#define MX51_CHIP_REV_3_2 0x32
441
442/* Mandatory defines used globally */
443
444#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS)
445
446extern unsigned int system_rev;
447
448static inline unsigned int mx51_revision(void)
449{
450 return system_rev;
451}
452#endif
453
454#endif /* __ASM_ARCH_MXC_MX51_H__ */
diff --git a/arch/arm/plat-mxc/include/mach/mxc.h b/arch/arm/plat-mxc/include/mach/mxc.h
index 51990536b845..a790bf212972 100644
--- a/arch/arm/plat-mxc/include/mach/mxc.h
+++ b/arch/arm/plat-mxc/include/mach/mxc.h
@@ -30,6 +30,7 @@
30#define MXC_CPU_MX27 27 30#define MXC_CPU_MX27 27
31#define MXC_CPU_MX31 31 31#define MXC_CPU_MX31 31
32#define MXC_CPU_MX35 35 32#define MXC_CPU_MX35 35
33#define MXC_CPU_MX51 51
33#define MXC_CPU_MXC91231 91231 34#define MXC_CPU_MXC91231 91231
34 35
35#ifndef __ASSEMBLY__ 36#ifndef __ASSEMBLY__
@@ -108,6 +109,18 @@ extern unsigned int __mxc_cpu_type;
108# define cpu_is_mx35() (0) 109# define cpu_is_mx35() (0)
109#endif 110#endif
110 111
112#ifdef CONFIG_ARCH_MX5
113# ifdef mxc_cpu_type
114# undef mxc_cpu_type
115# define mxc_cpu_type __mxc_cpu_type
116# else
117# define mxc_cpu_type MXC_CPU_MX51
118# endif
119# define cpu_is_mx51() (mxc_cpu_type == MXC_CPU_MX51)
120#else
121# define cpu_is_mx51() (0)
122#endif
123
111#ifdef CONFIG_ARCH_MXC91231 124#ifdef CONFIG_ARCH_MXC91231
112# ifdef mxc_cpu_type 125# ifdef mxc_cpu_type
113# undef mxc_cpu_type 126# undef mxc_cpu_type
@@ -121,9 +134,10 @@ extern unsigned int __mxc_cpu_type;
121#endif 134#endif
122 135
123#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2) 136#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2)
124#define CSCR_U(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10) 137/* These are deprecated, use mx[23][157]_setup_weimcs instead. */
125#define CSCR_L(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x4) 138#define CSCR_U(n) (IO_ADDRESS(WEIM_BASE_ADDR + n * 0x10))
126#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR) + n * 0x10 + 0x8) 139#define CSCR_L(n) (IO_ADDRESS(WEIM_BASE_ADDR + n * 0x10 + 0x4))
140#define CSCR_A(n) (IO_ADDRESS(WEIM_BASE_ADDR + n * 0x10 + 0x8))
127#endif 141#endif
128 142
129#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35() || cpu_is_mxc91231()) 143#define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35() || cpu_is_mxc91231())
diff --git a/arch/arm/plat-mxc/include/mach/mxc91231.h b/arch/arm/plat-mxc/include/mach/mxc91231.h
index 81484d1ef232..5182b986b785 100644
--- a/arch/arm/plat-mxc/include/mach/mxc91231.h
+++ b/arch/arm/plat-mxc/include/mach/mxc91231.h
@@ -184,60 +184,22 @@
184#define MXC91231_CS4_BASE_ADDR 0xB4000000 184#define MXC91231_CS4_BASE_ADDR 0xB4000000
185#define MXC91231_CS5_BASE_ADDR 0xB6000000 185#define MXC91231_CS5_BASE_ADDR 0xB6000000
186 186
187/* Is given address belongs to the specified memory region? */
188#define ADDRESS_IN_REGION(addr, start, size) \
189 (((addr) >= (start)) && ((addr) < (start)+(size)))
190
191/* Is given address belongs to the specified named `module'? */
192#define MXC91231_IS_MODULE(addr, module) \
193 ADDRESS_IN_REGION(addr, MXC91231_ ## module ## _BASE_ADDR, \
194 MXC91231_ ## module ## _SIZE)
195/* 187/*
196 * This macro defines the physical to virtual address mapping for all the 188 * This macro defines the physical to virtual address mapping for all the
197 * peripheral modules. It is used by passing in the physical address as x 189 * peripheral modules. It is used by passing in the physical address as x
198 * and returning the virtual address. If the physical address is not mapped, 190 * and returning the virtual address. If the physical address is not mapped,
199 * it returns 0xDEADBEEF 191 * it returns 0.
200 */
201
202#define MXC91231_IO_ADDRESS(x) \
203 (void __iomem *) \
204 (MXC91231_IS_MODULE(x, L2CC) ? MXC91231_L2CC_IO_ADDRESS(x) : \
205 MXC91231_IS_MODULE(x, AIPS1) ? MXC91231_AIPS1_IO_ADDRESS(x) : \
206 MXC91231_IS_MODULE(x, AIPS2) ? MXC91231_AIPS2_IO_ADDRESS(x) : \
207 MXC91231_IS_MODULE(x, SPBA0) ? MXC91231_SPBA0_IO_ADDRESS(x) : \
208 MXC91231_IS_MODULE(x, SPBA1) ? MXC91231_SPBA1_IO_ADDRESS(x) : \
209 MXC91231_IS_MODULE(x, ROMP) ? MXC91231_ROMP_IO_ADDRESS(x) : \
210 MXC91231_IS_MODULE(x, AVIC) ? MXC91231_AVIC_IO_ADDRESS(x) : \
211 MXC91231_IS_MODULE(x, X_MEMC) ? MXC91231_X_MEMC_IO_ADDRESS(x) : \
212 0xDEADBEEF)
213
214
215/*
216 * define the address mapping macros: in physical address order
217 */ 192 */
218#define MXC91231_L2CC_IO_ADDRESS(x) \
219 (((x) - MXC91231_L2CC_BASE_ADDR) + MXC91231_L2CC_BASE_ADDR_VIRT)
220
221#define MXC91231_AIPS1_IO_ADDRESS(x) \
222 (((x) - MXC91231_AIPS1_BASE_ADDR) + MXC91231_AIPS1_BASE_ADDR_VIRT)
223
224#define MXC91231_SPBA0_IO_ADDRESS(x) \
225 (((x) - MXC91231_SPBA0_BASE_ADDR) + MXC91231_SPBA0_BASE_ADDR_VIRT)
226
227#define MXC91231_SPBA1_IO_ADDRESS(x) \
228 (((x) - MXC91231_SPBA1_BASE_ADDR) + MXC91231_SPBA1_BASE_ADDR_VIRT)
229
230#define MXC91231_AIPS2_IO_ADDRESS(x) \
231 (((x) - MXC91231_AIPS2_BASE_ADDR) + MXC91231_AIPS2_BASE_ADDR_VIRT)
232
233#define MXC91231_ROMP_IO_ADDRESS(x) \
234 (((x) - MXC91231_ROMP_BASE_ADDR) + MXC91231_ROMP_BASE_ADDR_VIRT)
235
236#define MXC91231_AVIC_IO_ADDRESS(x) \
237 (((x) - MXC91231_AVIC_BASE_ADDR) + MXC91231_AVIC_BASE_ADDR_VIRT)
238 193
239#define MXC91231_X_MEMC_IO_ADDRESS(x) \ 194#define MXC91231_IO_ADDRESS(x) ( \
240 (((x) - MXC91231_X_MEMC_BASE_ADDR) + MXC91231_X_MEMC_BASE_ADDR_VIRT) 195 IMX_IO_ADDRESS(x, MXC91231_L2CC) ?: \
196 IMX_IO_ADDRESS(x, MXC91231_X_MEMC) ?: \
197 IMX_IO_ADDRESS(x, MXC91231_ROMP) ?: \
198 IMX_IO_ADDRESS(x, MXC91231_AVIC) ?: \
199 IMX_IO_ADDRESS(x, MXC91231_AIPS1) ?: \
200 IMX_IO_ADDRESS(x, MXC91231_SPBA0) ?: \
201 IMX_IO_ADDRESS(x, MXC91231_SPBA1) ?: \
202 IMX_IO_ADDRESS(x, MXC91231_AIPS2))
241 203
242/* 204/*
243 * Interrupt numbers 205 * Interrupt numbers
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h
index 8f796239393e..4b9b8368c0c0 100644
--- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h
+++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h
@@ -22,6 +22,10 @@
22#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5) 22#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5)
23#define MXC_EHCI_TTL_ENABLED (1 << 6) 23#define MXC_EHCI_TTL_ENABLED (1 << 6)
24 24
25#define MXC_EHCI_INTERNAL_PHY (1 << 7)
26#define MXC_EHCI_IPPUE_DOWN (1 << 8)
27#define MXC_EHCI_IPPUE_UP (1 << 9)
28
25struct mxc_usbh_platform_data { 29struct mxc_usbh_platform_data {
26 int (*init)(struct platform_device *pdev); 30 int (*init)(struct platform_device *pdev);
27 int (*exit)(struct platform_device *pdev); 31 int (*exit)(struct platform_device *pdev);
diff --git a/arch/arm/plat-mxc/include/mach/ssi.h b/arch/arm/plat-mxc/include/mach/ssi.h
new file mode 100644
index 000000000000..c34ded523f10
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/ssi.h
@@ -0,0 +1,18 @@
1#ifndef __MACH_SSI_H
2#define __MACH_SSI_H
3
4struct snd_ac97;
5
6extern unsigned char imx_ssi_fiq_start, imx_ssi_fiq_end;
7extern unsigned long imx_ssi_fiq_base, imx_ssi_fiq_tx_buffer, imx_ssi_fiq_rx_buffer;
8
9struct imx_ssi_platform_data {
10 unsigned int flags;
11#define IMX_SSI_DMA (1 << 0)
12#define IMX_SSI_USE_AC97 (1 << 1)
13 void (*ac97_reset) (struct snd_ac97 *ac97);
14 void (*ac97_warm_reset)(struct snd_ac97 *ac97);
15};
16
17#endif /* __MACH_SSI_H */
18
diff --git a/arch/arm/plat-mxc/include/mach/timex.h b/arch/arm/plat-mxc/include/mach/timex.h
index 527a6c24788e..024416ed11cd 100644
--- a/arch/arm/plat-mxc/include/mach/timex.h
+++ b/arch/arm/plat-mxc/include/mach/timex.h
@@ -28,6 +28,8 @@
28#define CLOCK_TICK_RATE 16625000 28#define CLOCK_TICK_RATE 16625000
29#elif defined CONFIG_ARCH_MX25 29#elif defined CONFIG_ARCH_MX25
30#define CLOCK_TICK_RATE 16000000 30#define CLOCK_TICK_RATE 16000000
31#elif defined CONFIG_ARCH_MX5
32#define CLOCK_TICK_RATE 8000000
31#elif defined CONFIG_ARCH_MXC91231 33#elif defined CONFIG_ARCH_MXC91231
32#define CLOCK_TICK_RATE 13000000 34#define CLOCK_TICK_RATE 13000000
33#endif 35#endif
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index d49384cb1e97..52e476a150ca 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -1,8 +1,6 @@
1/* 1/*
2 * arch/arm/plat-mxc/include/mach/uncompress.h 2 * arch/arm/plat-mxc/include/mach/uncompress.h
3 * 3 *
4 *
5 *
6 * Copyright (C) 1999 ARM Limited 4 * Copyright (C) 1999 ARM Limited
7 * Copyright (C) Shane Nay (shane@minirl.com) 5 * Copyright (C) Shane Nay (shane@minirl.com)
8 * 6 *
@@ -25,7 +23,6 @@
25 23
26#define __MXC_BOOT_UNCOMPRESS 24#define __MXC_BOOT_UNCOMPRESS
27 25
28#include <mach/hardware.h>
29#include <asm/mach-types.h> 26#include <asm/mach-types.h>
30 27
31static unsigned long uart_base; 28static unsigned long uart_base;
diff --git a/arch/arm/plat-mxc/iomux-mx1-mx2.c b/arch/arm/plat-mxc/iomux-mx1-mx2.c
deleted file mode 100644
index a37163ce280b..000000000000
--- a/arch/arm/plat-mxc/iomux-mx1-mx2.c
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 * arch/arm/mach-mxc/generic.c
3 *
4 * author: Sascha Hauer
5 * Created: april 20th, 2004
6 * Copyright: Synertronixx GmbH
7 *
8 * Common code for i.MX machines
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26#include <linux/errno.h>
27#include <linux/init.h>
28#include <linux/kernel.h>
29#include <linux/module.h>
30#include <linux/string.h>
31#include <linux/gpio.h>
32
33#include <mach/hardware.h>
34#include <asm/mach/map.h>
35#include <mach/iomux.h>
36
37void mxc_gpio_mode(int gpio_mode)
38{
39 unsigned int pin = gpio_mode & GPIO_PIN_MASK;
40 unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
41 unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT;
42 unsigned int tmp;
43
44 /* Pullup enable */
45 tmp = __raw_readl(VA_GPIO_BASE + MXC_PUEN(port));
46 if (gpio_mode & GPIO_PUEN)
47 tmp |= (1 << pin);
48 else
49 tmp &= ~(1 << pin);
50 __raw_writel(tmp, VA_GPIO_BASE + MXC_PUEN(port));
51
52 /* Data direction */
53 tmp = __raw_readl(VA_GPIO_BASE + MXC_DDIR(port));
54 if (gpio_mode & GPIO_OUT)
55 tmp |= 1 << pin;
56 else
57 tmp &= ~(1 << pin);
58 __raw_writel(tmp, VA_GPIO_BASE + MXC_DDIR(port));
59
60 /* Primary / alternate function */
61 tmp = __raw_readl(VA_GPIO_BASE + MXC_GPR(port));
62 if (gpio_mode & GPIO_AF)
63 tmp |= (1 << pin);
64 else
65 tmp &= ~(1 << pin);
66 __raw_writel(tmp, VA_GPIO_BASE + MXC_GPR(port));
67
68 /* use as gpio? */
69 tmp = __raw_readl(VA_GPIO_BASE + MXC_GIUS(port));
70 if (gpio_mode & (GPIO_PF | GPIO_AF))
71 tmp &= ~(1 << pin);
72 else
73 tmp |= (1 << pin);
74 __raw_writel(tmp, VA_GPIO_BASE + MXC_GIUS(port));
75
76 if (pin < 16) {
77 tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port));
78 tmp &= ~(3 << (pin * 2));
79 tmp |= (ocr << (pin * 2));
80 __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port));
81
82 tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port));
83 tmp &= ~(3 << (pin * 2));
84 tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2);
85 __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFA1(port));
86
87 tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFB1(port));
88 tmp &= ~(3 << (pin * 2));
89 tmp |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << (pin * 2);
90 __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port));
91 } else {
92 pin -= 16;
93
94 tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port));
95 tmp &= ~(3 << (pin * 2));
96 tmp |= (ocr << (pin * 2));
97 __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port));
98
99 tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA2(port));
100 tmp &= ~(3 << (pin * 2));
101 tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2);
102 __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFA2(port));
103
104 tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFB2(port));
105 tmp &= ~(3 << (pin * 2));
106 tmp |= ((gpio_mode >> GPIO_BOUT_SHIFT) & 3) << (pin * 2);
107 __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB2(port));
108 }
109}
110EXPORT_SYMBOL(mxc_gpio_mode);
111
112int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
113 const char *label)
114{
115 const int *p = pin_list;
116 int i;
117 unsigned gpio;
118 unsigned mode;
119 int ret = -EINVAL;
120
121 for (i = 0; i < count; i++) {
122 gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
123 mode = *p & ~(GPIO_PIN_MASK | GPIO_PORT_MASK);
124
125 if (gpio >= (GPIO_PORT_MAX + 1) * 32)
126 goto setup_error;
127
128 ret = gpio_request(gpio, label);
129 if (ret)
130 goto setup_error;
131
132 mxc_gpio_mode(gpio | mode);
133
134 p++;
135 }
136 return 0;
137
138setup_error:
139 mxc_gpio_release_multiple_pins(pin_list, i);
140 return ret;
141}
142EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins);
143
144void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
145{
146 const int *p = pin_list;
147 int i;
148
149 for (i = 0; i < count; i++) {
150 unsigned gpio = *p & (GPIO_PIN_MASK | GPIO_PORT_MASK);
151 gpio_free(gpio);
152 p++;
153 }
154
155}
156EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);
157
diff --git a/arch/arm/plat-mxc/iomux-v1.c b/arch/arm/plat-mxc/iomux-v1.c
new file mode 100644
index 000000000000..960a02cbcbaf
--- /dev/null
+++ b/arch/arm/plat-mxc/iomux-v1.c
@@ -0,0 +1,238 @@
1/*
2 * arch/arm/plat-mxc/iomux-v1.c
3 *
4 * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
5 * Copyright (C) 2009 Uwe Kleine-Koenig, Pengutronix
6 *
7 * Common code for i.MX1, i.MX21 and i.MX27
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23
24#include <linux/errno.h>
25#include <linux/init.h>
26#include <linux/kernel.h>
27#include <linux/module.h>
28#include <linux/string.h>
29#include <linux/gpio.h>
30
31#include <mach/hardware.h>
32#include <asm/mach/map.h>
33#include <mach/iomux-v1.h>
34
35static void __iomem *imx_iomuxv1_baseaddr;
36static unsigned imx_iomuxv1_numports;
37
38static inline unsigned long imx_iomuxv1_readl(unsigned offset)
39{
40 return __raw_readl(imx_iomuxv1_baseaddr + offset);
41}
42
43static inline void imx_iomuxv1_writel(unsigned long val, unsigned offset)
44{
45 __raw_writel(val, imx_iomuxv1_baseaddr + offset);
46}
47
48static inline void imx_iomuxv1_rmwl(unsigned offset,
49 unsigned long mask, unsigned long value)
50{
51 unsigned long reg = imx_iomuxv1_readl(offset);
52
53 reg &= ~mask;
54 reg |= value;
55
56 imx_iomuxv1_writel(reg, offset);
57}
58
59static inline void imx_iomuxv1_set_puen(
60 unsigned int port, unsigned int pin, int on)
61{
62 unsigned long mask = 1 << pin;
63
64 imx_iomuxv1_rmwl(MXC_PUEN(port), mask, on ? mask : 0);
65}
66
67static inline void imx_iomuxv1_set_ddir(
68 unsigned int port, unsigned int pin, int out)
69{
70 unsigned long mask = 1 << pin;
71
72 imx_iomuxv1_rmwl(MXC_DDIR(port), mask, out ? mask : 0);
73}
74
75static inline void imx_iomuxv1_set_gpr(
76 unsigned int port, unsigned int pin, int af)
77{
78 unsigned long mask = 1 << pin;
79
80 imx_iomuxv1_rmwl(MXC_GPR(port), mask, af ? mask : 0);
81}
82
83static inline void imx_iomuxv1_set_gius(
84 unsigned int port, unsigned int pin, int inuse)
85{
86 unsigned long mask = 1 << pin;
87
88 imx_iomuxv1_rmwl(MXC_GIUS(port), mask, inuse ? mask : 0);
89}
90
91static inline void imx_iomuxv1_set_ocr(
92 unsigned int port, unsigned int pin, unsigned int ocr)
93{
94 unsigned long shift = (pin & 0xf) << 1;
95 unsigned long mask = 3 << shift;
96 unsigned long value = ocr << shift;
97 unsigned long offset = pin < 16 ? MXC_OCR1(port) : MXC_OCR2(port);
98
99 imx_iomuxv1_rmwl(offset, mask, value);
100}
101
102static inline void imx_iomuxv1_set_iconfa(
103 unsigned int port, unsigned int pin, unsigned int aout)
104{
105 unsigned long shift = (pin & 0xf) << 1;
106 unsigned long mask = 3 << shift;
107 unsigned long value = aout << shift;
108 unsigned long offset = pin < 16 ? MXC_ICONFA1(port) : MXC_ICONFA2(port);
109
110 imx_iomuxv1_rmwl(offset, mask, value);
111}
112
113static inline void imx_iomuxv1_set_iconfb(
114 unsigned int port, unsigned int pin, unsigned int bout)
115{
116 unsigned long shift = (pin & 0xf) << 1;
117 unsigned long mask = 3 << shift;
118 unsigned long value = bout << shift;
119 unsigned long offset = pin < 16 ? MXC_ICONFB1(port) : MXC_ICONFB2(port);
120
121 imx_iomuxv1_rmwl(offset, mask, value);
122}
123
124int mxc_gpio_mode(int gpio_mode)
125{
126 unsigned int pin = gpio_mode & GPIO_PIN_MASK;
127 unsigned int port = (gpio_mode & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT;
128 unsigned int ocr = (gpio_mode & GPIO_OCR_MASK) >> GPIO_OCR_SHIFT;
129 unsigned int aout = (gpio_mode >> GPIO_AOUT_SHIFT) & 3;
130 unsigned int bout = (gpio_mode >> GPIO_BOUT_SHIFT) & 3;
131
132 if (port >= imx_iomuxv1_numports)
133 return -EINVAL;
134
135 /* Pullup enable */
136 imx_iomuxv1_set_puen(port, pin, gpio_mode & GPIO_PUEN);
137
138 /* Data direction */
139 imx_iomuxv1_set_ddir(port, pin, gpio_mode & GPIO_OUT);
140
141 /* Primary / alternate function */
142 imx_iomuxv1_set_gpr(port, pin, gpio_mode & GPIO_AF);
143
144 /* use as gpio? */
145 imx_iomuxv1_set_gius(port, pin, !(gpio_mode & (GPIO_PF | GPIO_AF)));
146
147 imx_iomuxv1_set_ocr(port, pin, ocr);
148
149 imx_iomuxv1_set_iconfa(port, pin, aout);
150
151 imx_iomuxv1_set_iconfb(port, pin, bout);
152
153 return 0;
154}
155EXPORT_SYMBOL(mxc_gpio_mode);
156
157static int imx_iomuxv1_setup_multiple(const int *list, unsigned count)
158{
159 size_t i;
160 int ret;
161
162 for (i = 0; i < count; ++i) {
163 ret = mxc_gpio_mode(list[i]);
164
165 if (ret)
166 return ret;
167 }
168
169 return ret;
170}
171
172int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
173 const char *label)
174{
175 size_t i;
176 int ret;
177
178 for (i = 0; i < count; ++i) {
179 unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);
180
181 ret = gpio_request(gpio, label);
182 if (ret)
183 goto err_gpio_request;
184 }
185
186 ret = imx_iomuxv1_setup_multiple(pin_list, count);
187 if (ret)
188 goto err_setup;
189
190 return 0;
191
192err_setup:
193 BUG_ON(i != count);
194
195err_gpio_request:
196 mxc_gpio_release_multiple_pins(pin_list, i);
197
198 return ret;
199}
200EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins);
201
202void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
203{
204 size_t i;
205
206 for (i = 0; i < count; ++i) {
207 unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);
208
209 gpio_free(gpio);
210 }
211}
212EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);
213
214static int imx_iomuxv1_init(void)
215{
216#ifdef CONFIG_ARCH_MX1
217 if (cpu_is_mx1()) {
218 imx_iomuxv1_baseaddr = MX1_IO_ADDRESS(MX1_GPIO_BASE_ADDR);
219 imx_iomuxv1_numports = MX1_NUM_GPIO_PORT;
220 } else
221#endif
222#ifdef CONFIG_MACH_MX21
223 if (cpu_is_mx21()) {
224 imx_iomuxv1_baseaddr = MX21_IO_ADDRESS(MX21_GPIO_BASE_ADDR);
225 imx_iomuxv1_numports = MX21_NUM_GPIO_PORT;
226 } else
227#endif
228#ifdef CONFIG_MACH_MX27
229 if (cpu_is_mx27()) {
230 imx_iomuxv1_baseaddr = MX27_IO_ADDRESS(MX27_GPIO_BASE_ADDR);
231 imx_iomuxv1_numports = MX27_NUM_GPIO_PORT;
232 } else
233#endif
234 return -ENODEV;
235
236 return 0;
237}
238pure_initcall(imx_iomuxv1_init);
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 844567ee35fe..c1ce51abdba6 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -30,9 +30,15 @@
30#include <asm/mach/time.h> 30#include <asm/mach/time.h>
31#include <mach/common.h> 31#include <mach/common.h>
32 32
33/*
34 * There are 2 versions of the timer hardware on Freescale MXC hardware.
35 * Version 1: MX1/MXL, MX21, MX27.
36 * Version 2: MX25, MX31, MX35, MX37, MX51
37 */
38
33/* defines common for all i.MX */ 39/* defines common for all i.MX */
34#define MXC_TCTL 0x00 40#define MXC_TCTL 0x00
35#define MXC_TCTL_TEN (1 << 0) 41#define MXC_TCTL_TEN (1 << 0) /* Enable module */
36#define MXC_TPRER 0x04 42#define MXC_TPRER 0x04
37 43
38/* MX1, MX21, MX27 */ 44/* MX1, MX21, MX27 */
@@ -47,8 +53,8 @@
47#define MX2_TSTAT_CAPT (1 << 1) 53#define MX2_TSTAT_CAPT (1 << 1)
48#define MX2_TSTAT_COMP (1 << 0) 54#define MX2_TSTAT_COMP (1 << 0)
49 55
50/* MX31, MX35, MX25, MXC91231 */ 56/* MX31, MX35, MX25, MXC91231, MX5 */
51#define MX3_TCTL_WAITEN (1 << 3) 57#define MX3_TCTL_WAITEN (1 << 3) /* Wait enable mode */
52#define MX3_TCTL_CLK_IPG (1 << 6) 58#define MX3_TCTL_CLK_IPG (1 << 6)
53#define MX3_TCTL_FRR (1 << 9) 59#define MX3_TCTL_FRR (1 << 9)
54#define MX3_IR 0x0c 60#define MX3_IR 0x0c
@@ -57,6 +63,9 @@
57#define MX3_TCN 0x24 63#define MX3_TCN 0x24
58#define MX3_TCMP 0x10 64#define MX3_TCMP 0x10
59 65
66#define timer_is_v1() (cpu_is_mx1() || cpu_is_mx21() || cpu_is_mx27())
67#define timer_is_v2() (!timer_is_v1())
68
60static struct clock_event_device clockevent_mxc; 69static struct clock_event_device clockevent_mxc;
61static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED; 70static enum clock_event_mode clockevent_mode = CLOCK_EVT_MODE_UNUSED;
62 71
@@ -66,7 +75,7 @@ static inline void gpt_irq_disable(void)
66{ 75{
67 unsigned int tmp; 76 unsigned int tmp;
68 77
69 if (cpu_is_mx3() || cpu_is_mx25()) 78 if (timer_is_v2())
70 __raw_writel(0, timer_base + MX3_IR); 79 __raw_writel(0, timer_base + MX3_IR);
71 else { 80 else {
72 tmp = __raw_readl(timer_base + MXC_TCTL); 81 tmp = __raw_readl(timer_base + MXC_TCTL);
@@ -76,7 +85,7 @@ static inline void gpt_irq_disable(void)
76 85
77static inline void gpt_irq_enable(void) 86static inline void gpt_irq_enable(void)
78{ 87{
79 if (cpu_is_mx3() || cpu_is_mx25()) 88 if (timer_is_v2())
80 __raw_writel(1<<0, timer_base + MX3_IR); 89 __raw_writel(1<<0, timer_base + MX3_IR);
81 else { 90 else {
82 __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, 91 __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN,
@@ -86,11 +95,13 @@ static inline void gpt_irq_enable(void)
86 95
87static void gpt_irq_acknowledge(void) 96static void gpt_irq_acknowledge(void)
88{ 97{
89 if (cpu_is_mx1()) 98 if (timer_is_v1()) {
90 __raw_writel(0, timer_base + MX1_2_TSTAT); 99 if (cpu_is_mx1())
91 if (cpu_is_mx2()) 100 __raw_writel(0, timer_base + MX1_2_TSTAT);
92 __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); 101 else
93 if (cpu_is_mx3() || cpu_is_mx25()) 102 __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP,
103 timer_base + MX1_2_TSTAT);
104 } else if (timer_is_v2())
94 __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); 105 __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT);
95} 106}
96 107
@@ -117,7 +128,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
117{ 128{
118 unsigned int c = clk_get_rate(timer_clk); 129 unsigned int c = clk_get_rate(timer_clk);
119 130
120 if (cpu_is_mx3() || cpu_is_mx25()) 131 if (timer_is_v2())
121 clocksource_mxc.read = mx3_get_cycles; 132 clocksource_mxc.read = mx3_get_cycles;
122 133
123 clocksource_mxc.mult = clocksource_hz2mult(c, 134 clocksource_mxc.mult = clocksource_hz2mult(c,
@@ -180,7 +191,7 @@ static void mxc_set_mode(enum clock_event_mode mode,
180 191
181 if (mode != clockevent_mode) { 192 if (mode != clockevent_mode) {
182 /* Set event time into far-far future */ 193 /* Set event time into far-far future */
183 if (cpu_is_mx3() || cpu_is_mx25()) 194 if (timer_is_v2())
184 __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, 195 __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3,
185 timer_base + MX3_TCMP); 196 timer_base + MX3_TCMP);
186 else 197 else
@@ -233,7 +244,7 @@ static irqreturn_t mxc_timer_interrupt(int irq, void *dev_id)
233 struct clock_event_device *evt = &clockevent_mxc; 244 struct clock_event_device *evt = &clockevent_mxc;
234 uint32_t tstat; 245 uint32_t tstat;
235 246
236 if (cpu_is_mx3() || cpu_is_mx25()) 247 if (timer_is_v2())
237 tstat = __raw_readl(timer_base + MX3_TSTAT); 248 tstat = __raw_readl(timer_base + MX3_TSTAT);
238 else 249 else
239 tstat = __raw_readl(timer_base + MX1_2_TSTAT); 250 tstat = __raw_readl(timer_base + MX1_2_TSTAT);
@@ -264,7 +275,7 @@ static int __init mxc_clockevent_init(struct clk *timer_clk)
264{ 275{
265 unsigned int c = clk_get_rate(timer_clk); 276 unsigned int c = clk_get_rate(timer_clk);
266 277
267 if (cpu_is_mx3() || cpu_is_mx25()) 278 if (timer_is_v2())
268 clockevent_mxc.set_next_event = mx3_set_next_event; 279 clockevent_mxc.set_next_event = mx3_set_next_event;
269 280
270 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC, 281 clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
@@ -296,7 +307,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq)
296 __raw_writel(0, timer_base + MXC_TCTL); 307 __raw_writel(0, timer_base + MXC_TCTL);
297 __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ 308 __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */
298 309
299 if (cpu_is_mx3() || cpu_is_mx25()) 310 if (timer_is_v2())
300 tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN; 311 tctl_val = MX3_TCTL_CLK_IPG | MX3_TCTL_FRR | MX3_TCTL_WAITEN | MXC_TCTL_TEN;
301 else 312 else
302 tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN; 313 tctl_val = MX1_2_TCTL_FRR | MX1_2_TCTL_CLK_PCLK1 | MXC_TCTL_TEN;
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c
new file mode 100644
index 000000000000..afa6709db0b3
--- /dev/null
+++ b/arch/arm/plat-mxc/tzic.c
@@ -0,0 +1,172 @@
1/*
2 * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11
12#include <linux/module.h>
13#include <linux/moduleparam.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/errno.h>
17#include <linux/io.h>
18
19#include <asm/mach/irq.h>
20
21#include <mach/hardware.h>
22
23/*
24 *****************************************
25 * TZIC Registers *
26 *****************************************
27 */
28
29#define TZIC_INTCNTL 0x0000 /* Control register */
30#define TZIC_INTTYPE 0x0004 /* Controller Type register */
31#define TZIC_IMPID 0x0008 /* Distributor Implementer Identification */
32#define TZIC_PRIOMASK 0x000C /* Priority Mask Reg */
33#define TZIC_SYNCCTRL 0x0010 /* Synchronizer Control register */
34#define TZIC_DSMINT 0x0014 /* DSM interrupt Holdoffregister */
35#define TZIC_INTSEC0(i) (0x0080 + ((i) << 2)) /* Interrupt Security Reg 0 */
36#define TZIC_ENSET0(i) (0x0100 + ((i) << 2)) /* Enable Set Reg 0 */
37#define TZIC_ENCLEAR0(i) (0x0180 + ((i) << 2)) /* Enable Clear Reg 0 */
38#define TZIC_SRCSET0 0x0200 /* Source Set Register 0 */
39#define TZIC_SRCCLAR0 0x0280 /* Source Clear Register 0 */
40#define TZIC_PRIORITY0 0x0400 /* Priority Register 0 */
41#define TZIC_PND0 0x0D00 /* Pending Register 0 */
42#define TZIC_HIPND0 0x0D80 /* High Priority Pending Register */
43#define TZIC_WAKEUP0(i) (0x0E00 + ((i) << 2)) /* Wakeup Config Register */
44#define TZIC_SWINT 0x0F00 /* Software Interrupt Rigger Register */
45#define TZIC_ID0 0x0FD0 /* Indentification Register 0 */
46
47void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */
48
49/**
50 * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC
51 *
52 * @param irq interrupt source number
53 */
54static void tzic_mask_irq(unsigned int irq)
55{
56 int index, off;
57
58 index = irq >> 5;
59 off = irq & 0x1F;
60 __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index));
61}
62
63/**
64 * tzic_unmask_irq() - Enable interrupt number "irq" in the TZIC
65 *
66 * @param irq interrupt source number
67 */
68static void tzic_unmask_irq(unsigned int irq)
69{
70 int index, off;
71
72 index = irq >> 5;
73 off = irq & 0x1F;
74 __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index));
75}
76
77static unsigned int wakeup_intr[4];
78
79/**
80 * tzic_set_wake_irq() - Set interrupt number "irq" in the TZIC as a wake-up source.
81 *
82 * @param irq interrupt source number
83 * @param enable enable as wake-up if equal to non-zero
84 * disble as wake-up if equal to zero
85 *
86 * @return This function returns 0 on success.
87 */
88static int tzic_set_wake_irq(unsigned int irq, unsigned int enable)
89{
90 unsigned int index, off;
91
92 index = irq >> 5;
93 off = irq & 0x1F;
94
95 if (index > 3)
96 return -EINVAL;
97
98 if (enable)
99 wakeup_intr[index] |= (1 << off);
100 else
101 wakeup_intr[index] &= ~(1 << off);
102
103 return 0;
104}
105
106static struct irq_chip mxc_tzic_chip = {
107 .name = "MXC_TZIC",
108 .ack = tzic_mask_irq,
109 .mask = tzic_mask_irq,
110 .unmask = tzic_unmask_irq,
111 .set_wake = tzic_set_wake_irq,
112};
113
114/*
115 * This function initializes the TZIC hardware and disables all the
116 * interrupts. It registers the interrupt enable and disable functions
117 * to the kernel for each interrupt source.
118 */
119void __init tzic_init_irq(void __iomem *irqbase)
120{
121 int i;
122
123 tzic_base = irqbase;
124 /* put the TZIC into the reset value with
125 * all interrupts disabled
126 */
127 i = __raw_readl(tzic_base + TZIC_INTCNTL);
128
129 __raw_writel(0x80010001, tzic_base + TZIC_INTCNTL);
130 __raw_writel(0x1f, tzic_base + TZIC_PRIOMASK);
131 __raw_writel(0x02, tzic_base + TZIC_SYNCCTRL);
132
133 for (i = 0; i < 4; i++)
134 __raw_writel(0xFFFFFFFF, tzic_base + TZIC_INTSEC0(i));
135
136 /* disable all interrupts */
137 for (i = 0; i < 4; i++)
138 __raw_writel(0xFFFFFFFF, tzic_base + TZIC_ENCLEAR0(i));
139
140 /* all IRQ no FIQ Warning :: No selection */
141
142 for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
143 set_irq_chip(i, &mxc_tzic_chip);
144 set_irq_handler(i, handle_level_irq);
145 set_irq_flags(i, IRQF_VALID);
146 }
147
148 pr_info("TrustZone Interrupt Controller (TZIC) initialized\n");
149}
150
151/**
152 * tzic_enable_wake() - enable wakeup interrupt
153 *
154 * @param is_idle 1 if called in idle loop (ENSET0 register);
155 * 0 to be used when called from low power entry
156 * @return 0 if successful; non-zero otherwise
157 */
158int tzic_enable_wake(int is_idle)
159{
160 unsigned int i, v;
161
162 __raw_writel(1, tzic_base + TZIC_DSMINT);
163 if (unlikely(__raw_readl(tzic_base + TZIC_DSMINT) == 0))
164 return -EAGAIN;
165
166 for (i = 0; i < 4; i++) {
167 v = is_idle ? __raw_readl(TZIC_ENSET0(i)) : wakeup_intr[i];
168 __raw_writel(v, TZIC_WAKEUP0(i));
169 }
170
171 return 0;
172}
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 62f18ad43a28..fa7cb3a57cbf 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -49,24 +49,17 @@ static struct clocksource nmdk_clksrc = {
49static void nmdk_clkevt_mode(enum clock_event_mode mode, 49static void nmdk_clkevt_mode(enum clock_event_mode mode,
50 struct clock_event_device *dev) 50 struct clock_event_device *dev)
51{ 51{
52 unsigned long flags;
53
54 switch (mode) { 52 switch (mode) {
55 case CLOCK_EVT_MODE_PERIODIC: 53 case CLOCK_EVT_MODE_PERIODIC:
56 /* enable interrupts -- and count current value? */ 54 /* count current value? */
57 raw_local_irq_save(flags);
58 writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC); 55 writel(readl(mtu_base + MTU_IMSC) | 1, mtu_base + MTU_IMSC);
59 raw_local_irq_restore(flags);
60 break; 56 break;
61 case CLOCK_EVT_MODE_ONESHOT: 57 case CLOCK_EVT_MODE_ONESHOT:
62 BUG(); /* Not supported, yet */ 58 BUG(); /* Not supported, yet */
63 /* FALLTHROUGH */ 59 /* FALLTHROUGH */
64 case CLOCK_EVT_MODE_SHUTDOWN: 60 case CLOCK_EVT_MODE_SHUTDOWN:
65 case CLOCK_EVT_MODE_UNUSED: 61 case CLOCK_EVT_MODE_UNUSED:
66 /* disable irq */
67 raw_local_irq_save(flags);
68 writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC); 62 writel(readl(mtu_base + MTU_IMSC) & ~1, mtu_base + MTU_IMSC);
69 raw_local_irq_restore(flags);
70 break; 63 break;
71 case CLOCK_EVT_MODE_RESUME: 64 case CLOCK_EVT_MODE_RESUME:
72 break; 65 break;
diff --git a/arch/arm/plat-s3c/Kconfig b/arch/arm/plat-s3c/Kconfig
deleted file mode 100644
index 9e9d0286e48f..000000000000
--- a/arch/arm/plat-s3c/Kconfig
+++ /dev/null
@@ -1,215 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5config PLAT_S3C
6 bool
7 depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX
8 default y
9 select NO_IOPORT
10 help
11 Base platform code for any Samsung S3C device
12
13# low-level serial option nodes
14
15if PLAT_S3C
16
17config CPU_LLSERIAL_S3C2410_ONLY
18 bool
19 default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
20
21config CPU_LLSERIAL_S3C2440_ONLY
22 bool
23 default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
24
25config CPU_LLSERIAL_S3C2410
26 bool
27 help
28 Selected if there is an S3C2410 (or register compatible) serial
29 low-level implementation needed
30
31config CPU_LLSERIAL_S3C2440
32 bool
33 help
34 Selected if there is an S3C2440 (or register compatible) serial
35 low-level implementation needed
36
37# boot configurations
38
39comment "Boot options"
40
41config S3C_BOOT_WATCHDOG
42 bool "S3C Initialisation watchdog"
43 depends on S3C2410_WATCHDOG
44 help
45 Say y to enable the watchdog during the kernel decompression
46 stage. If the kernel fails to uncompress, then the watchdog
47 will trigger a reset and the system should restart.
48
49config S3C_BOOT_ERROR_RESET
50 bool "S3C Reboot on decompression error"
51 help
52 Say y here to use the watchdog to reset the system if the
53 kernel decompressor detects an error during decompression.
54
55config S3C_BOOT_UART_FORCE_FIFO
56 bool "Force UART FIFO on during boot process"
57 default y
58 help
59 Say Y here to force the UART FIFOs on during the kernel
60 uncompressor
61
62comment "Power management"
63
64config S3C2410_PM_DEBUG
65 bool "S3C2410 PM Suspend debug"
66 depends on PM
67 help
68 Say Y here if you want verbose debugging from the PM Suspend and
69 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
70 for more information.
71
72config S3C_PM_DEBUG_LED_SMDK
73 bool "SMDK LED suspend/resume debugging"
74 depends on PM && (MACH_SMDK6410)
75 help
76 Say Y here to enable the use of the SMDK LEDs on the baseboard
77 for debugging of the state of the suspend and resume process.
78
79 Note, this currently only works for S3C64XX based SMDK boards.
80
81config S3C2410_PM_CHECK
82 bool "S3C2410 PM Suspend Memory CRC"
83 depends on PM && CRC32
84 help
85 Enable the PM code's memory area checksum over sleep. This option
86 will generate CRCs of all blocks of memory, and store them before
87 going to sleep. The blocks are then checked on resume for any
88 errors.
89
90 Note, this can take several seconds depending on memory size
91 and CPU speed.
92
93 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
94
95config S3C2410_PM_CHECK_CHUNKSIZE
96 int "S3C2410 PM Suspend CRC Chunksize (KiB)"
97 depends on PM && S3C2410_PM_CHECK
98 default 64
99 help
100 Set the chunksize in Kilobytes of the CRC for checking memory
101 corruption over suspend and resume. A smaller value will mean that
102 the CRC data block will take more memory, but wil identify any
103 faults with better precision.
104
105 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
106
107config S3C_LOWLEVEL_UART_PORT
108 int "S3C UART to use for low-level messages"
109 default 0
110 help
111 Choice of which UART port to use for the low-level messages,
112 such as the `Uncompressing...` at start time. The value of
113 this configuration should be between zero and two. The port
114 must have been initialised by the boot-loader before use.
115
116# options for gpiolib support
117
118config S3C_GPIO_SPACE
119 int "Space between gpio banks"
120 default 0
121 help
122 Add a number of spare GPIO entries between each bank for debugging
123 purposes. This allows any problems where an counter overflows from
124 one bank to another to be caught, at the expense of using a little
125 more memory.
126
127config S3C_GPIO_TRACK
128 bool
129 help
130 Internal configuration option to enable the s3c specific gpio
131 chip tracking if the platform requires it.
132
133config S3C_GPIO_PULL_UPDOWN
134 bool
135 help
136 Internal configuration to enable the correct GPIO pull helper
137
138config S3C_GPIO_PULL_DOWN
139 bool
140 help
141 Internal configuration to enable the correct GPIO pull helper
142
143config S3C_GPIO_PULL_UP
144 bool
145 help
146 Internal configuration to enable the correct GPIO pull helper
147
148config S3C_GPIO_CFG_S3C24XX
149 bool
150 help
151 Internal configuration to enable S3C24XX style GPIO configuration
152 functions.
153
154config S3C_GPIO_CFG_S3C64XX
155 bool
156 help
157 Internal configuration to enable S3C64XX style GPIO configuration
158 functions.
159
160config S5P_GPIO_CFG_S5PC1XX
161 bool
162 help
163 Internal configuration to enable S5PC1XX style GPIO configuration
164 functions.
165
166# DMA
167
168config S3C_DMA
169 bool
170 help
171 Internal configuration for S3C DMA core
172
173# device definitions to compile in
174
175config S3C_DEV_HSMMC
176 bool
177 help
178 Compile in platform device definitions for HSMMC code
179
180config S3C_DEV_HSMMC1
181 bool
182 help
183 Compile in platform device definitions for HSMMC channel 1
184
185config S3C_DEV_HSMMC2
186 bool
187 help
188 Compile in platform device definitions for HSMMC channel 2
189
190config S3C_DEV_I2C1
191 bool
192 help
193 Compile in platform device definitions for I2C channel 1
194
195config S3C_DEV_FB
196 bool
197 help
198 Compile in platform device definition for framebuffer
199
200config S3C_DEV_USB_HOST
201 bool
202 help
203 Compile in platform device definition for USB host.
204
205config S3C_DEV_USB_HSOTG
206 bool
207 help
208 Compile in platform device definition for USB high-speed OtG
209
210config S3C_DEV_NAND
211 bool
212 help
213 Compile in platform device definition for NAND controller
214
215endif
diff --git a/arch/arm/plat-s3c/Makefile b/arch/arm/plat-s3c/Makefile
deleted file mode 100644
index 50444da98425..000000000000
--- a/arch/arm/plat-s3c/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
1# arch/arm/plat-s3c/Makefile
2#
3# Copyright 2008 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12# Core support for all Samsung SoCs
13
14obj-y += init.o
15obj-y += time.o
16obj-y += clock.o
17obj-y += pwm-clock.o
18obj-y += gpio.o
19obj-y += gpio-config.o
20
21# DMA support
22
23obj-$(CONFIG_S3C_DMA) += dma.o
24
25# PM support
26
27obj-$(CONFIG_PM) += pm.o
28obj-$(CONFIG_PM) += pm-gpio.o
29obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o
30
31# PWM support
32
33obj-$(CONFIG_HAVE_PWM) += pwm.o
34
35# devices
36
37obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
38obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
39obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
40obj-y += dev-i2c0.o
41obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
42obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
43obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
44obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
45obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index 342647eb91d8..6e93ef8f3d43 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -14,58 +14,40 @@ config PLAT_S3C24XX
14 14
15if PLAT_S3C24XX 15if PLAT_S3C24XX
16 16
17# code that is shared between a number of the s3c24xx implementations 17# low-level serial option nodes
18 18
19config S3C2410_CLOCK 19config CPU_LLSERIAL_S3C2410_ONLY
20 bool 20 bool
21 help 21 default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440
22 Clock code for the S3C2410, and similar processors which
23 is currently includes the S3C2410, S3C2440, S3C2442.
24 22
25config S3C24XX_DCLK 23config CPU_LLSERIAL_S3C2440_ONLY
26 bool 24 bool
27 help 25 default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410
28 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
29 26
30config CPU_S3C244X 27config CPU_LLSERIAL_S3C2410
31 bool 28 bool
32 depends on ARCH_S3C2410 && (CPU_S3C2440 || CPU_S3C2442)
33 help
34 Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
35
36config S3C2440_CPUFREQ
37 bool "S3C2440/S3C2442 CPU Frequency scaling support"
38 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
39 select S3C2410_CPUFREQ_UTILS
40 default y
41 help 29 help
42 CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs. 30 Selected if there is an S3C2410 (or register compatible) serial
31 low-level implementation needed
43 32
44config S3C2440_XTAL_12000000 33config CPU_LLSERIAL_S3C2440
45 bool 34 bool
46 help 35 help
47 Indicate that the build needs to support 12MHz system 36 Selected if there is an S3C2440 (or register compatible) serial
48 crystal. 37 low-level implementation needed
49 38
50config S3C2440_XTAL_16934400 39# code that is shared between a number of the s3c24xx implementations
51 bool
52 help
53 Indicate that the build needs to support 16.9344MHz system
54 crystal.
55 40
56config S3C2440_PLL_12000000 41config S3C2410_CLOCK
57 bool 42 bool
58 depends on S3C2440_CPUFREQ && S3C2440_XTAL_12000000
59 default y if CPU_FREQ_S3C24XX_PLL
60 help 43 help
61 PLL tables for S3C2440 or S3C2442 CPUs with 12MHz crystals. 44 Clock code for the S3C2410, and similar processors which
45 is currently includes the S3C2410, S3C2440, S3C2442.
62 46
63config S3C2440_PLL_16934400 47config S3C24XX_DCLK
64 bool 48 bool
65 depends on S3C2440_CPUFREQ && S3C2440_XTAL_16934400
66 default y if CPU_FREQ_S3C24XX_PLL
67 help 49 help
68 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals. 50 Clock code for supporting DCLK/CLKOUT on S3C24XX architectures
69 51
70config S3C24XX_PWM 52config S3C24XX_PWM
71 bool "PWM device support" 53 bool "PWM device support"
@@ -74,7 +56,6 @@ config S3C24XX_PWM
74 Support for exporting the PWM timer blocks via the pwm device 56 Support for exporting the PWM timer blocks via the pwm device
75 system. 57 system.
76 58
77
78# gpio configurations 59# gpio configurations
79 60
80config S3C24XX_GPIO_EXTRA 61config S3C24XX_GPIO_EXTRA
@@ -117,13 +98,6 @@ config S3C2410_DMA_DEBUG
117 Enable debugging output for the DMA code. This option sends info 98 Enable debugging output for the DMA code. This option sends info
118 to the kernel log, at priority KERN_DEBUG. 99 to the kernel log, at priority KERN_DEBUG.
119 100
120config S3C24XX_ADC
121 bool "ADC common driver support"
122 help
123 Core support for the ADC block found in the S3C24XX SoC systems
124 for drivers such as the touchscreen and hwmon to use to share
125 this resource.
126
127# SPI default pin configuration code 101# SPI default pin configuration code
128 102
129config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13 103config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index 5dee8c12e8b4..c2237c41141f 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -25,20 +25,12 @@ obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o
25 25
26# Architecture dependant builds 26# Architecture dependant builds
27 27
28obj-$(CONFIG_CPU_S3C244X) += s3c244x.o
29obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o
30obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o
31obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
32obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o
33obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o
34
35obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o 28obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
36obj-$(CONFIG_PM) += pm.o 29obj-$(CONFIG_PM) += pm.o
37obj-$(CONFIG_PM) += irq-pm.o 30obj-$(CONFIG_PM) += irq-pm.o
38obj-$(CONFIG_PM) += sleep.o 31obj-$(CONFIG_PM) += sleep.o
39obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 32obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
40obj-$(CONFIG_S3C2410_DMA) += dma.o 33obj-$(CONFIG_S3C2410_DMA) += dma.o
41obj-$(CONFIG_S3C24XX_ADC) += adc.o
42obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o 34obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
43obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o 35obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
44obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o 36obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
diff --git a/arch/arm/plat-s3c24xx/clock-dclk.c b/arch/arm/plat-s3c24xx/clock-dclk.c
index ac061a1bcb37..cf97caafe56b 100644
--- a/arch/arm/plat-s3c24xx/clock-dclk.c
+++ b/arch/arm/plat-s3c24xx/clock-dclk.c
@@ -161,14 +161,18 @@ static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
161 161
162/* external clock definitions */ 162/* external clock definitions */
163 163
164static struct clk_ops dclk_ops = {
165 .set_parent = s3c24xx_dclk_setparent,
166 .set_rate = s3c24xx_set_dclk_rate,
167 .round_rate = s3c24xx_round_dclk_rate,
168};
169
164struct clk s3c24xx_dclk0 = { 170struct clk s3c24xx_dclk0 = {
165 .name = "dclk0", 171 .name = "dclk0",
166 .id = -1, 172 .id = -1,
167 .ctrlbit = S3C2410_DCLKCON_DCLK0EN, 173 .ctrlbit = S3C2410_DCLKCON_DCLK0EN,
168 .enable = s3c24xx_dclk_enable, 174 .enable = s3c24xx_dclk_enable,
169 .set_parent = s3c24xx_dclk_setparent, 175 .ops = &dclk_ops,
170 .set_rate = s3c24xx_set_dclk_rate,
171 .round_rate = s3c24xx_round_dclk_rate,
172}; 176};
173 177
174struct clk s3c24xx_dclk1 = { 178struct clk s3c24xx_dclk1 = {
@@ -176,19 +180,21 @@ struct clk s3c24xx_dclk1 = {
176 .id = -1, 180 .id = -1,
177 .ctrlbit = S3C2410_DCLKCON_DCLK1EN, 181 .ctrlbit = S3C2410_DCLKCON_DCLK1EN,
178 .enable = s3c24xx_dclk_enable, 182 .enable = s3c24xx_dclk_enable,
179 .set_parent = s3c24xx_dclk_setparent, 183 .ops = &dclk_ops,
180 .set_rate = s3c24xx_set_dclk_rate, 184};
181 .round_rate = s3c24xx_round_dclk_rate, 185
186static struct clk_ops clkout_ops = {
187 .set_parent = s3c24xx_clkout_setparent,
182}; 188};
183 189
184struct clk s3c24xx_clkout0 = { 190struct clk s3c24xx_clkout0 = {
185 .name = "clkout0", 191 .name = "clkout0",
186 .id = -1, 192 .id = -1,
187 .set_parent = s3c24xx_clkout_setparent, 193 .ops = &clkout_ops,
188}; 194};
189 195
190struct clk s3c24xx_clkout1 = { 196struct clk s3c24xx_clkout1 = {
191 .name = "clkout1", 197 .name = "clkout1",
192 .id = -1, 198 .id = -1,
193 .set_parent = s3c24xx_clkout_setparent, 199 .ops = &clkout_ops,
194}; 200};
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 4af9dd948793..9ca64df35bf6 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -49,9 +49,7 @@
49#include <plat/s3c2400.h> 49#include <plat/s3c2400.h>
50#include <plat/s3c2410.h> 50#include <plat/s3c2410.h>
51#include <plat/s3c2412.h> 51#include <plat/s3c2412.h>
52#include "s3c244x.h" 52#include <plat/s3c244x.h>
53#include <plat/s3c2440.h>
54#include <plat/s3c2442.h>
55#include <plat/s3c2443.h> 53#include <plat/s3c2443.h>
56 54
57/* table of supported CPUs */ 55/* table of supported CPUs */
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c
index 7f686a31e672..8c6de1c9968f 100644
--- a/arch/arm/plat-s3c24xx/devs.c
+++ b/arch/arm/plat-s3c24xx/devs.c
@@ -32,6 +32,7 @@
32 32
33#include <plat/regs-serial.h> 33#include <plat/regs-serial.h>
34#include <plat/udc.h> 34#include <plat/udc.h>
35#include <plat/mci.h>
35 36
36#include <plat/devs.h> 37#include <plat/devs.h>
37#include <plat/cpu.h> 38#include <plat/cpu.h>
@@ -112,34 +113,6 @@ struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
112 }, 113 },
113}; 114};
114 115
115/* yart devices */
116
117static struct platform_device s3c24xx_uart_device0 = {
118 .id = 0,
119};
120
121static struct platform_device s3c24xx_uart_device1 = {
122 .id = 1,
123};
124
125static struct platform_device s3c24xx_uart_device2 = {
126 .id = 2,
127};
128
129static struct platform_device s3c24xx_uart_device3 = {
130 .id = 3,
131};
132
133struct platform_device *s3c24xx_uart_src[4] = {
134 &s3c24xx_uart_device0,
135 &s3c24xx_uart_device1,
136 &s3c24xx_uart_device2,
137 &s3c24xx_uart_device3,
138};
139
140struct platform_device *s3c24xx_uart_devs[4] = {
141};
142
143/* LCD Controller */ 116/* LCD Controller */
144 117
145static struct resource s3c_lcd_resource[] = { 118static struct resource s3c_lcd_resource[] = {
@@ -185,9 +158,27 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
185} 158}
186 159
187/* Touchscreen */ 160/* Touchscreen */
161
162static struct resource s3c_ts_resource[] = {
163 [0] = {
164 .start = S3C24XX_PA_ADC,
165 .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
166 .flags = IORESOURCE_MEM,
167 },
168 [1] = {
169 .start = IRQ_TC,
170 .end = IRQ_TC,
171 .flags = IORESOURCE_IRQ,
172 },
173
174};
175
188struct platform_device s3c_device_ts = { 176struct platform_device s3c_device_ts = {
189 .name = "s3c2410-ts", 177 .name = "s3c2410-ts",
190 .id = -1, 178 .id = -1,
179 .dev.parent = &s3c_device_adc.dev,
180 .num_resources = ARRAY_SIZE(s3c_ts_resource),
181 .resource = s3c_ts_resource,
191}; 182};
192EXPORT_SYMBOL(s3c_device_ts); 183EXPORT_SYMBOL(s3c_device_ts);
193 184
@@ -379,6 +370,18 @@ struct platform_device s3c_device_sdi = {
379 370
380EXPORT_SYMBOL(s3c_device_sdi); 371EXPORT_SYMBOL(s3c_device_sdi);
381 372
373void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
374{
375 struct s3c24xx_mci_pdata *npd;
376
377 npd = kmemdup(pdata, sizeof(struct s3c24xx_mci_pdata), GFP_KERNEL);
378 if (!npd)
379 printk(KERN_ERR "%s: no memory to copy pdata", __func__);
380
381 s3c_device_sdi.dev.platform_data = npd;
382}
383
384
382/* SPI (0) */ 385/* SPI (0) */
383 386
384static struct resource s3c_spi0_resource[] = { 387static struct resource s3c_spi0_resource[] = {
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index f0ea7943ac5a..93827b3d4e84 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -33,7 +33,7 @@
33#include <mach/dma.h> 33#include <mach/dma.h>
34#include <mach/map.h> 34#include <mach/map.h>
35 35
36#include <plat/dma-plat.h> 36#include <plat/dma-s3c24xx.h>
37#include <plat/regs-dma.h> 37#include <plat/regs-dma.h>
38 38
39/* io map for dma */ 39/* io map for dma */
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index 6d7a961d3269..4f0f11a6a677 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -20,7 +20,7 @@
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22 22
23#include <mach/gpio-core.h> 23#include <plat/gpio-core.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <plat/pm.h> 26#include <plat/pm.h>
diff --git a/arch/arm/plat-s3c/include/plat/audio-simtec.h b/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h
index 53a93656d5db..de5e88fdcb31 100644
--- a/arch/arm/plat-s3c/include/plat/audio-simtec.h
+++ b/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/audio-simtec.h 1/* arch/arm/plat-s3c24xx/include/plat/audio-simtec.h
2 * 2 *
3 * Copyright 2008 Simtec Electronics 3 * Copyright 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
index 33d421d78bad..d623235ae961 100644
--- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
+++ b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h
@@ -135,7 +135,7 @@ struct s3c_cpufreq_config {
135 * @locktime_m: The lock-time in uS for the MPLL. 135 * @locktime_m: The lock-time in uS for the MPLL.
136 * @locktime_u: The lock-time in uS for the UPLL. 136 * @locktime_u: The lock-time in uS for the UPLL.
137 * @locttime_bits: The number of bits each LOCKTIME field. 137 * @locttime_bits: The number of bits each LOCKTIME field.
138 * @need_pll: Set if this driver needs to change the PLL values to acheive 138 * @need_pll: Set if this driver needs to change the PLL values to achieve
139 * any frequency changes. This is really only need by devices like the 139 * any frequency changes. This is really only need by devices like the
140 * S3C2410 where there is no or limited divider between the PLL and the 140 * S3C2410 where there is no or limited divider between the PLL and the
141 * ARMCLK. 141 * ARMCLK.
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h
index 36aaa10fad06..2ac2b21ec490 100644
--- a/arch/arm/plat-s3c24xx/include/plat/mci.h
+++ b/arch/arm/plat-s3c24xx/include/plat/mci.h
@@ -40,4 +40,13 @@ struct s3c24xx_mci_pdata {
40 unsigned short vdd); 40 unsigned short vdd);
41}; 41};
42 42
43/**
44 * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
45 * @pdata: The platform data
46 *
47 * Copy the platform data supplied by @pdata so that this can be marked
48 * __initdata.
49 */
50extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
51
43#endif /* _ARCH_NCI_H */ 52#endif /* _ARCH_NCI_H */
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2440.h b/arch/arm/plat-s3c24xx/include/plat/s3c2440.h
deleted file mode 100644
index 107853bf9481..000000000000
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2440.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2440.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for s3c2440 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifdef CONFIG_CPU_S3C2440
14extern int s3c2440_init(void);
15#else
16#define s3c2440_init NULL
17#endif
diff --git a/arch/arm/plat-s3c24xx/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
index 6aab5eaae2b4..307248d1ccbb 100644
--- a/arch/arm/plat-s3c24xx/s3c244x.h
+++ b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/s3c244x.h 1/* linux/arch/arm/plat-s3c24xx/include/plat/s3c244x.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -23,3 +23,15 @@ extern void s3c244x_init_clocks(int xtal);
23#define s3c244x_init_uarts NULL 23#define s3c244x_init_uarts NULL
24#define s3c244x_map_io NULL 24#define s3c244x_map_io NULL
25#endif 25#endif
26
27#ifdef CONFIG_CPU_S3C2440
28extern int s3c2440_init(void);
29#else
30#define s3c2440_init NULL
31#endif
32
33#ifdef CONFIG_CPU_S3C2442
34extern int s3c2442_init(void);
35#else
36#define s3c2442_init NULL
37#endif
diff --git a/arch/arm/plat-s3c64xx/Kconfig b/arch/arm/plat-s3c64xx/Kconfig
deleted file mode 100644
index e6da87a5885c..000000000000
--- a/arch/arm/plat-s3c64xx/Kconfig
+++ /dev/null
@@ -1,71 +0,0 @@
1# Copyright 2008 Openmoko, Inc.
2# Copyright 2008 Simtec Electronics
3# Ben Dooks <ben@simtec.co.uk>
4#
5# Licensed under GPLv2
6
7config PLAT_S3C64XX
8 bool
9 depends on ARCH_S3C64XX
10 default y
11 select CPU_V6
12 select PLAT_S3C
13 select ARM_VIC
14 select NO_IOPORT
15 select ARCH_REQUIRE_GPIOLIB
16 select S3C_GPIO_TRACK
17 select S3C_GPIO_PULL_UPDOWN
18 select S3C_GPIO_CFG_S3C24XX
19 select S3C_GPIO_CFG_S3C64XX
20 select S3C_DEV_NAND
21 select USB_ARCH_HAS_OHCI
22 help
23 Base platform code for any Samsung S3C64XX device
24
25if PLAT_S3C64XX
26
27# Configuration options shared by all S3C64XX implementations
28
29config CPU_S3C6400_INIT
30 bool
31 help
32 Common initialisation code for the S3C6400 that is shared
33 by other CPUs in the series, such as the S3C6410.
34
35config CPU_S3C6400_CLOCK
36 bool
37 help
38 Common clock support code for the S3C6400 that is shared
39 by other CPUs in the series, such as the S3C6410.
40
41config S3C64XX_DMA
42 bool "S3C64XX DMA"
43 select S3C_DMA
44
45# platform specific device setup
46
47config S3C64XX_SETUP_I2C0
48 bool
49 default y
50 help
51 Common setup code for i2c bus 0.
52
53 Note, currently since i2c0 is always compiled, this setup helper
54 is always compiled with it.
55
56config S3C64XX_SETUP_I2C1
57 bool
58 help
59 Common setup code for i2c bus 1.
60
61config S3C64XX_SETUP_FB_24BPP
62 bool
63 help
64 Common setup code for S3C64XX with an 24bpp RGB display helper.
65
66config S3C64XX_SETUP_SDHCI_GPIO
67 bool
68 help
69 Common setup code for S3C64XX SDHCI GPIO configurations
70
71endif
diff --git a/arch/arm/plat-s3c64xx/clock.c b/arch/arm/plat-s3c64xx/clock.c
deleted file mode 100644
index 7a36e899360d..000000000000
--- a/arch/arm/plat-s3c64xx/clock.c
+++ /dev/null
@@ -1,300 +0,0 @@
1/* linux/arch/arm/plat-s3c64xx/clock.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX Base clock support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19#include <linux/io.h>
20
21#include <mach/hardware.h>
22#include <mach/map.h>
23
24#include <plat/regs-sys.h>
25#include <plat/regs-clock.h>
26#include <plat/cpu.h>
27#include <plat/devs.h>
28#include <plat/clock.h>
29
30struct clk clk_h2 = {
31 .name = "hclk2",
32 .id = -1,
33 .rate = 0,
34};
35
36struct clk clk_27m = {
37 .name = "clk_27m",
38 .id = -1,
39 .rate = 27000000,
40};
41
42static int clk_48m_ctrl(struct clk *clk, int enable)
43{
44 unsigned long flags;
45 u32 val;
46
47 /* can't rely on clock lock, this register has other usages */
48 local_irq_save(flags);
49
50 val = __raw_readl(S3C64XX_OTHERS);
51 if (enable)
52 val |= S3C64XX_OTHERS_USBMASK;
53 else
54 val &= ~S3C64XX_OTHERS_USBMASK;
55
56 __raw_writel(val, S3C64XX_OTHERS);
57 local_irq_restore(flags);
58
59 return 0;
60}
61
62struct clk clk_48m = {
63 .name = "clk_48m",
64 .id = -1,
65 .rate = 48000000,
66 .enable = clk_48m_ctrl,
67};
68
69static int inline s3c64xx_gate(void __iomem *reg,
70 struct clk *clk,
71 int enable)
72{
73 unsigned int ctrlbit = clk->ctrlbit;
74 u32 con;
75
76 con = __raw_readl(reg);
77
78 if (enable)
79 con |= ctrlbit;
80 else
81 con &= ~ctrlbit;
82
83 __raw_writel(con, reg);
84 return 0;
85}
86
87static int s3c64xx_pclk_ctrl(struct clk *clk, int enable)
88{
89 return s3c64xx_gate(S3C_PCLK_GATE, clk, enable);
90}
91
92static int s3c64xx_hclk_ctrl(struct clk *clk, int enable)
93{
94 return s3c64xx_gate(S3C_HCLK_GATE, clk, enable);
95}
96
97int s3c64xx_sclk_ctrl(struct clk *clk, int enable)
98{
99 return s3c64xx_gate(S3C_SCLK_GATE, clk, enable);
100}
101
102static struct clk init_clocks_disable[] = {
103 {
104 .name = "nand",
105 .id = -1,
106 .parent = &clk_h,
107 }, {
108 .name = "adc",
109 .id = -1,
110 .parent = &clk_p,
111 .enable = s3c64xx_pclk_ctrl,
112 .ctrlbit = S3C_CLKCON_PCLK_TSADC,
113 }, {
114 .name = "i2c",
115 .id = -1,
116 .parent = &clk_p,
117 .enable = s3c64xx_pclk_ctrl,
118 .ctrlbit = S3C_CLKCON_PCLK_IIC,
119 }, {
120 .name = "iis",
121 .id = 0,
122 .parent = &clk_p,
123 .enable = s3c64xx_pclk_ctrl,
124 .ctrlbit = S3C_CLKCON_PCLK_IIS0,
125 }, {
126 .name = "iis",
127 .id = 1,
128 .parent = &clk_p,
129 .enable = s3c64xx_pclk_ctrl,
130 .ctrlbit = S3C_CLKCON_PCLK_IIS1,
131 }, {
132 .name = "spi",
133 .id = 0,
134 .parent = &clk_p,
135 .enable = s3c64xx_pclk_ctrl,
136 .ctrlbit = S3C_CLKCON_PCLK_SPI0,
137 }, {
138 .name = "spi",
139 .id = 1,
140 .parent = &clk_p,
141 .enable = s3c64xx_pclk_ctrl,
142 .ctrlbit = S3C_CLKCON_PCLK_SPI1,
143 }, {
144 .name = "48m",
145 .id = 0,
146 .parent = &clk_48m,
147 .enable = s3c64xx_sclk_ctrl,
148 .ctrlbit = S3C_CLKCON_SCLK_MMC0_48,
149 }, {
150 .name = "48m",
151 .id = 1,
152 .parent = &clk_48m,
153 .enable = s3c64xx_sclk_ctrl,
154 .ctrlbit = S3C_CLKCON_SCLK_MMC1_48,
155 }, {
156 .name = "48m",
157 .id = 2,
158 .parent = &clk_48m,
159 .enable = s3c64xx_sclk_ctrl,
160 .ctrlbit = S3C_CLKCON_SCLK_MMC2_48,
161 }, {
162 .name = "dma0",
163 .id = -1,
164 .parent = &clk_h,
165 .enable = s3c64xx_hclk_ctrl,
166 .ctrlbit = S3C_CLKCON_HCLK_DMA0,
167 }, {
168 .name = "dma1",
169 .id = -1,
170 .parent = &clk_h,
171 .enable = s3c64xx_hclk_ctrl,
172 .ctrlbit = S3C_CLKCON_HCLK_DMA1,
173 },
174};
175
176static struct clk init_clocks[] = {
177 {
178 .name = "lcd",
179 .id = -1,
180 .parent = &clk_h,
181 .enable = s3c64xx_hclk_ctrl,
182 .ctrlbit = S3C_CLKCON_HCLK_LCD,
183 }, {
184 .name = "gpio",
185 .id = -1,
186 .parent = &clk_p,
187 .enable = s3c64xx_pclk_ctrl,
188 .ctrlbit = S3C_CLKCON_PCLK_GPIO,
189 }, {
190 .name = "usb-host",
191 .id = -1,
192 .parent = &clk_h,
193 .enable = s3c64xx_hclk_ctrl,
194 .ctrlbit = S3C_CLKCON_HCLK_UHOST,
195 }, {
196 .name = "hsmmc",
197 .id = 0,
198 .parent = &clk_h,
199 .enable = s3c64xx_hclk_ctrl,
200 .ctrlbit = S3C_CLKCON_HCLK_HSMMC0,
201 }, {
202 .name = "hsmmc",
203 .id = 1,
204 .parent = &clk_h,
205 .enable = s3c64xx_hclk_ctrl,
206 .ctrlbit = S3C_CLKCON_HCLK_HSMMC1,
207 }, {
208 .name = "hsmmc",
209 .id = 2,
210 .parent = &clk_h,
211 .enable = s3c64xx_hclk_ctrl,
212 .ctrlbit = S3C_CLKCON_HCLK_HSMMC2,
213 }, {
214 .name = "timers",
215 .id = -1,
216 .parent = &clk_p,
217 .enable = s3c64xx_pclk_ctrl,
218 .ctrlbit = S3C_CLKCON_PCLK_PWM,
219 }, {
220 .name = "uart",
221 .id = 0,
222 .parent = &clk_p,
223 .enable = s3c64xx_pclk_ctrl,
224 .ctrlbit = S3C_CLKCON_PCLK_UART0,
225 }, {
226 .name = "uart",
227 .id = 1,
228 .parent = &clk_p,
229 .enable = s3c64xx_pclk_ctrl,
230 .ctrlbit = S3C_CLKCON_PCLK_UART1,
231 }, {
232 .name = "uart",
233 .id = 2,
234 .parent = &clk_p,
235 .enable = s3c64xx_pclk_ctrl,
236 .ctrlbit = S3C_CLKCON_PCLK_UART2,
237 }, {
238 .name = "uart",
239 .id = 3,
240 .parent = &clk_p,
241 .enable = s3c64xx_pclk_ctrl,
242 .ctrlbit = S3C_CLKCON_PCLK_UART3,
243 }, {
244 .name = "rtc",
245 .id = -1,
246 .parent = &clk_p,
247 .enable = s3c64xx_pclk_ctrl,
248 .ctrlbit = S3C_CLKCON_PCLK_RTC,
249 }, {
250 .name = "watchdog",
251 .id = -1,
252 .parent = &clk_p,
253 .ctrlbit = S3C_CLKCON_PCLK_WDT,
254 }, {
255 .name = "ac97",
256 .id = -1,
257 .parent = &clk_p,
258 .ctrlbit = S3C_CLKCON_PCLK_AC97,
259 }
260};
261
262static struct clk *clks[] __initdata = {
263 &clk_ext,
264 &clk_epll,
265 &clk_27m,
266 &clk_48m,
267 &clk_h2,
268};
269
270void __init s3c64xx_register_clocks(void)
271{
272 struct clk *clkp;
273 int ret;
274 int ptr;
275
276 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
277
278 clkp = init_clocks;
279 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks); ptr++, clkp++) {
280 ret = s3c24xx_register_clock(clkp);
281 if (ret < 0) {
282 printk(KERN_ERR "Failed to register clock %s (%d)\n",
283 clkp->name, ret);
284 }
285 }
286
287 clkp = init_clocks_disable;
288 for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) {
289
290 ret = s3c24xx_register_clock(clkp);
291 if (ret < 0) {
292 printk(KERN_ERR "Failed to register clock %s (%d)\n",
293 clkp->name, ret);
294 }
295
296 (clkp->enable)(clkp, 0);
297 }
298
299 s3c_pwmclk_init();
300}
diff --git a/arch/arm/plat-s3c64xx/dev-audio.c b/arch/arm/plat-s3c64xx/dev-audio.c
deleted file mode 100644
index a21a88fbb7e3..000000000000
--- a/arch/arm/plat-s3c64xx/dev-audio.c
+++ /dev/null
@@ -1,167 +0,0 @@
1/* linux/arch/arm/plat-s3c/dev-audio.c
2 *
3 * Copyright 2009 Wolfson Microelectronics
4 * Mark Brown <broonie@opensource.wolfsonmicro.com>
5 *
6
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/kernel.h>
13#include <linux/string.h>
14#include <linux/platform_device.h>
15
16#include <mach/irqs.h>
17#include <mach/map.h>
18#include <mach/dma.h>
19#include <mach/gpio.h>
20
21#include <plat/devs.h>
22#include <plat/audio.h>
23#include <plat/gpio-bank-d.h>
24#include <plat/gpio-bank-e.h>
25#include <plat/gpio-cfg.h>
26
27static struct resource s3c64xx_iis0_resource[] = {
28 [0] = {
29 .start = S3C64XX_PA_IIS0,
30 .end = S3C64XX_PA_IIS0 + 0x100 - 1,
31 .flags = IORESOURCE_MEM,
32 },
33};
34
35struct platform_device s3c64xx_device_iis0 = {
36 .name = "s3c64xx-iis",
37 .id = 0,
38 .num_resources = ARRAY_SIZE(s3c64xx_iis0_resource),
39 .resource = s3c64xx_iis0_resource,
40};
41EXPORT_SYMBOL(s3c64xx_device_iis0);
42
43static struct resource s3c64xx_iis1_resource[] = {
44 [0] = {
45 .start = S3C64XX_PA_IIS1,
46 .end = S3C64XX_PA_IIS1 + 0x100 - 1,
47 .flags = IORESOURCE_MEM,
48 },
49};
50
51struct platform_device s3c64xx_device_iis1 = {
52 .name = "s3c64xx-iis",
53 .id = 1,
54 .num_resources = ARRAY_SIZE(s3c64xx_iis1_resource),
55 .resource = s3c64xx_iis1_resource,
56};
57EXPORT_SYMBOL(s3c64xx_device_iis1);
58
59static struct resource s3c64xx_iisv4_resource[] = {
60 [0] = {
61 .start = S3C64XX_PA_IISV4,
62 .end = S3C64XX_PA_IISV4 + 0x100 - 1,
63 .flags = IORESOURCE_MEM,
64 },
65};
66
67struct platform_device s3c64xx_device_iisv4 = {
68 .name = "s3c64xx-iis-v4",
69 .id = -1,
70 .num_resources = ARRAY_SIZE(s3c64xx_iisv4_resource),
71 .resource = s3c64xx_iisv4_resource,
72};
73EXPORT_SYMBOL(s3c64xx_device_iisv4);
74
75
76/* PCM Controller platform_devices */
77
78static int s3c64xx_pcm_cfg_gpio(struct platform_device *pdev)
79{
80 switch (pdev->id) {
81 case 0:
82 s3c_gpio_cfgpin(S3C64XX_GPD(0), S3C64XX_GPD0_PCM0_SCLK);
83 s3c_gpio_cfgpin(S3C64XX_GPD(1), S3C64XX_GPD1_PCM0_EXTCLK);
84 s3c_gpio_cfgpin(S3C64XX_GPD(2), S3C64XX_GPD2_PCM0_FSYNC);
85 s3c_gpio_cfgpin(S3C64XX_GPD(3), S3C64XX_GPD3_PCM0_SIN);
86 s3c_gpio_cfgpin(S3C64XX_GPD(4), S3C64XX_GPD4_PCM0_SOUT);
87 break;
88 case 1:
89 s3c_gpio_cfgpin(S3C64XX_GPE(0), S3C64XX_GPE0_PCM1_SCLK);
90 s3c_gpio_cfgpin(S3C64XX_GPE(1), S3C64XX_GPE1_PCM1_EXTCLK);
91 s3c_gpio_cfgpin(S3C64XX_GPE(2), S3C64XX_GPE2_PCM1_FSYNC);
92 s3c_gpio_cfgpin(S3C64XX_GPE(3), S3C64XX_GPE3_PCM1_SIN);
93 s3c_gpio_cfgpin(S3C64XX_GPE(4), S3C64XX_GPE4_PCM1_SOUT);
94 break;
95 default:
96 printk(KERN_DEBUG "Invalid PCM Controller number!");
97 return -EINVAL;
98 }
99
100 return 0;
101}
102
103static struct resource s3c64xx_pcm0_resource[] = {
104 [0] = {
105 .start = S3C64XX_PA_PCM0,
106 .end = S3C64XX_PA_PCM0 + 0x100 - 1,
107 .flags = IORESOURCE_MEM,
108 },
109 [1] = {
110 .start = DMACH_PCM0_TX,
111 .end = DMACH_PCM0_TX,
112 .flags = IORESOURCE_DMA,
113 },
114 [2] = {
115 .start = DMACH_PCM0_RX,
116 .end = DMACH_PCM0_RX,
117 .flags = IORESOURCE_DMA,
118 },
119};
120
121static struct s3c_audio_pdata s3c_pcm0_pdata = {
122 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
123};
124
125struct platform_device s3c64xx_device_pcm0 = {
126 .name = "samsung-pcm",
127 .id = 0,
128 .num_resources = ARRAY_SIZE(s3c64xx_pcm0_resource),
129 .resource = s3c64xx_pcm0_resource,
130 .dev = {
131 .platform_data = &s3c_pcm0_pdata,
132 },
133};
134EXPORT_SYMBOL(s3c64xx_device_pcm0);
135
136static struct resource s3c64xx_pcm1_resource[] = {
137 [0] = {
138 .start = S3C64XX_PA_PCM1,
139 .end = S3C64XX_PA_PCM1 + 0x100 - 1,
140 .flags = IORESOURCE_MEM,
141 },
142 [1] = {
143 .start = DMACH_PCM1_TX,
144 .end = DMACH_PCM1_TX,
145 .flags = IORESOURCE_DMA,
146 },
147 [2] = {
148 .start = DMACH_PCM1_RX,
149 .end = DMACH_PCM1_RX,
150 .flags = IORESOURCE_DMA,
151 },
152};
153
154static struct s3c_audio_pdata s3c_pcm1_pdata = {
155 .cfg_gpio = s3c64xx_pcm_cfg_gpio,
156};
157
158struct platform_device s3c64xx_device_pcm1 = {
159 .name = "samsung-pcm",
160 .id = 1,
161 .num_resources = ARRAY_SIZE(s3c64xx_pcm1_resource),
162 .resource = s3c64xx_pcm1_resource,
163 .dev = {
164 .platform_data = &s3c_pcm1_pdata,
165 },
166};
167EXPORT_SYMBOL(s3c64xx_device_pcm1);
diff --git a/arch/arm/plat-s3c64xx/irq.c b/arch/arm/plat-s3c64xx/irq.c
deleted file mode 100644
index 8dc5b6da9789..000000000000
--- a/arch/arm/plat-s3c64xx/irq.c
+++ /dev/null
@@ -1,256 +0,0 @@
1/* arch/arm/plat-s3c64xx/irq.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C64XX - Interrupt handling
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/interrupt.h>
17#include <linux/serial_core.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include <asm/hardware/vic.h>
22
23#include <mach/map.h>
24#include <plat/regs-serial.h>
25#include <plat/regs-timer.h>
26#include <plat/cpu.h>
27
28/* Timer interrupt handling */
29
30static void s3c_irq_demux_timer(unsigned int base_irq, unsigned int sub_irq)
31{
32 generic_handle_irq(sub_irq);
33}
34
35static void s3c_irq_demux_timer0(unsigned int irq, struct irq_desc *desc)
36{
37 s3c_irq_demux_timer(irq, IRQ_TIMER0);
38}
39
40static void s3c_irq_demux_timer1(unsigned int irq, struct irq_desc *desc)
41{
42 s3c_irq_demux_timer(irq, IRQ_TIMER1);
43}
44
45static void s3c_irq_demux_timer2(unsigned int irq, struct irq_desc *desc)
46{
47 s3c_irq_demux_timer(irq, IRQ_TIMER2);
48}
49
50static void s3c_irq_demux_timer3(unsigned int irq, struct irq_desc *desc)
51{
52 s3c_irq_demux_timer(irq, IRQ_TIMER3);
53}
54
55static void s3c_irq_demux_timer4(unsigned int irq, struct irq_desc *desc)
56{
57 s3c_irq_demux_timer(irq, IRQ_TIMER4);
58}
59
60/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
61
62static void s3c_irq_timer_mask(unsigned int irq)
63{
64 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
65
66 reg &= 0x1f; /* mask out pending interrupts */
67 reg &= ~(1 << (irq - IRQ_TIMER0));
68 __raw_writel(reg, S3C64XX_TINT_CSTAT);
69}
70
71static void s3c_irq_timer_unmask(unsigned int irq)
72{
73 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
74
75 reg &= 0x1f; /* mask out pending interrupts */
76 reg |= 1 << (irq - IRQ_TIMER0);
77 __raw_writel(reg, S3C64XX_TINT_CSTAT);
78}
79
80static void s3c_irq_timer_ack(unsigned int irq)
81{
82 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
83
84 reg &= 0x1f;
85 reg |= (1 << 5) << (irq - IRQ_TIMER0);
86 __raw_writel(reg, S3C64XX_TINT_CSTAT);
87}
88
89static struct irq_chip s3c_irq_timer = {
90 .name = "s3c-timer",
91 .mask = s3c_irq_timer_mask,
92 .unmask = s3c_irq_timer_unmask,
93 .ack = s3c_irq_timer_ack,
94};
95
96struct uart_irq {
97 void __iomem *regs;
98 unsigned int base_irq;
99 unsigned int parent_irq;
100};
101
102/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
103 * are consecutive when looking up the interrupt in the demux routines.
104 */
105static struct uart_irq uart_irqs[] = {
106 [0] = {
107 .regs = S3C_VA_UART0,
108 .base_irq = IRQ_S3CUART_BASE0,
109 .parent_irq = IRQ_UART0,
110 },
111 [1] = {
112 .regs = S3C_VA_UART1,
113 .base_irq = IRQ_S3CUART_BASE1,
114 .parent_irq = IRQ_UART1,
115 },
116 [2] = {
117 .regs = S3C_VA_UART2,
118 .base_irq = IRQ_S3CUART_BASE2,
119 .parent_irq = IRQ_UART2,
120 },
121 [3] = {
122 .regs = S3C_VA_UART3,
123 .base_irq = IRQ_S3CUART_BASE3,
124 .parent_irq = IRQ_UART3,
125 },
126};
127
128static inline void __iomem *s3c_irq_uart_base(unsigned int irq)
129{
130 struct uart_irq *uirq = get_irq_chip_data(irq);
131 return uirq->regs;
132}
133
134static inline unsigned int s3c_irq_uart_bit(unsigned int irq)
135{
136 return irq & 3;
137}
138
139/* UART interrupt registers, not worth adding to seperate include header */
140
141static void s3c_irq_uart_mask(unsigned int irq)
142{
143 void __iomem *regs = s3c_irq_uart_base(irq);
144 unsigned int bit = s3c_irq_uart_bit(irq);
145 u32 reg;
146
147 reg = __raw_readl(regs + S3C64XX_UINTM);
148 reg |= (1 << bit);
149 __raw_writel(reg, regs + S3C64XX_UINTM);
150}
151
152static void s3c_irq_uart_maskack(unsigned int irq)
153{
154 void __iomem *regs = s3c_irq_uart_base(irq);
155 unsigned int bit = s3c_irq_uart_bit(irq);
156 u32 reg;
157
158 reg = __raw_readl(regs + S3C64XX_UINTM);
159 reg |= (1 << bit);
160 __raw_writel(reg, regs + S3C64XX_UINTM);
161 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
162}
163
164static void s3c_irq_uart_unmask(unsigned int irq)
165{
166 void __iomem *regs = s3c_irq_uart_base(irq);
167 unsigned int bit = s3c_irq_uart_bit(irq);
168 u32 reg;
169
170 reg = __raw_readl(regs + S3C64XX_UINTM);
171 reg &= ~(1 << bit);
172 __raw_writel(reg, regs + S3C64XX_UINTM);
173}
174
175static void s3c_irq_uart_ack(unsigned int irq)
176{
177 void __iomem *regs = s3c_irq_uart_base(irq);
178 unsigned int bit = s3c_irq_uart_bit(irq);
179
180 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
181}
182
183static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc)
184{
185 struct uart_irq *uirq = &uart_irqs[irq - IRQ_UART0];
186 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP);
187 int base = uirq->base_irq;
188
189 if (pend & (1 << 0))
190 generic_handle_irq(base);
191 if (pend & (1 << 1))
192 generic_handle_irq(base + 1);
193 if (pend & (1 << 2))
194 generic_handle_irq(base + 2);
195 if (pend & (1 << 3))
196 generic_handle_irq(base + 3);
197}
198
199static struct irq_chip s3c_irq_uart = {
200 .name = "s3c-uart",
201 .mask = s3c_irq_uart_mask,
202 .unmask = s3c_irq_uart_unmask,
203 .mask_ack = s3c_irq_uart_maskack,
204 .ack = s3c_irq_uart_ack,
205};
206
207static void __init s3c64xx_uart_irq(struct uart_irq *uirq)
208{
209 void __iomem *reg_base = uirq->regs;
210 unsigned int irq;
211 int offs;
212
213 /* mask all interrupts at the start. */
214 __raw_writel(0xf, reg_base + S3C64XX_UINTM);
215
216 for (offs = 0; offs < 3; offs++) {
217 irq = uirq->base_irq + offs;
218
219 set_irq_chip(irq, &s3c_irq_uart);
220 set_irq_chip_data(irq, uirq);
221 set_irq_handler(irq, handle_level_irq);
222 set_irq_flags(irq, IRQF_VALID);
223 }
224
225 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart);
226}
227
228void __init s3c64xx_init_irq(u32 vic0_valid, u32 vic1_valid)
229{
230 int uart, irq;
231
232 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
233
234 /* initialise the pair of VICs */
235 vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid, 0);
236 vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid, 0);
237
238 /* add the timer sub-irqs */
239
240 set_irq_chained_handler(IRQ_TIMER0_VIC, s3c_irq_demux_timer0);
241 set_irq_chained_handler(IRQ_TIMER1_VIC, s3c_irq_demux_timer1);
242 set_irq_chained_handler(IRQ_TIMER2_VIC, s3c_irq_demux_timer2);
243 set_irq_chained_handler(IRQ_TIMER3_VIC, s3c_irq_demux_timer3);
244 set_irq_chained_handler(IRQ_TIMER4_VIC, s3c_irq_demux_timer4);
245
246 for (irq = IRQ_TIMER0; irq <= IRQ_TIMER4; irq++) {
247 set_irq_chip(irq, &s3c_irq_timer);
248 set_irq_handler(irq, handle_level_irq);
249 set_irq_flags(irq, IRQF_VALID);
250 }
251
252 for (uart = 0; uart < ARRAY_SIZE(uart_irqs); uart++)
253 s3c64xx_uart_irq(&uart_irqs[uart]);
254}
255
256
diff --git a/arch/arm/plat-s3c64xx/s3c6400-clock.c b/arch/arm/plat-s3c64xx/s3c6400-clock.c
deleted file mode 100644
index ffd56deb9e81..000000000000
--- a/arch/arm/plat-s3c64xx/s3c6400-clock.c
+++ /dev/null
@@ -1,758 +0,0 @@
1/* linux/arch/arm/plat-s3c64xx/s3c6400-clock.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6400 based common clock support
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/init.h>
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/list.h>
19#include <linux/errno.h>
20#include <linux/err.h>
21#include <linux/clk.h>
22#include <linux/sysdev.h>
23#include <linux/io.h>
24
25#include <mach/hardware.h>
26#include <mach/map.h>
27
28#include <plat/cpu-freq.h>
29
30#include <plat/regs-clock.h>
31#include <plat/clock.h>
32#include <plat/cpu.h>
33#include <plat/pll.h>
34
35/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
36 * ext_xtal_mux for want of an actual name from the manual.
37*/
38
39static struct clk clk_ext_xtal_mux = {
40 .name = "ext_xtal",
41 .id = -1,
42};
43
44#define clk_fin_apll clk_ext_xtal_mux
45#define clk_fin_mpll clk_ext_xtal_mux
46#define clk_fin_epll clk_ext_xtal_mux
47
48#define clk_fout_mpll clk_mpll
49#define clk_fout_epll clk_epll
50
51struct clk_sources {
52 unsigned int nr_sources;
53 struct clk **sources;
54};
55
56struct clksrc_clk {
57 struct clk clk;
58 unsigned int mask;
59 unsigned int shift;
60
61 struct clk_sources *sources;
62
63 unsigned int divider_shift;
64 void __iomem *reg_divider;
65};
66
67static struct clk clk_fout_apll = {
68 .name = "fout_apll",
69 .id = -1,
70};
71
72static struct clk *clk_src_apll_list[] = {
73 [0] = &clk_fin_apll,
74 [1] = &clk_fout_apll,
75};
76
77static struct clk_sources clk_src_apll = {
78 .sources = clk_src_apll_list,
79 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
80};
81
82static struct clksrc_clk clk_mout_apll = {
83 .clk = {
84 .name = "mout_apll",
85 .id = -1,
86 },
87 .shift = S3C6400_CLKSRC_APLL_MOUT_SHIFT,
88 .mask = S3C6400_CLKSRC_APLL_MOUT,
89 .sources = &clk_src_apll,
90};
91
92static struct clk *clk_src_epll_list[] = {
93 [0] = &clk_fin_epll,
94 [1] = &clk_fout_epll,
95};
96
97static struct clk_sources clk_src_epll = {
98 .sources = clk_src_epll_list,
99 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
100};
101
102static struct clksrc_clk clk_mout_epll = {
103 .clk = {
104 .name = "mout_epll",
105 .id = -1,
106 },
107 .shift = S3C6400_CLKSRC_EPLL_MOUT_SHIFT,
108 .mask = S3C6400_CLKSRC_EPLL_MOUT,
109 .sources = &clk_src_epll,
110};
111
112static struct clk *clk_src_mpll_list[] = {
113 [0] = &clk_fin_mpll,
114 [1] = &clk_fout_mpll,
115};
116
117static struct clk_sources clk_src_mpll = {
118 .sources = clk_src_mpll_list,
119 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
120};
121
122static struct clksrc_clk clk_mout_mpll = {
123 .clk = {
124 .name = "mout_mpll",
125 .id = -1,
126 },
127 .shift = S3C6400_CLKSRC_MPLL_MOUT_SHIFT,
128 .mask = S3C6400_CLKSRC_MPLL_MOUT,
129 .sources = &clk_src_mpll,
130};
131
132static unsigned int armclk_mask;
133
134static unsigned long s3c64xx_clk_arm_get_rate(struct clk *clk)
135{
136 unsigned long rate = clk_get_rate(clk->parent);
137 u32 clkdiv;
138
139 /* divisor mask starts at bit0, so no need to shift */
140 clkdiv = __raw_readl(S3C_CLK_DIV0) & armclk_mask;
141
142 return rate / (clkdiv + 1);
143}
144
145static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk,
146 unsigned long rate)
147{
148 unsigned long parent = clk_get_rate(clk->parent);
149 u32 div;
150
151 if (parent < rate)
152 return parent;
153
154 div = (parent / rate) - 1;
155 if (div > armclk_mask)
156 div = armclk_mask;
157
158 return parent / (div + 1);
159}
160
161static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate)
162{
163 unsigned long parent = clk_get_rate(clk->parent);
164 u32 div;
165 u32 val;
166
167 if (rate < parent / (armclk_mask + 1))
168 return -EINVAL;
169
170 rate = clk_round_rate(clk, rate);
171 div = clk_get_rate(clk->parent) / rate;
172
173 val = __raw_readl(S3C_CLK_DIV0);
174 val &= ~armclk_mask;
175 val |= (div - 1);
176 __raw_writel(val, S3C_CLK_DIV0);
177
178 return 0;
179
180}
181
182static struct clk clk_arm = {
183 .name = "armclk",
184 .id = -1,
185 .parent = &clk_mout_apll.clk,
186 .get_rate = s3c64xx_clk_arm_get_rate,
187 .set_rate = s3c64xx_clk_arm_set_rate,
188 .round_rate = s3c64xx_clk_arm_round_rate,
189};
190
191static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk)
192{
193 unsigned long rate = clk_get_rate(clk->parent);
194
195 printk(KERN_DEBUG "%s: parent is %ld\n", __func__, rate);
196
197 if (__raw_readl(S3C_CLK_DIV0) & S3C6400_CLKDIV0_MPLL_MASK)
198 rate /= 2;
199
200 return rate;
201}
202
203static struct clk clk_dout_mpll = {
204 .name = "dout_mpll",
205 .id = -1,
206 .parent = &clk_mout_mpll.clk,
207 .get_rate = s3c64xx_clk_doutmpll_get_rate,
208};
209
210static struct clk *clkset_spi_mmc_list[] = {
211 &clk_mout_epll.clk,
212 &clk_dout_mpll,
213 &clk_fin_epll,
214 &clk_27m,
215};
216
217static struct clk_sources clkset_spi_mmc = {
218 .sources = clkset_spi_mmc_list,
219 .nr_sources = ARRAY_SIZE(clkset_spi_mmc_list),
220};
221
222static struct clk *clkset_irda_list[] = {
223 &clk_mout_epll.clk,
224 &clk_dout_mpll,
225 NULL,
226 &clk_27m,
227};
228
229static struct clk_sources clkset_irda = {
230 .sources = clkset_irda_list,
231 .nr_sources = ARRAY_SIZE(clkset_irda_list),
232};
233
234static struct clk *clkset_uart_list[] = {
235 &clk_mout_epll.clk,
236 &clk_dout_mpll,
237 NULL,
238 NULL
239};
240
241static struct clk_sources clkset_uart = {
242 .sources = clkset_uart_list,
243 .nr_sources = ARRAY_SIZE(clkset_uart_list),
244};
245
246static struct clk *clkset_uhost_list[] = {
247 &clk_48m,
248 &clk_mout_epll.clk,
249 &clk_dout_mpll,
250 &clk_fin_epll,
251};
252
253static struct clk_sources clkset_uhost = {
254 .sources = clkset_uhost_list,
255 .nr_sources = ARRAY_SIZE(clkset_uhost_list),
256};
257
258
259/* The peripheral clocks are all controlled via clocksource followed
260 * by an optional divider and gate stage. We currently roll this into
261 * one clock which hides the intermediate clock from the mux.
262 *
263 * Note, the JPEG clock can only be an even divider...
264 *
265 * The scaler and LCD clocks depend on the S3C64XX version, and also
266 * have a common parent divisor so are not included here.
267 */
268
269static inline struct clksrc_clk *to_clksrc(struct clk *clk)
270{
271 return container_of(clk, struct clksrc_clk, clk);
272}
273
274static unsigned long s3c64xx_getrate_clksrc(struct clk *clk)
275{
276 struct clksrc_clk *sclk = to_clksrc(clk);
277 unsigned long rate = clk_get_rate(clk->parent);
278 u32 clkdiv = __raw_readl(sclk->reg_divider);
279
280 clkdiv >>= sclk->divider_shift;
281 clkdiv &= 0xf;
282 clkdiv++;
283
284 rate /= clkdiv;
285 return rate;
286}
287
288static int s3c64xx_setrate_clksrc(struct clk *clk, unsigned long rate)
289{
290 struct clksrc_clk *sclk = to_clksrc(clk);
291 void __iomem *reg = sclk->reg_divider;
292 unsigned int div;
293 u32 val;
294
295 rate = clk_round_rate(clk, rate);
296 div = clk_get_rate(clk->parent) / rate;
297 if (div > 16)
298 return -EINVAL;
299
300 val = __raw_readl(reg);
301 val &= ~(0xf << sclk->divider_shift);
302 val |= (div - 1) << sclk->divider_shift;
303 __raw_writel(val, reg);
304
305 return 0;
306}
307
308static int s3c64xx_setparent_clksrc(struct clk *clk, struct clk *parent)
309{
310 struct clksrc_clk *sclk = to_clksrc(clk);
311 struct clk_sources *srcs = sclk->sources;
312 u32 clksrc = __raw_readl(S3C_CLK_SRC);
313 int src_nr = -1;
314 int ptr;
315
316 for (ptr = 0; ptr < srcs->nr_sources; ptr++)
317 if (srcs->sources[ptr] == parent) {
318 src_nr = ptr;
319 break;
320 }
321
322 if (src_nr >= 0) {
323 clksrc &= ~sclk->mask;
324 clksrc |= src_nr << sclk->shift;
325
326 __raw_writel(clksrc, S3C_CLK_SRC);
327
328 clk->parent = parent;
329 return 0;
330 }
331
332 return -EINVAL;
333}
334
335static unsigned long s3c64xx_roundrate_clksrc(struct clk *clk,
336 unsigned long rate)
337{
338 unsigned long parent_rate = clk_get_rate(clk->parent);
339 int div;
340
341 if (rate > parent_rate)
342 rate = parent_rate;
343 else {
344 div = parent_rate / rate;
345
346 if (div == 0)
347 div = 1;
348 if (div > 16)
349 div = 16;
350
351 rate = parent_rate / div;
352 }
353
354 return rate;
355}
356
357static struct clksrc_clk clk_mmc0 = {
358 .clk = {
359 .name = "mmc_bus",
360 .id = 0,
361 .ctrlbit = S3C_CLKCON_SCLK_MMC0,
362 .enable = s3c64xx_sclk_ctrl,
363 .set_parent = s3c64xx_setparent_clksrc,
364 .get_rate = s3c64xx_getrate_clksrc,
365 .set_rate = s3c64xx_setrate_clksrc,
366 .round_rate = s3c64xx_roundrate_clksrc,
367 },
368 .shift = S3C6400_CLKSRC_MMC0_SHIFT,
369 .mask = S3C6400_CLKSRC_MMC0_MASK,
370 .sources = &clkset_spi_mmc,
371 .divider_shift = S3C6400_CLKDIV1_MMC0_SHIFT,
372 .reg_divider = S3C_CLK_DIV1,
373};
374
375static struct clksrc_clk clk_mmc1 = {
376 .clk = {
377 .name = "mmc_bus",
378 .id = 1,
379 .ctrlbit = S3C_CLKCON_SCLK_MMC1,
380 .enable = s3c64xx_sclk_ctrl,
381 .get_rate = s3c64xx_getrate_clksrc,
382 .set_rate = s3c64xx_setrate_clksrc,
383 .set_parent = s3c64xx_setparent_clksrc,
384 .round_rate = s3c64xx_roundrate_clksrc,
385 },
386 .shift = S3C6400_CLKSRC_MMC1_SHIFT,
387 .mask = S3C6400_CLKSRC_MMC1_MASK,
388 .sources = &clkset_spi_mmc,
389 .divider_shift = S3C6400_CLKDIV1_MMC1_SHIFT,
390 .reg_divider = S3C_CLK_DIV1,
391};
392
393static struct clksrc_clk clk_mmc2 = {
394 .clk = {
395 .name = "mmc_bus",
396 .id = 2,
397 .ctrlbit = S3C_CLKCON_SCLK_MMC2,
398 .enable = s3c64xx_sclk_ctrl,
399 .get_rate = s3c64xx_getrate_clksrc,
400 .set_rate = s3c64xx_setrate_clksrc,
401 .set_parent = s3c64xx_setparent_clksrc,
402 .round_rate = s3c64xx_roundrate_clksrc,
403 },
404 .shift = S3C6400_CLKSRC_MMC2_SHIFT,
405 .mask = S3C6400_CLKSRC_MMC2_MASK,
406 .sources = &clkset_spi_mmc,
407 .divider_shift = S3C6400_CLKDIV1_MMC2_SHIFT,
408 .reg_divider = S3C_CLK_DIV1,
409};
410
411static struct clksrc_clk clk_usbhost = {
412 .clk = {
413 .name = "usb-bus-host",
414 .id = -1,
415 .ctrlbit = S3C_CLKCON_SCLK_UHOST,
416 .enable = s3c64xx_sclk_ctrl,
417 .set_parent = s3c64xx_setparent_clksrc,
418 .get_rate = s3c64xx_getrate_clksrc,
419 .set_rate = s3c64xx_setrate_clksrc,
420 .round_rate = s3c64xx_roundrate_clksrc,
421 },
422 .shift = S3C6400_CLKSRC_UHOST_SHIFT,
423 .mask = S3C6400_CLKSRC_UHOST_MASK,
424 .sources = &clkset_uhost,
425 .divider_shift = S3C6400_CLKDIV1_UHOST_SHIFT,
426 .reg_divider = S3C_CLK_DIV1,
427};
428
429static struct clksrc_clk clk_uart_uclk1 = {
430 .clk = {
431 .name = "uclk1",
432 .id = -1,
433 .ctrlbit = S3C_CLKCON_SCLK_UART,
434 .enable = s3c64xx_sclk_ctrl,
435 .set_parent = s3c64xx_setparent_clksrc,
436 .get_rate = s3c64xx_getrate_clksrc,
437 .set_rate = s3c64xx_setrate_clksrc,
438 .round_rate = s3c64xx_roundrate_clksrc,
439 },
440 .shift = S3C6400_CLKSRC_UART_SHIFT,
441 .mask = S3C6400_CLKSRC_UART_MASK,
442 .sources = &clkset_uart,
443 .divider_shift = S3C6400_CLKDIV2_UART_SHIFT,
444 .reg_divider = S3C_CLK_DIV2,
445};
446
447/* Where does UCLK0 come from? */
448
449static struct clksrc_clk clk_spi0 = {
450 .clk = {
451 .name = "spi-bus",
452 .id = 0,
453 .ctrlbit = S3C_CLKCON_SCLK_SPI0,
454 .enable = s3c64xx_sclk_ctrl,
455 .set_parent = s3c64xx_setparent_clksrc,
456 .get_rate = s3c64xx_getrate_clksrc,
457 .set_rate = s3c64xx_setrate_clksrc,
458 .round_rate = s3c64xx_roundrate_clksrc,
459 },
460 .shift = S3C6400_CLKSRC_SPI0_SHIFT,
461 .mask = S3C6400_CLKSRC_SPI0_MASK,
462 .sources = &clkset_spi_mmc,
463 .divider_shift = S3C6400_CLKDIV2_SPI0_SHIFT,
464 .reg_divider = S3C_CLK_DIV2,
465};
466
467static struct clksrc_clk clk_spi1 = {
468 .clk = {
469 .name = "spi-bus",
470 .id = 1,
471 .ctrlbit = S3C_CLKCON_SCLK_SPI1,
472 .enable = s3c64xx_sclk_ctrl,
473 .set_parent = s3c64xx_setparent_clksrc,
474 .get_rate = s3c64xx_getrate_clksrc,
475 .set_rate = s3c64xx_setrate_clksrc,
476 .round_rate = s3c64xx_roundrate_clksrc,
477 },
478 .shift = S3C6400_CLKSRC_SPI1_SHIFT,
479 .mask = S3C6400_CLKSRC_SPI1_MASK,
480 .sources = &clkset_spi_mmc,
481 .divider_shift = S3C6400_CLKDIV2_SPI1_SHIFT,
482 .reg_divider = S3C_CLK_DIV2,
483};
484
485static struct clk clk_iis_cd0 = {
486 .name = "iis_cdclk0",
487 .id = -1,
488};
489
490static struct clk clk_iis_cd1 = {
491 .name = "iis_cdclk1",
492 .id = -1,
493};
494
495static struct clk clk_pcm_cd = {
496 .name = "pcm_cdclk",
497 .id = -1,
498};
499
500static struct clk *clkset_audio0_list[] = {
501 [0] = &clk_mout_epll.clk,
502 [1] = &clk_dout_mpll,
503 [2] = &clk_fin_epll,
504 [3] = &clk_iis_cd0,
505 [4] = &clk_pcm_cd,
506};
507
508static struct clk_sources clkset_audio0 = {
509 .sources = clkset_audio0_list,
510 .nr_sources = ARRAY_SIZE(clkset_audio0_list),
511};
512
513static struct clksrc_clk clk_audio0 = {
514 .clk = {
515 .name = "audio-bus",
516 .id = 0,
517 .ctrlbit = S3C_CLKCON_SCLK_AUDIO0,
518 .enable = s3c64xx_sclk_ctrl,
519 .set_parent = s3c64xx_setparent_clksrc,
520 .get_rate = s3c64xx_getrate_clksrc,
521 .set_rate = s3c64xx_setrate_clksrc,
522 .round_rate = s3c64xx_roundrate_clksrc,
523 },
524 .shift = S3C6400_CLKSRC_AUDIO0_SHIFT,
525 .mask = S3C6400_CLKSRC_AUDIO0_MASK,
526 .sources = &clkset_audio0,
527 .divider_shift = S3C6400_CLKDIV2_AUDIO0_SHIFT,
528 .reg_divider = S3C_CLK_DIV2,
529};
530
531static struct clk *clkset_audio1_list[] = {
532 [0] = &clk_mout_epll.clk,
533 [1] = &clk_dout_mpll,
534 [2] = &clk_fin_epll,
535 [3] = &clk_iis_cd1,
536 [4] = &clk_pcm_cd,
537};
538
539static struct clk_sources clkset_audio1 = {
540 .sources = clkset_audio1_list,
541 .nr_sources = ARRAY_SIZE(clkset_audio1_list),
542};
543
544static struct clksrc_clk clk_audio1 = {
545 .clk = {
546 .name = "audio-bus",
547 .id = 1,
548 .ctrlbit = S3C_CLKCON_SCLK_AUDIO1,
549 .enable = s3c64xx_sclk_ctrl,
550 .set_parent = s3c64xx_setparent_clksrc,
551 .get_rate = s3c64xx_getrate_clksrc,
552 .set_rate = s3c64xx_setrate_clksrc,
553 .round_rate = s3c64xx_roundrate_clksrc,
554 },
555 .shift = S3C6400_CLKSRC_AUDIO1_SHIFT,
556 .mask = S3C6400_CLKSRC_AUDIO1_MASK,
557 .sources = &clkset_audio1,
558 .divider_shift = S3C6400_CLKDIV2_AUDIO1_SHIFT,
559 .reg_divider = S3C_CLK_DIV2,
560};
561
562static struct clksrc_clk clk_irda = {
563 .clk = {
564 .name = "irda-bus",
565 .id = 0,
566 .ctrlbit = S3C_CLKCON_SCLK_IRDA,
567 .enable = s3c64xx_sclk_ctrl,
568 .set_parent = s3c64xx_setparent_clksrc,
569 .get_rate = s3c64xx_getrate_clksrc,
570 .set_rate = s3c64xx_setrate_clksrc,
571 .round_rate = s3c64xx_roundrate_clksrc,
572 },
573 .shift = S3C6400_CLKSRC_IRDA_SHIFT,
574 .mask = S3C6400_CLKSRC_IRDA_MASK,
575 .sources = &clkset_irda,
576 .divider_shift = S3C6400_CLKDIV2_IRDA_SHIFT,
577 .reg_divider = S3C_CLK_DIV2,
578};
579
580static struct clk *clkset_camif_list[] = {
581 &clk_h2,
582};
583
584static struct clk_sources clkset_camif = {
585 .sources = clkset_camif_list,
586 .nr_sources = ARRAY_SIZE(clkset_camif_list),
587};
588
589static struct clksrc_clk clk_camif = {
590 .clk = {
591 .name = "camera",
592 .id = -1,
593 .ctrlbit = S3C_CLKCON_SCLK_CAM,
594 .enable = s3c64xx_sclk_ctrl,
595 .set_parent = s3c64xx_setparent_clksrc,
596 .get_rate = s3c64xx_getrate_clksrc,
597 .set_rate = s3c64xx_setrate_clksrc,
598 .round_rate = s3c64xx_roundrate_clksrc,
599 },
600 .shift = 0,
601 .mask = 0,
602 .sources = &clkset_camif,
603 .divider_shift = S3C6400_CLKDIV0_CAM_SHIFT,
604 .reg_divider = S3C_CLK_DIV0,
605};
606
607/* Clock initialisation code */
608
609static struct clksrc_clk *init_parents[] = {
610 &clk_mout_apll,
611 &clk_mout_epll,
612 &clk_mout_mpll,
613 &clk_mmc0,
614 &clk_mmc1,
615 &clk_mmc2,
616 &clk_usbhost,
617 &clk_uart_uclk1,
618 &clk_spi0,
619 &clk_spi1,
620 &clk_audio0,
621 &clk_audio1,
622 &clk_irda,
623 &clk_camif,
624};
625
626static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk)
627{
628 struct clk_sources *srcs = clk->sources;
629 u32 clksrc = __raw_readl(S3C_CLK_SRC);
630
631 clksrc &= clk->mask;
632 clksrc >>= clk->shift;
633
634 if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) {
635 printk(KERN_ERR "%s: bad source %d\n",
636 clk->clk.name, clksrc);
637 return;
638 }
639
640 clk->clk.parent = srcs->sources[clksrc];
641
642 printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",
643 clk->clk.name, clk->clk.parent->name, clksrc,
644 clk_get_rate(&clk->clk));
645}
646
647#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
648
649void __init_or_cpufreq s3c6400_setup_clocks(void)
650{
651 struct clk *xtal_clk;
652 unsigned long xtal;
653 unsigned long fclk;
654 unsigned long hclk;
655 unsigned long hclk2;
656 unsigned long pclk;
657 unsigned long epll;
658 unsigned long apll;
659 unsigned long mpll;
660 unsigned int ptr;
661 u32 clkdiv0;
662
663 printk(KERN_DEBUG "%s: registering clocks\n", __func__);
664
665 clkdiv0 = __raw_readl(S3C_CLK_DIV0);
666 printk(KERN_DEBUG "%s: clkdiv0 = %08x\n", __func__, clkdiv0);
667
668 xtal_clk = clk_get(NULL, "xtal");
669 BUG_ON(IS_ERR(xtal_clk));
670
671 xtal = clk_get_rate(xtal_clk);
672 clk_put(xtal_clk);
673
674 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal);
675
676 /* For now assume the mux always selects the crystal */
677 clk_ext_xtal_mux.parent = xtal_clk;
678
679 epll = s3c6400_get_epll(xtal);
680 mpll = s3c6400_get_pll(xtal, __raw_readl(S3C_MPLL_CON));
681 apll = s3c6400_get_pll(xtal, __raw_readl(S3C_APLL_CON));
682
683 fclk = mpll;
684
685 printk(KERN_INFO "S3C64XX: PLL settings, A=%ld, M=%ld, E=%ld\n",
686 apll, mpll, epll);
687
688 hclk2 = mpll / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK2);
689 hclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_HCLK);
690 pclk = hclk2 / GET_DIV(clkdiv0, S3C6400_CLKDIV0_PCLK);
691
692 printk(KERN_INFO "S3C64XX: HCLK2=%ld, HCLK=%ld, PCLK=%ld\n",
693 hclk2, hclk, pclk);
694
695 clk_fout_mpll.rate = mpll;
696 clk_fout_epll.rate = epll;
697 clk_fout_apll.rate = apll;
698
699 clk_h2.rate = hclk2;
700 clk_h.rate = hclk;
701 clk_p.rate = pclk;
702 clk_f.rate = fclk;
703
704 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
705 s3c6400_set_clksrc(init_parents[ptr]);
706}
707
708static struct clk *clks[] __initdata = {
709 &clk_ext_xtal_mux,
710 &clk_iis_cd0,
711 &clk_iis_cd1,
712 &clk_pcm_cd,
713 &clk_mout_epll.clk,
714 &clk_mout_mpll.clk,
715 &clk_dout_mpll,
716 &clk_mmc0.clk,
717 &clk_mmc1.clk,
718 &clk_mmc2.clk,
719 &clk_usbhost.clk,
720 &clk_uart_uclk1.clk,
721 &clk_spi0.clk,
722 &clk_spi1.clk,
723 &clk_audio0.clk,
724 &clk_audio1.clk,
725 &clk_irda.clk,
726 &clk_camif.clk,
727 &clk_arm,
728};
729
730/**
731 * s3c6400_register_clocks - register clocks for s3c6400 and above
732 * @armclk_divlimit: Divisor mask for ARMCLK
733 *
734 * Register the clocks for the S3C6400 and above SoC range, such
735 * as ARMCLK and the clocks which have divider chains attached.
736 *
737 * This call does not setup the clocks, which is left to the
738 * s3c6400_setup_clocks() call which may be needed by the cpufreq
739 * or resume code to re-set the clocks if the bootloader has changed
740 * them.
741 */
742void __init s3c6400_register_clocks(unsigned armclk_divlimit)
743{
744 struct clk *clkp;
745 int ret;
746 int ptr;
747
748 armclk_mask = armclk_divlimit;
749
750 for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) {
751 clkp = clks[ptr];
752 ret = s3c24xx_register_clock(clkp);
753 if (ret < 0) {
754 printk(KERN_ERR "Failed to register clock %s (%d)\n",
755 clkp->name, ret);
756 }
757 }
758}
diff --git a/arch/arm/plat-s3c64xx/s3c6400-init.c b/arch/arm/plat-s3c64xx/s3c6400-init.c
deleted file mode 100644
index 6c28f39df097..000000000000
--- a/arch/arm/plat-s3c64xx/s3c6400-init.c
+++ /dev/null
@@ -1,29 +0,0 @@
1/* linux/arch/arm/plat-s3c64xx/s3c6400-init.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * S3C6400 - CPU initialisation (common with other S3C64XX chips)
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17#include <linux/init.h>
18
19#include <plat/cpu.h>
20#include <plat/devs.h>
21#include <plat/s3c6400.h>
22#include <plat/s3c6410.h>
23
24/* uart registration process */
25
26void __init s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no)
27{
28 s3c24xx_init_uartdevs("s3c6400-uart", s3c64xx_uart_resources, cfg, no);
29}
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
new file mode 100644
index 000000000000..d400a6a20fe4
--- /dev/null
+++ b/arch/arm/plat-s5p/Kconfig
@@ -0,0 +1,25 @@
1# arch/arm/plat-s5p/Kconfig
2#
3# Copyright (c) 2009 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8config PLAT_S5P
9 bool
10 depends on (ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210)
11 default y
12 select ARM_VIC
13 select NO_IOPORT
14 select ARCH_REQUIRE_GPIOLIB
15 select S3C_GPIO_TRACK
16 select SAMSUNG_GPIOLIB_4BIT
17 select S3C_GPIO_CFG_S3C64XX
18 select S3C_GPIO_PULL_UPDOWN
19 select S3C_GPIO_CFG_S3C24XX
20 select PLAT_SAMSUNG
21 select SAMSUNG_CLKSRC
22 select SAMSUNG_IRQ_VIC_TIMER
23 select SAMSUNG_IRQ_UART
24 help
25 Base platform code for Samsung's S5P series SoC.
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
new file mode 100644
index 000000000000..a7c54b332d27
--- /dev/null
+++ b/arch/arm/plat-s5p/Makefile
@@ -0,0 +1,19 @@
1# arch/arm/plat-s5p/Makefile
2#
3# Copyright (c) 2009 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Licensed under GPLv2
7
8obj-y :=
9obj-m :=
10obj-n := dummy.o
11obj- :=
12
13# Core files
14
15obj-y += dev-uart.o
16obj-y += cpu.o
17obj-y += clock.o
18obj-y += irq.o
19obj-y += setup-i2c0.o
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
new file mode 100644
index 000000000000..aa96e335073b
--- /dev/null
+++ b/arch/arm/plat-s5p/clock.c
@@ -0,0 +1,149 @@
1/* linux/arch/arm/plat-s5p/clock.c
2 *
3 * Copyright 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P - Common clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/kernel.h>
16#include <linux/list.h>
17#include <linux/errno.h>
18#include <linux/err.h>
19#include <linux/clk.h>
20#include <linux/sysdev.h>
21#include <linux/io.h>
22#include <asm/div64.h>
23
24#include <plat/clock.h>
25#include <plat/clock-clksrc.h>
26#include <plat/s5p-clock.h>
27
28/* fin_apll, fin_mpll and fin_epll are all the same clock, which we call
29 * clk_ext_xtal_mux.
30*/
31struct clk clk_ext_xtal_mux = {
32 .name = "ext_xtal",
33 .id = -1,
34};
35
36static struct clk s5p_clk_27m = {
37 .name = "clk_27m",
38 .id = -1,
39 .rate = 27000000,
40};
41
42/* 48MHz USB Phy clock output */
43struct clk clk_48m = {
44 .name = "clk_48m",
45 .id = -1,
46 .rate = 48000000,
47};
48
49/* APLL clock output
50 * No need .ctrlbit, this is always on
51*/
52struct clk clk_fout_apll = {
53 .name = "fout_apll",
54 .id = -1,
55};
56
57/* MPLL clock output
58 * No need .ctrlbit, this is always on
59*/
60struct clk clk_fout_mpll = {
61 .name = "fout_mpll",
62 .id = -1,
63};
64
65/* EPLL clock output */
66struct clk clk_fout_epll = {
67 .name = "fout_epll",
68 .id = -1,
69 .ctrlbit = (1 << 31),
70};
71
72/* ARM clock */
73struct clk clk_arm = {
74 .name = "armclk",
75 .id = -1,
76 .rate = 0,
77 .ctrlbit = 0,
78};
79
80/* Possible clock sources for APLL Mux */
81static struct clk *clk_src_apll_list[] = {
82 [0] = &clk_fin_apll,
83 [1] = &clk_fout_apll,
84};
85
86struct clksrc_sources clk_src_apll = {
87 .sources = clk_src_apll_list,
88 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
89};
90
91/* Possible clock sources for MPLL Mux */
92static struct clk *clk_src_mpll_list[] = {
93 [0] = &clk_fin_mpll,
94 [1] = &clk_fout_mpll,
95};
96
97struct clksrc_sources clk_src_mpll = {
98 .sources = clk_src_mpll_list,
99 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
100};
101
102/* Possible clock sources for EPLL Mux */
103static struct clk *clk_src_epll_list[] = {
104 [0] = &clk_fin_epll,
105 [1] = &clk_fout_epll,
106};
107
108struct clksrc_sources clk_src_epll = {
109 .sources = clk_src_epll_list,
110 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
111};
112
113struct clk clk_vpll = {
114 .name = "vpll",
115 .id = -1,
116};
117
118int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable)
119{
120 unsigned int ctrlbit = clk->ctrlbit;
121 u32 con;
122
123 con = __raw_readl(reg);
124 con = enable ? (con | ctrlbit) : (con & ~ctrlbit);
125 __raw_writel(con, reg);
126 return 0;
127}
128
129static struct clk *s5p_clks[] __initdata = {
130 &clk_ext_xtal_mux,
131 &clk_48m,
132 &s5p_clk_27m,
133 &clk_fout_apll,
134 &clk_fout_mpll,
135 &clk_fout_epll,
136 &clk_arm,
137 &clk_vpll,
138};
139
140void __init s5p_register_clocks(unsigned long xtal_freq)
141{
142 int ret;
143
144 clk_ext_xtal_mux.rate = xtal_freq;
145
146 ret = s3c24xx_register_clocks(s5p_clks, ARRAY_SIZE(s5p_clks));
147 if (ret > 0)
148 printk(KERN_ERR "Failed to register s5p clocks\n");
149}
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c
new file mode 100644
index 000000000000..f92e5de3a755
--- /dev/null
+++ b/arch/arm/plat-s5p/cpu.c
@@ -0,0 +1,113 @@
1/* linux/arch/arm/plat-s5p/cpu.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P CPU Support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/init.h>
14#include <linux/module.h>
15#include <mach/map.h>
16#include <asm/mach/arch.h>
17#include <asm/mach/map.h>
18#include <mach/regs-clock.h>
19#include <plat/cpu.h>
20#include <plat/s5p6440.h>
21#include <plat/s5p6442.h>
22#include <plat/s5pv210.h>
23
24/* table of supported CPUs */
25
26static const char name_s5p6440[] = "S5P6440";
27static const char name_s5p6442[] = "S5P6442";
28static const char name_s5pv210[] = "S5PV210/S5PC110";
29
30static struct cpu_table cpu_ids[] __initdata = {
31 {
32 .idcode = 0x56440100,
33 .idmask = 0xffffff00,
34 .map_io = s5p6440_map_io,
35 .init_clocks = s5p6440_init_clocks,
36 .init_uarts = s5p6440_init_uarts,
37 .init = s5p6440_init,
38 .name = name_s5p6440,
39 }, {
40 .idcode = 0x36442000,
41 .idmask = 0xffffff00,
42 .map_io = s5p6442_map_io,
43 .init_clocks = s5p6442_init_clocks,
44 .init_uarts = s5p6442_init_uarts,
45 .init = s5p6442_init,
46 .name = name_s5p6442,
47 }, {
48 .idcode = 0x43110000,
49 .idmask = 0xfffff000,
50 .map_io = s5pv210_map_io,
51 .init_clocks = s5pv210_init_clocks,
52 .init_uarts = s5pv210_init_uarts,
53 .init = s5pv210_init,
54 .name = name_s5pv210,
55 },
56};
57
58/* minimal IO mapping */
59
60static struct map_desc s5p_iodesc[] __initdata = {
61 {
62 .virtual = (unsigned long)S5P_VA_CHIPID,
63 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
64 .length = SZ_4K,
65 .type = MT_DEVICE,
66 }, {
67 .virtual = (unsigned long)S3C_VA_SYS,
68 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
69 .length = SZ_64K,
70 .type = MT_DEVICE,
71 }, {
72 .virtual = (unsigned long)S3C_VA_UART,
73 .pfn = __phys_to_pfn(S3C_PA_UART),
74 .length = SZ_4K,
75 .type = MT_DEVICE,
76 }, {
77 .virtual = (unsigned long)VA_VIC0,
78 .pfn = __phys_to_pfn(S5P_PA_VIC0),
79 .length = SZ_16K,
80 .type = MT_DEVICE,
81 }, {
82 .virtual = (unsigned long)VA_VIC1,
83 .pfn = __phys_to_pfn(S5P_PA_VIC1),
84 .length = SZ_16K,
85 .type = MT_DEVICE,
86 }, {
87 .virtual = (unsigned long)S3C_VA_TIMER,
88 .pfn = __phys_to_pfn(S5P_PA_TIMER),
89 .length = SZ_16K,
90 .type = MT_DEVICE,
91 }, {
92 .virtual = (unsigned long)S5P_VA_GPIO,
93 .pfn = __phys_to_pfn(S5P_PA_GPIO),
94 .length = SZ_4K,
95 .type = MT_DEVICE,
96 },
97};
98
99/* read cpu identification code */
100
101void __init s5p_init_io(struct map_desc *mach_desc,
102 int size, void __iomem *cpuid_addr)
103{
104 unsigned long idcode;
105
106 /* initialize the io descriptors we need for initialization */
107 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
108 if (mach_desc)
109 iotable_init(mach_desc, size);
110
111 idcode = __raw_readl(cpuid_addr);
112 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
113}
diff --git a/arch/arm/plat-s5p/dev-uart.c b/arch/arm/plat-s5p/dev-uart.c
new file mode 100644
index 000000000000..a89331ef4ae1
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-uart.c
@@ -0,0 +1,139 @@
1/* linux/arch/arm/plat-s5p/dev-uart.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Base S5P UART resource and device definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/platform_device.h>
18
19#include <asm/mach/arch.h>
20#include <asm/mach/irq.h>
21#include <mach/hardware.h>
22#include <mach/map.h>
23
24#include <plat/devs.h>
25
26 /* Serial port registrations */
27
28static struct resource s5p_uart0_resource[] = {
29 [0] = {
30 .start = S5P_PA_UART0,
31 .end = S5P_PA_UART0 + S5P_SZ_UART,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = IRQ_S5P_UART_RX0,
36 .end = IRQ_S5P_UART_RX0,
37 .flags = IORESOURCE_IRQ,
38 },
39 [2] = {
40 .start = IRQ_S5P_UART_TX0,
41 .end = IRQ_S5P_UART_TX0,
42 .flags = IORESOURCE_IRQ,
43 },
44 [3] = {
45 .start = IRQ_S5P_UART_ERR0,
46 .end = IRQ_S5P_UART_ERR0,
47 .flags = IORESOURCE_IRQ,
48 }
49};
50
51static struct resource s5p_uart1_resource[] = {
52 [0] = {
53 .start = S5P_PA_UART1,
54 .end = S5P_PA_UART1 + S5P_SZ_UART,
55 .flags = IORESOURCE_MEM,
56 },
57 [1] = {
58 .start = IRQ_S5P_UART_RX1,
59 .end = IRQ_S5P_UART_RX1,
60 .flags = IORESOURCE_IRQ,
61 },
62 [2] = {
63 .start = IRQ_S5P_UART_TX1,
64 .end = IRQ_S5P_UART_TX1,
65 .flags = IORESOURCE_IRQ,
66 },
67 [3] = {
68 .start = IRQ_S5P_UART_ERR1,
69 .end = IRQ_S5P_UART_ERR1,
70 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct resource s5p_uart2_resource[] = {
75 [0] = {
76 .start = S5P_PA_UART2,
77 .end = S5P_PA_UART2 + S5P_SZ_UART,
78 .flags = IORESOURCE_MEM,
79 },
80 [1] = {
81 .start = IRQ_S5P_UART_RX2,
82 .end = IRQ_S5P_UART_RX2,
83 .flags = IORESOURCE_IRQ,
84 },
85 [2] = {
86 .start = IRQ_S5P_UART_TX2,
87 .end = IRQ_S5P_UART_TX2,
88 .flags = IORESOURCE_IRQ,
89 },
90 [3] = {
91 .start = IRQ_S5P_UART_ERR2,
92 .end = IRQ_S5P_UART_ERR2,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
97static struct resource s5p_uart3_resource[] = {
98#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
99 [0] = {
100 .start = S5P_PA_UART3,
101 .end = S5P_PA_UART3 + S5P_SZ_UART,
102 .flags = IORESOURCE_MEM,
103 },
104 [1] = {
105 .start = IRQ_S5P_UART_RX3,
106 .end = IRQ_S5P_UART_RX3,
107 .flags = IORESOURCE_IRQ,
108 },
109 [2] = {
110 .start = IRQ_S5P_UART_TX3,
111 .end = IRQ_S5P_UART_TX3,
112 .flags = IORESOURCE_IRQ,
113 },
114 [3] = {
115 .start = IRQ_S5P_UART_ERR3,
116 .end = IRQ_S5P_UART_ERR3,
117 .flags = IORESOURCE_IRQ,
118 },
119#endif
120};
121
122struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
123 [0] = {
124 .resources = s5p_uart0_resource,
125 .nr_resources = ARRAY_SIZE(s5p_uart0_resource),
126 },
127 [1] = {
128 .resources = s5p_uart1_resource,
129 .nr_resources = ARRAY_SIZE(s5p_uart1_resource),
130 },
131 [2] = {
132 .resources = s5p_uart2_resource,
133 .nr_resources = ARRAY_SIZE(s5p_uart2_resource),
134 },
135 [3] = {
136 .resources = s5p_uart3_resource,
137 .nr_resources = ARRAY_SIZE(s5p_uart3_resource),
138 },
139};
diff --git a/arch/arm/plat-s5p/include/plat/irqs.h b/arch/arm/plat-s5p/include/plat/irqs.h
new file mode 100644
index 000000000000..42e757f2e40c
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/irqs.h
@@ -0,0 +1,90 @@
1/* linux/arch/arm/plat-s5p/include/plat/irqs.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P Common IRQ support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_S5P_IRQS_H
14#define __ASM_PLAT_S5P_IRQS_H __FILE__
15
16/* we keep the first set of CPU IRQs out of the range of
17 * the ISA space, so that the PC104 has them to itself
18 * and we don't end up having to do horrible things to the
19 * standard ISA drivers....
20 *
21 * note, since we're using the VICs, our start must be a
22 * mulitple of 32 to allow the common code to work
23 */
24
25#define S5P_IRQ_OFFSET (32)
26
27#define S5P_IRQ(x) ((x) + S5P_IRQ_OFFSET)
28
29#define S5P_VIC0_BASE S5P_IRQ(0)
30#define S5P_VIC1_BASE S5P_IRQ(32)
31#define S5P_VIC2_BASE S5P_IRQ(64)
32#define S5P_VIC3_BASE S5P_IRQ(96)
33
34#define VIC_BASE(x) (S5P_VIC0_BASE + ((x)*32))
35
36#define IRQ_VIC0_BASE S5P_VIC0_BASE
37#define IRQ_VIC1_BASE S5P_VIC1_BASE
38#define IRQ_VIC2_BASE S5P_VIC2_BASE
39
40/* UART interrupts, each UART has 4 intterupts per channel so
41 * use the space between the ISA and S3C main interrupts. Note, these
42 * are not in the same order as the S3C24XX series! */
43
44#define IRQ_S5P_UART_BASE0 (16)
45#define IRQ_S5P_UART_BASE1 (20)
46#define IRQ_S5P_UART_BASE2 (24)
47#define IRQ_S5P_UART_BASE3 (28)
48
49#define UART_IRQ_RXD (0)
50#define UART_IRQ_ERR (1)
51#define UART_IRQ_TXD (2)
52
53#define IRQ_S5P_UART_RX0 (IRQ_S5P_UART_BASE0 + UART_IRQ_RXD)
54#define IRQ_S5P_UART_TX0 (IRQ_S5P_UART_BASE0 + UART_IRQ_TXD)
55#define IRQ_S5P_UART_ERR0 (IRQ_S5P_UART_BASE0 + UART_IRQ_ERR)
56
57#define IRQ_S5P_UART_RX1 (IRQ_S5P_UART_BASE1 + UART_IRQ_RXD)
58#define IRQ_S5P_UART_TX1 (IRQ_S5P_UART_BASE1 + UART_IRQ_TXD)
59#define IRQ_S5P_UART_ERR1 (IRQ_S5P_UART_BASE1 + UART_IRQ_ERR)
60
61#define IRQ_S5P_UART_RX2 (IRQ_S5P_UART_BASE2 + UART_IRQ_RXD)
62#define IRQ_S5P_UART_TX2 (IRQ_S5P_UART_BASE2 + UART_IRQ_TXD)
63#define IRQ_S5P_UART_ERR2 (IRQ_S5P_UART_BASE2 + UART_IRQ_ERR)
64
65#define IRQ_S5P_UART_RX3 (IRQ_S5P_UART_BASE3 + UART_IRQ_RXD)
66#define IRQ_S5P_UART_TX3 (IRQ_S5P_UART_BASE3 + UART_IRQ_TXD)
67#define IRQ_S5P_UART_ERR3 (IRQ_S5P_UART_BASE3 + UART_IRQ_ERR)
68
69/* S3C compatibilty defines */
70#define IRQ_S3CUART_RX0 IRQ_S5P_UART_RX0
71#define IRQ_S3CUART_RX1 IRQ_S5P_UART_RX1
72#define IRQ_S3CUART_RX2 IRQ_S5P_UART_RX2
73#define IRQ_S3CUART_RX3 IRQ_S5P_UART_RX3
74
75/* VIC based IRQs */
76
77#define S5P_IRQ_VIC0(x) (S5P_VIC0_BASE + (x))
78#define S5P_IRQ_VIC1(x) (S5P_VIC1_BASE + (x))
79#define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x))
80#define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x))
81
82#define S5P_TIMER_IRQ(x) S5P_IRQ(11 + (x))
83
84#define IRQ_TIMER0 S5P_TIMER_IRQ(0)
85#define IRQ_TIMER1 S5P_TIMER_IRQ(1)
86#define IRQ_TIMER2 S5P_TIMER_IRQ(2)
87#define IRQ_TIMER3 S5P_TIMER_IRQ(3)
88#define IRQ_TIMER4 S5P_TIMER_IRQ(4)
89
90#endif /* __ASM_PLAT_S5P_IRQS_H */
diff --git a/arch/arm/plat-s5p/include/plat/map-s5p.h b/arch/arm/plat-s5p/include/plat/map-s5p.h
new file mode 100644
index 000000000000..14828521f70c
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/map-s5p.h
@@ -0,0 +1,34 @@
1/* linux/arch/arm/plat-s5p/include/plat/map-s5p.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P - Memory map definitions
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_MAP_S5P_H
14#define __ASM_PLAT_MAP_S5P_H __FILE__
15
16#define S5P_VA_CHIPID S3C_ADDR(0x00700000)
17#define S5P_VA_GPIO S3C_ADDR(0x00500000)
18#define S5P_VA_SYSTIMER S3C_ADDR(0x01200000)
19#define S5P_VA_SROMC S3C_ADDR(0x01100000)
20
21#define S5P_VA_UART0 (S3C_VA_UART + 0x0)
22#define S5P_VA_UART1 (S3C_VA_UART + 0x400)
23#define S5P_VA_UART2 (S3C_VA_UART + 0x800)
24#define S5P_VA_UART3 (S3C_VA_UART + 0xC00)
25
26#define S3C_UART_OFFSET (0x400)
27
28#define VA_VIC(x) (S3C_VA_IRQ + ((x) * 0x10000))
29#define VA_VIC0 VA_VIC(0)
30#define VA_VIC1 VA_VIC(1)
31#define VA_VIC2 VA_VIC(2)
32#define VA_VIC3 VA_VIC(3)
33
34#endif /* __ASM_PLAT_MAP_S5P_H */
diff --git a/arch/arm/plat-s5p/include/plat/pll.h b/arch/arm/plat-s5p/include/plat/pll.h
new file mode 100644
index 000000000000..d48325bb29e2
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/pll.h
@@ -0,0 +1,83 @@
1/* arch/arm/plat-s5p/include/plat/pll.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P PLL code
7 *
8 * Based on arch/arm/plat-s3c64xx/include/plat/pll.h
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#define PLL45XX_MDIV_MASK (0x3FF)
16#define PLL45XX_PDIV_MASK (0x3F)
17#define PLL45XX_SDIV_MASK (0x7)
18#define PLL45XX_MDIV_SHIFT (16)
19#define PLL45XX_PDIV_SHIFT (8)
20#define PLL45XX_SDIV_SHIFT (0)
21
22#include <asm/div64.h>
23
24enum pll45xx_type_t {
25 pll_4500,
26 pll_4502,
27 pll_4508
28};
29
30static inline unsigned long s5p_get_pll45xx(unsigned long baseclk, u32 pll_con,
31 enum pll45xx_type_t pll_type)
32{
33 u32 mdiv, pdiv, sdiv;
34 u64 fvco = baseclk;
35
36 mdiv = (pll_con >> PLL45XX_MDIV_SHIFT) & PLL45XX_MDIV_MASK;
37 pdiv = (pll_con >> PLL45XX_PDIV_SHIFT) & PLL45XX_PDIV_MASK;
38 sdiv = (pll_con >> PLL45XX_SDIV_SHIFT) & PLL45XX_SDIV_MASK;
39
40 if (pll_type == pll_4508)
41 sdiv = sdiv - 1;
42
43 fvco *= mdiv;
44 do_div(fvco, (pdiv << sdiv));
45
46 return (unsigned long)fvco;
47}
48
49#define PLL90XX_MDIV_MASK (0xFF)
50#define PLL90XX_PDIV_MASK (0x3F)
51#define PLL90XX_SDIV_MASK (0x7)
52#define PLL90XX_KDIV_MASK (0xffff)
53#define PLL90XX_MDIV_SHIFT (16)
54#define PLL90XX_PDIV_SHIFT (8)
55#define PLL90XX_SDIV_SHIFT (0)
56#define PLL90XX_KDIV_SHIFT (0)
57
58static inline unsigned long s5p_get_pll90xx(unsigned long baseclk,
59 u32 pll_con, u32 pll_conk)
60{
61 unsigned long result;
62 u32 mdiv, pdiv, sdiv, kdiv;
63 u64 tmp;
64
65 mdiv = (pll_con >> PLL90XX_MDIV_SHIFT) & PLL90XX_MDIV_MASK;
66 pdiv = (pll_con >> PLL90XX_PDIV_SHIFT) & PLL90XX_PDIV_MASK;
67 sdiv = (pll_con >> PLL90XX_SDIV_SHIFT) & PLL90XX_SDIV_MASK;
68 kdiv = pll_conk & PLL90XX_KDIV_MASK;
69
70 /* We need to multiple baseclk by mdiv (the integer part) and kdiv
71 * which is in 2^16ths, so shift mdiv up (does not overflow) and
72 * add kdiv before multiplying. The use of tmp is to avoid any
73 * overflows before shifting bac down into result when multipling
74 * by the mdiv and kdiv pair.
75 */
76
77 tmp = baseclk;
78 tmp *= (mdiv << 16) + kdiv;
79 do_div(tmp, (pdiv << sdiv));
80 result = tmp >> 16;
81
82 return result;
83}
diff --git a/arch/arm/plat-s5p/include/plat/s5p-clock.h b/arch/arm/plat-s5p/include/plat/s5p-clock.h
new file mode 100644
index 000000000000..56fb8b414d41
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5p-clock.h
@@ -0,0 +1,40 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5p-clock.h
2 *
3 * Copyright 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p clock support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_PLAT_S5P_CLOCK_H
14#define __ASM_PLAT_S5P_CLOCK_H __FILE__
15
16#include <linux/clk.h>
17
18#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
19
20#define clk_fin_apll clk_ext_xtal_mux
21#define clk_fin_mpll clk_ext_xtal_mux
22#define clk_fin_epll clk_ext_xtal_mux
23#define clk_fin_vpll clk_ext_xtal_mux
24
25extern struct clk clk_ext_xtal_mux;
26extern struct clk clk_48m;
27extern struct clk clk_fout_apll;
28extern struct clk clk_fout_mpll;
29extern struct clk clk_fout_epll;
30extern struct clk clk_arm;
31extern struct clk clk_vpll;
32
33extern struct clksrc_sources clk_src_apll;
34extern struct clksrc_sources clk_src_mpll;
35extern struct clksrc_sources clk_src_epll;
36
37extern int s5p6440_clk48m_ctrl(struct clk *clk, int enable);
38extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable);
39
40#endif /* __ASM_PLAT_S5P_CLOCK_H */
diff --git a/arch/arm/plat-s5p/include/plat/s5p6440.h b/arch/arm/plat-s5p/include/plat/s5p6440.h
new file mode 100644
index 000000000000..a4cd75afeb3b
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5p6440.h
@@ -0,0 +1,37 @@
1/* arch/arm/plat-s5p/include/plat/s5p6440.h
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p6440 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13 /* Common init code for S5P6440 related SoCs */
14
15extern void s5p6440_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5p6440_register_clocks(void);
17extern void s5p6440_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5P6440
20
21extern int s5p6440_init(void);
22extern void s5p6440_init_irq(void);
23extern void s5p6440_map_io(void);
24extern void s5p6440_init_clocks(int xtal);
25
26#define s5p6440_init_uarts s5p6440_common_init_uarts
27
28#else
29#define s5p6440_init_clocks NULL
30#define s5p6440_init_uarts NULL
31#define s5p6440_map_io NULL
32#define s5p6440_init NULL
33#endif
34
35/* S5P6440 timer */
36
37extern struct sys_timer s5p6440_timer;
diff --git a/arch/arm/plat-s5p/include/plat/s5p6442.h b/arch/arm/plat-s5p/include/plat/s5p6442.h
new file mode 100644
index 000000000000..7b8801349c94
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5p6442.h
@@ -0,0 +1,33 @@
1/* arch/arm/plat-s5p/include/plat/s5p6442.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5p6442 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5P6442 related SoCs */
14
15extern void s5p6442_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5p6442_register_clocks(void);
17extern void s5p6442_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5P6442
20
21extern int s5p6442_init(void);
22extern void s5p6442_init_irq(void);
23extern void s5p6442_map_io(void);
24extern void s5p6442_init_clocks(int xtal);
25
26#define s5p6442_init_uarts s5p6442_common_init_uarts
27
28#else
29#define s5p6442_init_clocks NULL
30#define s5p6442_init_uarts NULL
31#define s5p6442_map_io NULL
32#define s5p6442_init NULL
33#endif
diff --git a/arch/arm/plat-s5p/include/plat/s5pv210.h b/arch/arm/plat-s5p/include/plat/s5pv210.h
new file mode 100644
index 000000000000..6c93a0c78100
--- /dev/null
+++ b/arch/arm/plat-s5p/include/plat/s5pv210.h
@@ -0,0 +1,33 @@
1/* linux/arch/arm/plat-s5p/include/plat/s5pv210.h
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Header file for s5pv210 cpu support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13/* Common init code for S5PV210 related SoCs */
14
15extern void s5pv210_common_init_uarts(struct s3c2410_uartcfg *cfg, int no);
16extern void s5pv210_register_clocks(void);
17extern void s5pv210_setup_clocks(void);
18
19#ifdef CONFIG_CPU_S5PV210
20
21extern int s5pv210_init(void);
22extern void s5pv210_init_irq(void);
23extern void s5pv210_map_io(void);
24extern void s5pv210_init_clocks(int xtal);
25
26#define s5pv210_init_uarts s5pv210_common_init_uarts
27
28#else
29#define s5pv210_init_clocks NULL
30#define s5pv210_init_uarts NULL
31#define s5pv210_map_io NULL
32#define s5pv210_init NULL
33#endif
diff --git a/arch/arm/plat-s5p/irq.c b/arch/arm/plat-s5p/irq.c
new file mode 100644
index 000000000000..25e1eb6de59e
--- /dev/null
+++ b/arch/arm/plat-s5p/irq.c
@@ -0,0 +1,72 @@
1/* arch/arm/plat-s5p/irq.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * S5P - Interrupt handling
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#include <linux/kernel.h>
14#include <linux/interrupt.h>
15#include <linux/irq.h>
16#include <linux/io.h>
17
18#include <asm/hardware/vic.h>
19
20#include <linux/serial_core.h>
21#include <mach/map.h>
22#include <plat/regs-timer.h>
23#include <plat/regs-serial.h>
24#include <plat/cpu.h>
25#include <plat/irq-vic-timer.h>
26#include <plat/irq-uart.h>
27
28/*
29 * Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
30 * are consecutive when looking up the interrupt in the demux routines.
31 */
32static struct s3c_uart_irq uart_irqs[] = {
33 [0] = {
34 .regs = S5P_VA_UART0,
35 .base_irq = IRQ_S5P_UART_BASE0,
36 .parent_irq = IRQ_UART0,
37 },
38 [1] = {
39 .regs = S5P_VA_UART1,
40 .base_irq = IRQ_S5P_UART_BASE1,
41 .parent_irq = IRQ_UART1,
42 },
43 [2] = {
44 .regs = S5P_VA_UART2,
45 .base_irq = IRQ_S5P_UART_BASE2,
46 .parent_irq = IRQ_UART2,
47 },
48#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
49 [3] = {
50 .regs = S5P_VA_UART3,
51 .base_irq = IRQ_S5P_UART_BASE3,
52 .parent_irq = IRQ_UART3,
53 },
54#endif
55};
56
57void __init s5p_init_irq(u32 *vic, u32 num_vic)
58{
59 int irq;
60
61 /* initialize the VICs */
62 for (irq = 0; irq < num_vic; irq++)
63 vic_init(VA_VIC(irq), VIC_BASE(irq), vic[irq], 0);
64
65 s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
66 s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
67 s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
68 s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
69 s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
70
71 s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
72}
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/plat-s5p/setup-i2c0.c
new file mode 100644
index 000000000000..67a66e02a97a
--- /dev/null
+++ b/arch/arm/plat-s5p/setup-i2c0.c
@@ -0,0 +1,25 @@
1/* linux/arch/arm/plat-s5p/setup-i2c0.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * I2C0 GPIO configuration.
7 *
8 * Based on plat-s3c64xx/setup-i2c0.c
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/kernel.h>
16#include <linux/types.h>
17
18struct platform_device; /* don't need the contents */
19
20#include <plat/iic.h>
21
22void s3c_i2c0_cfg_gpio(struct platform_device *dev)
23{
24 /* Will be populated later */
25}
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index b7b9e91c0243..c7ccdf22eefa 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -11,6 +11,9 @@ config PLAT_S5PC1XX
11 select ARM_VIC 11 select ARM_VIC
12 select NO_IOPORT 12 select NO_IOPORT
13 select ARCH_REQUIRE_GPIOLIB 13 select ARCH_REQUIRE_GPIOLIB
14 select SAMSUNG_CLKSRC
15 select SAMSUNG_IRQ_UART
16 select SAMSUNG_IRQ_VIC_TIMER
14 select S3C_GPIO_TRACK 17 select S3C_GPIO_TRACK
15 select S3C_GPIO_PULL_UPDOWN 18 select S3C_GPIO_PULL_UPDOWN
16 select S3C_GPIO_CFG_S3C24XX 19 select S3C_GPIO_CFG_S3C24XX
diff --git a/arch/arm/plat-s5pc1xx/clock.c b/arch/arm/plat-s5pc1xx/clock.c
index 26c21d849790..387f23190c3c 100644
--- a/arch/arm/plat-s5pc1xx/clock.c
+++ b/arch/arm/plat-s5pc1xx/clock.c
@@ -64,25 +64,13 @@ struct clk clk_54m = {
64 .rate = 54000000, 64 .rate = 54000000,
65}; 65};
66 66
67static int clk_default_setrate(struct clk *clk, unsigned long rate)
68{
69 clk->rate = rate;
70 return 0;
71}
72
73static int clk_dummy_enable(struct clk *clk, int enable)
74{
75 return 0;
76}
77
78struct clk clk_hd0 = { 67struct clk clk_hd0 = {
79 .name = "hclkd0", 68 .name = "hclkd0",
80 .id = -1, 69 .id = -1,
81 .rate = 0, 70 .rate = 0,
82 .parent = NULL, 71 .parent = NULL,
83 .ctrlbit = 0, 72 .ctrlbit = 0,
84 .set_rate = clk_default_setrate, 73 .ops = &clk_ops_def_setrate,
85 .enable = clk_dummy_enable,
86}; 74};
87 75
88struct clk clk_pd0 = { 76struct clk clk_pd0 = {
@@ -91,8 +79,7 @@ struct clk clk_pd0 = {
91 .rate = 0, 79 .rate = 0,
92 .parent = NULL, 80 .parent = NULL,
93 .ctrlbit = 0, 81 .ctrlbit = 0,
94 .set_rate = clk_default_setrate, 82 .ops = &clk_ops_def_setrate,
95 .enable = clk_dummy_enable,
96}; 83};
97 84
98static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable) 85static int s5pc1xx_clk_gate(void __iomem *reg, struct clk *clk, int enable)
@@ -686,6 +673,8 @@ static struct clk s5pc100_init_clocks[] = {
686static struct clk *clks[] __initdata = { 673static struct clk *clks[] __initdata = {
687 &clk_ext, 674 &clk_ext,
688 &clk_epll, 675 &clk_epll,
676 &clk_pd0,
677 &clk_hd0,
689 &clk_27m, 678 &clk_27m,
690 &clk_48m, 679 &clk_48m,
691 &clk_54m, 680 &clk_54m,
@@ -700,16 +689,8 @@ void __init s5pc1xx_register_clocks(void)
700 689
701 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 690 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
702 691
703 clkp = s5pc100_init_clocks; 692 s3c_register_clocks(s5pc100_init_clocks,
704 size = ARRAY_SIZE(s5pc100_init_clocks); 693 ARRAY_SIZE(s5pc100_init_clocks));
705
706 for (ptr = 0; ptr < size; ptr++, clkp++) {
707 ret = s3c24xx_register_clock(clkp);
708 if (ret < 0) {
709 printk(KERN_ERR "Failed to register clock %s (%d)\n",
710 clkp->name, ret);
711 }
712 }
713 694
714 clkp = s5pc100_init_clocks_disable; 695 clkp = s5pc100_init_clocks_disable;
715 size = ARRAY_SIZE(s5pc100_init_clocks_disable); 696 size = ARRAY_SIZE(s5pc100_init_clocks_disable);
diff --git a/arch/arm/plat-s5pc1xx/dev-uart.c b/arch/arm/plat-s5pc1xx/dev-uart.c
index f749bc5407b5..586c95c60bfe 100644
--- a/arch/arm/plat-s5pc1xx/dev-uart.c
+++ b/arch/arm/plat-s5pc1xx/dev-uart.c
@@ -143,32 +143,3 @@ struct s3c24xx_uart_resources s5pc1xx_uart_resources[] __initdata = {
143 .nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource), 143 .nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource),
144 }, 144 },
145}; 145};
146
147/* uart devices */
148
149static struct platform_device s3c24xx_uart_device0 = {
150 .id = 0,
151};
152
153static struct platform_device s3c24xx_uart_device1 = {
154 .id = 1,
155};
156
157static struct platform_device s3c24xx_uart_device2 = {
158 .id = 2,
159};
160
161static struct platform_device s3c24xx_uart_device3 = {
162 .id = 3,
163};
164
165struct platform_device *s3c24xx_uart_src[4] = {
166 &s3c24xx_uart_device0,
167 &s3c24xx_uart_device1,
168 &s3c24xx_uart_device2,
169 &s3c24xx_uart_device3,
170};
171
172struct platform_device *s3c24xx_uart_devs[4] = {
173};
174
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c b/arch/arm/plat-s5pc1xx/gpio-config.c
index bba675df9c75..a4f67e80a150 100644
--- a/arch/arm/plat-s5pc1xx/gpio-config.c
+++ b/arch/arm/plat-s5pc1xx/gpio-config.c
@@ -16,7 +16,7 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/io.h> 17#include <linux/io.h>
18 18
19#include <mach/gpio-core.h> 19#include <plat/gpio-core.h>
20#include <plat/gpio-cfg-s5pc1xx.h> 20#include <plat/gpio-cfg-s5pc1xx.h>
21 21
22s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off) 22s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off)
diff --git a/arch/arm/plat-s5pc1xx/gpiolib.c b/arch/arm/plat-s5pc1xx/gpiolib.c
index facb410e7a71..1ffc57ac293d 100644
--- a/arch/arm/plat-s5pc1xx/gpiolib.c
+++ b/arch/arm/plat-s5pc1xx/gpiolib.c
@@ -17,8 +17,8 @@
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18 18
19#include <mach/map.h> 19#include <mach/map.h>
20#include <mach/gpio-core.h>
21 20
21#include <plat/gpio-core.h>
22#include <plat/gpio-cfg.h> 22#include <plat/gpio-cfg.h>
23#include <plat/gpio-cfg-helpers.h> 23#include <plat/gpio-cfg-helpers.h>
24#include <plat/regs-gpio.h> 24#include <plat/regs-gpio.h>
diff --git a/arch/arm/plat-s5pc1xx/include/plat/irqs.h b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
index ef8736366f0d..409c804315e8 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/irqs.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/irqs.h
@@ -88,11 +88,11 @@
88#define IRQ_MDMA S5PC1XX_IRQ_VIC0(18) 88#define IRQ_MDMA S5PC1XX_IRQ_VIC0(18)
89#define IRQ_PDMA0 S5PC1XX_IRQ_VIC0(19) 89#define IRQ_PDMA0 S5PC1XX_IRQ_VIC0(19)
90#define IRQ_PDMA1 S5PC1XX_IRQ_VIC0(20) 90#define IRQ_PDMA1 S5PC1XX_IRQ_VIC0(20)
91#define IRQ_TIMER0 S5PC1XX_IRQ_VIC0(21) 91#define IRQ_TIMER0_VIC S5PC1XX_IRQ_VIC0(21)
92#define IRQ_TIMER1 S5PC1XX_IRQ_VIC0(22) 92#define IRQ_TIMER1_VIC S5PC1XX_IRQ_VIC0(22)
93#define IRQ_TIMER2 S5PC1XX_IRQ_VIC0(23) 93#define IRQ_TIMER2_VIC S5PC1XX_IRQ_VIC0(23)
94#define IRQ_TIMER3 S5PC1XX_IRQ_VIC0(24) 94#define IRQ_TIMER3_VIC S5PC1XX_IRQ_VIC0(24)
95#define IRQ_TIMER4 S5PC1XX_IRQ_VIC0(25) 95#define IRQ_TIMER4_VIC S5PC1XX_IRQ_VIC0(25)
96#define IRQ_SYSTIMER S5PC1XX_IRQ_VIC0(26) 96#define IRQ_SYSTIMER S5PC1XX_IRQ_VIC0(26)
97#define IRQ_WDT S5PC1XX_IRQ_VIC0(27) 97#define IRQ_WDT S5PC1XX_IRQ_VIC0(27)
98#define IRQ_RTC_ALARM S5PC1XX_IRQ_VIC0(28) 98#define IRQ_RTC_ALARM S5PC1XX_IRQ_VIC0(28)
@@ -171,8 +171,15 @@
171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30) 171#define IRQ_SDMIRQ S5PC1XX_IRQ_VIC2(30)
172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31) 172#define IRQ_SDMFIQ S5PC1XX_IRQ_VIC2(31)
173 173
174#define IRQ_TIMER(x) (IRQ_SDMFIQ + 1 + (x))
175#define IRQ_TIMER0 IRQ_TIMER(0)
176#define IRQ_TIMER1 IRQ_TIMER(1)
177#define IRQ_TIMER2 IRQ_TIMER(2)
178#define IRQ_TIMER3 IRQ_TIMER(3)
179#define IRQ_TIMER4 IRQ_TIMER(4)
180
174/* External interrupt */ 181/* External interrupt */
175#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 1) 182#define S3C_IRQ_EINT_BASE (IRQ_SDMFIQ + 6)
176 183
177#define S3C_EINT(x) (S3C_IRQ_EINT_BASE + (x - 16)) 184#define S3C_EINT(x) (S3C_IRQ_EINT_BASE + (x - 16))
178#define IRQ_EINT(x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x)) 185#define IRQ_EINT(x) (x < 16 ? IRQ_EINT0 + x : S3C_EINT(x))
diff --git a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
index c5cc86e92d65..24dec4e52538 100644
--- a/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
+++ b/arch/arm/plat-s5pc1xx/include/plat/regs-clock.h
@@ -61,73 +61,10 @@
61#define S5PC100_EPLL_MASK 0xffffffff 61#define S5PC100_EPLL_MASK 0xffffffff
62#define S5PC100_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s))) 62#define S5PC100_EPLLVAL(_m, _p, _s) ((_m) << 16 | ((_p) << 8) | ((_s)))
63 63
64/* CLKSRC0 */ 64/* CLKSRC0..CLKSRC3 -> mostly removed due to clksrc updates */
65#define S5PC100_CLKSRC0_APLL_MASK (0x1<<0) 65#define S5PC100_CLKSRC1_CLK48M_MASK (0x1<<24)
66#define S5PC100_CLKSRC0_APLL_SHIFT (0)
67#define S5PC100_CLKSRC0_MPLL_MASK (0x1<<4)
68#define S5PC100_CLKSRC0_MPLL_SHIFT (4)
69#define S5PC100_CLKSRC0_EPLL_MASK (0x1<<8)
70#define S5PC100_CLKSRC0_EPLL_SHIFT (8)
71#define S5PC100_CLKSRC0_HPLL_MASK (0x1<<12)
72#define S5PC100_CLKSRC0_HPLL_SHIFT (12)
73#define S5PC100_CLKSRC0_AMMUX_MASK (0x1<<16)
74#define S5PC100_CLKSRC0_AMMUX_SHIFT (16)
75#define S5PC100_CLKSRC0_HREF_MASK (0x1<<20)
76#define S5PC100_CLKSRC0_HREF_SHIFT (20)
77#define S5PC100_CLKSRC0_ONENAND_MASK (0x1<<24)
78#define S5PC100_CLKSRC0_ONENAND_SHIFT (24)
79
80
81/* CLKSRC1 */
82#define S5PC100_CLKSRC1_UART_MASK (0x1<<0)
83#define S5PC100_CLKSRC1_UART_SHIFT (0)
84#define S5PC100_CLKSRC1_SPI0_MASK (0x3<<4)
85#define S5PC100_CLKSRC1_SPI0_SHIFT (4)
86#define S5PC100_CLKSRC1_SPI1_MASK (0x3<<8)
87#define S5PC100_CLKSRC1_SPI1_SHIFT (8)
88#define S5PC100_CLKSRC1_SPI2_MASK (0x3<<12)
89#define S5PC100_CLKSRC1_SPI2_SHIFT (12)
90#define S5PC100_CLKSRC1_IRDA_MASK (0x3<<16)
91#define S5PC100_CLKSRC1_IRDA_SHIFT (16)
92#define S5PC100_CLKSRC1_UHOST_MASK (0x3<<20)
93#define S5PC100_CLKSRC1_UHOST_SHIFT (20)
94#define S5PC100_CLKSRC1_CLK48M_MASK (0x1<<24)
95#define S5PC100_CLKSRC1_CLK48M_SHIFT (24) 66#define S5PC100_CLKSRC1_CLK48M_SHIFT (24)
96 67
97/* CLKSRC2 */
98#define S5PC100_CLKSRC2_MMC0_MASK (0x3<<0)
99#define S5PC100_CLKSRC2_MMC0_SHIFT (0)
100#define S5PC100_CLKSRC2_MMC1_MASK (0x3<<4)
101#define S5PC100_CLKSRC2_MMC1_SHIFT (4)
102#define S5PC100_CLKSRC2_MMC2_MASK (0x3<<8)
103#define S5PC100_CLKSRC2_MMC2_SHIFT (8)
104#define S5PC100_CLKSRC2_LCD_MASK (0x3<<12)
105#define S5PC100_CLKSRC2_LCD_SHIFT (12)
106#define S5PC100_CLKSRC2_FIMC0_MASK (0x3<<16)
107#define S5PC100_CLKSRC2_FIMC0_SHIFT (16)
108#define S5PC100_CLKSRC2_FIMC1_MASK (0x3<<20)
109#define S5PC100_CLKSRC2_FIMC1_SHIFT (20)
110#define S5PC100_CLKSRC2_FIMC2_MASK (0x3<<24)
111#define S5PC100_CLKSRC2_FIMC2_SHIFT (24)
112#define S5PC100_CLKSRC2_MIXER_MASK (0x3<<28)
113#define S5PC100_CLKSRC2_MIXER_SHIFT (28)
114
115/* CLKSRC3 */
116#define S5PC100_CLKSRC3_PWI_MASK (0x3<<0)
117#define S5PC100_CLKSRC3_PWI_SHIFT (0)
118#define S5PC100_CLKSRC3_HCLKD2_MASK (0x1<<4)
119#define S5PC100_CLKSRC3_HCLKD2_SHIFT (4)
120#define S5PC100_CLKSRC3_I2SD2_MASK (0x3<<8)
121#define S5PC100_CLKSRC3_I2SD2_SHIFT (8)
122#define S5PC100_CLKSRC3_AUDIO0_MASK (0x7<<12)
123#define S5PC100_CLKSRC3_AUDIO0_SHIFT (12)
124#define S5PC100_CLKSRC3_AUDIO1_MASK (0x7<<16)
125#define S5PC100_CLKSRC3_AUDIO1_SHIFT (16)
126#define S5PC100_CLKSRC3_AUDIO2_MASK (0x7<<20)
127#define S5PC100_CLKSRC3_AUDIO2_SHIFT (20)
128#define S5PC100_CLKSRC3_SPDIF_MASK (0x3<<24)
129#define S5PC100_CLKSRC3_SPDIF_SHIFT (24)
130
131/* CLKDIV0 */ 68/* CLKDIV0 */
132#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0) 69#define S5PC100_CLKDIV0_APLL_MASK (0x1<<0)
133#define S5PC100_CLKDIV0_APLL_SHIFT (0) 70#define S5PC100_CLKDIV0_APLL_SHIFT (0)
@@ -140,7 +77,7 @@
140#define S5PC100_CLKDIV0_SECSS_MASK (0x7<<16) 77#define S5PC100_CLKDIV0_SECSS_MASK (0x7<<16)
141#define S5PC100_CLKDIV0_SECSS_SHIFT (16) 78#define S5PC100_CLKDIV0_SECSS_SHIFT (16)
142 79
143/* CLKDIV1 */ 80/* CLKDIV1 (OneNAND clock only used in one place, removed) */
144#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0) 81#define S5PC100_CLKDIV1_APLL2_MASK (0x7<<0)
145#define S5PC100_CLKDIV1_APLL2_SHIFT (0) 82#define S5PC100_CLKDIV1_APLL2_SHIFT (0)
146#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4) 83#define S5PC100_CLKDIV1_MPLL_MASK (0x3<<4)
@@ -151,56 +88,12 @@
151#define S5PC100_CLKDIV1_D1_SHIFT (12) 88#define S5PC100_CLKDIV1_D1_SHIFT (12)
152#define S5PC100_CLKDIV1_PCLKD1_MASK (0x7<<16) 89#define S5PC100_CLKDIV1_PCLKD1_MASK (0x7<<16)
153#define S5PC100_CLKDIV1_PCLKD1_SHIFT (16) 90#define S5PC100_CLKDIV1_PCLKD1_SHIFT (16)
154#define S5PC100_CLKDIV1_ONENAND_MASK (0x3<<20)
155#define S5PC100_CLKDIV1_ONENAND_SHIFT (20)
156#define S5PC100_CLKDIV1_CAM_MASK (0x1F<<24) 91#define S5PC100_CLKDIV1_CAM_MASK (0x1F<<24)
157#define S5PC100_CLKDIV1_CAM_SHIFT (24) 92#define S5PC100_CLKDIV1_CAM_SHIFT (24)
158 93
159/* CLKDIV2 */ 94/* CLKDIV2 => removed in clksrc update */
160#define S5PC100_CLKDIV2_UART_MASK (0x7<<0) 95/* CLKDIV3 => removed in clksrc update, or not needed */
161#define S5PC100_CLKDIV2_UART_SHIFT (0) 96/* CLKDIV4 => removed in clksrc update, or not needed */
162#define S5PC100_CLKDIV2_SPI0_MASK (0xf<<4)
163#define S5PC100_CLKDIV2_SPI0_SHIFT (4)
164#define S5PC100_CLKDIV2_SPI1_MASK (0xf<<8)
165#define S5PC100_CLKDIV2_SPI1_SHIFT (8)
166#define S5PC100_CLKDIV2_SPI2_MASK (0xf<<12)
167#define S5PC100_CLKDIV2_SPI2_SHIFT (12)
168#define S5PC100_CLKDIV2_IRDA_MASK (0xf<<16)
169#define S5PC100_CLKDIV2_IRDA_SHIFT (16)
170#define S5PC100_CLKDIV2_UHOST_MASK (0xf<<20)
171#define S5PC100_CLKDIV2_UHOST_SHIFT (20)
172
173/* CLKDIV3 */
174#define S5PC100_CLKDIV3_MMC0_MASK (0xf<<0)
175#define S5PC100_CLKDIV3_MMC0_SHIFT (0)
176#define S5PC100_CLKDIV3_MMC1_MASK (0xf<<4)
177#define S5PC100_CLKDIV3_MMC1_SHIFT (4)
178#define S5PC100_CLKDIV3_MMC2_MASK (0xf<<8)
179#define S5PC100_CLKDIV3_MMC2_SHIFT (8)
180#define S5PC100_CLKDIV3_LCD_MASK (0xf<<12)
181#define S5PC100_CLKDIV3_LCD_SHIFT (12)
182#define S5PC100_CLKDIV3_FIMC0_MASK (0xf<<16)
183#define S5PC100_CLKDIV3_FIMC0_SHIFT (16)
184#define S5PC100_CLKDIV3_FIMC1_MASK (0xf<<20)
185#define S5PC100_CLKDIV3_FIMC1_SHIFT (20)
186#define S5PC100_CLKDIV3_FIMC2_MASK (0xf<<24)
187#define S5PC100_CLKDIV3_FIMC2_SHIFT (24)
188#define S5PC100_CLKDIV3_HDMI_MASK (0xf<<28)
189#define S5PC100_CLKDIV3_HDMI_SHIFT (28)
190
191/* CLKDIV4 */
192#define S5PC100_CLKDIV4_PWI_MASK (0x7<<0)
193#define S5PC100_CLKDIV4_PWI_SHIFT (0)
194#define S5PC100_CLKDIV4_HCLKD2_MASK (0x7<<4)
195#define S5PC100_CLKDIV4_HCLKD2_SHIFT (4)
196#define S5PC100_CLKDIV4_I2SD2_MASK (0xf<<8)
197#define S5PC100_CLKDIV4_I2SD2_SHIFT (8)
198#define S5PC100_CLKDIV4_AUDIO0_MASK (0xf<<12)
199#define S5PC100_CLKDIV4_AUDIO0_SHIFT (12)
200#define S5PC100_CLKDIV4_AUDIO1_MASK (0xf<<16)
201#define S5PC100_CLKDIV4_AUDIO1_SHIFT (16)
202#define S5PC100_CLKDIV4_AUDIO2_MASK (0xf<<20)
203#define S5PC100_CLKDIV4_AUDIO2_SHIFT (20)
204 97
205/* HCLKD0/PCLKD0 Clock Gate 0 Registers */ 98/* HCLKD0/PCLKD0 Clock Gate 0 Registers */
206#define S5PC100_CLKGATE_D00_INTC (1<<0) 99#define S5PC100_CLKGATE_D00_INTC (1<<0)
diff --git a/arch/arm/plat-s5pc1xx/irq.c b/arch/arm/plat-s5pc1xx/irq.c
index e44fd04ef333..bfc524827819 100644
--- a/arch/arm/plat-s5pc1xx/irq.c
+++ b/arch/arm/plat-s5pc1xx/irq.c
@@ -20,87 +20,14 @@
20#include <asm/hardware/vic.h> 20#include <asm/hardware/vic.h>
21 21
22#include <mach/map.h> 22#include <mach/map.h>
23#include <plat/regs-timer.h> 23#include <plat/irq-vic-timer.h>
24#include <plat/irq-uart.h>
24#include <plat/cpu.h> 25#include <plat/cpu.h>
25 26
26/* Timer interrupt handling */
27
28static void s3c_irq_demux_timer(unsigned int base_irq, unsigned int sub_irq)
29{
30 generic_handle_irq(sub_irq);
31}
32
33static void s3c_irq_demux_timer0(unsigned int irq, struct irq_desc *desc)
34{
35 s3c_irq_demux_timer(irq, IRQ_TIMER0);
36}
37
38static void s3c_irq_demux_timer1(unsigned int irq, struct irq_desc *desc)
39{
40 s3c_irq_demux_timer(irq, IRQ_TIMER1);
41}
42
43static void s3c_irq_demux_timer2(unsigned int irq, struct irq_desc *desc)
44{
45 s3c_irq_demux_timer(irq, IRQ_TIMER2);
46}
47
48static void s3c_irq_demux_timer3(unsigned int irq, struct irq_desc *desc)
49{
50 s3c_irq_demux_timer(irq, IRQ_TIMER3);
51}
52
53static void s3c_irq_demux_timer4(unsigned int irq, struct irq_desc *desc)
54{
55 s3c_irq_demux_timer(irq, IRQ_TIMER4);
56}
57
58/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
59
60static void s3c_irq_timer_mask(unsigned int irq)
61{
62 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
63
64 reg &= 0x1f; /* mask out pending interrupts */
65 reg &= ~(1 << (irq - IRQ_TIMER0));
66 __raw_writel(reg, S3C64XX_TINT_CSTAT);
67}
68
69static void s3c_irq_timer_unmask(unsigned int irq)
70{
71 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
72
73 reg &= 0x1f; /* mask out pending interrupts */
74 reg |= 1 << (irq - IRQ_TIMER0);
75 __raw_writel(reg, S3C64XX_TINT_CSTAT);
76}
77
78static void s3c_irq_timer_ack(unsigned int irq)
79{
80 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
81
82 reg &= 0x1f; /* mask out pending interrupts */
83 reg |= (1 << 5) << (irq - IRQ_TIMER0);
84 __raw_writel(reg, S3C64XX_TINT_CSTAT);
85}
86
87static struct irq_chip s3c_irq_timer = {
88 .name = "s3c-timer",
89 .mask = s3c_irq_timer_mask,
90 .unmask = s3c_irq_timer_unmask,
91 .ack = s3c_irq_timer_ack,
92};
93
94struct uart_irq {
95 void __iomem *regs;
96 unsigned int base_irq;
97 unsigned int parent_irq;
98};
99
100/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3] 27/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
101 * are consecutive when looking up the interrupt in the demux routines. 28 * are consecutive when looking up the interrupt in the demux routines.
102 */ 29 */
103static struct uart_irq uart_irqs[] = { 30static struct s3c_uart_irq uart_irqs[] = {
104 [0] = { 31 [0] = {
105 .regs = (void *)S3C_VA_UART0, 32 .regs = (void *)S3C_VA_UART0,
106 .base_irq = IRQ_S3CUART_BASE0, 33 .base_irq = IRQ_S3CUART_BASE0,
@@ -123,113 +50,9 @@ static struct uart_irq uart_irqs[] = {
123 }, 50 },
124}; 51};
125 52
126static inline void __iomem *s3c_irq_uart_base(unsigned int irq)
127{
128 struct uart_irq *uirq = get_irq_chip_data(irq);
129 return uirq->regs;
130}
131
132static inline unsigned int s3c_irq_uart_bit(unsigned int irq)
133{
134 return irq & 3;
135}
136
137/* UART interrupt registers, not worth adding to seperate include header */
138#define S3C64XX_UINTP 0x30
139#define S3C64XX_UINTSP 0x34
140#define S3C64XX_UINTM 0x38
141
142static void s3c_irq_uart_mask(unsigned int irq)
143{
144 void __iomem *regs = s3c_irq_uart_base(irq);
145 unsigned int bit = s3c_irq_uart_bit(irq);
146 u32 reg;
147
148 reg = __raw_readl(regs + S3C64XX_UINTM);
149 reg |= (1 << bit);
150 __raw_writel(reg, regs + S3C64XX_UINTM);
151}
152
153static void s3c_irq_uart_maskack(unsigned int irq)
154{
155 void __iomem *regs = s3c_irq_uart_base(irq);
156 unsigned int bit = s3c_irq_uart_bit(irq);
157 u32 reg;
158
159 reg = __raw_readl(regs + S3C64XX_UINTM);
160 reg |= (1 << bit);
161 __raw_writel(reg, regs + S3C64XX_UINTM);
162 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
163}
164
165static void s3c_irq_uart_unmask(unsigned int irq)
166{
167 void __iomem *regs = s3c_irq_uart_base(irq);
168 unsigned int bit = s3c_irq_uart_bit(irq);
169 u32 reg;
170
171 reg = __raw_readl(regs + S3C64XX_UINTM);
172 reg &= ~(1 << bit);
173 __raw_writel(reg, regs + S3C64XX_UINTM);
174}
175
176static void s3c_irq_uart_ack(unsigned int irq)
177{
178 void __iomem *regs = s3c_irq_uart_base(irq);
179 unsigned int bit = s3c_irq_uart_bit(irq);
180
181 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
182}
183
184static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc)
185{
186 struct uart_irq *uirq = &uart_irqs[irq - IRQ_UART0];
187 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP);
188 int base = uirq->base_irq;
189
190 if (pend & (1 << 0))
191 generic_handle_irq(base);
192 if (pend & (1 << 1))
193 generic_handle_irq(base + 1);
194 if (pend & (1 << 2))
195 generic_handle_irq(base + 2);
196 if (pend & (1 << 3))
197 generic_handle_irq(base + 3);
198}
199
200static struct irq_chip s3c_irq_uart = {
201 .name = "s3c-uart",
202 .mask = s3c_irq_uart_mask,
203 .unmask = s3c_irq_uart_unmask,
204 .mask_ack = s3c_irq_uart_maskack,
205 .ack = s3c_irq_uart_ack,
206};
207
208static void __init s5pc1xx_uart_irq(struct uart_irq *uirq)
209{
210 void __iomem *reg_base = uirq->regs;
211 unsigned int irq;
212 int offs;
213
214 /* mask all interrupts at the start. */
215 __raw_writel(0xf, reg_base + S3C64XX_UINTM);
216
217 for (offs = 0; offs < 3; offs++) {
218 irq = uirq->base_irq + offs;
219
220 set_irq_chip(irq, &s3c_irq_uart);
221 set_irq_chip_data(irq, uirq);
222 set_irq_handler(irq, handle_level_irq);
223 set_irq_flags(irq, IRQF_VALID);
224 }
225
226 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart);
227}
228
229void __init s5pc1xx_init_irq(u32 *vic_valid, int num) 53void __init s5pc1xx_init_irq(u32 *vic_valid, int num)
230{ 54{
231 int i; 55 int i;
232 int uart, irq;
233 56
234 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); 57 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__);
235 58
@@ -240,20 +63,13 @@ void __init s5pc1xx_init_irq(u32 *vic_valid, int num)
240 63
241 /* add the timer sub-irqs */ 64 /* add the timer sub-irqs */
242 65
243 set_irq_chained_handler(IRQ_TIMER0, s3c_irq_demux_timer0); 66 s3c_init_vic_timer_irq(IRQ_TIMER0_VIC, IRQ_TIMER0);
244 set_irq_chained_handler(IRQ_TIMER1, s3c_irq_demux_timer1); 67 s3c_init_vic_timer_irq(IRQ_TIMER1_VIC, IRQ_TIMER1);
245 set_irq_chained_handler(IRQ_TIMER2, s3c_irq_demux_timer2); 68 s3c_init_vic_timer_irq(IRQ_TIMER2_VIC, IRQ_TIMER2);
246 set_irq_chained_handler(IRQ_TIMER3, s3c_irq_demux_timer3); 69 s3c_init_vic_timer_irq(IRQ_TIMER3_VIC, IRQ_TIMER3);
247 set_irq_chained_handler(IRQ_TIMER4, s3c_irq_demux_timer4); 70 s3c_init_vic_timer_irq(IRQ_TIMER4_VIC, IRQ_TIMER4);
248
249 for (irq = IRQ_TIMER0; irq <= IRQ_TIMER4; irq++) {
250 set_irq_chip(irq, &s3c_irq_timer);
251 set_irq_handler(irq, handle_level_irq);
252 set_irq_flags(irq, IRQF_VALID);
253 }
254 71
255 for (uart = 0; uart < ARRAY_SIZE(uart_irqs); uart++) 72 s3c_init_uart_irqs(uart_irqs, ARRAY_SIZE(uart_irqs));
256 s5pc1xx_uart_irq(&uart_irqs[uart]);
257} 73}
258 74
259 75
diff --git a/arch/arm/plat-s5pc1xx/s5pc100-clock.c b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
index b436d44510c8..2bf6c57a96a2 100644
--- a/arch/arm/plat-s5pc1xx/s5pc100-clock.c
+++ b/arch/arm/plat-s5pc1xx/s5pc100-clock.c
@@ -29,6 +29,7 @@
29 29
30#include <plat/regs-clock.h> 30#include <plat/regs-clock.h>
31#include <plat/clock.h> 31#include <plat/clock.h>
32#include <plat/clock-clksrc.h>
32#include <plat/cpu.h> 33#include <plat/cpu.h>
33#include <plat/pll.h> 34#include <plat/pll.h>
34#include <plat/devs.h> 35#include <plat/devs.h>
@@ -51,23 +52,6 @@ static struct clk clk_ext_xtal_mux = {
51#define clk_fout_mpll clk_mpll 52#define clk_fout_mpll clk_mpll
52#define clk_vclk_54m clk_54m 53#define clk_vclk_54m clk_54m
53 54
54struct clk_sources {
55 unsigned int nr_sources;
56 struct clk **sources;
57};
58
59struct clksrc_clk {
60 struct clk clk;
61 unsigned int mask;
62 unsigned int shift;
63
64 struct clk_sources *sources;
65
66 unsigned int divider_shift;
67 void __iomem *reg_divider;
68 void __iomem *reg_source;
69};
70
71/* APLL */ 55/* APLL */
72static struct clk clk_fout_apll = { 56static struct clk clk_fout_apll = {
73 .name = "fout_apll", 57 .name = "fout_apll",
@@ -80,7 +64,7 @@ static struct clk *clk_src_apll_list[] = {
80 [1] = &clk_fout_apll, 64 [1] = &clk_fout_apll,
81}; 65};
82 66
83static struct clk_sources clk_src_apll = { 67static struct clksrc_sources clk_src_apll = {
84 .sources = clk_src_apll_list, 68 .sources = clk_src_apll_list,
85 .nr_sources = ARRAY_SIZE(clk_src_apll_list), 69 .nr_sources = ARRAY_SIZE(clk_src_apll_list),
86}; 70};
@@ -90,10 +74,8 @@ static struct clksrc_clk clk_mout_apll = {
90 .name = "mout_apll", 74 .name = "mout_apll",
91 .id = -1, 75 .id = -1,
92 }, 76 },
93 .shift = S5PC100_CLKSRC0_APLL_SHIFT,
94 .mask = S5PC100_CLKSRC0_APLL_MASK,
95 .sources = &clk_src_apll, 77 .sources = &clk_src_apll,
96 .reg_source = S5PC100_CLKSRC0, 78 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 0, .size = 1, },
97}; 79};
98 80
99static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk) 81static unsigned long s5pc100_clk_dout_apll_get_rate(struct clk *clk)
@@ -111,7 +93,9 @@ static struct clk clk_dout_apll = {
111 .name = "dout_apll", 93 .name = "dout_apll",
112 .id = -1, 94 .id = -1,
113 .parent = &clk_mout_apll.clk, 95 .parent = &clk_mout_apll.clk,
114 .get_rate = s5pc100_clk_dout_apll_get_rate, 96 .ops = &(struct clk_ops) {
97 .get_rate = s5pc100_clk_dout_apll_get_rate,
98 },
115}; 99};
116 100
117static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk) 101static unsigned long s5pc100_clk_arm_get_rate(struct clk *clk)
@@ -165,9 +149,11 @@ static struct clk clk_arm = {
165 .name = "armclk", 149 .name = "armclk",
166 .id = -1, 150 .id = -1,
167 .parent = &clk_dout_apll, 151 .parent = &clk_dout_apll,
168 .get_rate = s5pc100_clk_arm_get_rate, 152 .ops = &(struct clk_ops) {
169 .set_rate = s5pc100_clk_arm_set_rate, 153 .get_rate = s5pc100_clk_arm_get_rate,
170 .round_rate = s5pc100_clk_arm_round_rate, 154 .set_rate = s5pc100_clk_arm_set_rate,
155 .round_rate = s5pc100_clk_arm_round_rate,
156 },
171}; 157};
172 158
173static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk) 159static unsigned long s5pc100_clk_dout_d0_bus_get_rate(struct clk *clk)
@@ -185,7 +171,9 @@ static struct clk clk_dout_d0_bus = {
185 .name = "dout_d0_bus", 171 .name = "dout_d0_bus",
186 .id = -1, 172 .id = -1,
187 .parent = &clk_arm, 173 .parent = &clk_arm,
188 .get_rate = s5pc100_clk_dout_d0_bus_get_rate, 174 .ops = &(struct clk_ops) {
175 .get_rate = s5pc100_clk_dout_d0_bus_get_rate,
176 },
189}; 177};
190 178
191static unsigned long s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk) 179static unsigned long s5pc100_clk_dout_pclkd0_get_rate(struct clk *clk)
@@ -203,7 +191,9 @@ static struct clk clk_dout_pclkd0 = {
203 .name = "dout_pclkd0", 191 .name = "dout_pclkd0",
204 .id = -1, 192 .id = -1,
205 .parent = &clk_dout_d0_bus, 193 .parent = &clk_dout_d0_bus,
206 .get_rate = s5pc100_clk_dout_pclkd0_get_rate, 194 .ops = &(struct clk_ops) {
195 .get_rate = s5pc100_clk_dout_pclkd0_get_rate,
196 },
207}; 197};
208 198
209static unsigned long s5pc100_clk_dout_apll2_get_rate(struct clk *clk) 199static unsigned long s5pc100_clk_dout_apll2_get_rate(struct clk *clk)
@@ -221,7 +211,9 @@ static struct clk clk_dout_apll2 = {
221 .name = "dout_apll2", 211 .name = "dout_apll2",
222 .id = -1, 212 .id = -1,
223 .parent = &clk_mout_apll.clk, 213 .parent = &clk_mout_apll.clk,
224 .get_rate = s5pc100_clk_dout_apll2_get_rate, 214 .ops = &(struct clk_ops) {
215 .get_rate = s5pc100_clk_dout_apll2_get_rate,
216 },
225}; 217};
226 218
227/* MPLL */ 219/* MPLL */
@@ -230,7 +222,7 @@ static struct clk *clk_src_mpll_list[] = {
230 [1] = &clk_fout_mpll, 222 [1] = &clk_fout_mpll,
231}; 223};
232 224
233static struct clk_sources clk_src_mpll = { 225static struct clksrc_sources clk_src_mpll = {
234 .sources = clk_src_mpll_list, 226 .sources = clk_src_mpll_list,
235 .nr_sources = ARRAY_SIZE(clk_src_mpll_list), 227 .nr_sources = ARRAY_SIZE(clk_src_mpll_list),
236}; 228};
@@ -240,10 +232,8 @@ static struct clksrc_clk clk_mout_mpll = {
240 .name = "mout_mpll", 232 .name = "mout_mpll",
241 .id = -1, 233 .id = -1,
242 }, 234 },
243 .shift = S5PC100_CLKSRC0_MPLL_SHIFT,
244 .mask = S5PC100_CLKSRC0_MPLL_MASK,
245 .sources = &clk_src_mpll, 235 .sources = &clk_src_mpll,
246 .reg_source = S5PC100_CLKSRC0, 236 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 4, .size = 1, },
247}; 237};
248 238
249static struct clk *clkset_am_list[] = { 239static struct clk *clkset_am_list[] = {
@@ -251,7 +241,7 @@ static struct clk *clkset_am_list[] = {
251 [1] = &clk_dout_apll2, 241 [1] = &clk_dout_apll2,
252}; 242};
253 243
254static struct clk_sources clk_src_am = { 244static struct clksrc_sources clk_src_am = {
255 .sources = clkset_am_list, 245 .sources = clkset_am_list,
256 .nr_sources = ARRAY_SIZE(clkset_am_list), 246 .nr_sources = ARRAY_SIZE(clkset_am_list),
257}; 247};
@@ -261,10 +251,8 @@ static struct clksrc_clk clk_mout_am = {
261 .name = "mout_am", 251 .name = "mout_am",
262 .id = -1, 252 .id = -1,
263 }, 253 },
264 .shift = S5PC100_CLKSRC0_AMMUX_SHIFT,
265 .mask = S5PC100_CLKSRC0_AMMUX_MASK,
266 .sources = &clk_src_am, 254 .sources = &clk_src_am,
267 .reg_source = S5PC100_CLKSRC0, 255 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 16, .size = 1, },
268}; 256};
269 257
270static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk) 258static unsigned long s5pc100_clk_dout_d1_bus_get_rate(struct clk *clk)
@@ -284,7 +272,9 @@ static struct clk clk_dout_d1_bus = {
284 .name = "dout_d1_bus", 272 .name = "dout_d1_bus",
285 .id = -1, 273 .id = -1,
286 .parent = &clk_mout_am.clk, 274 .parent = &clk_mout_am.clk,
287 .get_rate = s5pc100_clk_dout_d1_bus_get_rate, 275 .ops = &(struct clk_ops) {
276 .get_rate = s5pc100_clk_dout_d1_bus_get_rate,
277 },
288}; 278};
289 279
290static struct clk *clkset_onenand_list[] = { 280static struct clk *clkset_onenand_list[] = {
@@ -292,7 +282,7 @@ static struct clk *clkset_onenand_list[] = {
292 [1] = &clk_dout_d1_bus, 282 [1] = &clk_dout_d1_bus,
293}; 283};
294 284
295static struct clk_sources clk_src_onenand = { 285static struct clksrc_sources clk_src_onenand = {
296 .sources = clkset_onenand_list, 286 .sources = clkset_onenand_list,
297 .nr_sources = ARRAY_SIZE(clkset_onenand_list), 287 .nr_sources = ARRAY_SIZE(clkset_onenand_list),
298}; 288};
@@ -302,10 +292,8 @@ static struct clksrc_clk clk_mout_onenand = {
302 .name = "mout_onenand", 292 .name = "mout_onenand",
303 .id = -1, 293 .id = -1,
304 }, 294 },
305 .shift = S5PC100_CLKSRC0_ONENAND_SHIFT,
306 .mask = S5PC100_CLKSRC0_ONENAND_MASK,
307 .sources = &clk_src_onenand, 295 .sources = &clk_src_onenand,
308 .reg_source = S5PC100_CLKSRC0, 296 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 24, .size = 1, },
309}; 297};
310 298
311static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk) 299static unsigned long s5pc100_clk_dout_pclkd1_get_rate(struct clk *clk)
@@ -325,7 +313,9 @@ static struct clk clk_dout_pclkd1 = {
325 .name = "dout_pclkd1", 313 .name = "dout_pclkd1",
326 .id = -1, 314 .id = -1,
327 .parent = &clk_dout_d1_bus, 315 .parent = &clk_dout_d1_bus,
328 .get_rate = s5pc100_clk_dout_pclkd1_get_rate, 316 .ops = &(struct clk_ops) {
317 .get_rate = s5pc100_clk_dout_pclkd1_get_rate,
318 },
329}; 319};
330 320
331static unsigned long s5pc100_clk_dout_mpll2_get_rate(struct clk *clk) 321static unsigned long s5pc100_clk_dout_mpll2_get_rate(struct clk *clk)
@@ -345,7 +335,9 @@ static struct clk clk_dout_mpll2 = {
345 .name = "dout_mpll2", 335 .name = "dout_mpll2",
346 .id = -1, 336 .id = -1,
347 .parent = &clk_mout_am.clk, 337 .parent = &clk_mout_am.clk,
348 .get_rate = s5pc100_clk_dout_mpll2_get_rate, 338 .ops = &(struct clk_ops) {
339 .get_rate = s5pc100_clk_dout_mpll2_get_rate,
340 },
349}; 341};
350 342
351static unsigned long s5pc100_clk_dout_cam_get_rate(struct clk *clk) 343static unsigned long s5pc100_clk_dout_cam_get_rate(struct clk *clk)
@@ -365,7 +357,9 @@ static struct clk clk_dout_cam = {
365 .name = "dout_cam", 357 .name = "dout_cam",
366 .id = -1, 358 .id = -1,
367 .parent = &clk_dout_mpll2, 359 .parent = &clk_dout_mpll2,
368 .get_rate = s5pc100_clk_dout_cam_get_rate, 360 .ops = &(struct clk_ops) {
361 .get_rate = s5pc100_clk_dout_cam_get_rate,
362 },
369}; 363};
370 364
371static unsigned long s5pc100_clk_dout_mpll_get_rate(struct clk *clk) 365static unsigned long s5pc100_clk_dout_mpll_get_rate(struct clk *clk)
@@ -385,7 +379,9 @@ static struct clk clk_dout_mpll = {
385 .name = "dout_mpll", 379 .name = "dout_mpll",
386 .id = -1, 380 .id = -1,
387 .parent = &clk_mout_am.clk, 381 .parent = &clk_mout_am.clk,
388 .get_rate = s5pc100_clk_dout_mpll_get_rate, 382 .ops = &(struct clk_ops) {
383 .get_rate = s5pc100_clk_dout_mpll_get_rate,
384 },
389}; 385};
390 386
391/* EPLL */ 387/* EPLL */
@@ -399,7 +395,7 @@ static struct clk *clk_src_epll_list[] = {
399 [1] = &clk_fout_epll, 395 [1] = &clk_fout_epll,
400}; 396};
401 397
402static struct clk_sources clk_src_epll = { 398static struct clksrc_sources clk_src_epll = {
403 .sources = clk_src_epll_list, 399 .sources = clk_src_epll_list,
404 .nr_sources = ARRAY_SIZE(clk_src_epll_list), 400 .nr_sources = ARRAY_SIZE(clk_src_epll_list),
405}; 401};
@@ -409,10 +405,8 @@ static struct clksrc_clk clk_mout_epll = {
409 .name = "mout_epll", 405 .name = "mout_epll",
410 .id = -1, 406 .id = -1,
411 }, 407 },
412 .shift = S5PC100_CLKSRC0_EPLL_SHIFT, 408 .sources = &clk_src_epll,
413 .mask = S5PC100_CLKSRC0_EPLL_MASK, 409 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 8, .size = 1, },
414 .sources = &clk_src_epll,
415 .reg_source = S5PC100_CLKSRC0,
416}; 410};
417 411
418/* HPLL */ 412/* HPLL */
@@ -426,7 +420,7 @@ static struct clk *clk_src_hpll_list[] = {
426 [1] = &clk_fout_hpll, 420 [1] = &clk_fout_hpll,
427}; 421};
428 422
429static struct clk_sources clk_src_hpll = { 423static struct clksrc_sources clk_src_hpll = {
430 .sources = clk_src_hpll_list, 424 .sources = clk_src_hpll_list,
431 .nr_sources = ARRAY_SIZE(clk_src_hpll_list), 425 .nr_sources = ARRAY_SIZE(clk_src_hpll_list),
432}; 426};
@@ -436,10 +430,8 @@ static struct clksrc_clk clk_mout_hpll = {
436 .name = "mout_hpll", 430 .name = "mout_hpll",
437 .id = -1, 431 .id = -1,
438 }, 432 },
439 .shift = S5PC100_CLKSRC0_HPLL_SHIFT, 433 .sources = &clk_src_hpll,
440 .mask = S5PC100_CLKSRC0_HPLL_MASK, 434 .reg_src = { .reg = S5PC100_CLKSRC0, .shift = 12, .size = 1, },
441 .sources = &clk_src_hpll,
442 .reg_source = S5PC100_CLKSRC0,
443}; 435};
444 436
445/* Peripherals */ 437/* Peripherals */
@@ -454,190 +446,6 @@ static struct clksrc_clk clk_mout_hpll = {
454 * have a common parent divisor so are not included here. 446 * have a common parent divisor so are not included here.
455 */ 447 */
456 448
457static inline struct clksrc_clk *to_clksrc(struct clk *clk)
458{
459 return container_of(clk, struct clksrc_clk, clk);
460}
461
462static unsigned long s5pc100_getrate_clksrc(struct clk *clk)
463{
464 struct clksrc_clk *sclk = to_clksrc(clk);
465 unsigned long rate = clk_get_rate(clk->parent);
466 u32 clkdiv = __raw_readl(sclk->reg_divider);
467
468 clkdiv >>= sclk->divider_shift;
469 clkdiv &= 0xf;
470 clkdiv++;
471
472 rate /= clkdiv;
473 return rate;
474}
475
476static int s5pc100_setrate_clksrc(struct clk *clk, unsigned long rate)
477{
478 struct clksrc_clk *sclk = to_clksrc(clk);
479 void __iomem *reg = sclk->reg_divider;
480 unsigned int div;
481 u32 val;
482
483 rate = clk_round_rate(clk, rate);
484 div = clk_get_rate(clk->parent) / rate;
485 if (div > 16)
486 return -EINVAL;
487
488 val = __raw_readl(reg);
489 val &= ~(0xf << sclk->divider_shift);
490 val |= (div - 1) << sclk->divider_shift;
491 __raw_writel(val, reg);
492
493 return 0;
494}
495
496static int s5pc100_setparent_clksrc(struct clk *clk, struct clk *parent)
497{
498 struct clksrc_clk *sclk = to_clksrc(clk);
499 struct clk_sources *srcs = sclk->sources;
500 u32 clksrc = __raw_readl(sclk->reg_source);
501 int src_nr = -1;
502 int ptr;
503
504 for (ptr = 0; ptr < srcs->nr_sources; ptr++)
505 if (srcs->sources[ptr] == parent) {
506 src_nr = ptr;
507 break;
508 }
509
510 if (src_nr >= 0) {
511 clksrc &= ~sclk->mask;
512 clksrc |= src_nr << sclk->shift;
513
514 __raw_writel(clksrc, sclk->reg_source);
515 return 0;
516 }
517
518 return -EINVAL;
519}
520
521static unsigned long s5pc100_roundrate_clksrc(struct clk *clk,
522 unsigned long rate)
523{
524 unsigned long parent_rate = clk_get_rate(clk->parent);
525 int div;
526
527 if (rate > parent_rate)
528 rate = parent_rate;
529 else {
530 div = rate / parent_rate;
531
532 if (div == 0)
533 div = 1;
534 if (div > 16)
535 div = 16;
536
537 rate = parent_rate / div;
538 }
539
540 return rate;
541}
542
543static struct clk *clkset_spi_list[] = {
544 &clk_mout_epll.clk,
545 &clk_dout_mpll2,
546 &clk_fin_epll,
547 &clk_mout_hpll.clk,
548};
549
550static struct clk_sources clkset_spi = {
551 .sources = clkset_spi_list,
552 .nr_sources = ARRAY_SIZE(clkset_spi_list),
553};
554
555static struct clksrc_clk clk_spi0 = {
556 .clk = {
557 .name = "spi_bus",
558 .id = 0,
559 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0,
560 .enable = s5pc100_sclk0_ctrl,
561 .set_parent = s5pc100_setparent_clksrc,
562 .get_rate = s5pc100_getrate_clksrc,
563 .set_rate = s5pc100_setrate_clksrc,
564 .round_rate = s5pc100_roundrate_clksrc,
565 },
566 .shift = S5PC100_CLKSRC1_SPI0_SHIFT,
567 .mask = S5PC100_CLKSRC1_SPI0_MASK,
568 .sources = &clkset_spi,
569 .divider_shift = S5PC100_CLKDIV2_SPI0_SHIFT,
570 .reg_divider = S5PC100_CLKDIV2,
571 .reg_source = S5PC100_CLKSRC1,
572};
573
574static struct clksrc_clk clk_spi1 = {
575 .clk = {
576 .name = "spi_bus",
577 .id = 1,
578 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1,
579 .enable = s5pc100_sclk0_ctrl,
580 .set_parent = s5pc100_setparent_clksrc,
581 .get_rate = s5pc100_getrate_clksrc,
582 .set_rate = s5pc100_setrate_clksrc,
583 .round_rate = s5pc100_roundrate_clksrc,
584 },
585 .shift = S5PC100_CLKSRC1_SPI1_SHIFT,
586 .mask = S5PC100_CLKSRC1_SPI1_MASK,
587 .sources = &clkset_spi,
588 .divider_shift = S5PC100_CLKDIV2_SPI1_SHIFT,
589 .reg_divider = S5PC100_CLKDIV2,
590 .reg_source = S5PC100_CLKSRC1,
591};
592
593static struct clksrc_clk clk_spi2 = {
594 .clk = {
595 .name = "spi_bus",
596 .id = 2,
597 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2,
598 .enable = s5pc100_sclk0_ctrl,
599 .set_parent = s5pc100_setparent_clksrc,
600 .get_rate = s5pc100_getrate_clksrc,
601 .set_rate = s5pc100_setrate_clksrc,
602 .round_rate = s5pc100_roundrate_clksrc,
603 },
604 .shift = S5PC100_CLKSRC1_SPI2_SHIFT,
605 .mask = S5PC100_CLKSRC1_SPI2_MASK,
606 .sources = &clkset_spi,
607 .divider_shift = S5PC100_CLKDIV2_SPI2_SHIFT,
608 .reg_divider = S5PC100_CLKDIV2,
609 .reg_source = S5PC100_CLKSRC1,
610};
611
612static struct clk *clkset_uart_list[] = {
613 &clk_mout_epll.clk,
614 &clk_dout_mpll,
615};
616
617static struct clk_sources clkset_uart = {
618 .sources = clkset_uart_list,
619 .nr_sources = ARRAY_SIZE(clkset_uart_list),
620};
621
622static struct clksrc_clk clk_uart_uclk1 = {
623 .clk = {
624 .name = "uclk1",
625 .id = -1,
626 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART,
627 .enable = s5pc100_sclk0_ctrl,
628 .set_parent = s5pc100_setparent_clksrc,
629 .get_rate = s5pc100_getrate_clksrc,
630 .set_rate = s5pc100_setrate_clksrc,
631 .round_rate = s5pc100_roundrate_clksrc,
632 },
633 .shift = S5PC100_CLKSRC1_UART_SHIFT,
634 .mask = S5PC100_CLKSRC1_UART_MASK,
635 .sources = &clkset_uart,
636 .divider_shift = S5PC100_CLKDIV2_UART_SHIFT,
637 .reg_divider = S5PC100_CLKDIV2,
638 .reg_source = S5PC100_CLKSRC1,
639};
640
641static struct clk clk_iis_cd0 = { 449static struct clk clk_iis_cd0 = {
642 .name = "iis_cdclk0", 450 .name = "iis_cdclk0",
643 .id = -1, 451 .id = -1,
@@ -672,28 +480,31 @@ static struct clk *clkset_audio0_list[] = {
672 &clk_mout_hpll.clk, 480 &clk_mout_hpll.clk,
673}; 481};
674 482
675static struct clk_sources clkset_audio0 = { 483static struct clksrc_sources clkset_audio0 = {
676 .sources = clkset_audio0_list, 484 .sources = clkset_audio0_list,
677 .nr_sources = ARRAY_SIZE(clkset_audio0_list), 485 .nr_sources = ARRAY_SIZE(clkset_audio0_list),
678}; 486};
679 487
680static struct clksrc_clk clk_audio0 = { 488static struct clk *clkset_spi_list[] = {
681 .clk = { 489 &clk_mout_epll.clk,
682 .name = "audio-bus", 490 &clk_dout_mpll2,
683 .id = 0, 491 &clk_fin_epll,
684 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO0, 492 &clk_mout_hpll.clk,
685 .enable = s5pc100_sclk1_ctrl, 493};
686 .set_parent = s5pc100_setparent_clksrc, 494
687 .get_rate = s5pc100_getrate_clksrc, 495static struct clksrc_sources clkset_spi = {
688 .set_rate = s5pc100_setrate_clksrc, 496 .sources = clkset_spi_list,
689 .round_rate = s5pc100_roundrate_clksrc, 497 .nr_sources = ARRAY_SIZE(clkset_spi_list),
690 }, 498};
691 .shift = S5PC100_CLKSRC3_AUDIO0_SHIFT, 499
692 .mask = S5PC100_CLKSRC3_AUDIO0_MASK, 500static struct clk *clkset_uart_list[] = {
693 .sources = &clkset_audio0, 501 &clk_mout_epll.clk,
694 .divider_shift = S5PC100_CLKDIV4_AUDIO0_SHIFT, 502 &clk_dout_mpll,
695 .reg_divider = S5PC100_CLKDIV4, 503};
696 .reg_source = S5PC100_CLKSRC3, 504
505static struct clksrc_sources clkset_uart = {
506 .sources = clkset_uart_list,
507 .nr_sources = ARRAY_SIZE(clkset_uart_list),
697}; 508};
698 509
699static struct clk *clkset_audio1_list[] = { 510static struct clk *clkset_audio1_list[] = {
@@ -705,30 +516,11 @@ static struct clk *clkset_audio1_list[] = {
705 &clk_mout_hpll.clk, 516 &clk_mout_hpll.clk,
706}; 517};
707 518
708static struct clk_sources clkset_audio1 = { 519static struct clksrc_sources clkset_audio1 = {
709 .sources = clkset_audio1_list, 520 .sources = clkset_audio1_list,
710 .nr_sources = ARRAY_SIZE(clkset_audio1_list), 521 .nr_sources = ARRAY_SIZE(clkset_audio1_list),
711}; 522};
712 523
713static struct clksrc_clk clk_audio1 = {
714 .clk = {
715 .name = "audio-bus",
716 .id = 1,
717 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO1,
718 .enable = s5pc100_sclk1_ctrl,
719 .set_parent = s5pc100_setparent_clksrc,
720 .get_rate = s5pc100_getrate_clksrc,
721 .set_rate = s5pc100_setrate_clksrc,
722 .round_rate = s5pc100_roundrate_clksrc,
723 },
724 .shift = S5PC100_CLKSRC3_AUDIO1_SHIFT,
725 .mask = S5PC100_CLKSRC3_AUDIO1_MASK,
726 .sources = &clkset_audio1,
727 .divider_shift = S5PC100_CLKDIV4_AUDIO1_SHIFT,
728 .reg_divider = S5PC100_CLKDIV4,
729 .reg_source = S5PC100_CLKSRC3,
730};
731
732static struct clk *clkset_audio2_list[] = { 524static struct clk *clkset_audio2_list[] = {
733 &clk_mout_epll.clk, 525 &clk_mout_epll.clk,
734 &clk_dout_mpll, 526 &clk_dout_mpll,
@@ -737,52 +529,56 @@ static struct clk *clkset_audio2_list[] = {
737 &clk_mout_hpll.clk, 529 &clk_mout_hpll.clk,
738}; 530};
739 531
740static struct clk_sources clkset_audio2 = { 532static struct clksrc_sources clkset_audio2 = {
741 .sources = clkset_audio2_list, 533 .sources = clkset_audio2_list,
742 .nr_sources = ARRAY_SIZE(clkset_audio2_list), 534 .nr_sources = ARRAY_SIZE(clkset_audio2_list),
743}; 535};
744 536
745static struct clksrc_clk clk_audio2 = { 537static struct clksrc_clk clksrc_audio[] = {
746 .clk = { 538 {
747 .name = "audio-bus", 539 .clk = {
748 .id = 2, 540 .name = "audio-bus",
749 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO2, 541 .id = 0,
750 .enable = s5pc100_sclk1_ctrl, 542 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO0,
751 .set_parent = s5pc100_setparent_clksrc, 543 .enable = s5pc100_sclk1_ctrl,
752 .get_rate = s5pc100_getrate_clksrc, 544 },
753 .set_rate = s5pc100_setrate_clksrc, 545 .sources = &clkset_audio0,
754 .round_rate = s5pc100_roundrate_clksrc, 546 .reg_div = { .reg = S5PC100_CLKDIV4, .shift = 12, .size = 4, },
547 .reg_src = { .reg = S5PC100_CLKSRC3, .shift = 12, .size = 3, },
548 }, {
549 .clk = {
550 .name = "audio-bus",
551 .id = 1,
552 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO1,
553 .enable = s5pc100_sclk1_ctrl,
554 },
555 .sources = &clkset_audio1,
556 .reg_div = { .reg = S5PC100_CLKDIV4, .shift = 16, .size = 4, },
557 .reg_src = { .reg = S5PC100_CLKSRC3, .shift = 16, .size = 3, },
558 }, {
559 .clk = {
560 .name = "audio-bus",
561 .id = 2,
562 .ctrlbit = S5PC100_CLKGATE_SCLK1_AUDIO2,
563 .enable = s5pc100_sclk1_ctrl,
564 },
565 .sources = &clkset_audio2,
566 .reg_div = { .reg = S5PC100_CLKDIV4, .shift = 20, .size = 4, },
567 .reg_src = { .reg = S5PC100_CLKSRC3, .shift = 20, .size = 3, },
755 }, 568 },
756 .shift = S5PC100_CLKSRC3_AUDIO2_SHIFT,
757 .mask = S5PC100_CLKSRC3_AUDIO2_MASK,
758 .sources = &clkset_audio2,
759 .divider_shift = S5PC100_CLKDIV4_AUDIO2_SHIFT,
760 .reg_divider = S5PC100_CLKDIV4,
761 .reg_source = S5PC100_CLKSRC3,
762}; 569};
763 570
764static struct clk *clkset_spdif_list[] = { 571static struct clk *clkset_spdif_list[] = {
765 &clk_audio0.clk, 572 &clksrc_audio[0].clk,
766 &clk_audio1.clk, 573 &clksrc_audio[1].clk,
767 &clk_audio2.clk, 574 &clksrc_audio[2].clk,
768}; 575};
769 576
770static struct clk_sources clkset_spdif = { 577static struct clksrc_sources clkset_spdif = {
771 .sources = clkset_spdif_list, 578 .sources = clkset_spdif_list,
772 .nr_sources = ARRAY_SIZE(clkset_spdif_list), 579 .nr_sources = ARRAY_SIZE(clkset_spdif_list),
773}; 580};
774 581
775static struct clksrc_clk clk_spdif = {
776 .clk = {
777 .name = "spdif",
778 .id = -1,
779 },
780 .shift = S5PC100_CLKSRC3_SPDIF_SHIFT,
781 .mask = S5PC100_CLKSRC3_SPDIF_MASK,
782 .sources = &clkset_spdif,
783 .reg_source = S5PC100_CLKSRC3,
784};
785
786static struct clk *clkset_lcd_fimc_list[] = { 582static struct clk *clkset_lcd_fimc_list[] = {
787 &clk_mout_epll.clk, 583 &clk_mout_epll.clk,
788 &clk_dout_mpll, 584 &clk_dout_mpll,
@@ -790,87 +586,11 @@ static struct clk *clkset_lcd_fimc_list[] = {
790 &clk_vclk_54m, 586 &clk_vclk_54m,
791}; 587};
792 588
793static struct clk_sources clkset_lcd_fimc = { 589static struct clksrc_sources clkset_lcd_fimc = {
794 .sources = clkset_lcd_fimc_list, 590 .sources = clkset_lcd_fimc_list,
795 .nr_sources = ARRAY_SIZE(clkset_lcd_fimc_list), 591 .nr_sources = ARRAY_SIZE(clkset_lcd_fimc_list),
796}; 592};
797 593
798static struct clksrc_clk clk_lcd = {
799 .clk = {
800 .name = "lcd",
801 .id = -1,
802 .ctrlbit = S5PC100_CLKGATE_SCLK1_LCD,
803 .enable = s5pc100_sclk1_ctrl,
804 .set_parent = s5pc100_setparent_clksrc,
805 .get_rate = s5pc100_getrate_clksrc,
806 .set_rate = s5pc100_setrate_clksrc,
807 .round_rate = s5pc100_roundrate_clksrc,
808 },
809 .shift = S5PC100_CLKSRC2_LCD_SHIFT,
810 .mask = S5PC100_CLKSRC2_LCD_MASK,
811 .sources = &clkset_lcd_fimc,
812 .divider_shift = S5PC100_CLKDIV3_LCD_SHIFT,
813 .reg_divider = S5PC100_CLKDIV3,
814 .reg_source = S5PC100_CLKSRC2,
815};
816
817static struct clksrc_clk clk_fimc0 = {
818 .clk = {
819 .name = "fimc",
820 .id = 0,
821 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC0,
822 .enable = s5pc100_sclk1_ctrl,
823 .set_parent = s5pc100_setparent_clksrc,
824 .get_rate = s5pc100_getrate_clksrc,
825 .set_rate = s5pc100_setrate_clksrc,
826 .round_rate = s5pc100_roundrate_clksrc,
827 },
828 .shift = S5PC100_CLKSRC2_FIMC0_SHIFT,
829 .mask = S5PC100_CLKSRC2_FIMC0_MASK,
830 .sources = &clkset_lcd_fimc,
831 .divider_shift = S5PC100_CLKDIV3_FIMC0_SHIFT,
832 .reg_divider = S5PC100_CLKDIV3,
833 .reg_source = S5PC100_CLKSRC2,
834};
835
836static struct clksrc_clk clk_fimc1 = {
837 .clk = {
838 .name = "fimc",
839 .id = 1,
840 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC1,
841 .enable = s5pc100_sclk1_ctrl,
842 .set_parent = s5pc100_setparent_clksrc,
843 .get_rate = s5pc100_getrate_clksrc,
844 .set_rate = s5pc100_setrate_clksrc,
845 .round_rate = s5pc100_roundrate_clksrc,
846 },
847 .shift = S5PC100_CLKSRC2_FIMC1_SHIFT,
848 .mask = S5PC100_CLKSRC2_FIMC1_MASK,
849 .sources = &clkset_lcd_fimc,
850 .divider_shift = S5PC100_CLKDIV3_FIMC1_SHIFT,
851 .reg_divider = S5PC100_CLKDIV3,
852 .reg_source = S5PC100_CLKSRC2,
853};
854
855static struct clksrc_clk clk_fimc2 = {
856 .clk = {
857 .name = "fimc",
858 .id = 2,
859 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC2,
860 .enable = s5pc100_sclk1_ctrl,
861 .set_parent = s5pc100_setparent_clksrc,
862 .get_rate = s5pc100_getrate_clksrc,
863 .set_rate = s5pc100_setrate_clksrc,
864 .round_rate = s5pc100_roundrate_clksrc,
865 },
866 .shift = S5PC100_CLKSRC2_FIMC2_SHIFT,
867 .mask = S5PC100_CLKSRC2_FIMC2_MASK,
868 .sources = &clkset_lcd_fimc,
869 .divider_shift = S5PC100_CLKDIV3_FIMC2_SHIFT,
870 .reg_divider = S5PC100_CLKDIV3,
871 .reg_source = S5PC100_CLKSRC2,
872};
873
874static struct clk *clkset_mmc_list[] = { 594static struct clk *clkset_mmc_list[] = {
875 &clk_mout_epll.clk, 595 &clk_mout_epll.clk,
876 &clk_dout_mpll, 596 &clk_dout_mpll,
@@ -878,69 +598,11 @@ static struct clk *clkset_mmc_list[] = {
878 &clk_mout_hpll.clk , 598 &clk_mout_hpll.clk ,
879}; 599};
880 600
881static struct clk_sources clkset_mmc = { 601static struct clksrc_sources clkset_mmc = {
882 .sources = clkset_mmc_list, 602 .sources = clkset_mmc_list,
883 .nr_sources = ARRAY_SIZE(clkset_mmc_list), 603 .nr_sources = ARRAY_SIZE(clkset_mmc_list),
884}; 604};
885 605
886static struct clksrc_clk clk_mmc0 = {
887 .clk = {
888 .name = "mmc_bus",
889 .id = 0,
890 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0,
891 .enable = s5pc100_sclk0_ctrl,
892 .set_parent = s5pc100_setparent_clksrc,
893 .get_rate = s5pc100_getrate_clksrc,
894 .set_rate = s5pc100_setrate_clksrc,
895 .round_rate = s5pc100_roundrate_clksrc,
896 },
897 .shift = S5PC100_CLKSRC2_MMC0_SHIFT,
898 .mask = S5PC100_CLKSRC2_MMC0_MASK,
899 .sources = &clkset_mmc,
900 .divider_shift = S5PC100_CLKDIV3_MMC0_SHIFT,
901 .reg_divider = S5PC100_CLKDIV3,
902 .reg_source = S5PC100_CLKSRC2,
903};
904
905static struct clksrc_clk clk_mmc1 = {
906 .clk = {
907 .name = "mmc_bus",
908 .id = 1,
909 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1,
910 .enable = s5pc100_sclk0_ctrl,
911 .set_parent = s5pc100_setparent_clksrc,
912 .get_rate = s5pc100_getrate_clksrc,
913 .set_rate = s5pc100_setrate_clksrc,
914 .round_rate = s5pc100_roundrate_clksrc,
915 },
916 .shift = S5PC100_CLKSRC2_MMC1_SHIFT,
917 .mask = S5PC100_CLKSRC2_MMC1_MASK,
918 .sources = &clkset_mmc,
919 .divider_shift = S5PC100_CLKDIV3_MMC1_SHIFT,
920 .reg_divider = S5PC100_CLKDIV3,
921 .reg_source = S5PC100_CLKSRC2,
922};
923
924static struct clksrc_clk clk_mmc2 = {
925 .clk = {
926 .name = "mmc_bus",
927 .id = 2,
928 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2,
929 .enable = s5pc100_sclk0_ctrl,
930 .set_parent = s5pc100_setparent_clksrc,
931 .get_rate = s5pc100_getrate_clksrc,
932 .set_rate = s5pc100_setrate_clksrc,
933 .round_rate = s5pc100_roundrate_clksrc,
934 },
935 .shift = S5PC100_CLKSRC2_MMC2_SHIFT,
936 .mask = S5PC100_CLKSRC2_MMC2_MASK,
937 .sources = &clkset_mmc,
938 .divider_shift = S5PC100_CLKDIV3_MMC2_SHIFT,
939 .reg_divider = S5PC100_CLKDIV3,
940 .reg_source = S5PC100_CLKSRC2,
941};
942
943
944static struct clk *clkset_usbhost_list[] = { 606static struct clk *clkset_usbhost_list[] = {
945 &clk_mout_epll.clk, 607 &clk_mout_epll.clk,
946 &clk_dout_mpll, 608 &clk_dout_mpll,
@@ -948,28 +610,141 @@ static struct clk *clkset_usbhost_list[] = {
948 &clk_48m, 610 &clk_48m,
949}; 611};
950 612
951static struct clk_sources clkset_usbhost = { 613static struct clksrc_sources clkset_usbhost = {
952 .sources = clkset_usbhost_list, 614 .sources = clkset_usbhost_list,
953 .nr_sources = ARRAY_SIZE(clkset_usbhost_list), 615 .nr_sources = ARRAY_SIZE(clkset_usbhost_list),
954}; 616};
955 617
956static struct clksrc_clk clk_usbhost = { 618static struct clksrc_clk clksrc_clks[] = {
957 .clk = { 619 {
958 .name = "usbhost", 620 .clk = {
959 .id = -1, 621 .name = "spi_bus",
960 .ctrlbit = S5PC100_CLKGATE_SCLK0_USBHOST, 622 .id = 0,
961 .enable = s5pc100_sclk0_ctrl, 623 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI0,
962 .set_parent = s5pc100_setparent_clksrc, 624 .enable = s5pc100_sclk0_ctrl,
963 .get_rate = s5pc100_getrate_clksrc, 625
964 .set_rate = s5pc100_setrate_clksrc, 626 },
965 .round_rate = s5pc100_roundrate_clksrc, 627 .sources = &clkset_spi,
966 }, 628 .reg_div = { .reg = S5PC100_CLKDIV2, .shift = 4, .size = 4, },
967 .shift = S5PC100_CLKSRC1_UHOST_SHIFT, 629 .reg_src = { .reg = S5PC100_CLKSRC1, .shift = 4, .size = 2, },
968 .mask = S5PC100_CLKSRC1_UHOST_MASK, 630 }, {
969 .sources = &clkset_usbhost, 631 .clk = {
970 .divider_shift = S5PC100_CLKDIV2_UHOST_SHIFT, 632 .name = "spi_bus",
971 .reg_divider = S5PC100_CLKDIV2, 633 .id = 1,
972 .reg_source = S5PC100_CLKSRC1, 634 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI1,
635 .enable = s5pc100_sclk0_ctrl,
636 },
637 .sources = &clkset_spi,
638 .reg_div = { .reg = S5PC100_CLKDIV2, .shift = 8, .size = 4, },
639 .reg_src = { .reg = S5PC100_CLKSRC1, .shift = 8, .size = 2, },
640 }, {
641 .clk = {
642 .name = "spi_bus",
643 .id = 2,
644 .ctrlbit = S5PC100_CLKGATE_SCLK0_SPI2,
645 .enable = s5pc100_sclk0_ctrl,
646 },
647 .sources = &clkset_spi,
648 .reg_div = { .reg = S5PC100_CLKDIV2, .shift = 12, .size = 4, },
649 .reg_src = { .reg = S5PC100_CLKSRC1, .shift = 12, .size = 2, },
650 }, {
651 .clk = {
652 .name = "uclk1",
653 .id = -1,
654 .ctrlbit = S5PC100_CLKGATE_SCLK0_UART,
655 .enable = s5pc100_sclk0_ctrl,
656 },
657 .sources = &clkset_uart,
658 .reg_div = { .reg = S5PC100_CLKDIV2, .shift = 0, .size = 3, },
659 .reg_src = { .reg = S5PC100_CLKSRC1, .shift = 0, .size = 1, },
660 }, {
661 .clk = {
662 .name = "spdif",
663 .id = -1,
664 },
665 .sources = &clkset_spdif,
666 .reg_src = { .reg = S5PC100_CLKSRC3, .shift = 24, .size = 2, },
667 }, {
668 .clk = {
669 .name = "lcd",
670 .id = -1,
671 .ctrlbit = S5PC100_CLKGATE_SCLK1_LCD,
672 .enable = s5pc100_sclk1_ctrl,
673 },
674 .sources = &clkset_lcd_fimc,
675 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 12, .size = 4, },
676 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 12, .size = 2, },
677 }, {
678 .clk = {
679 .name = "fimc",
680 .id = 0,
681 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC0,
682 .enable = s5pc100_sclk1_ctrl,
683 },
684 .sources = &clkset_lcd_fimc,
685 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 16, .size = 4, },
686 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 16, .size = 2, },
687 }, {
688 .clk = {
689 .name = "fimc",
690 .id = 1,
691 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC1,
692 .enable = s5pc100_sclk1_ctrl,
693 },
694 .sources = &clkset_lcd_fimc,
695 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 20, .size = 4, },
696 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 20, .size = 2, },
697 }, {
698 .clk = {
699 .name = "fimc",
700 .id = 2,
701 .ctrlbit = S5PC100_CLKGATE_SCLK1_FIMC2,
702 .enable = s5pc100_sclk1_ctrl,
703 },
704 .sources = &clkset_lcd_fimc,
705 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 24, .size = 4, },
706 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 24, .size = 2, },
707 }, {
708 .clk = {
709 .name = "mmc_bus",
710 .id = 0,
711 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC0,
712 .enable = s5pc100_sclk0_ctrl,
713 },
714 .sources = &clkset_mmc,
715 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 0, .size = 4, },
716 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 0, .size = 2, },
717 }, {
718 .clk = {
719 .name = "mmc_bus",
720 .id = 1,
721 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC1,
722 .enable = s5pc100_sclk0_ctrl,
723 },
724 .sources = &clkset_mmc,
725 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 4, .size = 4, },
726 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 4, .size = 2, },
727 }, {
728 .clk = {
729 .name = "mmc_bus",
730 .id = 2,
731 .ctrlbit = S5PC100_CLKGATE_SCLK0_MMC2,
732 .enable = s5pc100_sclk0_ctrl,
733 },
734 .sources = &clkset_mmc,
735 .reg_div = { .reg = S5PC100_CLKDIV3, .shift = 8, .size = 4, },
736 .reg_src = { .reg = S5PC100_CLKSRC2, .shift = 8, .size = 2, },
737 }, {
738 .clk = {
739 .name = "usbhost",
740 .id = -1,
741 .ctrlbit = S5PC100_CLKGATE_SCLK0_USBHOST,
742 .enable = s5pc100_sclk0_ctrl,
743 },
744 .sources = &clkset_usbhost,
745 .reg_div = { .reg = S5PC100_CLKDIV2, .shift = 20, .size = 4, },
746 .reg_src = { .reg = S5PC100_CLKSRC1, .shift = 20, .size = 2, },
747 }
973}; 748};
974 749
975/* Clock initialisation code */ 750/* Clock initialisation code */
@@ -981,45 +756,8 @@ static struct clksrc_clk *init_parents[] = {
981 &clk_mout_onenand, 756 &clk_mout_onenand,
982 &clk_mout_epll, 757 &clk_mout_epll,
983 &clk_mout_hpll, 758 &clk_mout_hpll,
984 &clk_spi0,
985 &clk_spi1,
986 &clk_spi2,
987 &clk_uart_uclk1,
988 &clk_audio0,
989 &clk_audio1,
990 &clk_audio2,
991 &clk_spdif,
992 &clk_lcd,
993 &clk_fimc0,
994 &clk_fimc1,
995 &clk_fimc2,
996 &clk_mmc0,
997 &clk_mmc1,
998 &clk_mmc2,
999 &clk_usbhost,
1000}; 759};
1001 760
1002static void __init_or_cpufreq s5pc100_set_clksrc(struct clksrc_clk *clk)
1003{
1004 struct clk_sources *srcs = clk->sources;
1005 u32 clksrc = __raw_readl(clk->reg_source);
1006
1007 clksrc &= clk->mask;
1008 clksrc >>= clk->shift;
1009
1010 if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) {
1011 printk(KERN_ERR "%s: bad source %d\n",
1012 clk->clk.name, clksrc);
1013 return;
1014 }
1015
1016 clk->clk.parent = srcs->sources[clksrc];
1017
1018 printk(KERN_INFO "%s: source is %s (%d), rate is %ld.%03ld MHz\n",
1019 clk->clk.name, clk->clk.parent->name, clksrc,
1020 print_mhz(clk_get_rate(&clk->clk)));
1021}
1022
1023#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) 761#define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1)
1024 762
1025void __init_or_cpufreq s5pc100_setup_clocks(void) 763void __init_or_cpufreq s5pc100_setup_clocks(void)
@@ -1083,17 +821,25 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
1083 clk_f.rate = armclk; 821 clk_f.rate = armclk;
1084 822
1085 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++) 823 for (ptr = 0; ptr < ARRAY_SIZE(init_parents); ptr++)
1086 s5pc100_set_clksrc(init_parents[ptr]); 824 s3c_set_clksrc(init_parents[ptr], true);
825
826 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_audio); ptr++)
827 s3c_set_clksrc(clksrc_audio + ptr, true);
828
829 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_clks); ptr++)
830 s3c_set_clksrc(clksrc_clks + ptr, true);
1087} 831}
1088 832
1089static struct clk *clks[] __initdata = { 833static struct clk *clks[] __initdata = {
1090 &clk_ext_xtal_mux, 834 &clk_ext_xtal_mux,
1091 &clk_mout_apll.clk,
1092 &clk_dout_apll, 835 &clk_dout_apll,
1093 &clk_dout_d0_bus, 836 &clk_dout_d0_bus,
1094 &clk_dout_pclkd0, 837 &clk_dout_pclkd0,
1095 &clk_dout_apll2, 838 &clk_dout_apll2,
839 &clk_mout_apll.clk,
1096 &clk_mout_mpll.clk, 840 &clk_mout_mpll.clk,
841 &clk_mout_epll.clk,
842 &clk_mout_hpll.clk,
1097 &clk_mout_am.clk, 843 &clk_mout_am.clk,
1098 &clk_dout_d1_bus, 844 &clk_dout_d1_bus,
1099 &clk_mout_onenand.clk, 845 &clk_mout_onenand.clk,
@@ -1101,29 +847,12 @@ static struct clk *clks[] __initdata = {
1101 &clk_dout_mpll2, 847 &clk_dout_mpll2,
1102 &clk_dout_cam, 848 &clk_dout_cam,
1103 &clk_dout_mpll, 849 &clk_dout_mpll,
1104 &clk_mout_epll.clk,
1105 &clk_fout_epll, 850 &clk_fout_epll,
1106 &clk_iis_cd0, 851 &clk_iis_cd0,
1107 &clk_iis_cd1, 852 &clk_iis_cd1,
1108 &clk_iis_cd2, 853 &clk_iis_cd2,
1109 &clk_pcm_cd0, 854 &clk_pcm_cd0,
1110 &clk_pcm_cd1, 855 &clk_pcm_cd1,
1111 &clk_spi0.clk,
1112 &clk_spi1.clk,
1113 &clk_spi2.clk,
1114 &clk_uart_uclk1.clk,
1115 &clk_audio0.clk,
1116 &clk_audio1.clk,
1117 &clk_audio2.clk,
1118 &clk_spdif.clk,
1119 &clk_lcd.clk,
1120 &clk_fimc0.clk,
1121 &clk_fimc1.clk,
1122 &clk_fimc2.clk,
1123 &clk_mmc0.clk,
1124 &clk_mmc1.clk,
1125 &clk_mmc2.clk,
1126 &clk_usbhost.clk,
1127 &clk_arm, 856 &clk_arm,
1128}; 857};
1129 858
@@ -1141,4 +870,7 @@ void __init s5pc100_register_clocks(void)
1141 clkp->name, ret); 870 clkp->name, ret);
1142 } 871 }
1143 } 872 }
873
874 s3c_register_clksrc(clksrc_audio, ARRAY_SIZE(clksrc_audio));
875 s3c_register_clksrc(clksrc_clks, ARRAY_SIZE(clksrc_clks));
1144} 876}
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 486a0d6301e7..d552c65fa1b0 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -7,11 +7,240 @@
7config PLAT_SAMSUNG 7config PLAT_SAMSUNG
8 bool 8 bool
9 depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX 9 depends on ARCH_S3C2410 || ARCH_S3C24A0 || ARCH_S3C64XX || ARCH_S5PC1XX
10 select NO_IOPORT
10 default y 11 default y
11 help 12 help
12 Base platform code for all Samsung SoC based systems 13 Base platform code for all Samsung SoC based systems
13 14
14if PLAT_SAMSUNG 15if PLAT_SAMSUNG
15 16
17# boot configurations
18
19comment "Boot options"
20
21config S3C_BOOT_WATCHDOG
22 bool "S3C Initialisation watchdog"
23 depends on S3C2410_WATCHDOG
24 help
25 Say y to enable the watchdog during the kernel decompression
26 stage. If the kernel fails to uncompress, then the watchdog
27 will trigger a reset and the system should restart.
28
29config S3C_BOOT_ERROR_RESET
30 bool "S3C Reboot on decompression error"
31 help
32 Say y here to use the watchdog to reset the system if the
33 kernel decompressor detects an error during decompression.
34
35config S3C_BOOT_UART_FORCE_FIFO
36 bool "Force UART FIFO on during boot process"
37 default y
38 help
39 Say Y here to force the UART FIFOs on during the kernel
40 uncompressor
41
42
43config S3C_LOWLEVEL_UART_PORT
44 int "S3C UART to use for low-level messages"
45 default 0
46 help
47 Choice of which UART port to use for the low-level messages,
48 such as the `Uncompressing...` at start time. The value of
49 this configuration should be between zero and two. The port
50 must have been initialised by the boot-loader before use.
51
52# clock options
53
54config SAMSUNG_CLKSRC
55 bool
56 help
57 Select the clock code for the clksrc implementation
58 used by newer systems such as the S3C64XX.
59
60# options for IRQ support
61
62config SAMSUNG_IRQ_VIC_TIMER
63 bool
64 help
65 Internal configuration to build the VIC timer interrupt code.
66
67config SAMSUNG_IRQ_UART
68 bool
69 help
70 Internal configuration to build the IRQ UART demux code.
71
72# options for gpio configuration support
73
74config SAMSUNG_GPIOLIB_4BIT
75 bool
76 help
77 GPIOlib file contains the 4 bit modification functions for gpio
78 configuration. GPIOlib shall be compiled only for S3C64XX and S5P
79 series of processors.
80
81config S3C_GPIO_CFG_S3C24XX
82 bool
83 help
84 Internal configuration to enable S3C24XX style GPIO configuration
85 functions.
86
87config S3C_GPIO_CFG_S3C64XX
88 bool
89 help
90 Internal configuration to enable S3C64XX style GPIO configuration
91 functions.
92
93config S5P_GPIO_CFG_S5PC1XX
94 bool
95 help
96 Internal configuration to enable S5PC1XX style GPIO configuration
97 functions.
98
99config S3C_GPIO_PULL_UPDOWN
100 bool
101 help
102 Internal configuration to enable the correct GPIO pull helper
103
104config S3C_GPIO_PULL_DOWN
105 bool
106 help
107 Internal configuration to enable the correct GPIO pull helper
108
109config S3C_GPIO_PULL_UP
110 bool
111 help
112 Internal configuration to enable the correct GPIO pull helper
113
114config SAMSUNG_GPIO_EXTRA
115 int "Number of additional GPIO pins"
116 default 0
117 help
118 Use additional GPIO space in addition to the GPIO's the SOC
119 provides. This allows expanding the GPIO space for use with
120 GPIO expanders.
121
122config S3C_GPIO_SPACE
123 int "Space between gpio banks"
124 default 0
125 help
126 Add a number of spare GPIO entries between each bank for debugging
127 purposes. This allows any problems where an counter overflows from
128 one bank to another to be caught, at the expense of using a little
129 more memory.
130
131config S3C_GPIO_TRACK
132 bool
133 help
134 Internal configuration option to enable the s3c specific gpio
135 chip tracking if the platform requires it.
136
137# ADC driver
138
139config S3C_ADC
140 bool "ADC common driver support"
141 help
142 Core support for the ADC block found in the Samsung SoC systems
143 for drivers such as the touchscreen and hwmon to use to share
144 this resource.
145
146# device definitions to compile in
147
148config S3C_DEV_HSMMC
149 bool
150 help
151 Compile in platform device definitions for HSMMC code
152
153config S3C_DEV_HSMMC1
154 bool
155 help
156 Compile in platform device definitions for HSMMC channel 1
157
158config S3C_DEV_HSMMC2
159 bool
160 help
161 Compile in platform device definitions for HSMMC channel 2
162
163config S3C_DEV_I2C1
164 bool
165 help
166 Compile in platform device definitions for I2C channel 1
167
168config S3C_DEV_FB
169 bool
170 help
171 Compile in platform device definition for framebuffer
172
173config S3C_DEV_USB_HOST
174 bool
175 help
176 Compile in platform device definition for USB host.
177
178config S3C_DEV_USB_HSOTG
179 bool
180 help
181 Compile in platform device definition for USB high-speed OtG
182
183config S3C_DEV_NAND
184 bool
185 help
186 Compile in platform device definition for NAND controller
187
188config S3C64XX_DEV_SPI
189 bool
190 help
191 Compile in platform device definitions for S3C64XX's type
192 SPI controllers.
193
194# DMA
195
196config S3C_DMA
197 bool
198 help
199 Internal configuration for S3C DMA core
200
201comment "Power management"
202
203config SAMSUNG_PM_DEBUG
204 bool "S3C2410 PM Suspend debug"
205 depends on PM
206 help
207 Say Y here if you want verbose debugging from the PM Suspend and
208 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
209 for more information.
210
211config S3C_PM_DEBUG_LED_SMDK
212 bool "SMDK LED suspend/resume debugging"
213 depends on PM && (MACH_SMDK6410)
214 help
215 Say Y here to enable the use of the SMDK LEDs on the baseboard
216 for debugging of the state of the suspend and resume process.
217
218 Note, this currently only works for S3C64XX based SMDK boards.
219
220config SAMSUNG_PM_CHECK
221 bool "S3C2410 PM Suspend Memory CRC"
222 depends on PM && CRC32
223 help
224 Enable the PM code's memory area checksum over sleep. This option
225 will generate CRCs of all blocks of memory, and store them before
226 going to sleep. The blocks are then checked on resume for any
227 errors.
228
229 Note, this can take several seconds depending on memory size
230 and CPU speed.
231
232 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
233
234config SAMSUNG_PM_CHECK_CHUNKSIZE
235 int "S3C2410 PM Suspend CRC Chunksize (KiB)"
236 depends on PM && SAMSUNG_PM_CHECK
237 default 64
238 help
239 Set the chunksize in Kilobytes of the CRC for checking memory
240 corruption over suspend and resume. A smaller value will mean that
241 the CRC data block will take more memory, but wil identify any
242 faults with better precision.
243
244 See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt>
16 245
17endif 246endif
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 4478b9f7dc34..22c89d08f6e5 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -9,3 +9,48 @@ obj-m :=
9obj-n := dummy.o 9obj-n := dummy.o
10obj- := 10obj- :=
11 11
12# Objects we always build independent of SoC choice
13
14obj-y += init.o
15obj-y += time.o
16obj-y += clock.o
17obj-y += pwm-clock.o
18obj-y += gpio.o
19obj-y += gpio-config.o
20
21obj-$(CONFIG_SAMSUNG_GPIOLIB_4BIT) += gpiolib.o
22obj-$(CONFIG_SAMSUNG_CLKSRC) += clock-clksrc.o
23
24obj-$(CONFIG_SAMSUNG_IRQ_UART) += irq-uart.o
25obj-$(CONFIG_SAMSUNG_IRQ_VIC_TIMER) += irq-vic-timer.o
26
27# ADC
28
29obj-$(CONFIG_S3C_ADC) += adc.o
30
31# devices
32
33obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o
34obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o
35obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o
36obj-y += dev-i2c0.o
37obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o
38obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o
39obj-y += dev-uart.o
40obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o
41obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
42obj-$(CONFIG_S3C_DEV_NAND) += dev-nand.o
43
44# DMA support
45
46obj-$(CONFIG_S3C_DMA) += dma.o
47
48# PM support
49
50obj-$(CONFIG_PM) += pm.o
51obj-$(CONFIG_PM) += pm-gpio.o
52obj-$(CONFIG_SAMSUNG_PM_CHECK) += pm-check.o
53
54# PWM support
55
56obj-$(CONFIG_HAVE_PWM) += pwm.o
diff --git a/arch/arm/plat-s3c24xx/adc.c b/arch/arm/plat-samsung/adc.c
index ce47627f3368..0b5833b9ac5b 100644
--- a/arch/arm/plat-s3c24xx/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -1,10 +1,10 @@
1/* arch/arm/plat-s3c24xx/adc.c 1/* arch/arm/plat-samsung/adc.c
2 * 2 *
3 * Copyright (c) 2008 Simtec Electronics 3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org> 5 * Ben Dooks <ben@simtec.co.uk>, <ben-linux@fluff.org>
6 * 6 *
7 * S3C24XX ADC device core 7 * Samsung ADC device core
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
@@ -37,6 +37,11 @@
37 * action is required. 37 * action is required.
38 */ 38 */
39 39
40enum s3c_cpu_type {
41 TYPE_S3C24XX,
42 TYPE_S3C64XX
43};
44
40struct s3c_adc_client { 45struct s3c_adc_client {
41 struct platform_device *pdev; 46 struct platform_device *pdev;
42 struct list_head pend; 47 struct list_head pend;
@@ -257,12 +262,13 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
257{ 262{
258 struct adc_device *adc = pw; 263 struct adc_device *adc = pw;
259 struct s3c_adc_client *client = adc->cur; 264 struct s3c_adc_client *client = adc->cur;
265 enum s3c_cpu_type cpu = platform_get_device_id(adc->pdev)->driver_data;
260 unsigned long flags; 266 unsigned long flags;
261 unsigned data0, data1; 267 unsigned data0, data1;
262 268
263 if (!client) { 269 if (!client) {
264 dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__); 270 dev_warn(&adc->pdev->dev, "%s: no adc pending\n", __func__);
265 return IRQ_HANDLED; 271 goto exit;
266 } 272 }
267 273
268 data0 = readl(adc->regs + S3C2410_ADCDAT0); 274 data0 = readl(adc->regs + S3C2410_ADCDAT0);
@@ -271,9 +277,17 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
271 277
272 client->nr_samples--; 278 client->nr_samples--;
273 279
280 if (cpu == TYPE_S3C64XX) {
281 /* S3C64XX ADC resolution is 12-bit */
282 data0 &= 0xfff;
283 data1 &= 0xfff;
284 } else {
285 data0 &= 0x3ff;
286 data1 &= 0x3ff;
287 }
288
274 if (client->convert_cb) 289 if (client->convert_cb)
275 (client->convert_cb)(client, data0 & 0x3ff, data1 & 0x3ff, 290 (client->convert_cb)(client, data0, data1, &client->nr_samples);
276 &client->nr_samples);
277 291
278 if (client->nr_samples > 0) { 292 if (client->nr_samples > 0) {
279 /* fire another conversion for this */ 293 /* fire another conversion for this */
@@ -289,6 +303,11 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
289 local_irq_restore(flags); 303 local_irq_restore(flags);
290 } 304 }
291 305
306exit:
307 if (cpu == TYPE_S3C64XX) {
308 /* Clear ADC interrupt */
309 writel(0, adc->regs + S3C64XX_ADCCLRINT);
310 }
292 return IRQ_HANDLED; 311 return IRQ_HANDLED;
293} 312}
294 313
@@ -298,6 +317,7 @@ static int s3c_adc_probe(struct platform_device *pdev)
298 struct adc_device *adc; 317 struct adc_device *adc;
299 struct resource *regs; 318 struct resource *regs;
300 int ret; 319 int ret;
320 unsigned tmp;
301 321
302 adc = kzalloc(sizeof(struct adc_device), GFP_KERNEL); 322 adc = kzalloc(sizeof(struct adc_device), GFP_KERNEL);
303 if (adc == NULL) { 323 if (adc == NULL) {
@@ -344,8 +364,12 @@ static int s3c_adc_probe(struct platform_device *pdev)
344 364
345 clk_enable(adc->clk); 365 clk_enable(adc->clk);
346 366
347 writel(adc->prescale | S3C2410_ADCCON_PRSCEN, 367 tmp = adc->prescale | S3C2410_ADCCON_PRSCEN;
348 adc->regs + S3C2410_ADCCON); 368 if (platform_get_device_id(pdev)->driver_data == TYPE_S3C64XX) {
369 /* Enable 12-bit ADC resolution */
370 tmp |= S3C64XX_ADCCON_RESSEL;
371 }
372 writel(tmp, adc->regs + S3C2410_ADCCON);
349 373
350 dev_info(dev, "attached adc driver\n"); 374 dev_info(dev, "attached adc driver\n");
351 375
@@ -388,6 +412,7 @@ static int s3c_adc_suspend(struct platform_device *pdev, pm_message_t state)
388 con |= S3C2410_ADCCON_STDBM; 412 con |= S3C2410_ADCCON_STDBM;
389 writel(con, adc->regs + S3C2410_ADCCON); 413 writel(con, adc->regs + S3C2410_ADCCON);
390 414
415 disable_irq(adc->irq);
391 clk_disable(adc->clk); 416 clk_disable(adc->clk);
392 417
393 return 0; 418 return 0;
@@ -398,6 +423,7 @@ static int s3c_adc_resume(struct platform_device *pdev)
398 struct adc_device *adc = platform_get_drvdata(pdev); 423 struct adc_device *adc = platform_get_drvdata(pdev);
399 424
400 clk_enable(adc->clk); 425 clk_enable(adc->clk);
426 enable_irq(adc->irq);
401 427
402 writel(adc->prescale | S3C2410_ADCCON_PRSCEN, 428 writel(adc->prescale | S3C2410_ADCCON_PRSCEN,
403 adc->regs + S3C2410_ADCCON); 429 adc->regs + S3C2410_ADCCON);
@@ -410,9 +436,22 @@ static int s3c_adc_resume(struct platform_device *pdev)
410#define s3c_adc_resume NULL 436#define s3c_adc_resume NULL
411#endif 437#endif
412 438
439static struct platform_device_id s3c_adc_driver_ids[] = {
440 {
441 .name = "s3c24xx-adc",
442 .driver_data = TYPE_S3C24XX,
443 }, {
444 .name = "s3c64xx-adc",
445 .driver_data = TYPE_S3C64XX,
446 },
447 { }
448};
449MODULE_DEVICE_TABLE(platform, s3c_adc_driver_ids);
450
413static struct platform_driver s3c_adc_driver = { 451static struct platform_driver s3c_adc_driver = {
452 .id_table = s3c_adc_driver_ids,
414 .driver = { 453 .driver = {
415 .name = "s3c24xx-adc", 454 .name = "s3c-adc",
416 .owner = THIS_MODULE, 455 .owner = THIS_MODULE,
417 }, 456 },
418 .probe = s3c_adc_probe, 457 .probe = s3c_adc_probe,
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
new file mode 100644
index 000000000000..ae8b8507663f
--- /dev/null
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -0,0 +1,212 @@
1/* linux/arch/arm/plat-samsung/clock-clksrc.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10*/
11
12#include <linux/init.h>
13#include <linux/module.h>
14#include <linux/kernel.h>
15#include <linux/list.h>
16#include <linux/errno.h>
17#include <linux/err.h>
18#include <linux/clk.h>
19#include <linux/sysdev.h>
20#include <linux/io.h>
21
22#include <plat/clock.h>
23#include <plat/clock-clksrc.h>
24#include <plat/cpu-freq.h>
25
26static inline struct clksrc_clk *to_clksrc(struct clk *clk)
27{
28 return container_of(clk, struct clksrc_clk, clk);
29}
30
31static inline u32 bit_mask(u32 shift, u32 nr_bits)
32{
33 u32 mask = 0xffffffff >> (32 - nr_bits);
34
35 return mask << shift;
36}
37
38static unsigned long s3c_getrate_clksrc(struct clk *clk)
39{
40 struct clksrc_clk *sclk = to_clksrc(clk);
41 unsigned long rate = clk_get_rate(clk->parent);
42 u32 clkdiv = __raw_readl(sclk->reg_div.reg);
43 u32 mask = bit_mask(sclk->reg_div.shift, sclk->reg_div.size);
44
45 clkdiv &= mask;
46 clkdiv >>= sclk->reg_div.shift;
47 clkdiv++;
48
49 rate /= clkdiv;
50 return rate;
51}
52
53static int s3c_setrate_clksrc(struct clk *clk, unsigned long rate)
54{
55 struct clksrc_clk *sclk = to_clksrc(clk);
56 void __iomem *reg = sclk->reg_div.reg;
57 unsigned int div;
58 u32 mask = bit_mask(sclk->reg_div.shift, sclk->reg_div.size);
59 u32 val;
60
61 rate = clk_round_rate(clk, rate);
62 div = clk_get_rate(clk->parent) / rate;
63 if (div > (1 << sclk->reg_div.size))
64 return -EINVAL;
65
66 val = __raw_readl(reg);
67 val &= ~mask;
68 val |= (div - 1) << sclk->reg_div.shift;
69 __raw_writel(val, reg);
70
71 return 0;
72}
73
74static int s3c_setparent_clksrc(struct clk *clk, struct clk *parent)
75{
76 struct clksrc_clk *sclk = to_clksrc(clk);
77 struct clksrc_sources *srcs = sclk->sources;
78 u32 clksrc = __raw_readl(sclk->reg_src.reg);
79 u32 mask = bit_mask(sclk->reg_src.shift, sclk->reg_src.size);
80 int src_nr = -1;
81 int ptr;
82
83 for (ptr = 0; ptr < srcs->nr_sources; ptr++)
84 if (srcs->sources[ptr] == parent) {
85 src_nr = ptr;
86 break;
87 }
88
89 if (src_nr >= 0) {
90 clk->parent = parent;
91
92 clksrc &= ~mask;
93 clksrc |= src_nr << sclk->reg_src.shift;
94
95 __raw_writel(clksrc, sclk->reg_src.reg);
96 return 0;
97 }
98
99 return -EINVAL;
100}
101
102static unsigned long s3c_roundrate_clksrc(struct clk *clk,
103 unsigned long rate)
104{
105 struct clksrc_clk *sclk = to_clksrc(clk);
106 unsigned long parent_rate = clk_get_rate(clk->parent);
107 int max_div = 1 << sclk->reg_div.size;
108 int div;
109
110 if (rate >= parent_rate)
111 rate = parent_rate;
112 else {
113 div = parent_rate / rate;
114 if (parent_rate % rate)
115 div++;
116
117 if (div == 0)
118 div = 1;
119 if (div > max_div)
120 div = max_div;
121
122 rate = parent_rate / div;
123 }
124
125 return rate;
126}
127
128/* Clock initialisation code */
129
130void __init_or_cpufreq s3c_set_clksrc(struct clksrc_clk *clk, bool announce)
131{
132 struct clksrc_sources *srcs = clk->sources;
133 u32 mask = bit_mask(clk->reg_src.shift, clk->reg_src.size);
134 u32 clksrc;
135
136 if (!clk->reg_src.reg) {
137 if (!clk->clk.parent)
138 printk(KERN_ERR "%s: no parent clock specified\n",
139 clk->clk.name);
140 return;
141 }
142
143 clksrc = __raw_readl(clk->reg_src.reg);
144 clksrc &= mask;
145 clksrc >>= clk->reg_src.shift;
146
147 if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) {
148 printk(KERN_ERR "%s: bad source %d\n",
149 clk->clk.name, clksrc);
150 return;
151 }
152
153 clk->clk.parent = srcs->sources[clksrc];
154
155 if (announce)
156 printk(KERN_INFO "%s: source is %s (%d), rate is %ld\n",
157 clk->clk.name, clk->clk.parent->name, clksrc,
158 clk_get_rate(&clk->clk));
159}
160
161static struct clk_ops clksrc_ops = {
162 .set_parent = s3c_setparent_clksrc,
163 .get_rate = s3c_getrate_clksrc,
164 .set_rate = s3c_setrate_clksrc,
165 .round_rate = s3c_roundrate_clksrc,
166};
167
168static struct clk_ops clksrc_ops_nodiv = {
169 .set_parent = s3c_setparent_clksrc,
170};
171
172static struct clk_ops clksrc_ops_nosrc = {
173 .get_rate = s3c_getrate_clksrc,
174 .set_rate = s3c_setrate_clksrc,
175 .round_rate = s3c_roundrate_clksrc,
176};
177
178void __init s3c_register_clksrc(struct clksrc_clk *clksrc, int size)
179{
180 int ret;
181
182 for (; size > 0; size--, clksrc++) {
183 if (!clksrc->reg_div.reg && !clksrc->reg_src.reg)
184 printk(KERN_ERR "%s: clock %s has no registers set\n",
185 __func__, clksrc->clk.name);
186
187 /* fill in the default functions */
188
189 if (!clksrc->clk.ops) {
190 if (!clksrc->reg_div.reg)
191 clksrc->clk.ops = &clksrc_ops_nodiv;
192 else if (!clksrc->reg_src.reg)
193 clksrc->clk.ops = &clksrc_ops_nosrc;
194 else
195 clksrc->clk.ops = &clksrc_ops;
196 }
197
198 /* setup the clocksource, but do not announce it
199 * as it may be re-set by the setup routines
200 * called after the rest of the clocks have been
201 * registered
202 */
203 s3c_set_clksrc(clksrc, false);
204
205 ret = s3c24xx_register_clock(&clksrc->clk);
206
207 if (ret < 0) {
208 printk(KERN_ERR "%s: failed to register %s (%d)\n",
209 __func__, clksrc->clk.name, ret);
210 }
211 }
212}
diff --git a/arch/arm/plat-s3c/clock.c b/arch/arm/plat-samsung/clock.c
index 619cfa82dcab..1b25c9d8c403 100644
--- a/arch/arm/plat-s3c/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -150,8 +150,8 @@ unsigned long clk_get_rate(struct clk *clk)
150 if (clk->rate != 0) 150 if (clk->rate != 0)
151 return clk->rate; 151 return clk->rate;
152 152
153 if (clk->get_rate != NULL) 153 if (clk->ops != NULL && clk->ops->get_rate != NULL)
154 return (clk->get_rate)(clk); 154 return (clk->ops->get_rate)(clk);
155 155
156 if (clk->parent != NULL) 156 if (clk->parent != NULL)
157 return clk_get_rate(clk->parent); 157 return clk_get_rate(clk->parent);
@@ -161,8 +161,8 @@ unsigned long clk_get_rate(struct clk *clk)
161 161
162long clk_round_rate(struct clk *clk, unsigned long rate) 162long clk_round_rate(struct clk *clk, unsigned long rate)
163{ 163{
164 if (!IS_ERR(clk) && clk->round_rate) 164 if (!IS_ERR(clk) && clk->ops && clk->ops->round_rate)
165 return (clk->round_rate)(clk, rate); 165 return (clk->ops->round_rate)(clk, rate);
166 166
167 return rate; 167 return rate;
168} 168}
@@ -178,13 +178,14 @@ int clk_set_rate(struct clk *clk, unsigned long rate)
178 * the clock may have been made this way by choice. 178 * the clock may have been made this way by choice.
179 */ 179 */
180 180
181 WARN_ON(clk->set_rate == NULL); 181 WARN_ON(clk->ops == NULL);
182 WARN_ON(clk->ops && clk->ops->set_rate == NULL);
182 183
183 if (clk->set_rate == NULL) 184 if (clk->ops == NULL || clk->ops->set_rate == NULL)
184 return -EINVAL; 185 return -EINVAL;
185 186
186 spin_lock(&clocks_lock); 187 spin_lock(&clocks_lock);
187 ret = (clk->set_rate)(clk, rate); 188 ret = (clk->ops->set_rate)(clk, rate);
188 spin_unlock(&clocks_lock); 189 spin_unlock(&clocks_lock);
189 190
190 return ret; 191 return ret;
@@ -204,8 +205,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
204 205
205 spin_lock(&clocks_lock); 206 spin_lock(&clocks_lock);
206 207
207 if (clk->set_parent) 208 if (clk->ops && clk->ops->set_parent)
208 ret = (clk->set_parent)(clk, parent); 209 ret = (clk->ops->set_parent)(clk, parent);
209 210
210 spin_unlock(&clocks_lock); 211 spin_unlock(&clocks_lock);
211 212
@@ -224,12 +225,16 @@ EXPORT_SYMBOL(clk_set_parent);
224 225
225/* base clocks */ 226/* base clocks */
226 227
227static int clk_default_setrate(struct clk *clk, unsigned long rate) 228int clk_default_setrate(struct clk *clk, unsigned long rate)
228{ 229{
229 clk->rate = rate; 230 clk->rate = rate;
230 return 0; 231 return 0;
231} 232}
232 233
234struct clk_ops clk_ops_def_setrate = {
235 .set_rate = clk_default_setrate,
236};
237
233struct clk clk_xtal = { 238struct clk clk_xtal = {
234 .name = "xtal", 239 .name = "xtal",
235 .id = -1, 240 .id = -1,
@@ -251,7 +256,7 @@ struct clk clk_epll = {
251struct clk clk_mpll = { 256struct clk clk_mpll = {
252 .name = "mpll", 257 .name = "mpll",
253 .id = -1, 258 .id = -1,
254 .set_rate = clk_default_setrate, 259 .ops = &clk_ops_def_setrate,
255}; 260};
256 261
257struct clk clk_upll = { 262struct clk clk_upll = {
@@ -267,7 +272,6 @@ struct clk clk_f = {
267 .rate = 0, 272 .rate = 0,
268 .parent = &clk_mpll, 273 .parent = &clk_mpll,
269 .ctrlbit = 0, 274 .ctrlbit = 0,
270 .set_rate = clk_default_setrate,
271}; 275};
272 276
273struct clk clk_h = { 277struct clk clk_h = {
@@ -276,7 +280,7 @@ struct clk clk_h = {
276 .rate = 0, 280 .rate = 0,
277 .parent = NULL, 281 .parent = NULL,
278 .ctrlbit = 0, 282 .ctrlbit = 0,
279 .set_rate = clk_default_setrate, 283 .ops = &clk_ops_def_setrate,
280}; 284};
281 285
282struct clk clk_p = { 286struct clk clk_p = {
@@ -285,7 +289,7 @@ struct clk clk_p = {
285 .rate = 0, 289 .rate = 0,
286 .parent = NULL, 290 .parent = NULL,
287 .ctrlbit = 0, 291 .ctrlbit = 0,
288 .set_rate = clk_default_setrate, 292 .ops = &clk_ops_def_setrate,
289}; 293};
290 294
291struct clk clk_usb_bus = { 295struct clk clk_usb_bus = {
@@ -296,7 +300,6 @@ struct clk clk_usb_bus = {
296}; 300};
297 301
298 302
299
300struct clk s3c24xx_uclk = { 303struct clk s3c24xx_uclk = {
301 .name = "uclk", 304 .name = "uclk",
302 .id = -1, 305 .id = -1,
@@ -304,6 +307,12 @@ struct clk s3c24xx_uclk = {
304 307
305/* initialise the clock system */ 308/* initialise the clock system */
306 309
310/**
311 * s3c24xx_register_clock() - register a clock
312 * @clk: The clock to register
313 *
314 * Add the specified clock to the list of clocks known by the system.
315 */
307int s3c24xx_register_clock(struct clk *clk) 316int s3c24xx_register_clock(struct clk *clk)
308{ 317{
309 if (clk->enable == NULL) 318 if (clk->enable == NULL)
@@ -321,18 +330,52 @@ int s3c24xx_register_clock(struct clk *clk)
321 return 0; 330 return 0;
322} 331}
323 332
333/**
334 * s3c24xx_register_clocks() - register an array of clock pointers
335 * @clks: Pointer to an array of struct clk pointers
336 * @nr_clks: The number of clocks in the @clks array.
337 *
338 * Call s3c24xx_register_clock() for all the clock pointers contained
339 * in the @clks list. Returns the number of failures.
340 */
324int s3c24xx_register_clocks(struct clk **clks, int nr_clks) 341int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
325{ 342{
326 int fails = 0; 343 int fails = 0;
327 344
328 for (; nr_clks > 0; nr_clks--, clks++) { 345 for (; nr_clks > 0; nr_clks--, clks++) {
329 if (s3c24xx_register_clock(*clks) < 0) 346 if (s3c24xx_register_clock(*clks) < 0) {
347 struct clk *clk = *clks;
348 printk(KERN_ERR "%s: failed to register %p: %s\n",
349 __func__, clk, clk->name);
330 fails++; 350 fails++;
351 }
331 } 352 }
332 353
333 return fails; 354 return fails;
334} 355}
335 356
357/**
358 * s3c_register_clocks() - register an array of clocks
359 * @clkp: Pointer to the first clock in the array.
360 * @nr_clks: Number of clocks to register.
361 *
362 * Call s3c24xx_register_clock() on the @clkp array given, printing an
363 * error if it fails to register the clock (unlikely).
364 */
365void __init s3c_register_clocks(struct clk *clkp, int nr_clks)
366{
367 int ret;
368
369 for (; nr_clks > 0; nr_clks--, clkp++) {
370 ret = s3c24xx_register_clock(clkp);
371
372 if (ret < 0) {
373 printk(KERN_ERR "Failed to register clock %s (%d)\n",
374 clkp->name, ret);
375 }
376 }
377}
378
336/* initalise all the clocks */ 379/* initalise all the clocks */
337 380
338int __init s3c24xx_register_baseclocks(unsigned long xtal) 381int __init s3c24xx_register_baseclocks(unsigned long xtal)
diff --git a/arch/arm/plat-s3c/dev-fb.c b/arch/arm/plat-samsung/dev-fb.c
index a90198fc4b0f..a90198fc4b0f 100644
--- a/arch/arm/plat-s3c/dev-fb.c
+++ b/arch/arm/plat-samsung/dev-fb.c
diff --git a/arch/arm/plat-s3c/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
index 4c05b39810e2..4c05b39810e2 100644
--- a/arch/arm/plat-s3c/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
diff --git a/arch/arm/plat-s3c/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
index e49bc4cd0ee6..e49bc4cd0ee6 100644
--- a/arch/arm/plat-s3c/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
diff --git a/arch/arm/plat-s3c/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
index 824580bc0e06..824580bc0e06 100644
--- a/arch/arm/plat-s3c/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-samsung/dev-i2c0.c
index 4c761529b949..4c761529b949 100644
--- a/arch/arm/plat-s3c/dev-i2c0.c
+++ b/arch/arm/plat-samsung/dev-i2c0.c
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-samsung/dev-i2c1.c
index d44f79110506..d44f79110506 100644
--- a/arch/arm/plat-s3c/dev-i2c1.c
+++ b/arch/arm/plat-samsung/dev-i2c1.c
diff --git a/arch/arm/plat-s3c/dev-nand.c b/arch/arm/plat-samsung/dev-nand.c
index a52fb6cf618f..a52fb6cf618f 100644
--- a/arch/arm/plat-s3c/dev-nand.c
+++ b/arch/arm/plat-samsung/dev-nand.c
diff --git a/arch/arm/plat-samsung/dev-uart.c b/arch/arm/plat-samsung/dev-uart.c
new file mode 100644
index 000000000000..3776cd952450
--- /dev/null
+++ b/arch/arm/plat-samsung/dev-uart.c
@@ -0,0 +1,44 @@
1/* linux/arch/arm/plat-samsung/dev-uart.c
2 * originally from arch/arm/plat-s3c24xx/devs.c
3 *x
4 * Copyright (c) 2004 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Base S3C24XX platform device definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13*/
14
15#include <linux/kernel.h>
16#include <linux/platform_device.h>
17
18/* uart devices */
19
20static struct platform_device s3c24xx_uart_device0 = {
21 .id = 0,
22};
23
24static struct platform_device s3c24xx_uart_device1 = {
25 .id = 1,
26};
27
28static struct platform_device s3c24xx_uart_device2 = {
29 .id = 2,
30};
31
32static struct platform_device s3c24xx_uart_device3 = {
33 .id = 3,
34};
35
36struct platform_device *s3c24xx_uart_src[4] = {
37 &s3c24xx_uart_device0,
38 &s3c24xx_uart_device1,
39 &s3c24xx_uart_device2,
40 &s3c24xx_uart_device3,
41};
42
43struct platform_device *s3c24xx_uart_devs[4] = {
44};
diff --git a/arch/arm/plat-s3c/dev-usb-hsotg.c b/arch/arm/plat-samsung/dev-usb-hsotg.c
index e2f604b51c86..33a844ab6917 100644
--- a/arch/arm/plat-s3c/dev-usb-hsotg.c
+++ b/arch/arm/plat-samsung/dev-usb-hsotg.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/dma-mapping.h>
17 18
18#include <mach/irqs.h> 19#include <mach/irqs.h>
19#include <mach/map.h> 20#include <mach/map.h>
@@ -33,9 +34,15 @@ static struct resource s3c_usb_hsotg_resources[] = {
33 }, 34 },
34}; 35};
35 36
37static u64 s3c_hsotg_dmamask = DMA_BIT_MASK(32);
38
36struct platform_device s3c_device_usb_hsotg = { 39struct platform_device s3c_device_usb_hsotg = {
37 .name = "s3c-hsotg", 40 .name = "s3c-hsotg",
38 .id = -1, 41 .id = -1,
39 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources), 42 .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources),
40 .resource = s3c_usb_hsotg_resources, 43 .resource = s3c_usb_hsotg_resources,
44 .dev = {
45 .dma_mask = &s3c_hsotg_dmamask,
46 .coherent_dma_mask = DMA_BIT_MASK(32),
47 },
41}; 48};
diff --git a/arch/arm/plat-s3c/dev-usb.c b/arch/arm/plat-samsung/dev-usb.c
index 2ee85abed6d9..88165657fa53 100644
--- a/arch/arm/plat-s3c/dev-usb.c
+++ b/arch/arm/plat-samsung/dev-usb.c
@@ -19,7 +19,7 @@
19#include <mach/map.h> 19#include <mach/map.h>
20 20
21#include <plat/devs.h> 21#include <plat/devs.h>
22 22#include <plat/usb-control.h>
23 23
24static struct resource s3c_usb_resource[] = { 24static struct resource s3c_usb_resource[] = {
25 [0] = { 25 [0] = {
@@ -36,7 +36,7 @@ static struct resource s3c_usb_resource[] = {
36 36
37static u64 s3c_device_usb_dmamask = 0xffffffffUL; 37static u64 s3c_device_usb_dmamask = 0xffffffffUL;
38 38
39struct platform_device s3c_device_usb = { 39struct platform_device s3c_device_ohci = {
40 .name = "s3c2410-ohci", 40 .name = "s3c2410-ohci",
41 .id = -1, 41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_resource), 42 .num_resources = ARRAY_SIZE(s3c_usb_resource),
@@ -47,4 +47,23 @@ struct platform_device s3c_device_usb = {
47 } 47 }
48}; 48};
49 49
50EXPORT_SYMBOL(s3c_device_usb); 50EXPORT_SYMBOL(s3c_device_ohci);
51
52/**
53 * s3c_ohci_set_platdata - initialise OHCI device platform data
54 * @info: The platform data.
55 *
56 * This call copies the @info passed in and sets the device .platform_data
57 * field to that copy. The @info is copied so that the original can be marked
58 * __initdata.
59 */
60void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
61{
62 struct s3c2410_hcd_info *npd;
63
64 npd = kmemdup(info, sizeof(struct s3c2410_hcd_info), GFP_KERNEL);
65 if (!npd)
66 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
67
68 s3c_device_ohci.dev.platform_data = npd;
69}
diff --git a/arch/arm/plat-s3c/dma.c b/arch/arm/plat-samsung/dma.c
index a995850cd9d5..cb459dd95459 100644
--- a/arch/arm/plat-s3c/dma.c
+++ b/arch/arm/plat-samsung/dma.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c/dma.c 1/* linux/arch/arm/plat-samsung/dma.c
2 * 2 *
3 * Copyright (c) 2003-2009 Simtec Electronics 3 * Copyright (c) 2003-2009 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -20,8 +20,6 @@ struct s3c2410_dma_buf;
20#include <mach/dma.h> 20#include <mach/dma.h>
21#include <mach/irqs.h> 21#include <mach/irqs.h>
22 22
23#include <plat/dma-plat.h>
24
25/* dma channel state information */ 23/* dma channel state information */
26struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; 24struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
27struct s3c2410_dma_chan *s3c_dma_chan_map[DMACH_MAX]; 25struct s3c2410_dma_chan *s3c_dma_chan_map[DMACH_MAX];
diff --git a/arch/arm/plat-s3c/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 456969b6fa0d..44a84e896546 100644
--- a/arch/arm/plat-s3c/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -17,7 +17,7 @@
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <mach/gpio-core.h> 20#include <plat/gpio-core.h>
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <plat/gpio-cfg-helpers.h> 22#include <plat/gpio-cfg-helpers.h>
23 23
diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-samsung/gpio.c
index 5ff24e0f9f89..28d2ab8a08db 100644
--- a/arch/arm/plat-s3c/gpio.c
+++ b/arch/arm/plat-samsung/gpio.c
@@ -16,7 +16,7 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18 18
19#include <mach/gpio-core.h> 19#include <plat/gpio-core.h>
20 20
21#ifdef CONFIG_S3C_GPIO_TRACK 21#ifdef CONFIG_S3C_GPIO_TRACK
22struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; 22struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
diff --git a/arch/arm/plat-samsung/gpiolib.c b/arch/arm/plat-samsung/gpiolib.c
new file mode 100644
index 000000000000..8a8ba8bc1d96
--- /dev/null
+++ b/arch/arm/plat-samsung/gpiolib.c
@@ -0,0 +1,199 @@
1/* arch/arm/plat-samsung/gpiolib.c
2 *
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
7 *
8 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
9 * http://www.samsung.com/
10 *
11 * SAMSUNG - GPIOlib support
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17
18#include <linux/kernel.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21#include <mach/gpio.h>
22#include <plat/gpio-core.h>
23#include <plat/gpio-cfg.h>
24#include <plat/gpio-cfg-helpers.h>
25
26#ifndef DEBUG_GPIO
27#define gpio_dbg(x...) do { } while (0)
28#else
29#define gpio_dbg(x...) printk(KERN_DEBUG x)
30#endif
31
32/* The samsung_gpiolib_4bit routines are to control the gpio banks where
33 * the gpio configuration register (GPxCON) has 4 bits per GPIO, as the
34 * following example:
35 *
36 * base + 0x00: Control register, 4 bits per gpio
37 * gpio n: 4 bits starting at (4*n)
38 * 0000 = input, 0001 = output, others mean special-function
39 * base + 0x04: Data register, 1 bit per gpio
40 * bit n: data bit n
41 *
42 * Note, since the data register is one bit per gpio and is at base + 0x4
43 * we can use s3c_gpiolib_get and s3c_gpiolib_set to change the state of
44 * the output.
45*/
46
47static int samsung_gpiolib_4bit_input(struct gpio_chip *chip,
48 unsigned int offset)
49{
50 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
51 void __iomem *base = ourchip->base;
52 unsigned long con;
53
54 con = __raw_readl(base + GPIOCON_OFF);
55 con &= ~(0xf << con_4bit_shift(offset));
56 __raw_writel(con, base + GPIOCON_OFF);
57
58 gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con);
59
60 return 0;
61}
62
63static int samsung_gpiolib_4bit_output(struct gpio_chip *chip,
64 unsigned int offset, int value)
65{
66 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
67 void __iomem *base = ourchip->base;
68 unsigned long con;
69 unsigned long dat;
70
71 con = __raw_readl(base + GPIOCON_OFF);
72 con &= ~(0xf << con_4bit_shift(offset));
73 con |= 0x1 << con_4bit_shift(offset);
74
75 dat = __raw_readl(base + GPIODAT_OFF);
76
77 if (value)
78 dat |= 1 << offset;
79 else
80 dat &= ~(1 << offset);
81
82 __raw_writel(dat, base + GPIODAT_OFF);
83 __raw_writel(con, base + GPIOCON_OFF);
84 __raw_writel(dat, base + GPIODAT_OFF);
85
86 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
87
88 return 0;
89}
90
91/* The next set of routines are for the case where the GPIO configuration
92 * registers are 4 bits per GPIO but there is more than one register (the
93 * bank has more than 8 GPIOs.
94 *
95 * This case is the similar to the 4 bit case, but the registers are as
96 * follows:
97 *
98 * base + 0x00: Control register, 4 bits per gpio (lower 8 GPIOs)
99 * gpio n: 4 bits starting at (4*n)
100 * 0000 = input, 0001 = output, others mean special-function
101 * base + 0x04: Control register, 4 bits per gpio (up to 8 additions GPIOs)
102 * gpio n: 4 bits starting at (4*n)
103 * 0000 = input, 0001 = output, others mean special-function
104 * base + 0x08: Data register, 1 bit per gpio
105 * bit n: data bit n
106 *
107 * To allow us to use the s3c_gpiolib_get and s3c_gpiolib_set routines we
108 * store the 'base + 0x4' address so that these routines see the data
109 * register at ourchip->base + 0x04.
110 */
111
112static int samsung_gpiolib_4bit2_input(struct gpio_chip *chip,
113 unsigned int offset)
114{
115 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
116 void __iomem *base = ourchip->base;
117 void __iomem *regcon = base;
118 unsigned long con;
119
120 if (offset > 7)
121 offset -= 8;
122 else
123 regcon -= 4;
124
125 con = __raw_readl(regcon);
126 con &= ~(0xf << con_4bit_shift(offset));
127 __raw_writel(con, regcon);
128
129 gpio_dbg("%s: %p: CON %08lx\n", __func__, base, con);
130
131 return 0;
132}
133
134static int samsung_gpiolib_4bit2_output(struct gpio_chip *chip,
135 unsigned int offset, int value)
136{
137 struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
138 void __iomem *base = ourchip->base;
139 void __iomem *regcon = base;
140 unsigned long con;
141 unsigned long dat;
142 unsigned con_offset = offset;
143
144 if (con_offset > 7)
145 con_offset -= 8;
146 else
147 regcon -= 4;
148
149 con = __raw_readl(regcon);
150 con &= ~(0xf << con_4bit_shift(con_offset));
151 con |= 0x1 << con_4bit_shift(con_offset);
152
153 dat = __raw_readl(base + GPIODAT_OFF);
154
155 if (value)
156 dat |= 1 << offset;
157 else
158 dat &= ~(1 << offset);
159
160 __raw_writel(dat, base + GPIODAT_OFF);
161 __raw_writel(con, regcon);
162 __raw_writel(dat, base + GPIODAT_OFF);
163
164 gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
165
166 return 0;
167}
168
169void __init samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip)
170{
171 chip->chip.direction_input = samsung_gpiolib_4bit_input;
172 chip->chip.direction_output = samsung_gpiolib_4bit_output;
173 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
174}
175
176void __init samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip)
177{
178 chip->chip.direction_input = samsung_gpiolib_4bit2_input;
179 chip->chip.direction_output = samsung_gpiolib_4bit2_output;
180 chip->pm = __gpio_pm(&s3c_gpio_pm_4bit);
181}
182
183void __init samsung_gpiolib_add_4bit_chips(struct s3c_gpio_chip *chip,
184 int nr_chips)
185{
186 for (; nr_chips > 0; nr_chips--, chip++) {
187 samsung_gpiolib_add_4bit(chip);
188 s3c_gpiolib_add(chip);
189 }
190}
191
192void __init samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip,
193 int nr_chips)
194{
195 for (; nr_chips > 0; nr_chips--, chip++) {
196 samsung_gpiolib_add_4bit2(chip);
197 s3c_gpiolib_add(chip);
198 }
199}
diff --git a/arch/arm/plat-s3c/include/plat/adc.h b/arch/arm/plat-samsung/include/plat/adc.h
index 5f3b1cd53b90..e8382c7be10b 100644
--- a/arch/arm/plat-s3c/include/plat/adc.h
+++ b/arch/arm/plat-samsung/include/plat/adc.h
@@ -1,10 +1,10 @@
1/* arch/arm/plat-s3c/include/plat/adc.h 1/* arch/arm/plat-samsung/include/plat/adc.h
2 * 2 *
3 * Copyright (c) 2008 Simtec Electronics 3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simnte.co.uk/ 4 * http://armlinux.simnte.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
7 * S3C24XX ADC driver information 7 * S3C ADC driver information
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/plat/audio.h b/arch/arm/plat-samsung/include/plat/audio.h
index f22d23bb6271..e32f9edfd4b7 100644
--- a/arch/arm/plat-s3c/include/plat/audio.h
+++ b/arch/arm/plat-samsung/include/plat/audio.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/audio.h 1/* arch/arm/plat-samsung/include/plat/audio.h
2 * 2 *
3 * Copyright (c) 2009 Samsung Electronics Co. Ltd 3 * Copyright (c) 2009 Samsung Electronics Co. Ltd
4 * Author: Jaswinder Singh <jassi.brar@samsung.com> 4 * Author: Jaswinder Singh <jassi.brar@samsung.com>
@@ -8,6 +8,14 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11/* The machine init code calls s3c*_ac97_setup_gpio with
12 * one of these defines in order to select appropriate bank
13 * of GPIO for AC97 pins
14 */
15#define S3C64XX_AC97_GPD 0
16#define S3C64XX_AC97_GPE 1
17extern void s3c64xx_ac97_setup_gpio(int);
18
11/** 19/**
12 * struct s3c_audio_pdata - common platform data for audio device drivers 20 * struct s3c_audio_pdata - common platform data for audio device drivers
13 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode 21 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
diff --git a/arch/arm/plat-samsung/include/plat/clock-clksrc.h b/arch/arm/plat-samsung/include/plat/clock-clksrc.h
new file mode 100644
index 000000000000..50a8ca7c3760
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/clock-clksrc.h
@@ -0,0 +1,83 @@
1/* linux/arch/arm/plat-samsung/include/plat/clock-clksrc.h
2 *
3 * Parts taken from arch/arm/plat-s3c64xx/clock.c
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * Copyright 2009 Ben Dooks <ben-linux@fluff.org>
10 * Copyright 2009 Harald Welte
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15*/
16
17/**
18 * struct clksrc_sources - list of sources for a given clock
19 * @sources: array of pointers to clocks
20 * @nr_sources: The size of @sources
21 */
22struct clksrc_sources {
23 unsigned int nr_sources;
24 struct clk **sources;
25};
26
27/**
28 * struct clksrc_reg - register definition for clock control bits
29 * @reg: pointer to the register in virtual memory.
30 * @shift: the shift in bits to where the bitfield is.
31 * @size: the size in bits of the bitfield.
32 *
33 * This specifies the size and position of the bits we are interested
34 * in within the register specified by @reg.
35 */
36struct clksrc_reg {
37 void __iomem *reg;
38 unsigned short shift;
39 unsigned short size;
40};
41
42/**
43 * struct clksrc_clk - class of clock for newer style samsung devices.
44 * @clk: the standard clock representation
45 * @sources: the sources for this clock
46 * @reg_src: the register definition for selecting the clock's source
47 * @reg_div: the register definition for the clock's output divisor
48 *
49 * This clock implements the features required by the newer SoCs where
50 * the standard clock block provides an input mux and a post-mux divisor
51 * to provide the periperhal's clock.
52 *
53 * The array of @sources provides the mapping of mux position to the
54 * clock, and @reg_src shows the code where to modify to change the mux
55 * position. The @reg_div defines how to change the divider settings on
56 * the output.
57 */
58struct clksrc_clk {
59 struct clk clk;
60 struct clksrc_sources *sources;
61
62 struct clksrc_reg reg_src;
63 struct clksrc_reg reg_div;
64};
65
66/**
67 * s3c_set_clksrc() - setup the clock from the register settings
68 * @clk: The clock to setup.
69 * @announce: true to announce the setting to printk().
70 *
71 * Setup the clock from the current register settings, for when the
72 * kernel boots or if it is resuming from a possibly unknown state.
73 */
74extern void s3c_set_clksrc(struct clksrc_clk *clk, bool announce);
75
76/**
77 * s3c_register_clksrc() register clocks from an array of clksrc clocks
78 * @srcs: The array of clocks to register
79 * @size: The size of the @srcs array.
80 *
81 * Initialise and register the array of clocks described by @srcs.
82 */
83extern void s3c_register_clksrc(struct clksrc_clk *srcs, int size);
diff --git a/arch/arm/plat-s3c/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h
index d86af84b5b8c..60b62692ac7a 100644
--- a/arch/arm/plat-s3c/include/plat/clock.h
+++ b/arch/arm/plat-samsung/include/plat/clock.h
@@ -11,6 +11,30 @@
11 11
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13 13
14struct clk;
15
16/**
17 * struct clk_ops - standard clock operations
18 * @set_rate: set the clock rate, see clk_set_rate().
19 * @get_rate: get the clock rate, see clk_get_rate().
20 * @round_rate: round a given clock rate, see clk_round_rate().
21 * @set_parent: set the clock's parent, see clk_set_parent().
22 *
23 * Group the common clock implementations together so that we
24 * don't have to keep setting the same fiels again. We leave
25 * enable in struct clk.
26 *
27 * Adding an extra layer of indirection into the process should
28 * not be a problem as it is unlikely these operations are going
29 * to need to be called quickly.
30 */
31struct clk_ops {
32 int (*set_rate)(struct clk *c, unsigned long rate);
33 unsigned long (*get_rate)(struct clk *c);
34 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
35 int (*set_parent)(struct clk *c, struct clk *parent);
36};
37
14struct clk { 38struct clk {
15 struct list_head list; 39 struct list_head list;
16 struct module *owner; 40 struct module *owner;
@@ -21,11 +45,8 @@ struct clk {
21 unsigned long rate; 45 unsigned long rate;
22 unsigned long ctrlbit; 46 unsigned long ctrlbit;
23 47
48 struct clk_ops *ops;
24 int (*enable)(struct clk *, int enable); 49 int (*enable)(struct clk *, int enable);
25 int (*set_rate)(struct clk *c, unsigned long rate);
26 unsigned long (*get_rate)(struct clk *c);
27 unsigned long (*round_rate)(struct clk *c, unsigned long rate);
28 int (*set_parent)(struct clk *c, struct clk *parent);
29}; 50};
30 51
31/* other clocks which may be registered by board support */ 52/* other clocks which may be registered by board support */
@@ -54,6 +75,9 @@ extern struct clk clk_h2;
54extern struct clk clk_27m; 75extern struct clk clk_27m;
55extern struct clk clk_48m; 76extern struct clk clk_48m;
56 77
78extern int clk_default_setrate(struct clk *clk, unsigned long rate);
79extern struct clk_ops clk_ops_def_setrate;
80
57/* exports for arch/arm/mach-s3c2410 81/* exports for arch/arm/mach-s3c2410
58 * 82 *
59 * Please DO NOT use these outside of arch/arm/mach-s3c2410 83 * Please DO NOT use these outside of arch/arm/mach-s3c2410
@@ -66,9 +90,11 @@ extern int s3c2410_clkcon_enable(struct clk *clk, int enable);
66extern int s3c24xx_register_clock(struct clk *clk); 90extern int s3c24xx_register_clock(struct clk *clk);
67extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks); 91extern int s3c24xx_register_clocks(struct clk **clk, int nr_clks);
68 92
93extern void s3c_register_clocks(struct clk *clk, int nr_clks);
94
69extern int s3c24xx_register_baseclocks(unsigned long xtal); 95extern int s3c24xx_register_baseclocks(unsigned long xtal);
70 96
71extern void s3c64xx_register_clocks(void); 97extern void s5p_register_clocks(unsigned long xtal_freq);
72 98
73extern void s3c24xx_setup_clocks(unsigned long fclk, 99extern void s3c24xx_setup_clocks(unsigned long fclk,
74 unsigned long hclk, 100 unsigned long hclk,
diff --git a/arch/arm/plat-s3c/include/plat/cpu-freq.h b/arch/arm/plat-samsung/include/plat/cpu-freq.h
index 94eb06a2ea5c..80c4a809c721 100644
--- a/arch/arm/plat-s3c/include/plat/cpu-freq.h
+++ b/arch/arm/plat-samsung/include/plat/cpu-freq.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/cpu-freq.h 1/* arch/arm/plat-samsung/include/plat/cpu-freq.h
2 * 2 *
3 * Copyright (c) 2006-2007 Simtec Electronics 3 * Copyright (c) 2006-2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index d1131ca11e97..d316b4a579f4 100644
--- a/arch/arm/plat-s3c/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c/include/plat/cpu.h 1/* linux/arch/arm/plat-samsung/include/plat/cpu.h
2 * 2 *
3 * Copyright (c) 2004-2005 Simtec Electronics 3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -48,9 +48,12 @@ extern void s3c_init_cpu(unsigned long idcode,
48 48
49extern void s3c24xx_init_irq(void); 49extern void s3c24xx_init_irq(void);
50extern void s3c64xx_init_irq(u32 vic0, u32 vic1); 50extern void s3c64xx_init_irq(u32 vic0, u32 vic1);
51extern void s5p_init_irq(u32 *vic, u32 num_vic);
51 52
52extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); 53extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
53extern void s3c64xx_init_io(struct map_desc *mach_desc, int size); 54extern void s3c64xx_init_io(struct map_desc *mach_desc, int size);
55extern void s5p_init_io(struct map_desc *mach_desc,
56 int size, void __iomem *cpuid_addr);
54 57
55extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); 58extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
56 59
diff --git a/arch/arm/plat-s3c/include/plat/debug-macro.S b/arch/arm/plat-samsung/include/plat/debug-macro.S
index 3634d4e3708b..dc6efd90e8ff 100644
--- a/arch/arm/plat-s3c/include/plat/debug-macro.S
+++ b/arch/arm/plat-samsung/include/plat/debug-macro.S
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c/debug-macro.S 1/* arch/arm/plat-samsung/include/plat/debug-macro.S
2 * 2 *
3 * Copyright 2005, 2007 Simtec Electronics 3 * Copyright 2005, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -11,6 +11,18 @@
11 11
12#include <plat/regs-serial.h> 12#include <plat/regs-serial.h>
13 13
14/* The S5PV210/S5PC110 and S5P6442 implementations are as belows. */
15
16 .macro fifo_level_s5pv210 rd, rx
17 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
18 and \rd, \rd, #S5PV210_UFSTAT_TXMASK
19 .endm
20
21 .macro fifo_full_s5pv210 rd, rx
22 ldr \rd, [ \rx, # S3C2410_UFSTAT ]
23 tst \rd, #S5PV210_UFSTAT_TXFULL
24 .endm
25
14/* The S3C2440 implementations are used by default as they are the 26/* The S3C2440 implementations are used by default as they are the
15 * most widely re-used */ 27 * most widely re-used */
16 28
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index c1c20b023917..796d24258313 100644
--- a/arch/arm/plat-s3c/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/devs.h 1/* arch/arm/plat-samsung/include/plat/devs.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -18,6 +18,7 @@ struct s3c24xx_uart_resources {
18 18
19extern struct s3c24xx_uart_resources s3c2410_uart_resources[]; 19extern struct s3c24xx_uart_resources s3c2410_uart_resources[];
20extern struct s3c24xx_uart_resources s3c64xx_uart_resources[]; 20extern struct s3c24xx_uart_resources s3c64xx_uart_resources[];
21extern struct s3c24xx_uart_resources s5p_uart_resources[];
21 22
22extern struct platform_device *s3c24xx_uart_devs[]; 23extern struct platform_device *s3c24xx_uart_devs[];
23extern struct platform_device *s3c24xx_uart_src[]; 24extern struct platform_device *s3c24xx_uart_src[];
@@ -28,12 +29,18 @@ extern struct platform_device s3c64xx_device_iis0;
28extern struct platform_device s3c64xx_device_iis1; 29extern struct platform_device s3c64xx_device_iis1;
29extern struct platform_device s3c64xx_device_iisv4; 30extern struct platform_device s3c64xx_device_iisv4;
30 31
32extern struct platform_device s3c64xx_device_spi0;
33extern struct platform_device s3c64xx_device_spi1;
34
31extern struct platform_device s3c64xx_device_pcm0; 35extern struct platform_device s3c64xx_device_pcm0;
32extern struct platform_device s3c64xx_device_pcm1; 36extern struct platform_device s3c64xx_device_pcm1;
33 37
38extern struct platform_device s3c64xx_device_ac97;
39
34extern struct platform_device s3c_device_ts; 40extern struct platform_device s3c_device_ts;
41
35extern struct platform_device s3c_device_fb; 42extern struct platform_device s3c_device_fb;
36extern struct platform_device s3c_device_usb; 43extern struct platform_device s3c_device_ohci;
37extern struct platform_device s3c_device_lcd; 44extern struct platform_device s3c_device_lcd;
38extern struct platform_device s3c_device_wdt; 45extern struct platform_device s3c_device_wdt;
39extern struct platform_device s3c_device_i2c0; 46extern struct platform_device s3c_device_i2c0;
diff --git a/arch/arm/plat-s3c/include/plat/dma-core.h b/arch/arm/plat-samsung/include/plat/dma-core.h
index 32ff2a92cb3c..32ff2a92cb3c 100644
--- a/arch/arm/plat-s3c/include/plat/dma-core.h
+++ b/arch/arm/plat-samsung/include/plat/dma-core.h
diff --git a/arch/arm/plat-s3c24xx/include/plat/dma-plat.h b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
index 9565ead1bc9b..336d5ac02035 100644
--- a/arch/arm/plat-s3c24xx/include/plat/dma-plat.h
+++ b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
@@ -1,9 +1,9 @@
1/* linux/arch/arm/plat-s3c24xx/include/plat/dma-plat.h 1/* linux/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
2 * 2 *
3 * Copyright (C) 2006 Simtec Electronics 3 * Copyright (C) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Samsung S3C24XX DMA support 6 * Samsung S3C24XX DMA support - per SoC functions
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/plat/dma.h b/arch/arm/plat-samsung/include/plat/dma.h
index e429d10be3ad..7584d751ed51 100644
--- a/arch/arm/plat-s3c/include/plat/dma.h
+++ b/arch/arm/plat-samsung/include/plat/dma.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/dma.h 1/* arch/arm/plat-samsung/include/plat/dma.h
2 * 2 *
3 * Copyright (C) 2003-2006 Simtec Electronics 3 * Copyright (C) 2003-2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
diff --git a/arch/arm/plat-s3c/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index f8db87930f8b..ffc01a76b7ce 100644
--- a/arch/arm/plat-s3c/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c/include/plat/fb.h 1/* arch/arm/plat-samsung/include/plat/fb.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
index 652e2bbdaa20..dda19da037ad 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-cfg-helpers.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
@@ -78,7 +78,7 @@ extern int s3c_gpio_setcfg_s3c24xx_a(struct s3c_gpio_chip *chip,
78 * others = Special functions (dependant on bank) 78 * others = Special functions (dependant on bank)
79 * 79 *
80 * Note, since the code to deal with the case where there are two control 80 * Note, since the code to deal with the case where there are two control
81 * registers instead of one, we do not have a seperate set of functions for 81 * registers instead of one, we do not have a separate set of functions for
82 * each case. 82 * each case.
83*/ 83*/
84extern int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip, 84extern int s3c_gpio_setcfg_s3c64xx_4bit(struct s3c_gpio_chip *chip,
diff --git a/arch/arm/plat-s3c/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 29cd6a86cade..29cd6a86cade 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
diff --git a/arch/arm/plat-s3c/include/plat/gpio-core.h b/arch/arm/plat-samsung/include/plat/gpio-core.h
index 32af612767aa..49ff406a7066 100644
--- a/arch/arm/plat-s3c/include/plat/gpio-core.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-core.h
@@ -11,6 +11,11 @@
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14#define GPIOCON_OFF (0x00)
15#define GPIODAT_OFF (0x04)
16
17#define con_4bit_shift(__off) ((__off) * 4)
18
14/* Define the core gpiolib support functions that the s3c platforms may 19/* Define the core gpiolib support functions that the s3c platforms may
15 * need to extend or change depending on the hardware and the s3c chip 20 * need to extend or change depending on the hardware and the s3c chip
16 * selected at build or found at run time. 21 * selected at build or found at run time.
@@ -80,6 +85,29 @@ extern void s3c_gpiolib_add(struct s3c_gpio_chip *chip);
80 * and any other necessary functions. 85 * and any other necessary functions.
81 */ 86 */
82 87
88/**
89 * samsung_gpiolib_add_4bit_chips - 4bit single register GPIO config.
90 * @chip: The gpio chip that is being configured.
91 * @nr_chips: The no of chips (gpio ports) for the GPIO being configured.
92 *
93 * This helper deal with the GPIO cases where the control register has 4 bits
94 * of control per GPIO, generally in the form of:
95 * 0000 = Input
96 * 0001 = Output
97 * others = Special functions (dependant on bank)
98 *
99 * Note, since the code to deal with the case where there are two control
100 * registers instead of one, we do not have a seperate set of function
101 * (samsung_gpiolib_add_4bit2_chips)for each case.
102 */
103extern void samsung_gpiolib_add_4bit_chips(struct s3c_gpio_chip *chip,
104 int nr_chips);
105extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip,
106 int nr_chips);
107
108extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip);
109extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
110
83#ifdef CONFIG_S3C_GPIO_TRACK 111#ifdef CONFIG_S3C_GPIO_TRACK
84extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; 112extern struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END];
85 113
@@ -90,6 +118,8 @@ static inline struct s3c_gpio_chip *s3c_gpiolib_getchip(unsigned int chip)
90#else 118#else
91/* machine specific code should provide s3c_gpiolib_getchip */ 119/* machine specific code should provide s3c_gpiolib_getchip */
92 120
121#include <mach/gpio-track.h>
122
93static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } 123static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { }
94#endif 124#endif
95 125
diff --git a/arch/arm/plat-s3c/include/plat/hwmon.h b/arch/arm/plat-samsung/include/plat/hwmon.h
index 1ba88ea0aa31..1ba88ea0aa31 100644
--- a/arch/arm/plat-s3c/include/plat/hwmon.h
+++ b/arch/arm/plat-samsung/include/plat/hwmon.h
diff --git a/arch/arm/plat-s3c/include/plat/iic-core.h b/arch/arm/plat-samsung/include/plat/iic-core.h
index 36397ca20962..36397ca20962 100644
--- a/arch/arm/plat-s3c/include/plat/iic-core.h
+++ b/arch/arm/plat-samsung/include/plat/iic-core.h
diff --git a/arch/arm/plat-s3c/include/plat/iic.h b/arch/arm/plat-samsung/include/plat/iic.h
index 3083df00dee6..3083df00dee6 100644
--- a/arch/arm/plat-s3c/include/plat/iic.h
+++ b/arch/arm/plat-samsung/include/plat/iic.h
diff --git a/arch/arm/plat-samsung/include/plat/irq-uart.h b/arch/arm/plat-samsung/include/plat/irq-uart.h
new file mode 100644
index 000000000000..a9331e49bea3
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/irq-uart.h
@@ -0,0 +1,20 @@
1/* arch/arm/plat-samsung/include/plat/irq-uart.h
2 *
3 * Copyright (c) 2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for Samsung SoC UART IRQ demux for S3C64XX and later
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13struct s3c_uart_irq {
14 void __iomem *regs;
15 unsigned int base_irq;
16 unsigned int parent_irq;
17};
18
19extern void s3c_init_uart_irqs(struct s3c_uart_irq *irq, unsigned int nr_irqs);
20
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2442.h b/arch/arm/plat-samsung/include/plat/irq-vic-timer.h
index 451a23a2092a..a90b53431b5b 100644
--- a/arch/arm/plat-s3c24xx/include/plat/s3c2442.h
+++ b/arch/arm/plat-samsung/include/plat/irq-vic-timer.h
@@ -1,17 +1,13 @@
1/* linux/include/asm-arm/plat-s3c24xx/s3c2442.h 1/* arch/arm/plat-samsung/include/plat/irq-vic-timer.h
2 * 2 *
3 * Copyright (c) 2006 Simtec Electronics 3 * Copyright (c) 2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * Header file for s3c2442 cpu support 6 * Header file for Samsung SoC IRQ VIC timer
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#ifdef CONFIG_CPU_S3C2442 13extern void s3c_init_vic_timer_irq(unsigned int vic, unsigned int timer);
14extern int s3c2442_init(void);
15#else
16#define s3c2442_init NULL
17#endif
diff --git a/arch/arm/plat-s3c/include/plat/map-base.h b/arch/arm/plat-samsung/include/plat/map-base.h
index 250be311c85b..250be311c85b 100644
--- a/arch/arm/plat-s3c/include/plat/map-base.h
+++ b/arch/arm/plat-samsung/include/plat/map-base.h
diff --git a/arch/arm/plat-s3c/include/plat/nand.h b/arch/arm/plat-samsung/include/plat/nand.h
index 226147b7e026..b64115fa93a4 100644
--- a/arch/arm/plat-s3c/include/plat/nand.h
+++ b/arch/arm/plat-samsung/include/plat/nand.h
@@ -3,7 +3,7 @@
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * S3C2410 - NAND device controller platfrom_device info 6 * S3C2410 - NAND device controller platform_device info
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
diff --git a/arch/arm/plat-s3c/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index 7a797192fcf3..245836d91931 100644
--- a/arch/arm/plat-s3c/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c24xx/pm.h 1/* arch/arm/plat-samsung/include/plat/pm.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
@@ -111,7 +111,7 @@ extern int s3c24xx_irq_resume(struct sys_device *dev);
111 111
112/* PM debug functions */ 112/* PM debug functions */
113 113
114#ifdef CONFIG_S3C2410_PM_DEBUG 114#ifdef CONFIG_SAMSUNG_PM_DEBUG
115/** 115/**
116 * s3c_pm_dbg() - low level debug function for use in suspend/resume. 116 * s3c_pm_dbg() - low level debug function for use in suspend/resume.
117 * @msg: The message to print. 117 * @msg: The message to print.
@@ -141,7 +141,7 @@ static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { }
141 141
142/* suspend memory checking */ 142/* suspend memory checking */
143 143
144#ifdef CONFIG_S3C2410_PM_CHECK 144#ifdef CONFIG_SAMSUNG_PM_CHECK
145extern void s3c_pm_check_prepare(void); 145extern void s3c_pm_check_prepare(void);
146extern void s3c_pm_check_restore(void); 146extern void s3c_pm_check_restore(void);
147extern void s3c_pm_check_cleanup(void); 147extern void s3c_pm_check_cleanup(void);
diff --git a/arch/arm/plat-s3c/include/plat/regs-ac97.h b/arch/arm/plat-samsung/include/plat/regs-ac97.h
index c3878f7acb83..c3878f7acb83 100644
--- a/arch/arm/plat-s3c/include/plat/regs-ac97.h
+++ b/arch/arm/plat-samsung/include/plat/regs-ac97.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-adc.h b/arch/arm/plat-samsung/include/plat/regs-adc.h
index 4323cccc86cd..7554c4fcddb9 100644
--- a/arch/arm/plat-s3c/include/plat/regs-adc.h
+++ b/arch/arm/plat-samsung/include/plat/regs-adc.h
@@ -19,9 +19,13 @@
19#define S3C2410_ADCDLY S3C2410_ADCREG(0x08) 19#define S3C2410_ADCDLY S3C2410_ADCREG(0x08)
20#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C) 20#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)
21#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10) 21#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10)
22#define S3C64XX_ADCUPDN S3C2410_ADCREG(0x14)
23#define S3C64XX_ADCCLRINT S3C2410_ADCREG(0x18)
24#define S3C64XX_ADCCLRINTPNDNUP S3C2410_ADCREG(0x20)
22 25
23 26
24/* ADCCON Register Bits */ 27/* ADCCON Register Bits */
28#define S3C64XX_ADCCON_RESSEL (1<<16)
25#define S3C2410_ADCCON_ECFLG (1<<15) 29#define S3C2410_ADCCON_ECFLG (1<<15)
26#define S3C2410_ADCCON_PRSCEN (1<<14) 30#define S3C2410_ADCCON_PRSCEN (1<<14)
27#define S3C2410_ADCCON_PRSCVL(x) (((x)&0xFF)<<6) 31#define S3C2410_ADCCON_PRSCVL(x) (((x)&0xFF)<<6)
diff --git a/arch/arm/plat-s3c/include/plat/regs-fb-v4.h b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
index a60ed0d06c94..0f43599248ad 100644
--- a/arch/arm/plat-s3c/include/plat/regs-fb-v4.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/regs-fb-v4.h 1/* arch/arm/plat-samsung/include/plat/regs-fb-v4.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c/include/plat/regs-fb.h b/arch/arm/plat-samsung/include/plat/regs-fb.h
index e9ee599d430e..0ef806e50344 100644
--- a/arch/arm/plat-s3c/include/plat/regs-fb.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/regs-fb.h 1/* arch/arm/plat-samsung/include/plat/regs-fb.h
2 * 2 *
3 * Copyright 2008 Openmoko, Inc. 3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics 4 * Copyright 2008 Simtec Electronics
diff --git a/arch/arm/plat-s3c/include/plat/regs-iic.h b/arch/arm/plat-samsung/include/plat/regs-iic.h
index 2f7c17de8ac8..2f7c17de8ac8 100644
--- a/arch/arm/plat-s3c/include/plat/regs-iic.h
+++ b/arch/arm/plat-samsung/include/plat/regs-iic.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-irqtype.h b/arch/arm/plat-samsung/include/plat/regs-irqtype.h
index c63cd3fc5ad3..c63cd3fc5ad3 100644
--- a/arch/arm/plat-s3c/include/plat/regs-irqtype.h
+++ b/arch/arm/plat-samsung/include/plat/regs-irqtype.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-nand.h b/arch/arm/plat-samsung/include/plat/regs-nand.h
index 238efea7b9e4..238efea7b9e4 100644
--- a/arch/arm/plat-s3c/include/plat/regs-nand.h
+++ b/arch/arm/plat-samsung/include/plat/regs-nand.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-rtc.h b/arch/arm/plat-samsung/include/plat/regs-rtc.h
index d5837cf8e402..d5837cf8e402 100644
--- a/arch/arm/plat-s3c/include/plat/regs-rtc.h
+++ b/arch/arm/plat-samsung/include/plat/regs-rtc.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h b/arch/arm/plat-samsung/include/plat/regs-s3c2412-iis.h
index abf2fbc2eb2f..abf2fbc2eb2f 100644
--- a/arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
+++ b/arch/arm/plat-samsung/include/plat/regs-s3c2412-iis.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-sdhci.h b/arch/arm/plat-samsung/include/plat/regs-sdhci.h
index e34049ad44cc..e34049ad44cc 100644
--- a/arch/arm/plat-s3c/include/plat/regs-sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/regs-sdhci.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-serial.h b/arch/arm/plat-samsung/include/plat/regs-serial.h
index 85d8904e7f24..a6eba8496b24 100644
--- a/arch/arm/plat-s3c/include/plat/regs-serial.h
+++ b/arch/arm/plat-samsung/include/plat/regs-serial.h
@@ -1,4 +1,4 @@
1/* arch/arm/mach-s3c2410/include/mach/regs-serial.h 1/* arch/arm/plat-samsung/include/plat/regs-serial.h
2 * 2 *
3 * From linux/include/asm-arm/hardware/serial_s3c2410.h 3 * From linux/include/asm-arm/hardware/serial_s3c2410.h
4 * 4 *
@@ -194,6 +194,36 @@
194#define S3C64XX_UINTSP 0x34 194#define S3C64XX_UINTSP 0x34
195#define S3C64XX_UINTM 0x38 195#define S3C64XX_UINTM 0x38
196 196
197/* Following are specific to S5PV210 and S5P6442 */
198#define S5PV210_UCON_CLKMASK (1<<10)
199#define S5PV210_UCON_PCLK (0<<10)
200#define S5PV210_UCON_UCLK (1<<10)
201
202#define S5PV210_UFCON_TXTRIG0 (0<<8)
203#define S5PV210_UFCON_TXTRIG4 (1<<8)
204#define S5PV210_UFCON_TXTRIG8 (2<<8)
205#define S5PV210_UFCON_TXTRIG16 (3<<8)
206#define S5PV210_UFCON_TXTRIG32 (4<<8)
207#define S5PV210_UFCON_TXTRIG64 (5<<8)
208#define S5PV210_UFCON_TXTRIG128 (6<<8)
209#define S5PV210_UFCON_TXTRIG256 (7<<8)
210
211#define S5PV210_UFCON_RXTRIG1 (0<<4)
212#define S5PV210_UFCON_RXTRIG4 (1<<4)
213#define S5PV210_UFCON_RXTRIG8 (2<<4)
214#define S5PV210_UFCON_RXTRIG16 (3<<4)
215#define S5PV210_UFCON_RXTRIG32 (4<<4)
216#define S5PV210_UFCON_RXTRIG64 (5<<4)
217#define S5PV210_UFCON_RXTRIG128 (6<<4)
218#define S5PV210_UFCON_RXTRIG256 (7<<4)
219
220#define S5PV210_UFSTAT_TXFULL (1<<24)
221#define S5PV210_UFSTAT_RXFULL (1<<8)
222#define S5PV210_UFSTAT_TXMASK (255<<16)
223#define S5PV210_UFSTAT_TXSHIFT (16)
224#define S5PV210_UFSTAT_RXMASK (255<<0)
225#define S5PV210_UFSTAT_RXSHIFT (0)
226
197#ifndef __ASSEMBLY__ 227#ifndef __ASSEMBLY__
198 228
199/* struct s3c24xx_uart_clksrc 229/* struct s3c24xx_uart_clksrc
diff --git a/arch/arm/plat-s3c/include/plat/regs-timer.h b/arch/arm/plat-samsung/include/plat/regs-timer.h
index d097d92f8cc7..d097d92f8cc7 100644
--- a/arch/arm/plat-s3c/include/plat/regs-timer.h
+++ b/arch/arm/plat-samsung/include/plat/regs-timer.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
index 36a85f5000c8..a111ad871833 100644
--- a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg-phy.h
+++ b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg-phy.h
@@ -12,7 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15/* Note, this is a seperate header file as some of the clock framework 15/* Note, this is a separate header file as some of the clock framework
16 * needs to touch this if the clk_48m is used as the USB OHCI or other 16 * needs to touch this if the clk_48m is used as the USB OHCI or other
17 * peripheral source. 17 * peripheral source.
18*/ 18*/
diff --git a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h
index 8d18d9d4d148..8d18d9d4d148 100644
--- a/arch/arm/plat-s3c/include/plat/regs-usb-hsotg.h
+++ b/arch/arm/plat-samsung/include/plat/regs-usb-hsotg.h
diff --git a/arch/arm/plat-s3c/include/plat/regs-watchdog.h b/arch/arm/plat-samsung/include/plat/regs-watchdog.h
index 4938492470f7..4938492470f7 100644
--- a/arch/arm/plat-s3c/include/plat/regs-watchdog.h
+++ b/arch/arm/plat-samsung/include/plat/regs-watchdog.h
diff --git a/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
new file mode 100644
index 000000000000..d17724149315
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
@@ -0,0 +1,67 @@
1/* linux/arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
2 *
3 * Copyright (C) 2009 Samsung Electronics Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __S3C64XX_PLAT_SPI_H
12#define __S3C64XX_PLAT_SPI_H
13
14/**
15 * struct s3c64xx_spi_csinfo - ChipSelect description
16 * @fb_delay: Slave specific feedback delay.
17 * Refer to FB_CLK_SEL register definition in SPI chapter.
18 * @line: Custom 'identity' of the CS line.
19 * @set_level: CS line control.
20 *
21 * This is per SPI-Slave Chipselect information.
22 * Allocate and initialize one in machine init code and make the
23 * spi_board_info.controller_data point to it.
24 */
25struct s3c64xx_spi_csinfo {
26 u8 fb_delay;
27 unsigned line;
28 void (*set_level)(unsigned line_id, int lvl);
29};
30
31/**
32 * struct s3c64xx_spi_info - SPI Controller defining structure
33 * @src_clk_nr: Clock source index for the CLK_CFG[SPI_CLKSEL] field.
34 * @src_clk_name: Platform name of the corresponding clock.
35 * @num_cs: Number of CS this controller emulates.
36 * @cfg_gpio: Configure pins for this SPI controller.
37 * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6
38 * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number
39 * @high_speed: If the controller supports HIGH_SPEED_EN bit
40 */
41struct s3c64xx_spi_info {
42 int src_clk_nr;
43 char *src_clk_name;
44
45 int num_cs;
46
47 int (*cfg_gpio)(struct platform_device *pdev);
48
49 /* Following two fields are for future compatibility */
50 int fifo_lvl_mask;
51 int rx_lvl_offset;
52 int high_speed;
53};
54
55/**
56 * s3c64xx_spi_set_info - SPI Controller configure callback by the board
57 * initialization code.
58 * @cntrlr: SPI controller number the configuration is for.
59 * @src_clk_nr: Clock the SPI controller is to use to generate SPI clocks.
60 * @num_cs: Number of elements in the 'cs' array.
61 *
62 * Call this from machine init code for each SPI Controller that
63 * has some chips attached to it.
64 */
65extern void s3c64xx_spi_set_info(int cntrlr, int src_clk_nr, int num_cs);
66
67#endif /* __S3C64XX_PLAT_SPI_H */
diff --git a/arch/arm/plat-s3c/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 53198673b6bd..7d07cd7aa4f2 100644
--- a/arch/arm/plat-s3c/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -78,8 +78,8 @@ extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
78 78
79/* S3C6400 SDHCI setup */ 79/* S3C6400 SDHCI setup */
80 80
81#ifdef CONFIG_S3C6400_SETUP_SDHCI 81#ifdef CONFIG_S3C64XX_SETUP_SDHCI
82extern char *s3c6400_hsmmc_clksrcs[4]; 82extern char *s3c64xx_hsmmc_clksrcs[4];
83 83
84#ifdef CONFIG_S3C_DEV_HSMMC 84#ifdef CONFIG_S3C_DEV_HSMMC
85extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, 85extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
@@ -89,7 +89,7 @@ extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev,
89 89
90static inline void s3c6400_default_sdhci0(void) 90static inline void s3c6400_default_sdhci0(void)
91{ 91{
92 s3c_hsmmc0_def_platdata.clocks = s3c6400_hsmmc_clksrcs; 92 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
93 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 93 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
94 s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; 94 s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
95} 95}
@@ -101,7 +101,7 @@ static inline void s3c6400_default_sdhci0(void) { }
101#ifdef CONFIG_S3C_DEV_HSMMC1 101#ifdef CONFIG_S3C_DEV_HSMMC1
102static inline void s3c6400_default_sdhci1(void) 102static inline void s3c6400_default_sdhci1(void)
103{ 103{
104 s3c_hsmmc1_def_platdata.clocks = s3c6400_hsmmc_clksrcs; 104 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
105 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 105 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
106 s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; 106 s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
107} 107}
@@ -112,7 +112,7 @@ static inline void s3c6400_default_sdhci1(void) { }
112#ifdef CONFIG_S3C_DEV_HSMMC2 112#ifdef CONFIG_S3C_DEV_HSMMC2
113static inline void s3c6400_default_sdhci2(void) 113static inline void s3c6400_default_sdhci2(void)
114{ 114{
115 s3c_hsmmc2_def_platdata.clocks = s3c6400_hsmmc_clksrcs; 115 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
116 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; 116 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
117 s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; 117 s3c_hsmmc2_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card;
118} 118}
@@ -120,27 +120,19 @@ static inline void s3c6400_default_sdhci2(void)
120static inline void s3c6400_default_sdhci2(void) { } 120static inline void s3c6400_default_sdhci2(void) { }
121#endif /* CONFIG_S3C_DEV_HSMMC2 */ 121#endif /* CONFIG_S3C_DEV_HSMMC2 */
122 122
123#else
124static inline void s3c6400_default_sdhci0(void) { }
125static inline void s3c6400_default_sdhci1(void) { }
126#endif /* CONFIG_S3C6400_SETUP_SDHCI */
127
128/* S3C6410 SDHCI setup */ 123/* S3C6410 SDHCI setup */
129 124
130#ifdef CONFIG_S3C6410_SETUP_SDHCI 125extern void s3c6410_setup_sdhci_cfg_card(struct platform_device *dev,
131extern char *s3c6410_hsmmc_clksrcs[4]; 126 void __iomem *r,
132 127 struct mmc_ios *ios,
133extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, 128 struct mmc_card *card);
134 void __iomem *r,
135 struct mmc_ios *ios,
136 struct mmc_card *card);
137 129
138#ifdef CONFIG_S3C_DEV_HSMMC 130#ifdef CONFIG_S3C_DEV_HSMMC
139static inline void s3c6410_default_sdhci0(void) 131static inline void s3c6410_default_sdhci0(void)
140{ 132{
141 s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 133 s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
142 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 134 s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
143 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 135 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
144} 136}
145#else 137#else
146static inline void s3c6410_default_sdhci0(void) { } 138static inline void s3c6410_default_sdhci0(void) { }
@@ -149,9 +141,9 @@ static inline void s3c6410_default_sdhci0(void) { }
149#ifdef CONFIG_S3C_DEV_HSMMC1 141#ifdef CONFIG_S3C_DEV_HSMMC1
150static inline void s3c6410_default_sdhci1(void) 142static inline void s3c6410_default_sdhci1(void)
151{ 143{
152 s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 144 s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
153 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 145 s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
154 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 146 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
155} 147}
156#else 148#else
157static inline void s3c6410_default_sdhci1(void) { } 149static inline void s3c6410_default_sdhci1(void) { }
@@ -160,9 +152,9 @@ static inline void s3c6410_default_sdhci1(void) { }
160#ifdef CONFIG_S3C_DEV_HSMMC2 152#ifdef CONFIG_S3C_DEV_HSMMC2
161static inline void s3c6410_default_sdhci2(void) 153static inline void s3c6410_default_sdhci2(void)
162{ 154{
163 s3c_hsmmc2_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 155 s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
164 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio; 156 s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
165 s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 157 s3c_hsmmc2_def_platdata.cfg_card = s3c6410_setup_sdhci_cfg_card;
166} 158}
167#else 159#else
168static inline void s3c6410_default_sdhci2(void) { } 160static inline void s3c6410_default_sdhci2(void) { }
@@ -171,7 +163,10 @@ static inline void s3c6410_default_sdhci2(void) { }
171#else 163#else
172static inline void s3c6410_default_sdhci0(void) { } 164static inline void s3c6410_default_sdhci0(void) { }
173static inline void s3c6410_default_sdhci1(void) { } 165static inline void s3c6410_default_sdhci1(void) { }
174#endif /* CONFIG_S3C6410_SETUP_SDHCI */ 166static inline void s3c6400_default_sdhci0(void) { }
167static inline void s3c6400_default_sdhci1(void) { }
168
169#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
175 170
176/* S5PC100 SDHCI setup */ 171/* S5PC100 SDHCI setup */
177 172
diff --git a/arch/arm/plat-s3c/include/plat/udc-hs.h b/arch/arm/plat-samsung/include/plat/udc-hs.h
index dd04db043109..a22a4f2eea94 100644
--- a/arch/arm/plat-s3c/include/plat/udc-hs.h
+++ b/arch/arm/plat-samsung/include/plat/udc-hs.h
@@ -12,7 +12,7 @@
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13*/ 13*/
14 14
15enum s3c_hostg_dmamode { 15enum s3c_hsotg_dmamode {
16 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ 16 S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */
17 S3C_HSOTG_DMA_ONLY, /* always use DMA */ 17 S3C_HSOTG_DMA_ONLY, /* always use DMA */
18 S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */ 18 S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */
@@ -24,6 +24,6 @@ enum s3c_hostg_dmamode {
24 * @is_osc: The clock source is an oscillator, not a crystal 24 * @is_osc: The clock source is an oscillator, not a crystal
25 */ 25 */
26struct s3c_hsotg_plat { 26struct s3c_hsotg_plat {
27 enum s3c_hostg_dmamode dma; 27 enum s3c_hsotg_dmamode dma;
28 unsigned int is_osc : 1; 28 unsigned int is_osc : 1;
29}; 29};
diff --git a/arch/arm/plat-s3c/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index dc66a477f62e..e87ce8ffbbcd 100644
--- a/arch/arm/plat-s3c/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -1,4 +1,4 @@
1/* linux/include/asm-arm/plat-s3c/uncompress.h 1/* arch/arm/plat-samsung/include/plat/uncompress.h
2 * 2 *
3 * Copyright 2003, 2007 Simtec Electronics 3 * Copyright 2003, 2007 Simtec Electronics
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
diff --git a/arch/arm/plat-s3c/include/plat/usb-control.h b/arch/arm/plat-samsung/include/plat/usb-control.h
index 822c87fe948e..7fa1fbefc3f2 100644
--- a/arch/arm/plat-s3c/include/plat/usb-control.h
+++ b/arch/arm/plat-samsung/include/plat/usb-control.h
@@ -1,4 +1,4 @@
1/* arch/arm/plat-s3c/include/plat/usb-control.h 1/* arch/arm/plat-samsung/include/plat/usb-control.h
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
@@ -38,4 +38,6 @@ static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int port
38 } 38 }
39} 39}
40 40
41extern void s3c_ohci_set_platdata(struct s3c2410_hcd_info *info);
42
41#endif /*__ASM_ARCH_USBCONTROL_H */ 43#endif /*__ASM_ARCH_USBCONTROL_H */
diff --git a/arch/arm/plat-s3c/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
index 54b762acb5a0..54b762acb5a0 100644
--- a/arch/arm/plat-s3c/include/plat/watchdog-reset.h
+++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h
diff --git a/arch/arm/plat-s3c/init.c b/arch/arm/plat-samsung/init.c
index 6790edfaca6f..6790edfaca6f 100644
--- a/arch/arm/plat-s3c/init.c
+++ b/arch/arm/plat-samsung/init.c
diff --git a/arch/arm/plat-samsung/irq-uart.c b/arch/arm/plat-samsung/irq-uart.c
new file mode 100644
index 000000000000..4f8c102674ae
--- /dev/null
+++ b/arch/arm/plat-samsung/irq-uart.c
@@ -0,0 +1,143 @@
1/* arch/arm/plat-samsung/irq-uart.c
2 * originally part of arch/arm/plat-s3c64xx/irq.c
3 *
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * Samsung- UART Interrupt handling
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/kernel.h>
17#include <linux/interrupt.h>
18#include <linux/serial_core.h>
19#include <linux/irq.h>
20#include <linux/io.h>
21
22#include <mach/map.h>
23#include <plat/irq-uart.h>
24#include <plat/regs-serial.h>
25#include <plat/cpu.h>
26
27/* Note, we make use of the fact that the parent IRQs, IRQ_UART[0..3]
28 * are consecutive when looking up the interrupt in the demux routines.
29 */
30
31static inline void __iomem *s3c_irq_uart_base(unsigned int irq)
32{
33 struct s3c_uart_irq *uirq = get_irq_chip_data(irq);
34 return uirq->regs;
35}
36
37static inline unsigned int s3c_irq_uart_bit(unsigned int irq)
38{
39 return irq & 3;
40}
41
42static void s3c_irq_uart_mask(unsigned int irq)
43{
44 void __iomem *regs = s3c_irq_uart_base(irq);
45 unsigned int bit = s3c_irq_uart_bit(irq);
46 u32 reg;
47
48 reg = __raw_readl(regs + S3C64XX_UINTM);
49 reg |= (1 << bit);
50 __raw_writel(reg, regs + S3C64XX_UINTM);
51}
52
53static void s3c_irq_uart_maskack(unsigned int irq)
54{
55 void __iomem *regs = s3c_irq_uart_base(irq);
56 unsigned int bit = s3c_irq_uart_bit(irq);
57 u32 reg;
58
59 reg = __raw_readl(regs + S3C64XX_UINTM);
60 reg |= (1 << bit);
61 __raw_writel(reg, regs + S3C64XX_UINTM);
62 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
63}
64
65static void s3c_irq_uart_unmask(unsigned int irq)
66{
67 void __iomem *regs = s3c_irq_uart_base(irq);
68 unsigned int bit = s3c_irq_uart_bit(irq);
69 u32 reg;
70
71 reg = __raw_readl(regs + S3C64XX_UINTM);
72 reg &= ~(1 << bit);
73 __raw_writel(reg, regs + S3C64XX_UINTM);
74}
75
76static void s3c_irq_uart_ack(unsigned int irq)
77{
78 void __iomem *regs = s3c_irq_uart_base(irq);
79 unsigned int bit = s3c_irq_uart_bit(irq);
80
81 __raw_writel(1 << bit, regs + S3C64XX_UINTP);
82}
83
84static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc)
85{
86 struct s3c_uart_irq *uirq = desc->handler_data;
87 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP);
88 int base = uirq->base_irq;
89
90 if (pend & (1 << 0))
91 generic_handle_irq(base);
92 if (pend & (1 << 1))
93 generic_handle_irq(base + 1);
94 if (pend & (1 << 2))
95 generic_handle_irq(base + 2);
96 if (pend & (1 << 3))
97 generic_handle_irq(base + 3);
98}
99
100static struct irq_chip s3c_irq_uart = {
101 .name = "s3c-uart",
102 .mask = s3c_irq_uart_mask,
103 .unmask = s3c_irq_uart_unmask,
104 .mask_ack = s3c_irq_uart_maskack,
105 .ack = s3c_irq_uart_ack,
106};
107
108static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq)
109{
110 struct irq_desc *desc = irq_to_desc(uirq->parent_irq);
111 void __iomem *reg_base = uirq->regs;
112 unsigned int irq;
113 int offs;
114
115 /* mask all interrupts at the start. */
116 __raw_writel(0xf, reg_base + S3C64XX_UINTM);
117
118 for (offs = 0; offs < 3; offs++) {
119 irq = uirq->base_irq + offs;
120
121 set_irq_chip(irq, &s3c_irq_uart);
122 set_irq_chip_data(irq, uirq);
123 set_irq_handler(irq, handle_level_irq);
124 set_irq_flags(irq, IRQF_VALID);
125 }
126
127 desc->handler_data = uirq;
128 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart);
129}
130
131/**
132 * s3c_init_uart_irqs() - initialise UART IRQs and the necessary demuxing
133 * @irq: The interrupt data for registering
134 * @nr_irqs: The number of interrupt descriptions in @irq.
135 *
136 * Register the UART interrupts specified by @irq including the demuxing
137 * routines. This supports the S3C6400 and newer style of devices.
138 */
139void __init s3c_init_uart_irqs(struct s3c_uart_irq *irq, unsigned int nr_irqs)
140{
141 for (; nr_irqs > 0; nr_irqs--, irq++)
142 s3c_init_uart_irq(irq);
143}
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c
new file mode 100644
index 000000000000..0270519fcabc
--- /dev/null
+++ b/arch/arm/plat-samsung/irq-vic-timer.c
@@ -0,0 +1,86 @@
1/* arch/arm/plat-samsung/irq-vic-timer.c
2 * originally part of arch/arm/plat-s3c64xx/irq.c
3 *
4 * Copyright 2008 Openmoko, Inc.
5 * Copyright 2008 Simtec Electronics
6 * Ben Dooks <ben@simtec.co.uk>
7 * http://armlinux.simtec.co.uk/
8 *
9 * S3C64XX - Interrupt handling
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/kernel.h>
17#include <linux/interrupt.h>
18#include <linux/irq.h>
19#include <linux/io.h>
20
21#include <mach/map.h>
22#include <plat/irq-vic-timer.h>
23#include <plat/regs-timer.h>
24
25static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc)
26{
27 generic_handle_irq((int)desc->handler_data);
28}
29
30/* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */
31
32static void s3c_irq_timer_mask(unsigned int irq)
33{
34 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
35
36 reg &= 0x1f; /* mask out pending interrupts */
37 reg &= ~(1 << (irq - IRQ_TIMER0));
38 __raw_writel(reg, S3C64XX_TINT_CSTAT);
39}
40
41static void s3c_irq_timer_unmask(unsigned int irq)
42{
43 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
44
45 reg &= 0x1f; /* mask out pending interrupts */
46 reg |= 1 << (irq - IRQ_TIMER0);
47 __raw_writel(reg, S3C64XX_TINT_CSTAT);
48}
49
50static void s3c_irq_timer_ack(unsigned int irq)
51{
52 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT);
53
54 reg &= 0x1f;
55 reg |= (1 << 5) << (irq - IRQ_TIMER0);
56 __raw_writel(reg, S3C64XX_TINT_CSTAT);
57}
58
59static struct irq_chip s3c_irq_timer = {
60 .name = "s3c-timer",
61 .mask = s3c_irq_timer_mask,
62 .unmask = s3c_irq_timer_unmask,
63 .ack = s3c_irq_timer_ack,
64};
65
66/**
67 * s3c_init_vic_timer_irq() - initialise timer irq chanined off VIC.\
68 * @parent_irq: The parent IRQ on the VIC for the timer.
69 * @timer_irq: The IRQ to be used for the timer.
70 *
71 * Register the necessary IRQ chaining and support for the timer IRQs
72 * chained of the VIC.
73 */
74void __init s3c_init_vic_timer_irq(unsigned int parent_irq,
75 unsigned int timer_irq)
76{
77 struct irq_desc *desc = irq_to_desc(parent_irq);
78
79 set_irq_chained_handler(parent_irq, s3c_irq_demux_vic_timer);
80
81 set_irq_chip(timer_irq, &s3c_irq_timer);
82 set_irq_handler(timer_irq, handle_level_irq);
83 set_irq_flags(timer_irq, IRQF_VALID);
84
85 desc->handler_data = (void *)timer_irq;
86}
diff --git a/arch/arm/plat-s3c/pm-check.c b/arch/arm/plat-samsung/pm-check.c
index 8eb1f439861c..0b5bb774192a 100644
--- a/arch/arm/plat-s3c/pm-check.c
+++ b/arch/arm/plat-samsung/pm-check.c
@@ -20,8 +20,8 @@
20 20
21#include <plat/pm.h> 21#include <plat/pm.h>
22 22
23#if CONFIG_S3C2410_PM_CHECK_CHUNKSIZE < 1 23#if CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE < 1
24#error CONFIG_S3C2410_PM_CHECK_CHUNKSIZE must be a positive non-zero value 24#error CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE must be a positive non-zero value
25#endif 25#endif
26 26
27/* suspend checking code... 27/* suspend checking code...
@@ -29,12 +29,12 @@
29 * this next area does a set of crc checks over all the installed 29 * this next area does a set of crc checks over all the installed
30 * memory, so the system can verify if the resume was ok. 30 * memory, so the system can verify if the resume was ok.
31 * 31 *
32 * CONFIG_S3C2410_PM_CHECK_CHUNKSIZE defines the block-size for the CRC, 32 * CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE defines the block-size for the CRC,
33 * increasing it will mean that the area corrupted will be less easy to spot, 33 * increasing it will mean that the area corrupted will be less easy to spot,
34 * and reducing the size will cause the CRC save area to grow 34 * and reducing the size will cause the CRC save area to grow
35*/ 35*/
36 36
37#define CHECK_CHUNKSIZE (CONFIG_S3C2410_PM_CHECK_CHUNKSIZE * 1024) 37#define CHECK_CHUNKSIZE (CONFIG_SAMSUNG_PM_CHECK_CHUNKSIZE * 1024)
38 38
39static u32 crc_size; /* size needed for the crc block */ 39static u32 crc_size; /* size needed for the crc block */
40static u32 *crcs; /* allocated over suspend/resume */ 40static u32 *crcs; /* allocated over suspend/resume */
diff --git a/arch/arm/plat-s3c/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index cfd326a8b693..69a4c7f02e25 100644
--- a/arch/arm/plat-s3c/pm-gpio.c
+++ b/arch/arm/plat-samsung/pm-gpio.c
@@ -19,7 +19,7 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21 21
22#include <mach/gpio-core.h> 22#include <plat/gpio-core.h>
23#include <plat/pm.h> 23#include <plat/pm.h>
24 24
25/* PM GPIO helpers */ 25/* PM GPIO helpers */
diff --git a/arch/arm/plat-s3c/pm.c b/arch/arm/plat-samsung/pm.c
index 767470601e5c..27cfca597699 100644
--- a/arch/arm/plat-s3c/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -29,7 +29,7 @@
29#include <asm/irq.h> 29#include <asm/irq.h>
30 30
31#include <plat/pm.h> 31#include <plat/pm.h>
32#include <plat/pm-core.h> 32#include <mach/pm-core.h>
33 33
34/* for external use */ 34/* for external use */
35 35
@@ -41,7 +41,7 @@ unsigned long s3c_pm_flags;
41 * resume before the console layer is available. 41 * resume before the console layer is available.
42*/ 42*/
43 43
44#ifdef CONFIG_S3C2410_PM_DEBUG 44#ifdef CONFIG_SAMSUNG_PM_DEBUG
45extern void printascii(const char *); 45extern void printascii(const char *);
46 46
47void s3c_pm_dbg(const char *fmt, ...) 47void s3c_pm_dbg(const char *fmt, ...)
@@ -65,13 +65,13 @@ static inline void s3c_pm_debug_init(void)
65#else 65#else
66#define s3c_pm_debug_init() do { } while(0) 66#define s3c_pm_debug_init() do { } while(0)
67 67
68#endif /* CONFIG_S3C2410_PM_DEBUG */ 68#endif /* CONFIG_SAMSUNG_PM_DEBUG */
69 69
70/* Save the UART configurations if we are configured for debug. */ 70/* Save the UART configurations if we are configured for debug. */
71 71
72unsigned char pm_uart_udivslot; 72unsigned char pm_uart_udivslot;
73 73
74#ifdef CONFIG_S3C2410_PM_DEBUG 74#ifdef CONFIG_SAMSUNG_PM_DEBUG
75 75
76struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS]; 76struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS];
77 77
diff --git a/arch/arm/plat-s3c/pwm-clock.c b/arch/arm/plat-samsung/pwm-clock.c
index a318215ab535..46c9381e083b 100644
--- a/arch/arm/plat-s3c/pwm-clock.c
+++ b/arch/arm/plat-samsung/pwm-clock.c
@@ -130,20 +130,22 @@ static int clk_pwm_scaler_set_rate(struct clk *clk, unsigned long rate)
130 return 0; 130 return 0;
131} 131}
132 132
133static struct clk_ops clk_pwm_scaler_ops = {
134 .get_rate = clk_pwm_scaler_get_rate,
135 .set_rate = clk_pwm_scaler_set_rate,
136 .round_rate = clk_pwm_scaler_round_rate,
137};
138
133static struct clk clk_timer_scaler[] = { 139static struct clk clk_timer_scaler[] = {
134 [0] = { 140 [0] = {
135 .name = "pwm-scaler0", 141 .name = "pwm-scaler0",
136 .id = -1, 142 .id = -1,
137 .get_rate = clk_pwm_scaler_get_rate, 143 .ops = &clk_pwm_scaler_ops,
138 .set_rate = clk_pwm_scaler_set_rate,
139 .round_rate = clk_pwm_scaler_round_rate,
140 }, 144 },
141 [1] = { 145 [1] = {
142 .name = "pwm-scaler1", 146 .name = "pwm-scaler1",
143 .id = -1, 147 .id = -1,
144 .get_rate = clk_pwm_scaler_get_rate, 148 .ops = &clk_pwm_scaler_ops,
145 .set_rate = clk_pwm_scaler_set_rate,
146 .round_rate = clk_pwm_scaler_round_rate,
147 }, 149 },
148}; 150};
149 151
@@ -256,50 +258,46 @@ static int clk_pwm_tdiv_set_rate(struct clk *clk, unsigned long rate)
256 return 0; 258 return 0;
257} 259}
258 260
261static struct clk_ops clk_tdiv_ops = {
262 .get_rate = clk_pwm_tdiv_get_rate,
263 .set_rate = clk_pwm_tdiv_set_rate,
264 .round_rate = clk_pwm_tdiv_round_rate,
265};
266
259static struct pwm_tdiv_clk clk_timer_tdiv[] = { 267static struct pwm_tdiv_clk clk_timer_tdiv[] = {
260 [0] = { 268 [0] = {
261 .clk = { 269 .clk = {
262 .name = "pwm-tdiv", 270 .name = "pwm-tdiv",
263 .parent = &clk_timer_scaler[0], 271 .ops = &clk_tdiv_ops,
264 .get_rate = clk_pwm_tdiv_get_rate, 272 .parent = &clk_timer_scaler[0],
265 .set_rate = clk_pwm_tdiv_set_rate,
266 .round_rate = clk_pwm_tdiv_round_rate,
267 }, 273 },
268 }, 274 },
269 [1] = { 275 [1] = {
270 .clk = { 276 .clk = {
271 .name = "pwm-tdiv", 277 .name = "pwm-tdiv",
272 .parent = &clk_timer_scaler[0], 278 .ops = &clk_tdiv_ops,
273 .get_rate = clk_pwm_tdiv_get_rate, 279 .parent = &clk_timer_scaler[0],
274 .set_rate = clk_pwm_tdiv_set_rate,
275 .round_rate = clk_pwm_tdiv_round_rate,
276 } 280 }
277 }, 281 },
278 [2] = { 282 [2] = {
279 .clk = { 283 .clk = {
280 .name = "pwm-tdiv", 284 .name = "pwm-tdiv",
281 .parent = &clk_timer_scaler[1], 285 .ops = &clk_tdiv_ops,
282 .get_rate = clk_pwm_tdiv_get_rate, 286 .parent = &clk_timer_scaler[1],
283 .set_rate = clk_pwm_tdiv_set_rate,
284 .round_rate = clk_pwm_tdiv_round_rate,
285 }, 287 },
286 }, 288 },
287 [3] = { 289 [3] = {
288 .clk = { 290 .clk = {
289 .name = "pwm-tdiv", 291 .name = "pwm-tdiv",
290 .parent = &clk_timer_scaler[1], 292 .ops = &clk_tdiv_ops,
291 .get_rate = clk_pwm_tdiv_get_rate, 293 .parent = &clk_timer_scaler[1],
292 .set_rate = clk_pwm_tdiv_set_rate,
293 .round_rate = clk_pwm_tdiv_round_rate,
294 }, 294 },
295 }, 295 },
296 [4] = { 296 [4] = {
297 .clk = { 297 .clk = {
298 .name = "pwm-tdiv", 298 .name = "pwm-tdiv",
299 .parent = &clk_timer_scaler[1], 299 .ops = &clk_tdiv_ops,
300 .get_rate = clk_pwm_tdiv_get_rate, 300 .parent = &clk_timer_scaler[1],
301 .set_rate = clk_pwm_tdiv_set_rate,
302 .round_rate = clk_pwm_tdiv_round_rate,
303 }, 301 },
304 }, 302 },
305}; 303};
@@ -356,31 +354,35 @@ static int clk_pwm_tin_set_parent(struct clk *clk, struct clk *parent)
356 return 0; 354 return 0;
357} 355}
358 356
357static struct clk_ops clk_tin_ops = {
358 .set_parent = clk_pwm_tin_set_parent,
359};
360
359static struct clk clk_tin[] = { 361static struct clk clk_tin[] = {
360 [0] = { 362 [0] = {
361 .name = "pwm-tin", 363 .name = "pwm-tin",
362 .id = 0, 364 .id = 0,
363 .set_parent = clk_pwm_tin_set_parent, 365 .ops = &clk_tin_ops,
364 }, 366 },
365 [1] = { 367 [1] = {
366 .name = "pwm-tin", 368 .name = "pwm-tin",
367 .id = 1, 369 .id = 1,
368 .set_parent = clk_pwm_tin_set_parent, 370 .ops = &clk_tin_ops,
369 }, 371 },
370 [2] = { 372 [2] = {
371 .name = "pwm-tin", 373 .name = "pwm-tin",
372 .id = 2, 374 .id = 2,
373 .set_parent = clk_pwm_tin_set_parent, 375 .ops = &clk_tin_ops,
374 }, 376 },
375 [3] = { 377 [3] = {
376 .name = "pwm-tin", 378 .name = "pwm-tin",
377 .id = 3, 379 .id = 3,
378 .set_parent = clk_pwm_tin_set_parent, 380 .ops = &clk_tin_ops,
379 }, 381 },
380 [4] = { 382 [4] = {
381 .name = "pwm-tin", 383 .name = "pwm-tin",
382 .id = 4, 384 .id = 4,
383 .set_parent = clk_pwm_tin_set_parent, 385 .ops = &clk_tin_ops,
384 }, 386 },
385}; 387};
386 388
@@ -428,25 +430,15 @@ __init void s3c_pwmclk_init(void)
428 return; 430 return;
429 } 431 }
430 432
431 for (clk = 0; clk < ARRAY_SIZE(clk_timer_scaler); clk++) { 433 for (clk = 0; clk < ARRAY_SIZE(clk_timer_scaler); clk++)
432 clk_timer_scaler[clk].parent = clk_timers; 434 clk_timer_scaler[clk].parent = clk_timers;
433 ret = s3c24xx_register_clock(&clk_timer_scaler[clk]);
434 if (ret < 0) {
435 printk(KERN_ERR "error adding pwm scaler%d clock\n", clk);
436 return;
437 }
438 }
439 435
440 for (clk = 0; clk < ARRAY_SIZE(clk_timer_tclk); clk++) { 436 s3c_register_clocks(clk_timer_scaler, ARRAY_SIZE(clk_timer_scaler));
441 ret = s3c24xx_register_clock(&clk_timer_tclk[clk]); 437 s3c_register_clocks(clk_timer_tclk, ARRAY_SIZE(clk_timer_tclk));
442 if (ret < 0) {
443 printk(KERN_ERR "error adding pww tclk%d\n", clk);
444 return;
445 }
446 }
447 438
448 for (clk = 0; clk < ARRAY_SIZE(clk_timer_tdiv); clk++) { 439 for (clk = 0; clk < ARRAY_SIZE(clk_timer_tdiv); clk++) {
449 ret = clk_pwm_tdiv_register(clk); 440 ret = clk_pwm_tdiv_register(clk);
441
450 if (ret < 0) { 442 if (ret < 0) {
451 printk(KERN_ERR "error adding pwm%d tdiv clock\n", clk); 443 printk(KERN_ERR "error adding pwm%d tdiv clock\n", clk);
452 return; 444 return;
diff --git a/arch/arm/plat-s3c/pwm.c b/arch/arm/plat-samsung/pwm.c
index ef019f27b67d..ef019f27b67d 100644
--- a/arch/arm/plat-s3c/pwm.c
+++ b/arch/arm/plat-samsung/pwm.c
diff --git a/arch/arm/plat-s3c/time.c b/arch/arm/plat-samsung/time.c
index 3b27b29da478..2231d80ad817 100644
--- a/arch/arm/plat-s3c/time.c
+++ b/arch/arm/plat-samsung/time.c
@@ -1,4 +1,4 @@
1/* linux/arch/arm/plat-s3c24xx/time.c 1/* linux/arch/arm/plat-samsung/time.c
2 * 2 *
3 * Copyright (C) 2003-2005 Simtec Electronics 3 * Copyright (C) 2003-2005 Simtec Electronics
4 * Ben Dooks, <ben@simtec.co.uk> 4 * Ben Dooks, <ben@simtec.co.uk>
diff --git a/arch/avr32/include/asm/ptrace.h b/arch/avr32/include/asm/ptrace.h
index 9e2d44f4e0fe..e53dd0d900f5 100644
--- a/arch/avr32/include/asm/ptrace.h
+++ b/arch/avr32/include/asm/ptrace.h
@@ -124,6 +124,8 @@ struct pt_regs {
124 124
125#include <asm/ocd.h> 125#include <asm/ocd.h>
126 126
127#define arch_has_single_step() (1)
128
127#define arch_ptrace_attach(child) ocd_enable(child) 129#define arch_ptrace_attach(child) ocd_enable(child)
128 130
129#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER) 131#define user_mode(regs) (((regs)->sr & MODE_MASK) == MODE_USER)
diff --git a/arch/avr32/kernel/ptrace.c b/arch/avr32/kernel/ptrace.c
index 1fed38fcf594..dd5b882aab40 100644
--- a/arch/avr32/kernel/ptrace.c
+++ b/arch/avr32/kernel/ptrace.c
@@ -28,9 +28,9 @@ static struct pt_regs *get_user_regs(struct task_struct *tsk)
28 THREAD_SIZE - sizeof(struct pt_regs)); 28 THREAD_SIZE - sizeof(struct pt_regs));
29} 29}
30 30
31static void ptrace_single_step(struct task_struct *tsk) 31static void user_enable_single_step(struct task_struct *tsk)
32{ 32{
33 pr_debug("ptrace_single_step: pid=%u, PC=0x%08lx, SR=0x%08lx\n", 33 pr_debug("user_enable_single_step: pid=%u, PC=0x%08lx, SR=0x%08lx\n",
34 tsk->pid, task_pt_regs(tsk)->pc, task_pt_regs(tsk)->sr); 34 tsk->pid, task_pt_regs(tsk)->pc, task_pt_regs(tsk)->sr);
35 35
36 /* 36 /*
@@ -49,6 +49,11 @@ static void ptrace_single_step(struct task_struct *tsk)
49 set_tsk_thread_flag(tsk, TIF_SINGLE_STEP); 49 set_tsk_thread_flag(tsk, TIF_SINGLE_STEP);
50} 50}
51 51
52void user_disable_single_step(struct task_struct *child)
53{
54 /* XXX(hch): a no-op here seems wrong.. */
55}
56
52/* 57/*
53 * Called by kernel/ptrace.c when detaching 58 * Called by kernel/ptrace.c when detaching
54 * 59 *
@@ -167,50 +172,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
167 ret = ptrace_write_user(child, addr, data); 172 ret = ptrace_write_user(child, addr, data);
168 break; 173 break;
169 174
170 /* continue and stop at next (return from) syscall */
171 case PTRACE_SYSCALL:
172 /* restart after signal */
173 case PTRACE_CONT:
174 ret = -EIO;
175 if (!valid_signal(data))
176 break;
177 if (request == PTRACE_SYSCALL)
178 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
179 else
180 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
181 child->exit_code = data;
182 /* XXX: Are we sure no breakpoints are active here? */
183 wake_up_process(child);
184 ret = 0;
185 break;
186
187 /*
188 * Make the child exit. Best I can do is send it a
189 * SIGKILL. Perhaps it should be put in the status that it
190 * wants to exit.
191 */
192 case PTRACE_KILL:
193 ret = 0;
194 if (child->exit_state == EXIT_ZOMBIE)
195 break;
196 child->exit_code = SIGKILL;
197 wake_up_process(child);
198 break;
199
200 /*
201 * execute single instruction.
202 */
203 case PTRACE_SINGLESTEP:
204 ret = -EIO;
205 if (!valid_signal(data))
206 break;
207 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
208 ptrace_single_step(child);
209 child->exit_code = data;
210 wake_up_process(child);
211 ret = 0;
212 break;
213
214 case PTRACE_GETREGS: 175 case PTRACE_GETREGS:
215 ret = ptrace_getregs(child, (void __user *)data); 176 ret = ptrace_getregs(child, (void __user *)data);
216 break; 177 break;
diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index f9172ff30e5c..413a30314a6f 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -65,13 +65,6 @@ _dma_sync(dma_addr_t addr, size_t size, enum dma_data_direction dir)
65 } 65 }
66} 66}
67 67
68/*
69 * Map a single buffer of the indicated size for DMA in streaming mode.
70 * The 32-bit bus address to use is returned.
71 *
72 * Once the device is given the dma address, the device owns this memory
73 * until either pci_unmap_single or pci_dma_sync_single is performed.
74 */
75static inline dma_addr_t 68static inline dma_addr_t
76dma_map_single(struct device *dev, void *ptr, size_t size, 69dma_map_single(struct device *dev, void *ptr, size_t size,
77 enum dma_data_direction dir) 70 enum dma_data_direction dir)
@@ -88,14 +81,6 @@ dma_map_page(struct device *dev, struct page *page,
88 return dma_map_single(dev, page_address(page) + offset, size, dir); 81 return dma_map_single(dev, page_address(page) + offset, size, dir);
89} 82}
90 83
91/*
92 * Unmap a single streaming mode DMA translation. The dma_addr and size
93 * must match what was provided for in a previous pci_map_single call. All
94 * other usages are undefined.
95 *
96 * After this call, reads by the cpu to the buffer are guarenteed to see
97 * whatever the device wrote there.
98 */
99static inline void 84static inline void
100dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 85dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
101 enum dma_data_direction dir) 86 enum dma_data_direction dir)
@@ -110,30 +95,9 @@ dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
110 dma_unmap_single(dev, dma_addr, size, dir); 95 dma_unmap_single(dev, dma_addr, size, dir);
111} 96}
112 97
113/*
114 * Map a set of buffers described by scatterlist in streaming
115 * mode for DMA. This is the scather-gather version of the
116 * above pci_map_single interface. Here the scatter gather list
117 * elements are each tagged with the appropriate dma address
118 * and length. They are obtained via sg_dma_{address,length}(SG).
119 *
120 * NOTE: An implementation may be able to use a smaller number of
121 * DMA address/length pairs than there are SG table elements.
122 * (for example via virtual mapping capabilities)
123 * The routine returns the number of addr/length pairs actually
124 * used, at most nents.
125 *
126 * Device ownership issues as mentioned above for pci_map_single are
127 * the same here.
128 */
129extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 98extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
130 enum dma_data_direction dir); 99 enum dma_data_direction dir);
131 100
132/*
133 * Unmap a set of streaming mode DMA translations.
134 * Again, cpu read rules concerning calls here are the same as for
135 * pci_unmap_single() above.
136 */
137static inline void 101static inline void
138dma_unmap_sg(struct device *dev, struct scatterlist *sg, 102dma_unmap_sg(struct device *dev, struct scatterlist *sg,
139 int nhwentries, enum dma_data_direction dir) 103 int nhwentries, enum dma_data_direction dir)
diff --git a/arch/blackfin/include/asm/nand.h b/arch/blackfin/include/asm/nand.h
index 3ae8b569edfc..3a1e79dfc8d9 100644
--- a/arch/blackfin/include/asm/nand.h
+++ b/arch/blackfin/include/asm/nand.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * BF5XX - NAND flash controller platfrom_device info 2 * BF5XX - NAND flash controller platform_device info
3 * 3 *
4 * Copyright 2007-2008 Analog Devices, Inc. 4 * Copyright 2007-2008 Analog Devices, Inc.
5 * 5 *
@@ -8,7 +8,7 @@
8 8
9/* struct bf5xx_nand_platform 9/* struct bf5xx_nand_platform
10 * 10 *
11 * define a interface between platfrom board specific code and 11 * define a interface between platform board specific code and
12 * bf54x NFC driver. 12 * bf54x NFC driver.
13 * 13 *
14 * nr_partitions = number of partitions pointed to be partitoons (or zero) 14 * nr_partitions = number of partitions pointed to be partitoons (or zero)
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index c52bef39e250..0d6420d087fd 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -692,7 +692,7 @@ sys_call_table:
692 .long sys_swapon 692 .long sys_swapon
693 .long sys_reboot 693 .long sys_reboot
694 .long sys_old_readdir 694 .long sys_old_readdir
695 .long old_mmap /* 90 */ 695 .long sys_old_mmap /* 90 */
696 .long sys_munmap 696 .long sys_munmap
697 .long sys_truncate 697 .long sys_truncate
698 .long sys_ftruncate 698 .long sys_ftruncate
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index ee505b2eb4db..e70c804e9377 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -127,57 +127,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
127 ret = 0; 127 ret = 0;
128 break; 128 break;
129 129
130 case PTRACE_SYSCALL:
131 case PTRACE_CONT:
132 ret = -EIO;
133
134 if (!valid_signal(data))
135 break;
136
137 if (request == PTRACE_SYSCALL) {
138 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
139 }
140 else {
141 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
142 }
143
144 child->exit_code = data;
145
146 /* TODO: make sure any pending breakpoint is killed */
147 wake_up_process(child);
148 ret = 0;
149
150 break;
151
152 /* Make the child exit by sending it a sigkill. */
153 case PTRACE_KILL:
154 ret = 0;
155
156 if (child->exit_state == EXIT_ZOMBIE)
157 break;
158
159 child->exit_code = SIGKILL;
160
161 /* TODO: make sure any pending breakpoint is killed */
162 wake_up_process(child);
163 break;
164
165 /* Set the trap flag. */
166 case PTRACE_SINGLESTEP:
167 ret = -EIO;
168
169 if (!valid_signal(data))
170 break;
171
172 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
173
174 /* TODO: set some clever breakpoint mechanism... */
175
176 child->exit_code = data;
177 wake_up_process(child);
178 ret = 0;
179 break;
180
181 /* Get all GP registers from the child. */ 130 /* Get all GP registers from the child. */
182 case PTRACE_GETREGS: { 131 case PTRACE_GETREGS: {
183 int i; 132 int i;
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c
index 1734b467efa6..8f79163f1394 100644
--- a/arch/cris/arch-v10/lib/old_checksum.c
+++ b/arch/cris/arch-v10/lib/old_checksum.c
@@ -77,7 +77,7 @@ __wsum csum_partial(const void *p, int len, __wsum __sum)
77 sum += *buff++; 77 sum += *buff++;
78 78
79 if (endMarker > buff) 79 if (endMarker > buff)
80 sum += *(const u8 *)buff; /* add extra byte seperately */ 80 sum += *(const u8 *)buff; /* add extra byte separately */
81 81
82 BITOFF; 82 BITOFF;
83 return (__force __wsum)sum; 83 return (__force __wsum)sum;
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index 435b9671bd4b..1f39861eac8c 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -615,7 +615,7 @@ sys_call_table:
615 .long sys_swapon 615 .long sys_swapon
616 .long sys_reboot 616 .long sys_reboot
617 .long sys_old_readdir 617 .long sys_old_readdir
618 .long old_mmap /* 90 */ 618 .long sys_old_mmap /* 90 */
619 .long sys_munmap 619 .long sys_munmap
620 .long sys_truncate 620 .long sys_truncate
621 .long sys_ftruncate 621 .long sys_ftruncate
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index dd401473f5b5..f4ebd1e7d0f5 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -78,6 +78,35 @@ int put_reg(struct task_struct *task, unsigned int regno, unsigned long data)
78 return 0; 78 return 0;
79} 79}
80 80
81void user_enable_single_step(struct task_struct *child)
82{
83 unsigned long tmp;
84
85 /*
86 * Set up SPC if not set already (in which case we have no other
87 * choice but to trust it).
88 */
89 if (!get_reg(child, PT_SPC)) {
90 /* In case we're stopped in a delay slot. */
91 tmp = get_reg(child, PT_ERP) & ~1;
92 put_reg(child, PT_SPC, tmp);
93 }
94 tmp = get_reg(child, PT_CCS) | SBIT_USER;
95 put_reg(child, PT_CCS, tmp);
96}
97
98void user_disable_single_step(struct task_struct *child)
99{
100 put_reg(child, PT_SPC, 0);
101
102 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
103 unsigned long tmp;
104 /* If no h/w bp configured, disable S bit. */
105 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
106 put_reg(child, PT_CCS, tmp);
107 }
108}
109
81/* 110/*
82 * Called by kernel/ptrace.c when detaching. 111 * Called by kernel/ptrace.c when detaching.
83 * 112 *
@@ -89,8 +118,7 @@ ptrace_disable(struct task_struct *child)
89 unsigned long tmp; 118 unsigned long tmp;
90 119
91 /* Deconfigure SPC and S-bit. */ 120 /* Deconfigure SPC and S-bit. */
92 tmp = get_reg(child, PT_CCS) & ~SBIT_USER; 121 user_disable_single_step(child);
93 put_reg(child, PT_CCS, tmp);
94 put_reg(child, PT_SPC, 0); 122 put_reg(child, PT_SPC, 0);
95 123
96 /* Deconfigure any watchpoints associated with the child. */ 124 /* Deconfigure any watchpoints associated with the child. */
@@ -169,83 +197,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
169 ret = 0; 197 ret = 0;
170 break; 198 break;
171 199
172 case PTRACE_SYSCALL:
173 case PTRACE_CONT:
174 ret = -EIO;
175
176 if (!valid_signal(data))
177 break;
178
179 /* Continue means no single-step. */
180 put_reg(child, PT_SPC, 0);
181
182 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
183 unsigned long tmp;
184 /* If no h/w bp configured, disable S bit. */
185 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
186 put_reg(child, PT_CCS, tmp);
187 }
188
189 if (request == PTRACE_SYSCALL) {
190 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
191 }
192 else {
193 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
194 }
195
196 child->exit_code = data;
197
198 /* TODO: make sure any pending breakpoint is killed */
199 wake_up_process(child);
200 ret = 0;
201
202 break;
203
204 /* Make the child exit by sending it a sigkill. */
205 case PTRACE_KILL:
206 ret = 0;
207
208 if (child->exit_state == EXIT_ZOMBIE)
209 break;
210
211 child->exit_code = SIGKILL;
212
213 /* Deconfigure single-step and h/w bp. */
214 ptrace_disable(child);
215
216 /* TODO: make sure any pending breakpoint is killed */
217 wake_up_process(child);
218 break;
219
220 /* Set the trap flag. */
221 case PTRACE_SINGLESTEP: {
222 unsigned long tmp;
223 ret = -EIO;
224
225 /* Set up SPC if not set already (in which case we have
226 no other choice but to trust it). */
227 if (!get_reg(child, PT_SPC)) {
228 /* In case we're stopped in a delay slot. */
229 tmp = get_reg(child, PT_ERP) & ~1;
230 put_reg(child, PT_SPC, tmp);
231 }
232 tmp = get_reg(child, PT_CCS) | SBIT_USER;
233 put_reg(child, PT_CCS, tmp);
234
235 if (!valid_signal(data))
236 break;
237
238 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
239
240 /* TODO: set some clever breakpoint mechanism... */
241
242 child->exit_code = data;
243 wake_up_process(child);
244 ret = 0;
245 break;
246
247 }
248
249 /* Get all GP registers from the child. */ 200 /* Get all GP registers from the child. */
250 case PTRACE_GETREGS: { 201 case PTRACE_GETREGS: {
251 int i; 202 int i;
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
index 6779bcb28ab0..c030d020660a 100644
--- a/arch/cris/arch-v32/mm/tlb.c
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -189,7 +189,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
189 spin_unlock(&mmu_context_lock); 189 spin_unlock(&mmu_context_lock);
190 190
191 /* 191 /*
192 * Remember the pgd for the fault handlers. Keep a seperate 192 * Remember the pgd for the fault handlers. Keep a separate
193 * copy of it because current and active_mm might be invalid 193 * copy of it because current and active_mm might be invalid
194 * at points where * there's still a need to derefer the pgd. 194 * at points where * there's still a need to derefer the pgd.
195 */ 195 */
diff --git a/arch/cris/include/arch-v32/arch/ptrace.h b/arch/cris/include/arch-v32/arch/ptrace.h
index 41f4e8662bc2..ffca8d0f2e17 100644
--- a/arch/cris/include/arch-v32/arch/ptrace.h
+++ b/arch/cris/include/arch-v32/arch/ptrace.h
@@ -108,6 +108,7 @@ struct switch_stack {
108 108
109#ifdef __KERNEL__ 109#ifdef __KERNEL__
110 110
111#define arch_has_single_step() (1)
111#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0) 112#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
112#define instruction_pointer(regs) ((regs)->erp) 113#define instruction_pointer(regs) ((regs)->erp)
113extern void show_regs(struct pt_regs *); 114extern void show_regs(struct pt_regs *);
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h
index 730ce40fdd0f..9f1cd56da28c 100644
--- a/arch/cris/include/asm/pci.h
+++ b/arch/cris/include/asm/pci.h
@@ -44,14 +44,6 @@ struct pci_dev;
44 */ 44 */
45#define PCI_DMA_BUS_IS_PHYS (1) 45#define PCI_DMA_BUS_IS_PHYS (1)
46 46
47/* pci_unmap_{page,single} is a nop so... */
48#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
49#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
50#define pci_unmap_addr(PTR, ADDR_NAME) (0)
51#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
52#define pci_unmap_len(PTR, LEN_NAME) (0)
53#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
54
55#define HAVE_PCI_MMAP 47#define HAVE_PCI_MMAP
56extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 48extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
57 enum pci_mmap_state mmap_state, int write_combine); 49 enum pci_mmap_state mmap_state, int write_combine);
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h
index c17079388bb9..f6fad83b3a8c 100644
--- a/arch/cris/include/asm/unistd.h
+++ b/arch/cris/include/asm/unistd.h
@@ -352,6 +352,7 @@
352#define __ARCH_WANT_STAT64 352#define __ARCH_WANT_STAT64
353#define __ARCH_WANT_SYS_ALARM 353#define __ARCH_WANT_SYS_ALARM
354#define __ARCH_WANT_SYS_GETHOSTNAME 354#define __ARCH_WANT_SYS_GETHOSTNAME
355#define __ARCH_WANT_SYS_IPC
355#define __ARCH_WANT_SYS_PAUSE 356#define __ARCH_WANT_SYS_PAUSE
356#define __ARCH_WANT_SYS_SGETMASK 357#define __ARCH_WANT_SYS_SGETMASK
357#define __ARCH_WANT_SYS_SIGNAL 358#define __ARCH_WANT_SYS_SIGNAL
@@ -364,6 +365,7 @@
364#define __ARCH_WANT_SYS_LLSEEK 365#define __ARCH_WANT_SYS_LLSEEK
365#define __ARCH_WANT_SYS_NICE 366#define __ARCH_WANT_SYS_NICE
366#define __ARCH_WANT_SYS_OLD_GETRLIMIT 367#define __ARCH_WANT_SYS_OLD_GETRLIMIT
368#define __ARCH_WANT_SYS_OLD_MMAP
367#define __ARCH_WANT_SYS_OLDUMOUNT 369#define __ARCH_WANT_SYS_OLDUMOUNT
368#define __ARCH_WANT_SYS_SIGPENDING 370#define __ARCH_WANT_SYS_SIGPENDING
369#define __ARCH_WANT_SYS_SIGPROCMASK 371#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index c2bbb1ac98a9..7aa036ec78ff 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -26,24 +26,6 @@
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/segment.h> 27#include <asm/segment.h>
28 28
29asmlinkage unsigned long old_mmap(unsigned long __user *args)
30{
31 unsigned long buffer[6];
32 int err = -EFAULT;
33
34 if (copy_from_user(&buffer, args, sizeof(buffer)))
35 goto out;
36
37 err = -EINVAL;
38 if (buffer[5] & ~PAGE_MASK) /* verify that offset is on page boundary */
39 goto out;
40
41 err = sys_mmap_pgoff(buffer[0], buffer[1], buffer[2], buffer[3],
42 buffer[4], buffer[5] >> PAGE_SHIFT);
43out:
44 return err;
45}
46
47asmlinkage long 29asmlinkage long
48sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, 30sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
49 unsigned long flags, unsigned long fd, unsigned long pgoff) 31 unsigned long flags, unsigned long fd, unsigned long pgoff)
@@ -51,81 +33,3 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
51 /* bug(?): 8Kb pages here */ 33 /* bug(?): 8Kb pages here */
52 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); 34 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
53} 35}
54
55/*
56 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
57 *
58 * This is really horribly ugly. (same as arch/i386)
59 */
60
61asmlinkage int sys_ipc (uint call, int first, int second,
62 int third, void __user *ptr, long fifth)
63{
64 int version, ret;
65
66 version = call >> 16; /* hack for backward compatibility */
67 call &= 0xffff;
68
69 switch (call) {
70 case SEMOP:
71 return sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
72 case SEMTIMEDOP:
73 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
74 (const struct timespec __user *)fifth);
75
76 case SEMGET:
77 return sys_semget (first, second, third);
78 case SEMCTL: {
79 union semun fourth;
80 if (!ptr)
81 return -EINVAL;
82 if (get_user(fourth.__pad, (void * __user *) ptr))
83 return -EFAULT;
84 return sys_semctl (first, second, third, fourth);
85 }
86
87 case MSGSND:
88 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
89 second, third);
90 case MSGRCV:
91 switch (version) {
92 case 0: {
93 struct ipc_kludge tmp;
94 if (!ptr)
95 return -EINVAL;
96
97 if (copy_from_user(&tmp,
98 (struct ipc_kludge __user *) ptr,
99 sizeof (tmp)))
100 return -EFAULT;
101 return sys_msgrcv (first, tmp.msgp, second,
102 tmp.msgtyp, third);
103 }
104 default:
105 return sys_msgrcv (first,
106 (struct msgbuf __user *) ptr,
107 second, fifth, third);
108 }
109 case MSGGET:
110 return sys_msgget ((key_t) first, second);
111 case MSGCTL:
112 return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
113
114 case SHMAT: {
115 ulong raddr;
116 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
117 if (ret)
118 return ret;
119 return put_user (raddr, (ulong __user *) third);
120 }
121 case SHMDT:
122 return sys_shmdt ((char __user *)ptr);
123 case SHMGET:
124 return sys_shmget (first, second, third);
125 case SHMCTL:
126 return sys_shmctl (first, second,
127 (struct shmid_ds __user *) ptr);
128 default:
129 return -ENOSYS;
130 }
131}
diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index b2898877c07b..6af5d83e2fb2 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -7,6 +7,11 @@
7#include <asm/scatterlist.h> 7#include <asm/scatterlist.h>
8#include <asm/io.h> 8#include <asm/io.h>
9 9
10/*
11 * See Documentation/DMA-API.txt for the description of how the
12 * following DMA API should work.
13 */
14
10#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 15#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
11#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 16#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
12 17
@@ -16,24 +21,9 @@ extern unsigned long __nongprelbss dma_coherent_mem_end;
16void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); 21void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp);
17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); 22void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle);
18 23
19/*
20 * Map a single buffer of the indicated size for DMA in streaming mode.
21 * The 32-bit bus address to use is returned.
22 *
23 * Once the device is given the dma address, the device owns this memory
24 * until either pci_unmap_single or pci_dma_sync_single is performed.
25 */
26extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 24extern dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
27 enum dma_data_direction direction); 25 enum dma_data_direction direction);
28 26
29/*
30 * Unmap a single streaming mode DMA translation. The dma_addr and size
31 * must match what was provided for in a previous pci_map_single call. All
32 * other usages are undefined.
33 *
34 * After this call, reads by the cpu to the buffer are guarenteed to see
35 * whatever the device wrote there.
36 */
37static inline 27static inline
38void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 28void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
39 enum dma_data_direction direction) 29 enum dma_data_direction direction)
@@ -41,30 +31,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
41 BUG_ON(direction == DMA_NONE); 31 BUG_ON(direction == DMA_NONE);
42} 32}
43 33
44/*
45 * Map a set of buffers described by scatterlist in streaming
46 * mode for DMA. This is the scather-gather version of the
47 * above pci_map_single interface. Here the scatter gather list
48 * elements are each tagged with the appropriate dma address
49 * and length. They are obtained via sg_dma_{address,length}(SG).
50 *
51 * NOTE: An implementation may be able to use a smaller number of
52 * DMA address/length pairs than there are SG table elements.
53 * (for example via virtual mapping capabilities)
54 * The routine returns the number of addr/length pairs actually
55 * used, at most nents.
56 *
57 * Device ownership issues as mentioned above for pci_map_single are
58 * the same here.
59 */
60extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 34extern int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
61 enum dma_data_direction direction); 35 enum dma_data_direction direction);
62 36
63/*
64 * Unmap a set of streaming mode DMA translations.
65 * Again, cpu read rules concerning calls here are the same as for
66 * pci_unmap_single() above.
67 */
68static inline 37static inline
69void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 38void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
70 enum dma_data_direction direction) 39 enum dma_data_direction direction)
diff --git a/arch/frv/include/asm/pci.h b/arch/frv/include/asm/pci.h
index 8c7260a3cd41..0d5997909850 100644
--- a/arch/frv/include/asm/pci.h
+++ b/arch/frv/include/asm/pci.h
@@ -43,14 +43,6 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
43/* Return the index of the PCI controller for device PDEV. */ 43/* Return the index of the PCI controller for device PDEV. */
44#define pci_controller_num(PDEV) (0) 44#define pci_controller_num(PDEV) (0)
45 45
46/* pci_unmap_{page,single} is a nop so... */
47#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
48#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
49#define pci_unmap_addr(PTR, ADDR_NAME) (0)
50#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
51#define pci_unmap_len(PTR, LEN_NAME) (0)
52#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
53
54#ifdef CONFIG_PCI 46#ifdef CONFIG_PCI
55static inline void pci_dma_burst_advice(struct pci_dev *pdev, 47static inline void pci_dma_burst_advice(struct pci_dev *pdev,
56 enum pci_dma_burst_strategy *strat, 48 enum pci_dma_burst_strategy *strat,
diff --git a/arch/frv/include/asm/ptrace.h b/arch/frv/include/asm/ptrace.h
index a54b535c9e49..6bfad4cf1907 100644
--- a/arch/frv/include/asm/ptrace.h
+++ b/arch/frv/include/asm/ptrace.h
@@ -84,8 +84,6 @@ extern void show_regs(struct pt_regs *);
84#define task_pt_regs(task) ((task)->thread.frame0) 84#define task_pt_regs(task) ((task)->thread.frame0)
85 85
86#define arch_has_single_step() (1) 86#define arch_has_single_step() (1)
87extern void user_enable_single_step(struct task_struct *);
88extern void user_disable_single_step(struct task_struct *);
89 87
90#endif /* !__ASSEMBLY__ */ 88#endif /* !__ASSEMBLY__ */
91#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h
index be6ef0f5cd42..b28da499e22a 100644
--- a/arch/frv/include/asm/unistd.h
+++ b/arch/frv/include/asm/unistd.h
@@ -354,6 +354,7 @@
354#define __ARCH_WANT_STAT64 354#define __ARCH_WANT_STAT64
355#define __ARCH_WANT_SYS_ALARM 355#define __ARCH_WANT_SYS_ALARM
356/* #define __ARCH_WANT_SYS_GETHOSTNAME */ 356/* #define __ARCH_WANT_SYS_GETHOSTNAME */
357#define __ARCH_WANT_SYS_IPC
357#define __ARCH_WANT_SYS_PAUSE 358#define __ARCH_WANT_SYS_PAUSE
358/* #define __ARCH_WANT_SYS_SGETMASK */ 359/* #define __ARCH_WANT_SYS_SGETMASK */
359/* #define __ARCH_WANT_SYS_SIGNAL */ 360/* #define __ARCH_WANT_SYS_SIGNAL */
diff --git a/arch/frv/kernel/sys_frv.c b/arch/frv/kernel/sys_frv.c
index 1d3d4c9e2521..9c4980825bbb 100644
--- a/arch/frv/kernel/sys_frv.c
+++ b/arch/frv/kernel/sys_frv.c
@@ -42,92 +42,3 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
42 return sys_mmap_pgoff(addr, len, prot, flags, fd, 42 return sys_mmap_pgoff(addr, len, prot, flags, fd,
43 pgoff >> (PAGE_SHIFT - 12)); 43 pgoff >> (PAGE_SHIFT - 12));
44} 44}
45
46/*
47 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
48 *
49 * This is really horribly ugly.
50 */
51asmlinkage long sys_ipc(unsigned long call,
52 unsigned long first,
53 unsigned long second,
54 unsigned long third,
55 void __user *ptr,
56 unsigned long fifth)
57{
58 int version, ret;
59
60 version = call >> 16; /* hack for backward compatibility */
61 call &= 0xffff;
62
63 switch (call) {
64 case SEMOP:
65 return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL);
66 case SEMTIMEDOP:
67 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
68 (const struct timespec __user *)fifth);
69
70 case SEMGET:
71 return sys_semget (first, second, third);
72 case SEMCTL: {
73 union semun fourth;
74 if (!ptr)
75 return -EINVAL;
76 if (get_user(fourth.__pad, (void * __user *) ptr))
77 return -EFAULT;
78 return sys_semctl (first, second, third, fourth);
79 }
80
81 case MSGSND:
82 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
83 second, third);
84 case MSGRCV:
85 switch (version) {
86 case 0: {
87 struct ipc_kludge tmp;
88 if (!ptr)
89 return -EINVAL;
90
91 if (copy_from_user(&tmp,
92 (struct ipc_kludge __user *) ptr,
93 sizeof (tmp)))
94 return -EFAULT;
95 return sys_msgrcv (first, tmp.msgp, second,
96 tmp.msgtyp, third);
97 }
98 default:
99 return sys_msgrcv (first,
100 (struct msgbuf __user *) ptr,
101 second, fifth, third);
102 }
103 case MSGGET:
104 return sys_msgget ((key_t) first, second);
105 case MSGCTL:
106 return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
107
108 case SHMAT:
109 switch (version) {
110 default: {
111 ulong raddr;
112 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
113 if (ret)
114 return ret;
115 return put_user (raddr, (ulong __user *) third);
116 }
117 case 1: /* iBCS2 emulator entry point */
118 if (!segment_eq(get_fs(), get_ds()))
119 return -EINVAL;
120 /* The "(ulong *) third" is valid _only_ because of the kernel segment thing */
121 return do_shmat (first, (char __user *) ptr, second, (ulong *) third);
122 }
123 case SHMDT:
124 return sys_shmdt ((char __user *)ptr);
125 case SHMGET:
126 return sys_shmget (first, second, third);
127 case SHMCTL:
128 return sys_shmctl (first, second,
129 (struct shmid_ds __user *) ptr);
130 default:
131 return -ENOSYS;
132 }
133}
diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c
index 4e1ba0b15443..e47857f889b6 100644
--- a/arch/frv/mb93090-mb00/pci-dma-nommu.c
+++ b/arch/frv/mb93090-mb00/pci-dma-nommu.c
@@ -106,13 +106,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
106 106
107EXPORT_SYMBOL(dma_free_coherent); 107EXPORT_SYMBOL(dma_free_coherent);
108 108
109/*
110 * Map a single buffer of the indicated size for DMA in streaming mode.
111 * The 32-bit bus address to use is returned.
112 *
113 * Once the device is given the dma address, the device owns this memory
114 * until either dma_unmap_single or pci_dma_sync_single is performed.
115 */
116dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 109dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
117 enum dma_data_direction direction) 110 enum dma_data_direction direction)
118{ 111{
@@ -125,22 +118,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
125 118
126EXPORT_SYMBOL(dma_map_single); 119EXPORT_SYMBOL(dma_map_single);
127 120
128/*
129 * Map a set of buffers described by scatterlist in streaming
130 * mode for DMA. This is the scather-gather version of the
131 * above dma_map_single interface. Here the scatter gather list
132 * elements are each tagged with the appropriate dma address
133 * and length. They are obtained via sg_dma_{address,length}(SG).
134 *
135 * NOTE: An implementation may be able to use a smaller number of
136 * DMA address/length pairs than there are SG table elements.
137 * (for example via virtual mapping capabilities)
138 * The routine returns the number of addr/length pairs actually
139 * used, at most nents.
140 *
141 * Device ownership issues as mentioned above for dma_map_single are
142 * the same here.
143 */
144int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 121int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
145 enum dma_data_direction direction) 122 enum dma_data_direction direction)
146{ 123{
@@ -157,13 +134,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
157 134
158EXPORT_SYMBOL(dma_map_sg); 135EXPORT_SYMBOL(dma_map_sg);
159 136
160/*
161 * Map a single page of the indicated size for DMA in streaming mode.
162 * The 32-bit bus address to use is returned.
163 *
164 * Device ownership issues as mentioned above for dma_map_single are
165 * the same here.
166 */
167dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, 137dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
168 size_t size, enum dma_data_direction direction) 138 size_t size, enum dma_data_direction direction)
169{ 139{
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c
index 45954f0813dc..2c912e805162 100644
--- a/arch/frv/mb93090-mb00/pci-dma.c
+++ b/arch/frv/mb93090-mb00/pci-dma.c
@@ -38,13 +38,6 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_
38 38
39EXPORT_SYMBOL(dma_free_coherent); 39EXPORT_SYMBOL(dma_free_coherent);
40 40
41/*
42 * Map a single buffer of the indicated size for DMA in streaming mode.
43 * The 32-bit bus address to use is returned.
44 *
45 * Once the device is given the dma address, the device owns this memory
46 * until either pci_unmap_single or pci_dma_sync_single is performed.
47 */
48dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 41dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
49 enum dma_data_direction direction) 42 enum dma_data_direction direction)
50{ 43{
@@ -57,22 +50,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
57 50
58EXPORT_SYMBOL(dma_map_single); 51EXPORT_SYMBOL(dma_map_single);
59 52
60/*
61 * Map a set of buffers described by scatterlist in streaming
62 * mode for DMA. This is the scather-gather version of the
63 * above dma_map_single interface. Here the scatter gather list
64 * elements are each tagged with the appropriate dma address
65 * and length. They are obtained via sg_dma_{address,length}(SG).
66 *
67 * NOTE: An implementation may be able to use a smaller number of
68 * DMA address/length pairs than there are SG table elements.
69 * (for example via virtual mapping capabilities)
70 * The routine returns the number of addr/length pairs actually
71 * used, at most nents.
72 *
73 * Device ownership issues as mentioned above for dma_map_single are
74 * the same here.
75 */
76int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 53int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
77 enum dma_data_direction direction) 54 enum dma_data_direction direction)
78{ 55{
@@ -103,13 +80,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
103 80
104EXPORT_SYMBOL(dma_map_sg); 81EXPORT_SYMBOL(dma_map_sg);
105 82
106/*
107 * Map a single page of the indicated size for DMA in streaming mode.
108 * The 32-bit bus address to use is returned.
109 *
110 * Device ownership issues as mentioned above for dma_map_single are
111 * the same here.
112 */
113dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, 83dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset,
114 size_t size, enum dma_data_direction direction) 84 size_t size, enum dma_data_direction direction)
115{ 85{
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h
index 33e842f3284b..c1a8df22080f 100644
--- a/arch/h8300/include/asm/io.h
+++ b/arch/h8300/include/asm/io.h
@@ -25,7 +25,7 @@
25 * memory location directly. 25 * memory location directly.
26 */ 26 */
27/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates 27/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
28 * two accesses to memory, which may be undesireable for some devices. 28 * two accesses to memory, which may be undesirable for some devices.
29 */ 29 */
30 30
31/* 31/*
diff --git a/arch/h8300/include/asm/ptrace.h b/arch/h8300/include/asm/ptrace.h
index c2e05e4b512e..d866c0efba87 100644
--- a/arch/h8300/include/asm/ptrace.h
+++ b/arch/h8300/include/asm/ptrace.h
@@ -55,6 +55,8 @@ struct pt_regs {
55/* Find the stack offset for a register, relative to thread.esp0. */ 55/* Find the stack offset for a register, relative to thread.esp0. */
56#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) 56#define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg)
57 57
58#define arch_has_single_step() (1)
59
58#define user_mode(regs) (!((regs)->ccr & PS_S)) 60#define user_mode(regs) (!((regs)->ccr & PS_S))
59#define instruction_pointer(regs) ((regs)->pc) 61#define instruction_pointer(regs) ((regs)->pc)
60#define profile_pc(regs) instruction_pointer(regs) 62#define profile_pc(regs) instruction_pointer(regs)
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h
index 99f3c3561ecb..50f2c5a36591 100644
--- a/arch/h8300/include/asm/unistd.h
+++ b/arch/h8300/include/asm/unistd.h
@@ -336,6 +336,7 @@
336#define __ARCH_WANT_STAT64 336#define __ARCH_WANT_STAT64
337#define __ARCH_WANT_SYS_ALARM 337#define __ARCH_WANT_SYS_ALARM
338#define __ARCH_WANT_SYS_GETHOSTNAME 338#define __ARCH_WANT_SYS_GETHOSTNAME
339#define __ARCH_WANT_SYS_IPC
339#define __ARCH_WANT_SYS_PAUSE 340#define __ARCH_WANT_SYS_PAUSE
340#define __ARCH_WANT_SYS_SGETMASK 341#define __ARCH_WANT_SYS_SGETMASK
341#define __ARCH_WANT_SYS_SIGNAL 342#define __ARCH_WANT_SYS_SIGNAL
@@ -348,6 +349,8 @@
348#define __ARCH_WANT_SYS_LLSEEK 349#define __ARCH_WANT_SYS_LLSEEK
349#define __ARCH_WANT_SYS_NICE 350#define __ARCH_WANT_SYS_NICE
350#define __ARCH_WANT_SYS_OLD_GETRLIMIT 351#define __ARCH_WANT_SYS_OLD_GETRLIMIT
352#define __ARCH_WANT_SYS_OLD_MMAP
353#define __ARCH_WANT_SYS_OLD_SELECT
351#define __ARCH_WANT_SYS_OLDUMOUNT 354#define __ARCH_WANT_SYS_OLDUMOUNT
352#define __ARCH_WANT_SYS_SIGPENDING 355#define __ARCH_WANT_SYS_SIGPENDING
353#define __ARCH_WANT_SYS_SIGPROCMASK 356#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index d32bbf02fc48..df114122ebdf 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -34,25 +34,20 @@
34/* cpu depend functions */ 34/* cpu depend functions */
35extern long h8300_get_reg(struct task_struct *task, int regno); 35extern long h8300_get_reg(struct task_struct *task, int regno);
36extern int h8300_put_reg(struct task_struct *task, int regno, unsigned long data); 36extern int h8300_put_reg(struct task_struct *task, int regno, unsigned long data);
37extern void h8300_disable_trace(struct task_struct *child); 37
38extern void h8300_enable_trace(struct task_struct *child); 38
39void user_disable_single_step(struct task_struct *child)
40{
41}
39 42
40/* 43/*
41 * does not yet catch signals sent when the child dies. 44 * does not yet catch signals sent when the child dies.
42 * in exit.c or in signal.c. 45 * in exit.c or in signal.c.
43 */ 46 */
44 47
45inline
46static int read_long(struct task_struct * tsk, unsigned long addr,
47 unsigned long * result)
48{
49 *result = *(unsigned long *)addr;
50 return 0;
51}
52
53void ptrace_disable(struct task_struct *child) 48void ptrace_disable(struct task_struct *child)
54{ 49{
55 h8300_disable_trace(child); 50 user_disable_single_step(child);
56} 51}
57 52
58long arch_ptrace(struct task_struct *child, long request, long addr, long data) 53long arch_ptrace(struct task_struct *child, long request, long addr, long data)
@@ -60,17 +55,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
60 int ret; 55 int ret;
61 56
62 switch (request) { 57 switch (request) {
63 case PTRACE_PEEKTEXT: /* read word at location addr. */
64 case PTRACE_PEEKDATA: {
65 unsigned long tmp;
66
67 ret = read_long(child, addr, &tmp);
68 if (ret < 0)
69 break ;
70 ret = put_user(tmp, (unsigned long *) data);
71 break ;
72 }
73
74 /* read the word at location addr in the USER area. */ 58 /* read the word at location addr in the USER area. */
75 case PTRACE_PEEKUSR: { 59 case PTRACE_PEEKUSR: {
76 unsigned long tmp = 0; 60 unsigned long tmp = 0;
@@ -109,11 +93,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
109 } 93 }
110 94
111 /* when I and D space are separate, this will have to be fixed. */ 95 /* when I and D space are separate, this will have to be fixed. */
112 case PTRACE_POKETEXT: /* write the word at location addr. */
113 case PTRACE_POKEDATA:
114 ret = generic_ptrace_pokedata(child, addr, data);
115 break;
116
117 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 96 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
118 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { 97 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {
119 ret = -EIO; 98 ret = -EIO;
@@ -131,53 +110,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
131 } 110 }
132 ret = -EIO; 111 ret = -EIO;
133 break ; 112 break ;
134 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
135 case PTRACE_CONT: { /* restart after signal. */
136 ret = -EIO;
137 if (!valid_signal(data))
138 break ;
139 if (request == PTRACE_SYSCALL)
140 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
141 else
142 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
143 child->exit_code = data;
144 wake_up_process(child);
145 /* make sure the single step bit is not set. */
146 h8300_disable_trace(child);
147 ret = 0;
148 }
149
150/*
151 * make the child exit. Best I can do is send it a sigkill.
152 * perhaps it should be put in the status that it wants to
153 * exit.
154 */
155 case PTRACE_KILL: {
156
157 ret = 0;
158 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
159 break;
160 child->exit_code = SIGKILL;
161 h8300_disable_trace(child);
162 wake_up_process(child);
163 break;
164 }
165
166 case PTRACE_SINGLESTEP: { /* set the trap flag. */
167 ret = -EIO;
168 if (!valid_signal(data))
169 break;
170 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
171 child->exit_code = data;
172 h8300_enable_trace(child);
173 wake_up_process(child);
174 ret = 0;
175 break;
176 }
177
178 case PTRACE_DETACH: /* detach a process that was attached. */
179 ret = ptrace_detach(child, data);
180 break;
181 113
182 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 114 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
183 int i; 115 int i;
@@ -210,7 +142,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
210 } 142 }
211 143
212 default: 144 default:
213 ret = -EIO; 145 ret = ptrace_request(child, request, addr, data);
214 break; 146 break;
215 } 147 }
216 return ret; 148 return ret;
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c
index b5969db0ca10..f9b3f44da69f 100644
--- a/arch/h8300/kernel/sys_h8300.c
+++ b/arch/h8300/kernel/sys_h8300.c
@@ -26,144 +26,6 @@
26#include <asm/traps.h> 26#include <asm/traps.h>
27#include <asm/unistd.h> 27#include <asm/unistd.h>
28 28
29/*
30 * Perform the select(nd, in, out, ex, tv) and mmap() system
31 * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to
32 * handle more than 4 system call parameters, so these system calls
33 * used a memory block for parameter passing..
34 */
35
36struct mmap_arg_struct {
37 unsigned long addr;
38 unsigned long len;
39 unsigned long prot;
40 unsigned long flags;
41 unsigned long fd;
42 unsigned long offset;
43};
44
45asmlinkage int old_mmap(struct mmap_arg_struct *arg)
46{
47 struct mmap_arg_struct a;
48 int error = -EFAULT;
49
50 if (copy_from_user(&a, arg, sizeof(a)))
51 goto out;
52
53 error = -EINVAL;
54 if (a.offset & ~PAGE_MASK)
55 goto out;
56
57 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
58 a.offset >> PAGE_SHIFT);
59out:
60 return error;
61}
62
63struct sel_arg_struct {
64 unsigned long n;
65 fd_set *inp, *outp, *exp;
66 struct timeval *tvp;
67};
68
69asmlinkage int old_select(struct sel_arg_struct *arg)
70{
71 struct sel_arg_struct a;
72
73 if (copy_from_user(&a, arg, sizeof(a)))
74 return -EFAULT;
75 /* sys_select() does the appropriate kernel locking */
76 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
77}
78
79/*
80 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
81 *
82 * This is really horribly ugly.
83 */
84asmlinkage int sys_ipc (uint call, int first, int second,
85 int third, void *ptr, long fifth)
86{
87 int version, ret;
88
89 version = call >> 16; /* hack for backward compatibility */
90 call &= 0xffff;
91
92 if (call <= SEMCTL)
93 switch (call) {
94 case SEMOP:
95 return sys_semop (first, (struct sembuf *)ptr, second);
96 case SEMGET:
97 return sys_semget (first, second, third);
98 case SEMCTL: {
99 union semun fourth;
100 if (!ptr)
101 return -EINVAL;
102 if (get_user(fourth.__pad, (void **) ptr))
103 return -EFAULT;
104 return sys_semctl (first, second, third, fourth);
105 }
106 default:
107 return -EINVAL;
108 }
109 if (call <= MSGCTL)
110 switch (call) {
111 case MSGSND:
112 return sys_msgsnd (first, (struct msgbuf *) ptr,
113 second, third);
114 case MSGRCV:
115 switch (version) {
116 case 0: {
117 struct ipc_kludge tmp;
118 if (!ptr)
119 return -EINVAL;
120 if (copy_from_user (&tmp,
121 (struct ipc_kludge *)ptr,
122 sizeof (tmp)))
123 return -EFAULT;
124 return sys_msgrcv (first, tmp.msgp, second,
125 tmp.msgtyp, third);
126 }
127 default:
128 return sys_msgrcv (first,
129 (struct msgbuf *) ptr,
130 second, fifth, third);
131 }
132 case MSGGET:
133 return sys_msgget ((key_t) first, second);
134 case MSGCTL:
135 return sys_msgctl (first, second,
136 (struct msqid_ds *) ptr);
137 default:
138 return -EINVAL;
139 }
140 if (call <= SHMCTL)
141 switch (call) {
142 case SHMAT:
143 switch (version) {
144 default: {
145 ulong raddr;
146 ret = do_shmat (first, (char *) ptr,
147 second, &raddr);
148 if (ret)
149 return ret;
150 return put_user (raddr, (ulong *) third);
151 }
152 }
153 case SHMDT:
154 return sys_shmdt ((char *)ptr);
155 case SHMGET:
156 return sys_shmget (first, second, third);
157 case SHMCTL:
158 return sys_shmctl (first, second,
159 (struct shmid_ds *) ptr);
160 default:
161 return -EINVAL;
162 }
163
164 return -EINVAL;
165}
166
167/* sys_cacheflush -- no support. */ 29/* sys_cacheflush -- no support. */
168asmlinkage int 30asmlinkage int
169sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) 31sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S
index 2d69881eda6a..faefaff7d43d 100644
--- a/arch/h8300/kernel/syscalls.S
+++ b/arch/h8300/kernel/syscalls.S
@@ -96,7 +96,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
96 .long SYMBOL_NAME(sys_settimeofday) 96 .long SYMBOL_NAME(sys_settimeofday)
97 .long SYMBOL_NAME(sys_getgroups16) /* 80 */ 97 .long SYMBOL_NAME(sys_getgroups16) /* 80 */
98 .long SYMBOL_NAME(sys_setgroups16) 98 .long SYMBOL_NAME(sys_setgroups16)
99 .long SYMBOL_NAME(old_select) 99 .long SYMBOL_NAME(sys_old_select)
100 .long SYMBOL_NAME(sys_symlink) 100 .long SYMBOL_NAME(sys_symlink)
101 .long SYMBOL_NAME(sys_lstat) 101 .long SYMBOL_NAME(sys_lstat)
102 .long SYMBOL_NAME(sys_readlink) /* 85 */ 102 .long SYMBOL_NAME(sys_readlink) /* 85 */
@@ -104,7 +104,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
104 .long SYMBOL_NAME(sys_swapon) 104 .long SYMBOL_NAME(sys_swapon)
105 .long SYMBOL_NAME(sys_reboot) 105 .long SYMBOL_NAME(sys_reboot)
106 .long SYMBOL_NAME(sys_old_readdir) 106 .long SYMBOL_NAME(sys_old_readdir)
107 .long SYMBOL_NAME(old_mmap) /* 90 */ 107 .long SYMBOL_NAME(sys_old_mmap) /* 90 */
108 .long SYMBOL_NAME(sys_munmap) 108 .long SYMBOL_NAME(sys_munmap)
109 .long SYMBOL_NAME(sys_truncate) 109 .long SYMBOL_NAME(sys_truncate)
110 .long SYMBOL_NAME(sys_ftruncate) 110 .long SYMBOL_NAME(sys_ftruncate)
diff --git a/arch/h8300/platform/h8300h/ptrace_h8300h.c b/arch/h8300/platform/h8300h/ptrace_h8300h.c
index 746b1ae672a1..4f1ed0279633 100644
--- a/arch/h8300/platform/h8300h/ptrace_h8300h.c
+++ b/arch/h8300/platform/h8300h/ptrace_h8300h.c
@@ -60,7 +60,7 @@ int h8300_put_reg(struct task_struct *task, int regno, unsigned long data)
60} 60}
61 61
62/* disable singlestep */ 62/* disable singlestep */
63void h8300_disable_trace(struct task_struct *child) 63void user_disable_single_step(struct task_struct *child)
64{ 64{
65 if((long)child->thread.breakinfo.addr != -1L) { 65 if((long)child->thread.breakinfo.addr != -1L) {
66 *child->thread.breakinfo.addr = child->thread.breakinfo.inst; 66 *child->thread.breakinfo.addr = child->thread.breakinfo.inst;
@@ -264,7 +264,7 @@ static unsigned short *getnextpc(struct task_struct *child, unsigned short *pc)
264 264
265/* Set breakpoint(s) to simulate a single step from the current PC. */ 265/* Set breakpoint(s) to simulate a single step from the current PC. */
266 266
267void h8300_enable_trace(struct task_struct *child) 267void user_enable_single_step(struct task_struct *child)
268{ 268{
269 unsigned short *nextpc; 269 unsigned short *nextpc;
270 nextpc = getnextpc(child,(unsigned short *)h8300_get_reg(child, PT_PC)); 270 nextpc = getnextpc(child,(unsigned short *)h8300_get_reg(child, PT_PC));
@@ -276,7 +276,7 @@ void h8300_enable_trace(struct task_struct *child)
276asmlinkage void trace_trap(unsigned long bp) 276asmlinkage void trace_trap(unsigned long bp)
277{ 277{
278 if ((unsigned long)current->thread.breakinfo.addr == bp) { 278 if ((unsigned long)current->thread.breakinfo.addr == bp) {
279 h8300_disable_trace(current); 279 user_disable_single_step(current);
280 force_sig(SIGTRAP,current); 280 force_sig(SIGTRAP,current);
281 } else 281 } else
282 force_sig(SIGILL,current); 282 force_sig(SIGILL,current);
diff --git a/arch/h8300/platform/h8s/ptrace_h8s.c b/arch/h8300/platform/h8s/ptrace_h8s.c
index e8cd46f9255c..c058ab1a8495 100644
--- a/arch/h8300/platform/h8s/ptrace_h8s.c
+++ b/arch/h8300/platform/h8s/ptrace_h8s.c
@@ -65,13 +65,13 @@ int h8300_put_reg(struct task_struct *task, int regno, unsigned long data)
65} 65}
66 66
67/* disable singlestep */ 67/* disable singlestep */
68void h8300_disable_trace(struct task_struct *child) 68void user_disable_single_step(struct task_struct *child)
69{ 69{
70 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) &= ~EXR_TRACE; 70 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) &= ~EXR_TRACE;
71} 71}
72 72
73/* enable singlestep */ 73/* enable singlestep */
74void h8300_enable_trace(struct task_struct *child) 74void user_enable_single_step(struct task_struct *child)
75{ 75{
76 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) |= EXR_TRACE; 76 *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) |= EXR_TRACE;
77} 77}
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 9a50d7dd2a0b..4d4f4188cdf1 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -53,6 +53,9 @@ config MMU
53 bool 53 bool
54 default y 54 default y
55 55
56config NEED_DMA_MAP_STATE
57 def_bool y
58
56config SWIOTLB 59config SWIOTLB
57 bool 60 bool
58 61
diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h
index dfcf75b8426d..f90edc85b509 100644
--- a/arch/ia64/include/asm/compat.h
+++ b/arch/ia64/include/asm/compat.h
@@ -5,7 +5,8 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8#define COMPAT_USER_HZ 100 8#define COMPAT_USER_HZ 100
9#define COMPAT_UTS_MACHINE "i686\0\0\0"
9 10
10typedef u32 compat_size_t; 11typedef u32 compat_size_t;
11typedef s32 compat_ssize_t; 12typedef s32 compat_ssize_t;
diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h
index 55281aabe5f2..73b5f785e70c 100644
--- a/arch/ia64/include/asm/pci.h
+++ b/arch/ia64/include/asm/pci.h
@@ -56,20 +56,6 @@ pcibios_penalize_isa_irq (int irq, int active)
56 56
57#include <asm-generic/pci-dma-compat.h> 57#include <asm-generic/pci-dma-compat.h>
58 58
59/* pci_unmap_{single,page} is not a nop, thus... */
60#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
61 dma_addr_t ADDR_NAME;
62#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
63 __u32 LEN_NAME;
64#define pci_unmap_addr(PTR, ADDR_NAME) \
65 ((PTR)->ADDR_NAME)
66#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
67 (((PTR)->ADDR_NAME) = (VAL))
68#define pci_unmap_len(PTR, LEN_NAME) \
69 ((PTR)->LEN_NAME)
70#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
71 (((PTR)->LEN_NAME) = (VAL))
72
73#ifdef CONFIG_PCI 59#ifdef CONFIG_PCI
74static inline void pci_dma_burst_advice(struct pci_dev *pdev, 60static inline void pci_dma_burst_advice(struct pci_dev *pdev,
75 enum pci_dma_burst_strategy *strat, 61 enum pci_dma_burst_strategy *strat,
diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h
index 14055c636adf..7ae9c3f15a1c 100644
--- a/arch/ia64/include/asm/ptrace.h
+++ b/arch/ia64/include/asm/ptrace.h
@@ -319,11 +319,7 @@ static inline unsigned long user_stack_pointer(struct pt_regs *regs)
319 ptrace_attach_sync_user_rbs(child) 319 ptrace_attach_sync_user_rbs(child)
320 320
321 #define arch_has_single_step() (1) 321 #define arch_has_single_step() (1)
322 extern void user_enable_single_step(struct task_struct *);
323 extern void user_disable_single_step(struct task_struct *);
324
325 #define arch_has_block_step() (1) 322 #define arch_has_block_step() (1)
326 extern void user_enable_block_step(struct task_struct *);
327 323
328#endif /* !__KERNEL__ */ 324#endif /* !__KERNEL__ */
329 325
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index e456f062f241..d00dfc180021 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -241,7 +241,7 @@ static void __cpuinit sn_check_for_wars(void)
241 * Note: This stuff is duped here because Altix requires the PCDP to 241 * Note: This stuff is duped here because Altix requires the PCDP to
242 * locate a usable VGA device due to lack of proper ACPI support. Structures 242 * locate a usable VGA device due to lack of proper ACPI support. Structures
243 * could be used from drivers/firmware/pcdp.h, but it was decided that moving 243 * could be used from drivers/firmware/pcdp.h, but it was decided that moving
244 * this file to a more public location just for Altix use was undesireable. 244 * this file to a more public location just for Altix use was undesirable.
245 */ 245 */
246 246
247struct hcdp_uart_desc { 247struct hcdp_uart_desc {
diff --git a/arch/m32r/include/asm/ptrace.h b/arch/m32r/include/asm/ptrace.h
index a0755b982028..840a1231edeb 100644
--- a/arch/m32r/include/asm/ptrace.h
+++ b/arch/m32r/include/asm/ptrace.h
@@ -120,6 +120,8 @@ struct pt_regs {
120 120
121#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */ 121#include <asm/m32r.h> /* M32R_PSW_BSM, M32R_PSW_BPM */
122 122
123#define arch_has_single_step() (1)
124
123struct task_struct; 125struct task_struct;
124extern void init_debug_traps(struct task_struct *); 126extern void init_debug_traps(struct task_struct *);
125#define arch_ptrace_attach(child) \ 127#define arch_ptrace_attach(child) \
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h
index cf701c933249..76125777483c 100644
--- a/arch/m32r/include/asm/unistd.h
+++ b/arch/m32r/include/asm/unistd.h
@@ -339,6 +339,7 @@
339#define __ARCH_WANT_STAT64 339#define __ARCH_WANT_STAT64
340#define __ARCH_WANT_SYS_ALARM 340#define __ARCH_WANT_SYS_ALARM
341#define __ARCH_WANT_SYS_GETHOSTNAME 341#define __ARCH_WANT_SYS_GETHOSTNAME
342#define __ARCH_WANT_SYS_IPC
342#define __ARCH_WANT_SYS_PAUSE 343#define __ARCH_WANT_SYS_PAUSE
343#define __ARCH_WANT_SYS_TIME 344#define __ARCH_WANT_SYS_TIME
344#define __ARCH_WANT_SYS_UTIME 345#define __ARCH_WANT_SYS_UTIME
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 98682bba0ed9..e555091eb97c 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -580,6 +580,35 @@ init_debug_traps(struct task_struct *child)
580 } 580 }
581} 581}
582 582
583void user_enable_single_step(struct task_struct *child)
584{
585 unsigned long next_pc;
586 unsigned long pc, insn;
587
588 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
589
590 /* Compute next pc. */
591 pc = get_stack_long(child, PT_BPC);
592
593 if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
594 != sizeof(insn))
595 break;
596
597 compute_next_pc(insn, pc, &next_pc, child);
598 if (next_pc & 0x80000000)
599 break;
600
601 if (embed_debug_trap(child, next_pc))
602 break;
603
604 invalidate_cache();
605}
606
607void user_disable_single_step(struct task_struct *child)
608{
609 unregister_all_debug_traps(child);
610 invalidate_cache();
611}
583 612
584/* 613/*
585 * Called by kernel/ptrace.c when detaching.. 614 * Called by kernel/ptrace.c when detaching..
@@ -630,74 +659,6 @@ arch_ptrace(struct task_struct *child, long request, long addr, long data)
630 ret = ptrace_write_user(child, addr, data); 659 ret = ptrace_write_user(child, addr, data);
631 break; 660 break;
632 661
633 /*
634 * continue/restart and stop at next (return from) syscall
635 */
636 case PTRACE_SYSCALL:
637 case PTRACE_CONT:
638 ret = -EIO;
639 if (!valid_signal(data))
640 break;
641 if (request == PTRACE_SYSCALL)
642 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
643 else
644 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
645 child->exit_code = data;
646 wake_up_process(child);
647 ret = 0;
648 break;
649
650 /*
651 * make the child exit. Best I can do is send it a sigkill.
652 * perhaps it should be put in the status that it wants to
653 * exit.
654 */
655 case PTRACE_KILL: {
656 ret = 0;
657 unregister_all_debug_traps(child);
658 invalidate_cache();
659 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
660 break;
661 child->exit_code = SIGKILL;
662 wake_up_process(child);
663 break;
664 }
665
666 /*
667 * execute single instruction.
668 */
669 case PTRACE_SINGLESTEP: {
670 unsigned long next_pc;
671 unsigned long pc, insn;
672
673 ret = -EIO;
674 if (!valid_signal(data))
675 break;
676 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
677
678 /* Compute next pc. */
679 pc = get_stack_long(child, PT_BPC);
680
681 if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
682 != sizeof(insn))
683 break;
684
685 compute_next_pc(insn, pc, &next_pc, child);
686 if (next_pc & 0x80000000)
687 break;
688
689 if (embed_debug_trap(child, next_pc))
690 break;
691
692 invalidate_cache();
693 child->exit_code = data;
694
695 /* give it a chance to run. */
696 wake_up_process(child);
697 ret = 0;
698 break;
699 }
700
701 case PTRACE_GETREGS: 662 case PTRACE_GETREGS:
702 ret = ptrace_getregs(child, (void __user *)data); 663 ret = ptrace_getregs(child, (void __user *)data);
703 break; 664 break;
diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c
index d3c865c5a6ba..0a00f467edfa 100644
--- a/arch/m32r/kernel/sys_m32r.c
+++ b/arch/m32r/kernel/sys_m32r.c
@@ -76,98 +76,6 @@ asmlinkage int sys_tas(int __user *addr)
76 return oldval; 76 return oldval;
77} 77}
78 78
79/*
80 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
81 *
82 * This is really horribly ugly.
83 */
84asmlinkage int sys_ipc(uint call, int first, int second,
85 int third, void __user *ptr, long fifth)
86{
87 int version, ret;
88
89 version = call >> 16; /* hack for backward compatibility */
90 call &= 0xffff;
91
92 switch (call) {
93 case SEMOP:
94 return sys_semtimedop(first, (struct sembuf __user *)ptr,
95 second, NULL);
96 case SEMTIMEDOP:
97 return sys_semtimedop(first, (struct sembuf __user *)ptr,
98 second, (const struct timespec __user *)fifth);
99 case SEMGET:
100 return sys_semget (first, second, third);
101 case SEMCTL: {
102 union semun fourth;
103 if (!ptr)
104 return -EINVAL;
105 if (get_user(fourth.__pad, (void __user * __user *) ptr))
106 return -EFAULT;
107 return sys_semctl (first, second, third, fourth);
108 }
109
110 case MSGSND:
111 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
112 second, third);
113 case MSGRCV:
114 switch (version) {
115 case 0: {
116 struct ipc_kludge tmp;
117 if (!ptr)
118 return -EINVAL;
119
120 if (copy_from_user(&tmp,
121 (struct ipc_kludge __user *) ptr,
122 sizeof (tmp)))
123 return -EFAULT;
124 return sys_msgrcv (first, tmp.msgp, second,
125 tmp.msgtyp, third);
126 }
127 default:
128 return sys_msgrcv (first,
129 (struct msgbuf __user *) ptr,
130 second, fifth, third);
131 }
132 case MSGGET:
133 return sys_msgget ((key_t) first, second);
134 case MSGCTL:
135 return sys_msgctl (first, second,
136 (struct msqid_ds __user *) ptr);
137 case SHMAT: {
138 ulong raddr;
139
140 if (!access_ok(VERIFY_WRITE, (ulong __user *) third,
141 sizeof(ulong)))
142 return -EFAULT;
143 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
144 if (ret)
145 return ret;
146 return put_user (raddr, (ulong __user *) third);
147 }
148 case SHMDT:
149 return sys_shmdt ((char __user *)ptr);
150 case SHMGET:
151 return sys_shmget (first, second, third);
152 case SHMCTL:
153 return sys_shmctl (first, second,
154 (struct shmid_ds __user *) ptr);
155 default:
156 return -ENOSYS;
157 }
158}
159
160asmlinkage int sys_uname(struct old_utsname __user * name)
161{
162 int err;
163 if (!name)
164 return -EFAULT;
165 down_read(&uts_sem);
166 err = copy_to_user(name, utsname(), sizeof (*name));
167 up_read(&uts_sem);
168 return err?-EFAULT:0;
169}
170
171asmlinkage int sys_cacheflush(void *addr, int bytes, int cache) 79asmlinkage int sys_cacheflush(void *addr, int bytes, int cache)
172{ 80{
173 /* This should flush more selectively ... */ 81 /* This should flush more selectively ... */
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index 4add96d13b19..5890897d28bf 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -121,7 +121,7 @@ KEYBOARD_STATE kb_state;
121 * bytes have been lost and in which state of the packet structure we are now. 121 * bytes have been lost and in which state of the packet structure we are now.
122 * This usually causes keyboards bytes to be interpreted as mouse movements 122 * This usually causes keyboards bytes to be interpreted as mouse movements
123 * and vice versa, which is very annoying. It seems better to throw away some 123 * and vice versa, which is very annoying. It seems better to throw away some
124 * bytes (that are usually mouse bytes) than to misinterpret them. Therefor I 124 * bytes (that are usually mouse bytes) than to misinterpret them. Therefore I
125 * introduced the RESYNC state for IKBD data. In this state, the bytes up to 125 * introduced the RESYNC state for IKBD data. In this state, the bytes up to
126 * one that really looks like a key event (0x04..0xf2) or the start of a mouse 126 * one that really looks like a key event (0x04..0xf2) or the start of a mouse
127 * packet (0xf8..0xfb) are thrown away, but at most 2 bytes. This at least 127 * packet (0xf8..0xfb) are thrown away, but at most 2 bytes. This at least
diff --git a/arch/m68k/include/asm/fbio.h b/arch/m68k/include/asm/fbio.h
index b9215a0907d3..0a21da87f7d6 100644
--- a/arch/m68k/include/asm/fbio.h
+++ b/arch/m68k/include/asm/fbio.h
@@ -173,7 +173,7 @@ struct mdi_cfginfo {
173 int mdi_ncluts; /* Number of implemented CLUTs in this MDI */ 173 int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
174 int mdi_type; /* FBTYPE name */ 174 int mdi_type; /* FBTYPE name */
175 int mdi_height; /* height */ 175 int mdi_height; /* height */
176 int mdi_width; /* widht */ 176 int mdi_width; /* width */
177 int mdi_size; /* available ram */ 177 int mdi_size; /* available ram */
178 int mdi_mode; /* 8bpp, 16bpp or 32bpp */ 178 int mdi_mode; /* 8bpp, 16bpp or 32bpp */
179 int mdi_pixfreq; /* pixel clock (from PROM) */ 179 int mdi_pixfreq; /* pixel clock (from PROM) */
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h
index 359065d5a9f2..6e2413e518cb 100644
--- a/arch/m68k/include/asm/io_no.h
+++ b/arch/m68k/include/asm/io_no.h
@@ -16,7 +16,7 @@
16 * memory location directly. 16 * memory location directly.
17 */ 17 */
18/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates 18/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
19 * two accesses to memory, which may be undesireable for some devices. 19 * two accesses to memory, which may be undesirable for some devices.
20 */ 20 */
21 21
22/* 22/*
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h
index 21605c736f69..6e6e3ac1d913 100644
--- a/arch/m68k/include/asm/ptrace.h
+++ b/arch/m68k/include/asm/ptrace.h
@@ -87,18 +87,10 @@ struct switch_stack {
87#define profile_pc(regs) instruction_pointer(regs) 87#define profile_pc(regs) instruction_pointer(regs)
88extern void show_regs(struct pt_regs *); 88extern void show_regs(struct pt_regs *);
89 89
90/*
91 * These are defined as per linux/ptrace.h.
92 */
93struct task_struct;
94
95#define arch_has_single_step() (1) 90#define arch_has_single_step() (1)
96extern void user_enable_single_step(struct task_struct *);
97extern void user_disable_single_step(struct task_struct *);
98 91
99#ifdef CONFIG_MMU 92#ifdef CONFIG_MMU
100#define arch_has_block_step() (1) 93#define arch_has_block_step() (1)
101extern void user_enable_block_step(struct task_struct *);
102#endif 94#endif
103 95
104#endif /* __KERNEL__ */ 96#endif /* __KERNEL__ */
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index d72a71dabecb..60b15d0aa072 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -351,6 +351,7 @@
351#define __ARCH_WANT_STAT64 351#define __ARCH_WANT_STAT64
352#define __ARCH_WANT_SYS_ALARM 352#define __ARCH_WANT_SYS_ALARM
353#define __ARCH_WANT_SYS_GETHOSTNAME 353#define __ARCH_WANT_SYS_GETHOSTNAME
354#define __ARCH_WANT_SYS_IPC
354#define __ARCH_WANT_SYS_PAUSE 355#define __ARCH_WANT_SYS_PAUSE
355#define __ARCH_WANT_SYS_SGETMASK 356#define __ARCH_WANT_SYS_SGETMASK
356#define __ARCH_WANT_SYS_SIGNAL 357#define __ARCH_WANT_SYS_SIGNAL
@@ -363,6 +364,8 @@
363#define __ARCH_WANT_SYS_LLSEEK 364#define __ARCH_WANT_SYS_LLSEEK
364#define __ARCH_WANT_SYS_NICE 365#define __ARCH_WANT_SYS_NICE
365#define __ARCH_WANT_SYS_OLD_GETRLIMIT 366#define __ARCH_WANT_SYS_OLD_GETRLIMIT
367#define __ARCH_WANT_SYS_OLD_MMAP
368#define __ARCH_WANT_SYS_OLD_SELECT
366#define __ARCH_WANT_SYS_OLDUMOUNT 369#define __ARCH_WANT_SYS_OLDUMOUNT
367#define __ARCH_WANT_SYS_SIGPENDING 370#define __ARCH_WANT_SYS_SIGPENDING
368#define __ARCH_WANT_SYS_SIGPROCMASK 371#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index e136b8cbe9b9..2391bdff0996 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -510,7 +510,7 @@ sys_call_table:
510 .long sys_settimeofday 510 .long sys_settimeofday
511 .long sys_getgroups16 /* 80 */ 511 .long sys_getgroups16 /* 80 */
512 .long sys_setgroups16 512 .long sys_setgroups16
513 .long old_select 513 .long sys_old_select
514 .long sys_symlink 514 .long sys_symlink
515 .long sys_lstat 515 .long sys_lstat
516 .long sys_readlink /* 85 */ 516 .long sys_readlink /* 85 */
@@ -518,7 +518,7 @@ sys_call_table:
518 .long sys_swapon 518 .long sys_swapon
519 .long sys_reboot 519 .long sys_reboot
520 .long sys_old_readdir 520 .long sys_old_readdir
521 .long old_mmap /* 90 */ 521 .long sys_old_mmap /* 90 */
522 .long sys_munmap 522 .long sys_munmap
523 .long sys_truncate 523 .long sys_truncate
524 .long sys_ftruncate 524 .long sys_ftruncate
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index e3ad2d671973..77896692eb0a 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -46,137 +46,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
46 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); 46 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
47} 47}
48 48
49/*
50 * Perform the select(nd, in, out, ex, tv) and mmap() system
51 * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to
52 * handle more than 4 system call parameters, so these system calls
53 * used a memory block for parameter passing..
54 */
55
56struct mmap_arg_struct {
57 unsigned long addr;
58 unsigned long len;
59 unsigned long prot;
60 unsigned long flags;
61 unsigned long fd;
62 unsigned long offset;
63};
64
65asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
66{
67 struct mmap_arg_struct a;
68 int error = -EFAULT;
69
70 if (copy_from_user(&a, arg, sizeof(a)))
71 goto out;
72
73 error = -EINVAL;
74 if (a.offset & ~PAGE_MASK)
75 goto out;
76
77 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
78 a.offset >> PAGE_SHIFT);
79out:
80 return error;
81}
82
83struct sel_arg_struct {
84 unsigned long n;
85 fd_set __user *inp, *outp, *exp;
86 struct timeval __user *tvp;
87};
88
89asmlinkage int old_select(struct sel_arg_struct __user *arg)
90{
91 struct sel_arg_struct a;
92
93 if (copy_from_user(&a, arg, sizeof(a)))
94 return -EFAULT;
95 /* sys_select() does the appropriate kernel locking */
96 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
97}
98
99/*
100 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
101 *
102 * This is really horribly ugly.
103 */
104asmlinkage int sys_ipc (uint call, int first, int second,
105 int third, void __user *ptr, long fifth)
106{
107 int version, ret;
108
109 version = call >> 16; /* hack for backward compatibility */
110 call &= 0xffff;
111
112 if (call <= SEMCTL)
113 switch (call) {
114 case SEMOP:
115 return sys_semop (first, ptr, second);
116 case SEMGET:
117 return sys_semget (first, second, third);
118 case SEMCTL: {
119 union semun fourth;
120 if (!ptr)
121 return -EINVAL;
122 if (get_user(fourth.__pad, (void __user *__user *) ptr))
123 return -EFAULT;
124 return sys_semctl (first, second, third, fourth);
125 }
126 default:
127 return -ENOSYS;
128 }
129 if (call <= MSGCTL)
130 switch (call) {
131 case MSGSND:
132 return sys_msgsnd (first, ptr, second, third);
133 case MSGRCV:
134 switch (version) {
135 case 0: {
136 struct ipc_kludge tmp;
137 if (!ptr)
138 return -EINVAL;
139 if (copy_from_user (&tmp, ptr, sizeof (tmp)))
140 return -EFAULT;
141 return sys_msgrcv (first, tmp.msgp, second,
142 tmp.msgtyp, third);
143 }
144 default:
145 return sys_msgrcv (first, ptr,
146 second, fifth, third);
147 }
148 case MSGGET:
149 return sys_msgget ((key_t) first, second);
150 case MSGCTL:
151 return sys_msgctl (first, second, ptr);
152 default:
153 return -ENOSYS;
154 }
155 if (call <= SHMCTL)
156 switch (call) {
157 case SHMAT:
158 switch (version) {
159 default: {
160 ulong raddr;
161 ret = do_shmat (first, ptr, second, &raddr);
162 if (ret)
163 return ret;
164 return put_user (raddr, (ulong __user *) third);
165 }
166 }
167 case SHMDT:
168 return sys_shmdt (ptr);
169 case SHMGET:
170 return sys_shmget (first, second, third);
171 case SHMCTL:
172 return sys_shmctl (first, second, ptr);
173 default:
174 return -ENOSYS;
175 }
176
177 return -EINVAL;
178}
179
180/* Convert virtual (user) address VADDR to physical address PADDR */ 49/* Convert virtual (user) address VADDR to physical address PADDR */
181#define virt_to_phys_040(vaddr) \ 50#define virt_to_phys_040(vaddr) \
182({ \ 51({ \
diff --git a/arch/m68knommu/kernel/ptrace.c b/arch/m68knommu/kernel/ptrace.c
index 85ed2f988f98..f6be1248d216 100644
--- a/arch/m68knommu/kernel/ptrace.c
+++ b/arch/m68knommu/kernel/ptrace.c
@@ -116,12 +116,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
116 int ret; 116 int ret;
117 117
118 switch (request) { 118 switch (request) {
119 /* when I and D space are separate, these will need to be fixed. */
120 case PTRACE_PEEKTEXT: /* read word at location addr. */
121 case PTRACE_PEEKDATA:
122 ret = generic_ptrace_peekdata(child, addr, data);
123 break;
124
125 /* read the word at location addr in the USER area. */ 119 /* read the word at location addr in the USER area. */
126 case PTRACE_PEEKUSR: { 120 case PTRACE_PEEKUSR: {
127 unsigned long tmp; 121 unsigned long tmp;
@@ -160,12 +154,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
160 break; 154 break;
161 } 155 }
162 156
163 /* when I and D space are separate, this will have to be fixed. */
164 case PTRACE_POKETEXT: /* write the word at location addr. */
165 case PTRACE_POKEDATA:
166 ret = generic_ptrace_pokedata(child, addr, data);
167 break;
168
169 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 157 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
170 ret = -EIO; 158 ret = -EIO;
171 if ((addr & 3) || addr < 0 || 159 if ((addr & 3) || addr < 0 ||
@@ -202,66 +190,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
202 } 190 }
203 break; 191 break;
204 192
205 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
206 case PTRACE_CONT: { /* restart after signal. */
207 long tmp;
208
209 ret = -EIO;
210 if (!valid_signal(data))
211 break;
212 if (request == PTRACE_SYSCALL)
213 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
214 else
215 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
216 child->exit_code = data;
217 /* make sure the single step bit is not set. */
218 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
219 put_reg(child, PT_SR, tmp);
220 wake_up_process(child);
221 ret = 0;
222 break;
223 }
224
225 /*
226 * make the child exit. Best I can do is send it a sigkill.
227 * perhaps it should be put in the status that it wants to
228 * exit.
229 */
230 case PTRACE_KILL: {
231 long tmp;
232
233 ret = 0;
234 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
235 break;
236 child->exit_code = SIGKILL;
237 /* make sure the single step bit is not set. */
238 tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
239 put_reg(child, PT_SR, tmp);
240 wake_up_process(child);
241 break;
242 }
243
244 case PTRACE_SINGLESTEP: { /* set the trap flag. */
245 long tmp;
246
247 ret = -EIO;
248 if (!valid_signal(data))
249 break;
250 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
251 tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16);
252 put_reg(child, PT_SR, tmp);
253
254 child->exit_code = data;
255 /* give it a chance to run. */
256 wake_up_process(child);
257 ret = 0;
258 break;
259 }
260
261 case PTRACE_DETACH: /* detach a process that was attached. */
262 ret = ptrace_detach(child, data);
263 break;
264
265 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 193 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
266 int i; 194 int i;
267 unsigned long tmp; 195 unsigned long tmp;
@@ -325,7 +253,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
325 break; 253 break;
326 254
327 default: 255 default:
328 ret = -EIO; 256 ret = ptrace_request(child, request, addr, data);
329 break; 257 break;
330 } 258 }
331 return ret; 259 return ret;
diff --git a/arch/m68knommu/kernel/sys_m68k.c b/arch/m68knommu/kernel/sys_m68k.c
index 923dd4aab875..d65e9c4c930c 100644
--- a/arch/m68knommu/kernel/sys_m68k.c
+++ b/arch/m68knommu/kernel/sys_m68k.c
@@ -27,142 +27,6 @@
27#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
28#include <asm/unistd.h> 28#include <asm/unistd.h>
29 29
30/*
31 * Perform the select(nd, in, out, ex, tv) and mmap() system
32 * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to
33 * handle more than 4 system call parameters, so these system calls
34 * used a memory block for parameter passing..
35 */
36
37struct mmap_arg_struct {
38 unsigned long addr;
39 unsigned long len;
40 unsigned long prot;
41 unsigned long flags;
42 unsigned long fd;
43 unsigned long offset;
44};
45
46asmlinkage int old_mmap(struct mmap_arg_struct *arg)
47{
48 struct mmap_arg_struct a;
49 int error = -EFAULT;
50
51 if (copy_from_user(&a, arg, sizeof(a)))
52 goto out;
53
54 error = -EINVAL;
55 if (a.offset & ~PAGE_MASK)
56 goto out;
57
58 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
59 a.offset >> PAGE_SHIFT);
60out:
61 return error;
62}
63
64struct sel_arg_struct {
65 unsigned long n;
66 fd_set *inp, *outp, *exp;
67 struct timeval *tvp;
68};
69
70asmlinkage int old_select(struct sel_arg_struct *arg)
71{
72 struct sel_arg_struct a;
73
74 if (copy_from_user(&a, arg, sizeof(a)))
75 return -EFAULT;
76 /* sys_select() does the appropriate kernel locking */
77 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
78}
79
80/*
81 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
82 *
83 * This is really horribly ugly.
84 */
85asmlinkage int sys_ipc (uint call, int first, int second,
86 int third, void *ptr, long fifth)
87{
88 int version, ret;
89
90 version = call >> 16; /* hack for backward compatibility */
91 call &= 0xffff;
92
93 if (call <= SEMCTL)
94 switch (call) {
95 case SEMOP:
96 return sys_semop (first, (struct sembuf *)ptr, second);
97 case SEMGET:
98 return sys_semget (first, second, third);
99 case SEMCTL: {
100 union semun fourth;
101 if (!ptr)
102 return -EINVAL;
103 if (get_user(fourth.__pad, (void **) ptr))
104 return -EFAULT;
105 return sys_semctl (first, second, third, fourth);
106 }
107 default:
108 return -EINVAL;
109 }
110 if (call <= MSGCTL)
111 switch (call) {
112 case MSGSND:
113 return sys_msgsnd (first, (struct msgbuf *) ptr,
114 second, third);
115 case MSGRCV:
116 switch (version) {
117 case 0: {
118 struct ipc_kludge tmp;
119 if (!ptr)
120 return -EINVAL;
121 if (copy_from_user (&tmp,
122 (struct ipc_kludge *)ptr,
123 sizeof (tmp)))
124 return -EFAULT;
125 return sys_msgrcv (first, tmp.msgp, second,
126 tmp.msgtyp, third);
127 }
128 default:
129 return sys_msgrcv (first,
130 (struct msgbuf *) ptr,
131 second, fifth, third);
132 }
133 case MSGGET:
134 return sys_msgget ((key_t) first, second);
135 case MSGCTL:
136 return sys_msgctl (first, second,
137 (struct msqid_ds *) ptr);
138 default:
139 return -EINVAL;
140 }
141 if (call <= SHMCTL)
142 switch (call) {
143 case SHMAT:
144 switch (version) {
145 default: {
146 ulong raddr;
147 ret = do_shmat (first, ptr, second, &raddr);
148 if (ret)
149 return ret;
150 return put_user (raddr, (ulong __user *) third);
151 }
152 }
153 case SHMDT:
154 return sys_shmdt (ptr);
155 case SHMGET:
156 return sys_shmget (first, second, third);
157 case SHMCTL:
158 return sys_shmctl (first, second, ptr);
159 default:
160 return -ENOSYS;
161 }
162
163 return -EINVAL;
164}
165
166/* sys_cacheflush -- flush (part of) the processor cache. */ 30/* sys_cacheflush -- flush (part of) the processor cache. */
167asmlinkage int 31asmlinkage int
168sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) 32sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S
index 56dd01ded148..b30b3eb197a5 100644
--- a/arch/m68knommu/kernel/syscalltable.S
+++ b/arch/m68knommu/kernel/syscalltable.S
@@ -100,7 +100,7 @@ ENTRY(sys_call_table)
100 .long sys_settimeofday 100 .long sys_settimeofday
101 .long sys_getgroups16 /* 80 */ 101 .long sys_getgroups16 /* 80 */
102 .long sys_setgroups16 102 .long sys_setgroups16
103 .long old_select 103 .long sys_old_select
104 .long sys_symlink 104 .long sys_symlink
105 .long sys_lstat 105 .long sys_lstat
106 .long sys_readlink /* 85 */ 106 .long sys_readlink /* 85 */
@@ -108,7 +108,7 @@ ENTRY(sys_call_table)
108 .long sys_ni_syscall /* sys_swapon */ 108 .long sys_ni_syscall /* sys_swapon */
109 .long sys_reboot 109 .long sys_reboot
110 .long sys_old_readdir 110 .long sys_old_readdir
111 .long old_mmap /* 90 */ 111 .long sys_old_mmap /* 90 */
112 .long sys_munmap 112 .long sys_munmap
113 .long sys_truncate 113 .long sys_truncate
114 .long sys_ftruncate 114 .long sys_ftruncate
diff --git a/arch/microblaze/kernel/ptrace.c b/arch/microblaze/kernel/ptrace.c
index 4b3ac32754de..6d6349a145f9 100644
--- a/arch/microblaze/kernel/ptrace.c
+++ b/arch/microblaze/kernel/ptrace.c
@@ -78,26 +78,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
78 unsigned long copied; 78 unsigned long copied;
79 79
80 switch (request) { 80 switch (request) {
81 case PTRACE_PEEKTEXT: /* read word at location addr. */
82 case PTRACE_PEEKDATA:
83 pr_debug("PEEKTEXT/PEEKDATA at %08lX\n", addr);
84 copied = access_process_vm(child, addr, &val, sizeof(val), 0);
85 rval = -EIO;
86 if (copied != sizeof(val))
87 break;
88 rval = put_user(val, (unsigned long *)data);
89 break;
90
91 case PTRACE_POKETEXT: /* write the word at location addr. */
92 case PTRACE_POKEDATA:
93 pr_debug("POKETEXT/POKEDATA to %08lX\n", addr);
94 rval = 0;
95 if (access_process_vm(child, addr, &data, sizeof(data), 1)
96 == sizeof(data))
97 break;
98 rval = -EIO;
99 break;
100
101 /* Read/write the word at location ADDR in the registers. */ 81 /* Read/write the word at location ADDR in the registers. */
102 case PTRACE_PEEKUSR: 82 case PTRACE_PEEKUSR:
103 case PTRACE_POKEUSR: 83 case PTRACE_POKEUSR:
@@ -130,50 +110,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
130 if (rval == 0 && request == PTRACE_PEEKUSR) 110 if (rval == 0 && request == PTRACE_PEEKUSR)
131 rval = put_user(val, (unsigned long *)data); 111 rval = put_user(val, (unsigned long *)data);
132 break; 112 break;
133 /* Continue and stop at next (return from) syscall */
134 case PTRACE_SYSCALL:
135 pr_debug("PTRACE_SYSCALL\n");
136 case PTRACE_SINGLESTEP:
137 pr_debug("PTRACE_SINGLESTEP\n");
138 /* Restart after a signal. */
139 case PTRACE_CONT:
140 pr_debug("PTRACE_CONT\n");
141 rval = -EIO;
142 if (!valid_signal(data))
143 break;
144
145 if (request == PTRACE_SYSCALL)
146 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
147 else
148 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
149
150 child->exit_code = data;
151 pr_debug("wakeup_process\n");
152 wake_up_process(child);
153 rval = 0;
154 break;
155
156 /*
157 * make the child exit. Best I can do is send it a sigkill.
158 * perhaps it should be put in the status that it wants to
159 * exit.
160 */
161 case PTRACE_KILL:
162 pr_debug("PTRACE_KILL\n");
163 rval = 0;
164 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
165 break;
166 child->exit_code = SIGKILL;
167 wake_up_process(child);
168 break;
169
170 case PTRACE_DETACH: /* detach a process that was attached. */
171 pr_debug("PTRACE_DETACH\n");
172 rval = ptrace_detach(child, data);
173 break;
174 default: 113 default:
175 /* rval = ptrace_request(child, request, addr, data); noMMU */ 114 rval = ptrace_request(child, request, addr, data);
176 rval = -EIO;
177 } 115 }
178 return rval; 116 return rval;
179} 117}
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 591ca0cd4c24..29e86923d1bf 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -812,9 +812,9 @@ config DMA_COHERENT
812 812
813config DMA_NONCOHERENT 813config DMA_NONCOHERENT
814 bool 814 bool
815 select DMA_NEED_PCI_MAP_STATE 815 select NEED_DMA_MAP_STATE
816 816
817config DMA_NEED_PCI_MAP_STATE 817config NEED_DMA_MAP_STATE
818 bool 818 bool
819 819
820config SYS_HAS_EARLY_PRINTK 820config SYS_HAS_EARLY_PRINTK
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index f58aed354bfd..613f6912dfc1 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -8,7 +8,8 @@
8#include <asm/page.h> 8#include <asm/page.h>
9#include <asm/ptrace.h> 9#include <asm/ptrace.h>
10 10
11#define COMPAT_USER_HZ 100 11#define COMPAT_USER_HZ 100
12#define COMPAT_UTS_MACHINE "mips\0\0\0"
12 13
13typedef u32 compat_size_t; 14typedef u32 compat_size_t;
14typedef s32 compat_ssize_t; 15typedef s32 compat_ssize_t;
diff --git a/arch/mips/include/asm/pci.h b/arch/mips/include/asm/pci.h
index 5ebf82572ec0..3beea1479b43 100644
--- a/arch/mips/include/asm/pci.h
+++ b/arch/mips/include/asm/pci.h
@@ -102,28 +102,6 @@ struct pci_dev;
102 */ 102 */
103extern unsigned int PCI_DMA_BUS_IS_PHYS; 103extern unsigned int PCI_DMA_BUS_IS_PHYS;
104 104
105#ifdef CONFIG_DMA_NEED_PCI_MAP_STATE
106
107/* pci_unmap_{single,page} is not a nop, thus... */
108#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
109#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
110#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
111#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
112#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
113#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
114
115#else /* CONFIG_DMA_NEED_PCI_MAP_STATE */
116
117/* pci_unmap_{page,single} is a nop so... */
118#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
119#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
120#define pci_unmap_addr(PTR, ADDR_NAME) (0)
121#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
122#define pci_unmap_len(PTR, LEN_NAME) (0)
123#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
124
125#endif /* CONFIG_DMA_NEED_PCI_MAP_STATE */
126
127#ifdef CONFIG_PCI 105#ifdef CONFIG_PCI
128static inline void pci_dma_burst_advice(struct pci_dev *pdev, 106static inline void pci_dma_burst_advice(struct pci_dev *pdev,
129 enum pci_dma_burst_strategy *strat, 107 enum pci_dma_burst_strategy *strat,
diff --git a/arch/mips/include/asm/unistd.h b/arch/mips/include/asm/unistd.h
index 65c679ecbe6b..1b5a6648eb86 100644
--- a/arch/mips/include/asm/unistd.h
+++ b/arch/mips/include/asm/unistd.h
@@ -1004,6 +1004,7 @@
1004#define __ARCH_WANT_OLD_READDIR 1004#define __ARCH_WANT_OLD_READDIR
1005#define __ARCH_WANT_SYS_ALARM 1005#define __ARCH_WANT_SYS_ALARM
1006#define __ARCH_WANT_SYS_GETHOSTNAME 1006#define __ARCH_WANT_SYS_GETHOSTNAME
1007#define __ARCH_WANT_SYS_IPC
1007#define __ARCH_WANT_SYS_PAUSE 1008#define __ARCH_WANT_SYS_PAUSE
1008#define __ARCH_WANT_SYS_SGETMASK 1009#define __ARCH_WANT_SYS_SGETMASK
1009#define __ARCH_WANT_SYS_UTIME 1010#define __ARCH_WANT_SYS_UTIME
@@ -1013,6 +1014,7 @@
1013#define __ARCH_WANT_SYS_LLSEEK 1014#define __ARCH_WANT_SYS_LLSEEK
1014#define __ARCH_WANT_SYS_NICE 1015#define __ARCH_WANT_SYS_NICE
1015#define __ARCH_WANT_SYS_OLD_GETRLIMIT 1016#define __ARCH_WANT_SYS_OLD_GETRLIMIT
1017#define __ARCH_WANT_SYS_OLD_UNAME
1016#define __ARCH_WANT_SYS_OLDUMOUNT 1018#define __ARCH_WANT_SYS_OLDUMOUNT
1017#define __ARCH_WANT_SYS_SIGPENDING 1019#define __ARCH_WANT_SYS_SIGPENDING
1018#define __ARCH_WANT_SYS_SIGPROCMASK 1020#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index bde79ef602e6..a39d0597a375 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -249,22 +249,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
249} 249}
250#endif 250#endif
251 251
252SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
253{
254 int ret = 0;
255
256 down_read(&uts_sem);
257 if (copy_to_user(name, utsname(), sizeof *name))
258 ret = -EFAULT;
259 up_read(&uts_sem);
260
261 if (current->personality == PER_LINUX32 && !ret)
262 if (copy_to_user(name->machine, "mips\0\0\0", 8))
263 ret = -EFAULT;
264
265 return ret;
266}
267
268SYSCALL_DEFINE1(32_personality, unsigned long, personality) 252SYSCALL_DEFINE1(32_personality, unsigned long, personality)
269{ 253{
270 int ret; 254 int ret;
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 054861ccb4dd..c51b95ff8644 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -493,36 +493,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
493 ret = ptrace_setfpregs(child, (__u32 __user *) data); 493 ret = ptrace_setfpregs(child, (__u32 __user *) data);
494 break; 494 break;
495 495
496 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
497 case PTRACE_CONT: { /* restart after signal. */
498 ret = -EIO;
499 if (!valid_signal(data))
500 break;
501 if (request == PTRACE_SYSCALL) {
502 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
503 }
504 else {
505 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
506 }
507 child->exit_code = data;
508 wake_up_process(child);
509 ret = 0;
510 break;
511 }
512
513 /*
514 * make the child exit. Best I can do is send it a sigkill.
515 * perhaps it should be put in the status that it wants to
516 * exit.
517 */
518 case PTRACE_KILL:
519 ret = 0;
520 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
521 break;
522 child->exit_code = SIGKILL;
523 wake_up_process(child);
524 break;
525
526 case PTRACE_GET_THREAD_AREA: 496 case PTRACE_GET_THREAD_AREA:
527 ret = put_user(task_thread_info(child)->tp_value, 497 ret = put_user(task_thread_info(child)->tp_value,
528 (unsigned long __user *) data); 498 (unsigned long __user *) data);
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 66b5a48676dd..44337ba03717 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -181,7 +181,7 @@ EXPORT(sysn32_call_table)
181 PTR sys_exit 181 PTR sys_exit
182 PTR compat_sys_wait4 182 PTR compat_sys_wait4
183 PTR sys_kill /* 6060 */ 183 PTR sys_kill /* 6060 */
184 PTR sys_32_newuname 184 PTR sys_newuname
185 PTR sys_semget 185 PTR sys_semget
186 PTR sys_semop 186 PTR sys_semop
187 PTR sys_n32_semctl 187 PTR sys_n32_semctl
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 515f9eab2b28..813689ef2384 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -325,7 +325,7 @@ sys_call_table:
325 PTR sys32_sigreturn 325 PTR sys32_sigreturn
326 PTR sys32_clone /* 4120 */ 326 PTR sys32_clone /* 4120 */
327 PTR sys_setdomainname 327 PTR sys_setdomainname
328 PTR sys_32_newuname 328 PTR sys_newuname
329 PTR sys_ni_syscall /* sys_modify_ldt */ 329 PTR sys_ni_syscall /* sys_modify_ldt */
330 PTR compat_sys_adjtimex 330 PTR compat_sys_adjtimex
331 PTR sys_mprotect /* 4125 */ 331 PTR sys_mprotect /* 4125 */
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index 3f7f466190b4..e96b1c30c7aa 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -215,48 +215,6 @@ out:
215 return error; 215 return error;
216} 216}
217 217
218/*
219 * Compacrapability ...
220 */
221SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
222{
223 if (name && !copy_to_user(name, utsname(), sizeof (*name)))
224 return 0;
225 return -EFAULT;
226}
227
228/*
229 * Compacrapability ...
230 */
231SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
232{
233 int error;
234
235 if (!name)
236 return -EFAULT;
237 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
238 return -EFAULT;
239
240 error = __copy_to_user(&name->sysname, &utsname()->sysname,
241 __OLD_UTS_LEN);
242 error -= __put_user(0, name->sysname + __OLD_UTS_LEN);
243 error -= __copy_to_user(&name->nodename, &utsname()->nodename,
244 __OLD_UTS_LEN);
245 error -= __put_user(0, name->nodename + __OLD_UTS_LEN);
246 error -= __copy_to_user(&name->release, &utsname()->release,
247 __OLD_UTS_LEN);
248 error -= __put_user(0, name->release + __OLD_UTS_LEN);
249 error -= __copy_to_user(&name->version, &utsname()->version,
250 __OLD_UTS_LEN);
251 error -= __put_user(0, name->version + __OLD_UTS_LEN);
252 error -= __copy_to_user(&name->machine, &utsname()->machine,
253 __OLD_UTS_LEN);
254 error = __put_user(0, name->machine + __OLD_UTS_LEN);
255 error = error ? -EFAULT : 0;
256
257 return error;
258}
259
260SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) 218SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
261{ 219{
262 struct thread_info *ti = task_thread_info(current); 220 struct thread_info *ti = task_thread_info(current);
@@ -407,94 +365,6 @@ _sys_sysmips(nabi_no_regargs struct pt_regs regs)
407} 365}
408 366
409/* 367/*
410 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
411 *
412 * This is really horribly ugly.
413 */
414SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second,
415 unsigned long, third, void __user *, ptr, long, fifth)
416{
417 int version, ret;
418
419 version = call >> 16; /* hack for backward compatibility */
420 call &= 0xffff;
421
422 switch (call) {
423 case SEMOP:
424 return sys_semtimedop(first, (struct sembuf __user *)ptr,
425 second, NULL);
426 case SEMTIMEDOP:
427 return sys_semtimedop(first, (struct sembuf __user *)ptr,
428 second,
429 (const struct timespec __user *)fifth);
430 case SEMGET:
431 return sys_semget(first, second, third);
432 case SEMCTL: {
433 union semun fourth;
434 if (!ptr)
435 return -EINVAL;
436 if (get_user(fourth.__pad, (void __user *__user *) ptr))
437 return -EFAULT;
438 return sys_semctl(first, second, third, fourth);
439 }
440
441 case MSGSND:
442 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
443 second, third);
444 case MSGRCV:
445 switch (version) {
446 case 0: {
447 struct ipc_kludge tmp;
448 if (!ptr)
449 return -EINVAL;
450
451 if (copy_from_user(&tmp,
452 (struct ipc_kludge __user *) ptr,
453 sizeof(tmp)))
454 return -EFAULT;
455 return sys_msgrcv(first, tmp.msgp, second,
456 tmp.msgtyp, third);
457 }
458 default:
459 return sys_msgrcv(first,
460 (struct msgbuf __user *) ptr,
461 second, fifth, third);
462 }
463 case MSGGET:
464 return sys_msgget((key_t) first, second);
465 case MSGCTL:
466 return sys_msgctl(first, second,
467 (struct msqid_ds __user *) ptr);
468
469 case SHMAT:
470 switch (version) {
471 default: {
472 unsigned long raddr;
473 ret = do_shmat(first, (char __user *) ptr, second,
474 &raddr);
475 if (ret)
476 return ret;
477 return put_user(raddr, (unsigned long __user *) third);
478 }
479 case 1: /* iBCS2 emulator entry point */
480 if (!segment_eq(get_fs(), get_ds()))
481 return -EINVAL;
482 return do_shmat(first, (char __user *) ptr, second,
483 (unsigned long *) third);
484 }
485 case SHMDT:
486 return sys_shmdt((char __user *)ptr);
487 case SHMGET:
488 return sys_shmget(first, second, third);
489 case SHMCTL:
490 return sys_shmctl(first, second,
491 (struct shmid_ds __user *) ptr);
492 default:
493 return -ENOSYS;
494 }
495}
496
497/*
498 * No implemented yet ... 368 * No implemented yet ...
499 */ 369 */
500SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) 370SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op)
diff --git a/arch/mn10300/include/asm/dma-mapping.h b/arch/mn10300/include/asm/dma-mapping.h
index ccae8f6c6326..4ed1522b38d2 100644
--- a/arch/mn10300/include/asm/dma-mapping.h
+++ b/arch/mn10300/include/asm/dma-mapping.h
@@ -17,6 +17,11 @@
17#include <asm/cache.h> 17#include <asm/cache.h>
18#include <asm/io.h> 18#include <asm/io.h>
19 19
20/*
21 * See Documentation/DMA-API.txt for the description of how the
22 * following DMA API should work.
23 */
24
20extern void *dma_alloc_coherent(struct device *dev, size_t size, 25extern void *dma_alloc_coherent(struct device *dev, size_t size,
21 dma_addr_t *dma_handle, int flag); 26 dma_addr_t *dma_handle, int flag);
22 27
@@ -26,13 +31,6 @@ extern void dma_free_coherent(struct device *dev, size_t size,
26#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f)) 31#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent((d), (s), (h), (f))
27#define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h)) 32#define dma_free_noncoherent(d, s, v, h) dma_free_coherent((d), (s), (v), (h))
28 33
29/*
30 * Map a single buffer of the indicated size for DMA in streaming mode. The
31 * 32-bit bus address to use is returned.
32 *
33 * Once the device is given the dma address, the device owns this memory until
34 * either pci_unmap_single or pci_dma_sync_single is performed.
35 */
36static inline 34static inline
37dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, 35dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
38 enum dma_data_direction direction) 36 enum dma_data_direction direction)
@@ -42,14 +40,6 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
42 return virt_to_bus(ptr); 40 return virt_to_bus(ptr);
43} 41}
44 42
45/*
46 * Unmap a single streaming mode DMA translation. The dma_addr and size must
47 * match what was provided for in a previous pci_map_single call. All other
48 * usages are undefined.
49 *
50 * After this call, reads by the cpu to the buffer are guarenteed to see
51 * whatever the device wrote there.
52 */
53static inline 43static inline
54void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 44void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
55 enum dma_data_direction direction) 45 enum dma_data_direction direction)
@@ -57,20 +47,6 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
57 BUG_ON(direction == DMA_NONE); 47 BUG_ON(direction == DMA_NONE);
58} 48}
59 49
60/*
61 * Map a set of buffers described by scatterlist in streaming mode for DMA.
62 * This is the scather-gather version of the above pci_map_single interface.
63 * Here the scatter gather list elements are each tagged with the appropriate
64 * dma address and length. They are obtained via sg_dma_{address,length}(SG).
65 *
66 * NOTE: An implementation may be able to use a smaller number of DMA
67 * address/length pairs than there are SG table elements. (for example
68 * via virtual mapping capabilities) The routine returns the number of
69 * addr/length pairs actually used, at most nents.
70 *
71 * Device ownership issues as mentioned above for pci_map_single are the same
72 * here.
73 */
74static inline 50static inline
75int dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents, 51int dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
76 enum dma_data_direction direction) 52 enum dma_data_direction direction)
@@ -91,11 +67,6 @@ int dma_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
91 return nents; 67 return nents;
92} 68}
93 69
94/*
95 * Unmap a set of streaming mode DMA translations.
96 * Again, cpu read rules concerning calls here are the same as for
97 * pci_unmap_single() above.
98 */
99static inline 70static inline
100void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 71void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
101 enum dma_data_direction direction) 72 enum dma_data_direction direction)
@@ -103,10 +74,6 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
103 BUG_ON(!valid_dma_direction(direction)); 74 BUG_ON(!valid_dma_direction(direction));
104} 75}
105 76
106/*
107 * pci_{map,unmap}_single_page maps a kernel page to a dma_addr_t. identical
108 * to pci_map_single, but takes a struct page instead of a virtual address
109 */
110static inline 77static inline
111dma_addr_t dma_map_page(struct device *dev, struct page *page, 78dma_addr_t dma_map_page(struct device *dev, struct page *page,
112 unsigned long offset, size_t size, 79 unsigned long offset, size_t size,
@@ -123,15 +90,6 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
123 BUG_ON(direction == DMA_NONE); 90 BUG_ON(direction == DMA_NONE);
124} 91}
125 92
126/*
127 * Make physical memory consistent for a single streaming mode DMA translation
128 * after a transfer.
129 *
130 * If you perform a pci_map_single() but wish to interrogate the buffer using
131 * the cpu, yet do not wish to teardown the PCI dma mapping, you must call this
132 * function before doing so. At the next point you give the PCI dma address
133 * back to the card, the device again owns the buffer.
134 */
135static inline 93static inline
136void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, 94void dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
137 size_t size, enum dma_data_direction direction) 95 size_t size, enum dma_data_direction direction)
@@ -161,13 +119,6 @@ dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
161} 119}
162 120
163 121
164/*
165 * Make physical memory consistent for a set of streaming mode DMA translations
166 * after a transfer.
167 *
168 * The same as pci_dma_sync_single but for a scatter-gather list, same rules
169 * and usage.
170 */
171static inline 122static inline
172void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, 123void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
173 int nelems, enum dma_data_direction direction) 124 int nelems, enum dma_data_direction direction)
@@ -187,12 +138,6 @@ int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
187 return 0; 138 return 0;
188} 139}
189 140
190/*
191 * Return whether the given PCI device DMA address mask can be supported
192 * properly. For example, if your device can only drive the low 24-bits during
193 * PCI bus mastering, then you would pass 0x00ffffff as the mask to this
194 * function.
195 */
196static inline 141static inline
197int dma_supported(struct device *dev, u64 mask) 142int dma_supported(struct device *dev, u64 mask)
198{ 143{
diff --git a/arch/mn10300/include/asm/ptrace.h b/arch/mn10300/include/asm/ptrace.h
index 1b0ba5e182b0..7c2e911052b6 100644
--- a/arch/mn10300/include/asm/ptrace.h
+++ b/arch/mn10300/include/asm/ptrace.h
@@ -99,8 +99,6 @@ struct task_struct;
99extern void show_regs(struct pt_regs *); 99extern void show_regs(struct pt_regs *);
100 100
101#define arch_has_single_step() (1) 101#define arch_has_single_step() (1)
102extern void user_enable_single_step(struct task_struct *);
103extern void user_disable_single_step(struct task_struct *);
104 102
105#endif /* !__ASSEMBLY */ 103#endif /* !__ASSEMBLY */
106 104
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h
index c05acb95c2a9..9d056f515929 100644
--- a/arch/mn10300/include/asm/unistd.h
+++ b/arch/mn10300/include/asm/unistd.h
@@ -363,6 +363,7 @@
363#define __ARCH_WANT_STAT64 363#define __ARCH_WANT_STAT64
364#define __ARCH_WANT_SYS_ALARM 364#define __ARCH_WANT_SYS_ALARM
365#define __ARCH_WANT_SYS_GETHOSTNAME 365#define __ARCH_WANT_SYS_GETHOSTNAME
366#define __ARCH_WANT_SYS_IPC
366#define __ARCH_WANT_SYS_PAUSE 367#define __ARCH_WANT_SYS_PAUSE
367#define __ARCH_WANT_SYS_SGETMASK 368#define __ARCH_WANT_SYS_SGETMASK
368#define __ARCH_WANT_SYS_SIGNAL 369#define __ARCH_WANT_SYS_SIGNAL
@@ -375,6 +376,7 @@
375#define __ARCH_WANT_SYS_LLSEEK 376#define __ARCH_WANT_SYS_LLSEEK
376#define __ARCH_WANT_SYS_NICE 377#define __ARCH_WANT_SYS_NICE
377#define __ARCH_WANT_SYS_OLD_GETRLIMIT 378#define __ARCH_WANT_SYS_OLD_GETRLIMIT
379#define __ARCH_WANT_SYS_OLD_SELECT
378#define __ARCH_WANT_SYS_OLDUMOUNT 380#define __ARCH_WANT_SYS_OLDUMOUNT
379#define __ARCH_WANT_SYS_SIGPENDING 381#define __ARCH_WANT_SYS_SIGPENDING
380#define __ARCH_WANT_SYS_SIGPROCMASK 382#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 88e3e1c3cc21..d9ed5a15c547 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -468,7 +468,7 @@ ENTRY(sys_call_table)
468 .long sys_settimeofday 468 .long sys_settimeofday
469 .long sys_getgroups16 /* 80 */ 469 .long sys_getgroups16 /* 80 */
470 .long sys_setgroups16 470 .long sys_setgroups16
471 .long old_select 471 .long sys_old_select
472 .long sys_symlink 472 .long sys_symlink
473 .long sys_lstat 473 .long sys_lstat
474 .long sys_readlink /* 85 */ 474 .long sys_readlink /* 85 */
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index 17cc6ce04e84..815f1355fad4 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -31,109 +31,3 @@ asmlinkage long old_mmap(unsigned long addr, unsigned long len,
31 return -EINVAL; 31 return -EINVAL;
32 return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 32 return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
33} 33}
34
35struct sel_arg_struct {
36 unsigned long n;
37 fd_set *inp;
38 fd_set *outp;
39 fd_set *exp;
40 struct timeval *tvp;
41};
42
43asmlinkage int old_select(struct sel_arg_struct __user *arg)
44{
45 struct sel_arg_struct a;
46
47 if (copy_from_user(&a, arg, sizeof(a)))
48 return -EFAULT;
49 /* sys_select() does the appropriate kernel locking */
50 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
51}
52
53/*
54 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
55 *
56 * This is really horribly ugly.
57 */
58asmlinkage long sys_ipc(uint call, int first, int second,
59 int third, void __user *ptr, long fifth)
60{
61 int version, ret;
62
63 version = call >> 16; /* hack for backward compatibility */
64 call &= 0xffff;
65
66 switch (call) {
67 case SEMOP:
68 return sys_semtimedop(first, (struct sembuf __user *)ptr,
69 second, NULL);
70 case SEMTIMEDOP:
71 return sys_semtimedop(first, (struct sembuf __user *)ptr,
72 second,
73 (const struct timespec __user *)fifth);
74 case SEMGET:
75 return sys_semget(first, second, third);
76 case SEMCTL: {
77 union semun fourth;
78 if (!ptr)
79 return -EINVAL;
80 if (get_user(fourth.__pad, (void __user * __user *) ptr))
81 return -EFAULT;
82 return sys_semctl(first, second, third, fourth);
83 }
84
85 case MSGSND:
86 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
87 second, third);
88 case MSGRCV:
89 switch (version) {
90 case 0: {
91 struct ipc_kludge tmp;
92 if (!ptr)
93 return -EINVAL;
94
95 if (copy_from_user(&tmp,
96 (struct ipc_kludge __user *) ptr,
97 sizeof(tmp)))
98 return -EFAULT;
99 return sys_msgrcv(first, tmp.msgp, second,
100 tmp.msgtyp, third);
101 }
102 default:
103 return sys_msgrcv(first,
104 (struct msgbuf __user *) ptr,
105 second, fifth, third);
106 }
107 case MSGGET:
108 return sys_msgget((key_t) first, second);
109 case MSGCTL:
110 return sys_msgctl(first, second,
111 (struct msqid_ds __user *) ptr);
112
113 case SHMAT:
114 switch (version) {
115 default: {
116 ulong raddr;
117 ret = do_shmat(first, (char __user *) ptr, second,
118 &raddr);
119 if (ret)
120 return ret;
121 return put_user(raddr, (ulong *) third);
122 }
123 case 1: /* iBCS2 emulator entry point */
124 if (!segment_eq(get_fs(), get_ds()))
125 return -EINVAL;
126 return do_shmat(first, (char __user *) ptr, second,
127 (ulong *) third);
128 }
129 case SHMDT:
130 return sys_shmdt((char __user *)ptr);
131 case SHMGET:
132 return sys_shmget(first, second, third);
133 case SHMCTL:
134 return sys_shmctl(first, second,
135 (struct shmid_ds __user *) ptr);
136 default:
137 return -EINVAL;
138 }
139}
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index f388dc68f605..9c4da3d63bfb 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -95,6 +95,9 @@ config PM
95config STACKTRACE_SUPPORT 95config STACKTRACE_SUPPORT
96 def_bool y 96 def_bool y
97 97
98config NEED_DMA_MAP_STATE
99 def_bool y
100
98config ISA_DMA_API 101config ISA_DMA_API
99 bool 102 bool
100 103
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 7f32611a7a5e..02b77baa5da6 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -7,7 +7,8 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/thread_info.h> 8#include <linux/thread_info.h>
9 9
10#define COMPAT_USER_HZ 100 10#define COMPAT_USER_HZ 100
11#define COMPAT_UTS_MACHINE "parisc\0\0"
11 12
12typedef u32 compat_size_t; 13typedef u32 compat_size_t;
13typedef s32 compat_ssize_t; 14typedef s32 compat_ssize_t;
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h
index 64c7aa590ae5..2242a5c636c2 100644
--- a/arch/parisc/include/asm/pci.h
+++ b/arch/parisc/include/asm/pci.h
@@ -183,20 +183,6 @@ struct pci_bios_ops {
183 void (*fixup_bus)(struct pci_bus *bus); 183 void (*fixup_bus)(struct pci_bus *bus);
184}; 184};
185 185
186/* pci_unmap_{single,page} is not a nop, thus... */
187#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
188 dma_addr_t ADDR_NAME;
189#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
190 __u32 LEN_NAME;
191#define pci_unmap_addr(PTR, ADDR_NAME) \
192 ((PTR)->ADDR_NAME)
193#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
194 (((PTR)->ADDR_NAME) = (VAL))
195#define pci_unmap_len(PTR, LEN_NAME) \
196 ((PTR)->LEN_NAME)
197#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
198 (((PTR)->LEN_NAME) = (VAL))
199
200/* 186/*
201** Stuff declared in arch/parisc/kernel/pci.c 187** Stuff declared in arch/parisc/kernel/pci.c
202*/ 188*/
diff --git a/arch/parisc/include/asm/ptrace.h b/arch/parisc/include/asm/ptrace.h
index aead40b16dd8..7f09533da771 100644
--- a/arch/parisc/include/asm/ptrace.h
+++ b/arch/parisc/include/asm/ptrace.h
@@ -47,13 +47,8 @@ struct pt_regs {
47 47
48#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS)) 48#define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS))
49 49
50struct task_struct;
51#define arch_has_single_step() 1 50#define arch_has_single_step() 1
52void user_disable_single_step(struct task_struct *task);
53void user_enable_single_step(struct task_struct *task);
54
55#define arch_has_block_step() 1 51#define arch_has_block_step() 1
56void user_enable_block_step(struct task_struct *task);
57 52
58/* XXX should we use iaoq[1] or iaoq[0] ? */ 53/* XXX should we use iaoq[1] or iaoq[0] ? */
59#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) 54#define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0)
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 9147391afb03..c9b932260f47 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -234,18 +234,3 @@ long parisc_personality(unsigned long personality)
234 234
235 return err; 235 return err;
236} 236}
237
238long parisc_newuname(struct new_utsname __user *name)
239{
240 int err = sys_newuname(name);
241
242#ifdef CONFIG_COMPAT
243 if (!err && personality(current->personality) == PER_LINUX32) {
244 if (__put_user(0, name->machine + 6) ||
245 __put_user(0, name->machine + 7))
246 err = -EFAULT;
247 }
248#endif
249
250 return err;
251}
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index de5f6dab48b7..3d52c978738f 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -127,7 +127,7 @@
127 ENTRY_SAME(socketpair) 127 ENTRY_SAME(socketpair)
128 ENTRY_SAME(setpgid) 128 ENTRY_SAME(setpgid)
129 ENTRY_SAME(send) 129 ENTRY_SAME(send)
130 ENTRY_OURS(newuname) 130 ENTRY_SAME(newuname)
131 ENTRY_SAME(umask) /* 60 */ 131 ENTRY_SAME(umask) /* 60 */
132 ENTRY_SAME(chroot) 132 ENTRY_SAME(chroot)
133 ENTRY_COMP(ustat) 133 ENTRY_COMP(ustat)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 155d571f5e26..8a54eb8e3768 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -672,6 +672,9 @@ config ZONE_DMA
672 bool 672 bool
673 default y 673 default y
674 674
675config NEED_DMA_MAP_STATE
676 def_bool (PPC64 || NOT_COHERENT_CACHE)
677
675config GENERIC_ISA_DMA 678config GENERIC_ISA_DMA
676 bool 679 bool
677 depends on PPC64 || POWER4 || 6xx && !CPM2 680 depends on PPC64 || POWER4 || 6xx && !CPM2
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index 977f260d5e64..83f4b79dff85 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * GE Fanuc PPC9A Device Tree Source 2 * GE PPC9A Device Tree Source
3 * 3 *
4 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 4 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index 8e4efff3bda1..fc3a331dd392 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * GE Fanuc SBC310 Device Tree Source 2 * GE SBC310 Device Tree Source
3 * 3 *
4 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 4 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index bb7060078fb4..c0671cc98125 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -1,7 +1,7 @@
1/* 1/*
2 * GE Fanuc SBC610 Device Tree Source 2 * GE SBC610 Device Tree Source
3 * 3 *
4 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 4 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the 7 * under the terms of the GNU General Public License as published by the
diff --git a/arch/powerpc/boot/dts/kmeter1.dts b/arch/powerpc/boot/dts/kmeter1.dts
index 65b8b4f27efe..d8b5d12fb663 100644
--- a/arch/powerpc/boot/dts/kmeter1.dts
+++ b/arch/powerpc/boot/dts/kmeter1.dts
@@ -490,7 +490,7 @@
490 compatible = "cfi-flash"; 490 compatible = "cfi-flash";
491 /* 491 /*
492 * The Intel P30 chip has 2 non-identical chips on 492 * The Intel P30 chip has 2 non-identical chips on
493 * one die, so we need to define 2 seperate regions 493 * one die, so we need to define 2 separate regions
494 * that are scanned by physmap_of independantly. 494 * that are scanned by physmap_of independantly.
495 */ 495 */
496 reg = <0 0x00000000 0x02000000 496 reg = <0 0x00000000 0x02000000
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index 4774c2f92232..396d21a80058 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -7,7 +7,8 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/sched.h> 8#include <linux/sched.h>
9 9
10#define COMPAT_USER_HZ 100 10#define COMPAT_USER_HZ 100
11#define COMPAT_UTS_MACHINE "ppc\0\0"
11 12
12typedef u32 compat_size_t; 13typedef u32 compat_size_t;
13typedef s32 compat_ssize_t; 14typedef s32 compat_ssize_t;
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index 80a973bb9e71..c85ef230135b 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -127,9 +127,6 @@ static inline int dma_supported(struct device *dev, u64 mask)
127 return dma_ops->dma_supported(dev, mask); 127 return dma_ops->dma_supported(dev, mask);
128} 128}
129 129
130/* We have our own implementation of pci_set_dma_mask() */
131#define HAVE_ARCH_PCI_SET_DMA_MASK
132
133static inline int dma_set_mask(struct device *dev, u64 dma_mask) 130static inline int dma_set_mask(struct device *dev, u64 dma_mask)
134{ 131{
135 struct dma_map_ops *dma_ops = get_dma_ops(dev); 132 struct dma_map_ops *dma_ops = get_dma_ops(dev);
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index d8a693109c82..a011603d4079 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -14,6 +14,9 @@
14#define _ASM_POWERPC_PACA_H 14#define _ASM_POWERPC_PACA_H
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#ifdef CONFIG_PPC64
18
19#include <linux/init.h>
17#include <asm/types.h> 20#include <asm/types.h>
18#include <asm/lppaca.h> 21#include <asm/lppaca.h>
19#include <asm/mmu.h> 22#include <asm/mmu.h>
@@ -145,8 +148,19 @@ struct paca_struct {
145#endif 148#endif
146}; 149};
147 150
148extern struct paca_struct paca[]; 151extern struct paca_struct *paca;
149extern void initialise_pacas(void); 152extern __initdata struct paca_struct boot_paca;
153extern void initialise_paca(struct paca_struct *new_paca, int cpu);
154
155extern void allocate_pacas(void);
156extern void free_unused_pacas(void);
157
158#else /* CONFIG_PPC64 */
159
160static inline void allocate_pacas(void) { };
161static inline void free_unused_pacas(void) { };
162
163#endif /* CONFIG_PPC64 */
150 164
151#endif /* __KERNEL__ */ 165#endif /* __KERNEL__ */
152#endif /* _ASM_POWERPC_PACA_H */ 166#endif /* _ASM_POWERPC_PACA_H */
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index b5ea626eea2d..a20a9ad2258b 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -141,38 +141,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
141 141
142#define HAVE_PCI_LEGACY 1 142#define HAVE_PCI_LEGACY 1
143 143
144#if defined(CONFIG_PPC64) || defined(CONFIG_NOT_COHERENT_CACHE)
145/*
146 * For 64-bit kernels, pci_unmap_{single,page} is not a nop.
147 * For 32-bit non-coherent kernels, pci_dma_sync_single_for_cpu() and
148 * so on are not nops.
149 * and thus...
150 */
151#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
152 dma_addr_t ADDR_NAME;
153#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
154 __u32 LEN_NAME;
155#define pci_unmap_addr(PTR, ADDR_NAME) \
156 ((PTR)->ADDR_NAME)
157#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
158 (((PTR)->ADDR_NAME) = (VAL))
159#define pci_unmap_len(PTR, LEN_NAME) \
160 ((PTR)->LEN_NAME)
161#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
162 (((PTR)->LEN_NAME) = (VAL))
163
164#else /* 32-bit && coherent */
165
166/* pci_unmap_{page,single} is a nop so... */
167#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
168#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
169#define pci_unmap_addr(PTR, ADDR_NAME) (0)
170#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
171#define pci_unmap_len(PTR, LEN_NAME) (0)
172#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
173
174#endif /* CONFIG_PPC64 || CONFIG_NOT_COHERENT_CACHE */
175
176#ifdef CONFIG_PPC64 144#ifdef CONFIG_PPC64
177 145
178/* The PCI address space does not equal the physical memory address 146/* The PCI address space does not equal the physical memory address
diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index 3288ce3997e0..e6d4ce69b126 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -1,110 +1,23 @@
1/* 1/*
2 * Performance event support - PowerPC-specific definitions. 2 * Performance event support - hardware-specific disambiguation
3 * 3 *
4 * Copyright 2008-2009 Paul Mackerras, IBM Corporation. 4 * For now this is a compile-time decision, but eventually it should be
5 * runtime. This would allow multiplatform perf event support for e300 (fsl
6 * embedded perf counters) plus server/classic, and would accommodate
7 * devices other than the core which provide their own performance counters.
8 *
9 * Copyright 2010 Freescale Semiconductor, Inc.
5 * 10 *
6 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 13 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version. 14 * 2 of the License, or (at your option) any later version.
10 */ 15 */
11#include <linux/types.h>
12
13#include <asm/hw_irq.h>
14
15#define MAX_HWEVENTS 8
16#define MAX_EVENT_ALTERNATIVES 8
17#define MAX_LIMITED_HWCOUNTERS 2
18
19/*
20 * This struct provides the constants and functions needed to
21 * describe the PMU on a particular POWER-family CPU.
22 */
23struct power_pmu {
24 const char *name;
25 int n_counter;
26 int max_alternatives;
27 unsigned long add_fields;
28 unsigned long test_adder;
29 int (*compute_mmcr)(u64 events[], int n_ev,
30 unsigned int hwc[], unsigned long mmcr[]);
31 int (*get_constraint)(u64 event_id, unsigned long *mskp,
32 unsigned long *valp);
33 int (*get_alternatives)(u64 event_id, unsigned int flags,
34 u64 alt[]);
35 void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
36 int (*limited_pmc_event)(u64 event_id);
37 u32 flags;
38 int n_generic;
39 int *generic_events;
40 int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
41 [PERF_COUNT_HW_CACHE_OP_MAX]
42 [PERF_COUNT_HW_CACHE_RESULT_MAX];
43};
44
45/*
46 * Values for power_pmu.flags
47 */
48#define PPMU_LIMITED_PMC5_6 1 /* PMC5/6 have limited function */
49#define PPMU_ALT_SIPR 2 /* uses alternate posn for SIPR/HV */
50
51/*
52 * Values for flags to get_alternatives()
53 */
54#define PPMU_LIMITED_PMC_OK 1 /* can put this on a limited PMC */
55#define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */
56#define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */
57
58extern int register_power_pmu(struct power_pmu *);
59 16
60struct pt_regs;
61extern unsigned long perf_misc_flags(struct pt_regs *regs);
62extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
63
64#define PERF_EVENT_INDEX_OFFSET 1
65
66/*
67 * Only override the default definitions in include/linux/perf_event.h
68 * if we have hardware PMU support.
69 */
70#ifdef CONFIG_PPC_PERF_CTRS 17#ifdef CONFIG_PPC_PERF_CTRS
71#define perf_misc_flags(regs) perf_misc_flags(regs) 18#include <asm/perf_event_server.h>
72#endif 19#endif
73 20
74/* 21#ifdef CONFIG_FSL_EMB_PERF_EVENT
75 * The power_pmu.get_constraint function returns a 32/64-bit value and 22#include <asm/perf_event_fsl_emb.h>
76 * a 32/64-bit mask that express the constraints between this event_id and 23#endif
77 * other events.
78 *
79 * The value and mask are divided up into (non-overlapping) bitfields
80 * of three different types:
81 *
82 * Select field: this expresses the constraint that some set of bits
83 * in MMCR* needs to be set to a specific value for this event_id. For a
84 * select field, the mask contains 1s in every bit of the field, and
85 * the value contains a unique value for each possible setting of the
86 * MMCR* bits. The constraint checking code will ensure that two events
87 * that set the same field in their masks have the same value in their
88 * value dwords.
89 *
90 * Add field: this expresses the constraint that there can be at most
91 * N events in a particular class. A field of k bits can be used for
92 * N <= 2^(k-1) - 1. The mask has the most significant bit of the field
93 * set (and the other bits 0), and the value has only the least significant
94 * bit of the field set. In addition, the 'add_fields' and 'test_adder'
95 * in the struct power_pmu for this processor come into play. The
96 * add_fields value contains 1 in the LSB of the field, and the
97 * test_adder contains 2^(k-1) - 1 - N in the field.
98 *
99 * NAND field: this expresses the constraint that you may not have events
100 * in all of a set of classes. (For example, on PPC970, you can't select
101 * events from the FPU, ISU and IDU simultaneously, although any two are
102 * possible.) For N classes, the field is N+1 bits wide, and each class
103 * is assigned one bit from the least-significant N bits. The mask has
104 * only the most-significant bit set, and the value has only the bit
105 * for the event_id's class set. The test_adder has the least significant
106 * bit set in the field.
107 *
108 * If an event_id is not subject to the constraint expressed by a particular
109 * field, then it will have 0 in both the mask and value for that field.
110 */
diff --git a/arch/powerpc/include/asm/perf_event_fsl_emb.h b/arch/powerpc/include/asm/perf_event_fsl_emb.h
new file mode 100644
index 000000000000..718a9fa94e68
--- /dev/null
+++ b/arch/powerpc/include/asm/perf_event_fsl_emb.h
@@ -0,0 +1,50 @@
1/*
2 * Performance event support - Freescale embedded specific definitions.
3 *
4 * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
5 * Copyright 2010 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#include <linux/types.h>
14#include <asm/hw_irq.h>
15
16#define MAX_HWEVENTS 4
17
18/* event flags */
19#define FSL_EMB_EVENT_VALID 1
20#define FSL_EMB_EVENT_RESTRICTED 2
21
22/* upper half of event flags is PMLCb */
23#define FSL_EMB_EVENT_THRESHMUL 0x0000070000000000ULL
24#define FSL_EMB_EVENT_THRESH 0x0000003f00000000ULL
25
26struct fsl_emb_pmu {
27 const char *name;
28 int n_counter; /* total number of counters */
29
30 /*
31 * The number of contiguous counters starting at zero that
32 * can hold restricted events, or zero if there are no
33 * restricted events.
34 *
35 * This isn't a very flexible method of expressing constraints,
36 * but it's very simple and is adequate for existing chips.
37 */
38 int n_restricted;
39
40 /* Returns event flags and PMLCb (FSL_EMB_EVENT_*) */
41 u64 (*xlate_event)(u64 event_id);
42
43 int n_generic;
44 int *generic_events;
45 int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
46 [PERF_COUNT_HW_CACHE_OP_MAX]
47 [PERF_COUNT_HW_CACHE_RESULT_MAX];
48};
49
50int register_fsl_emb_pmu(struct fsl_emb_pmu *);
diff --git a/arch/powerpc/include/asm/perf_event_server.h b/arch/powerpc/include/asm/perf_event_server.h
new file mode 100644
index 000000000000..8f1df1208d23
--- /dev/null
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -0,0 +1,110 @@
1/*
2 * Performance event support - PowerPC classic/server specific definitions.
3 *
4 * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <linux/types.h>
13#include <asm/hw_irq.h>
14
15#define MAX_HWEVENTS 8
16#define MAX_EVENT_ALTERNATIVES 8
17#define MAX_LIMITED_HWCOUNTERS 2
18
19/*
20 * This struct provides the constants and functions needed to
21 * describe the PMU on a particular POWER-family CPU.
22 */
23struct power_pmu {
24 const char *name;
25 int n_counter;
26 int max_alternatives;
27 unsigned long add_fields;
28 unsigned long test_adder;
29 int (*compute_mmcr)(u64 events[], int n_ev,
30 unsigned int hwc[], unsigned long mmcr[]);
31 int (*get_constraint)(u64 event_id, unsigned long *mskp,
32 unsigned long *valp);
33 int (*get_alternatives)(u64 event_id, unsigned int flags,
34 u64 alt[]);
35 void (*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
36 int (*limited_pmc_event)(u64 event_id);
37 u32 flags;
38 int n_generic;
39 int *generic_events;
40 int (*cache_events)[PERF_COUNT_HW_CACHE_MAX]
41 [PERF_COUNT_HW_CACHE_OP_MAX]
42 [PERF_COUNT_HW_CACHE_RESULT_MAX];
43};
44
45/*
46 * Values for power_pmu.flags
47 */
48#define PPMU_LIMITED_PMC5_6 1 /* PMC5/6 have limited function */
49#define PPMU_ALT_SIPR 2 /* uses alternate posn for SIPR/HV */
50
51/*
52 * Values for flags to get_alternatives()
53 */
54#define PPMU_LIMITED_PMC_OK 1 /* can put this on a limited PMC */
55#define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */
56#define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */
57
58extern int register_power_pmu(struct power_pmu *);
59
60struct pt_regs;
61extern unsigned long perf_misc_flags(struct pt_regs *regs);
62extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
63
64#define PERF_EVENT_INDEX_OFFSET 1
65
66/*
67 * Only override the default definitions in include/linux/perf_event.h
68 * if we have hardware PMU support.
69 */
70#ifdef CONFIG_PPC_PERF_CTRS
71#define perf_misc_flags(regs) perf_misc_flags(regs)
72#endif
73
74/*
75 * The power_pmu.get_constraint function returns a 32/64-bit value and
76 * a 32/64-bit mask that express the constraints between this event_id and
77 * other events.
78 *
79 * The value and mask are divided up into (non-overlapping) bitfields
80 * of three different types:
81 *
82 * Select field: this expresses the constraint that some set of bits
83 * in MMCR* needs to be set to a specific value for this event_id. For a
84 * select field, the mask contains 1s in every bit of the field, and
85 * the value contains a unique value for each possible setting of the
86 * MMCR* bits. The constraint checking code will ensure that two events
87 * that set the same field in their masks have the same value in their
88 * value dwords.
89 *
90 * Add field: this expresses the constraint that there can be at most
91 * N events in a particular class. A field of k bits can be used for
92 * N <= 2^(k-1) - 1. The mask has the most significant bit of the field
93 * set (and the other bits 0), and the value has only the least significant
94 * bit of the field set. In addition, the 'add_fields' and 'test_adder'
95 * in the struct power_pmu for this processor come into play. The
96 * add_fields value contains 1 in the LSB of the field, and the
97 * test_adder contains 2^(k-1) - 1 - N in the field.
98 *
99 * NAND field: this expresses the constraint that you may not have events
100 * in all of a set of classes. (For example, on PPC970, you can't select
101 * events from the FPU, ISU and IDU simultaneously, although any two are
102 * possible.) For N classes, the field is N+1 bits wide, and each class
103 * is assigned one bit from the least-significant N bits. The mask has
104 * only the most-significant bit set, and the value has only the bit
105 * for the event_id's class set. The test_adder has the least significant
106 * bit set in the field.
107 *
108 * If an event_id is not subject to the constraint expressed by a particular
109 * field, then it will have 0 in both the mask and value for that field.
110 */
diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h
index b45108126562..9e2d84c06b74 100644
--- a/arch/powerpc/include/asm/ptrace.h
+++ b/arch/powerpc/include/asm/ptrace.h
@@ -137,15 +137,8 @@ do { \
137} while (0) 137} while (0)
138#endif /* __powerpc64__ */ 138#endif /* __powerpc64__ */
139 139
140/*
141 * These are defined as per linux/ptrace.h, which see.
142 */
143#define arch_has_single_step() (1) 140#define arch_has_single_step() (1)
144#define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601)) 141#define arch_has_block_step() (!cpu_has_feature(CPU_FTR_601))
145extern void user_enable_single_step(struct task_struct *);
146extern void user_enable_block_step(struct task_struct *);
147extern void user_disable_single_step(struct task_struct *);
148
149#define ARCH_HAS_USER_SINGLE_STEP_INFO 142#define ARCH_HAS_USER_SINGLE_STEP_INFO
150 143
151#endif /* __ASSEMBLY__ */ 144#endif /* __ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index 8808d307fe7e..414d434a66d0 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -421,8 +421,8 @@
421/* Bit definitions related to the DBCR2. */ 421/* Bit definitions related to the DBCR2. */
422#define DBCR2_DAC1US 0xC0000000 /* Data Addr Cmp 1 Sup/User */ 422#define DBCR2_DAC1US 0xC0000000 /* Data Addr Cmp 1 Sup/User */
423#define DBCR2_DAC1ER 0x30000000 /* Data Addr Cmp 1 Eff/Real */ 423#define DBCR2_DAC1ER 0x30000000 /* Data Addr Cmp 1 Eff/Real */
424#define DBCR2_DAC2US 0x00000000 /* Data Addr Cmp 2 Sup/User */ 424#define DBCR2_DAC2US 0x0C000000 /* Data Addr Cmp 2 Sup/User */
425#define DBCR2_DAC2ER 0x00000000 /* Data Addr Cmp 2 Eff/Real */ 425#define DBCR2_DAC2ER 0x03000000 /* Data Addr Cmp 2 Eff/Real */
426#define DBCR2_DAC12M 0x00800000 /* DAC 1-2 range enable */ 426#define DBCR2_DAC12M 0x00800000 /* DAC 1-2 range enable */
427#define DBCR2_DAC12MM 0x00400000 /* DAC 1-2 Mask mode*/ 427#define DBCR2_DAC12MM 0x00400000 /* DAC 1-2 Mask mode*/
428#define DBCR2_DAC12MX 0x00C00000 /* DAC 1-2 range eXclusive */ 428#define DBCR2_DAC12MX 0x00C00000 /* DAC 1-2 range eXclusive */
diff --git a/arch/powerpc/include/asm/reg_fsl_emb.h b/arch/powerpc/include/asm/reg_fsl_emb.h
index 0de404dfee8b..77bb71cfd991 100644
--- a/arch/powerpc/include/asm/reg_fsl_emb.h
+++ b/arch/powerpc/include/asm/reg_fsl_emb.h
@@ -31,7 +31,7 @@
31#define PMLCA_FCM0 0x08000000 /* Freeze when PMM==0 */ 31#define PMLCA_FCM0 0x08000000 /* Freeze when PMM==0 */
32#define PMLCA_CE 0x04000000 /* Condition Enable */ 32#define PMLCA_CE 0x04000000 /* Condition Enable */
33 33
34#define PMLCA_EVENT_MASK 0x007f0000 /* Event field */ 34#define PMLCA_EVENT_MASK 0x00ff0000 /* Event field */
35#define PMLCA_EVENT_SHIFT 16 35#define PMLCA_EVENT_SHIFT 16
36 36
37#define PMRN_PMLCB0 0x110 /* PM Local Control B0 */ 37#define PMRN_PMLCB0 0x110 /* PM Local Control B0 */
diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h
index eb8eb400c664..4084e567d28e 100644
--- a/arch/powerpc/include/asm/syscalls.h
+++ b/arch/powerpc/include/asm/syscalls.h
@@ -7,7 +7,6 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <asm/signal.h> 8#include <asm/signal.h>
9 9
10struct new_utsname;
11struct pt_regs; 10struct pt_regs;
12struct rtas_args; 11struct rtas_args;
13struct sigaction; 12struct sigaction;
@@ -35,12 +34,9 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags);
35asmlinkage long sys_rt_sigaction(int sig, 34asmlinkage long sys_rt_sigaction(int sig,
36 const struct sigaction __user *act, 35 const struct sigaction __user *act,
37 struct sigaction __user *oact, size_t sigsetsize); 36 struct sigaction __user *oact, size_t sigsetsize);
38asmlinkage int sys_ipc(uint call, int first, unsigned long second,
39 long third, void __user *ptr, long fifth);
40asmlinkage long ppc64_personality(unsigned long personality); 37asmlinkage long ppc64_personality(unsigned long personality);
41asmlinkage int ppc_rtas(struct rtas_args __user *uargs); 38asmlinkage int ppc_rtas(struct rtas_args __user *uargs);
42asmlinkage time_t sys64_time(time_t __user * tloc); 39asmlinkage time_t sys64_time(time_t __user * tloc);
43asmlinkage long ppc_newuname(struct new_utsname __user * name);
44 40
45asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, 41asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset,
46 size_t sigsetsize); 42 size_t sigsetsize);
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index 07d2d19ab5e9..a5ee345b6a5c 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -125,7 +125,7 @@ SYSCALL_SPU(fsync)
125SYS32ONLY(sigreturn) 125SYS32ONLY(sigreturn)
126PPC_SYS(clone) 126PPC_SYS(clone)
127COMPAT_SYS_SPU(setdomainname) 127COMPAT_SYS_SPU(setdomainname)
128PPC_SYS_SPU(newuname) 128SYSCALL_SPU(newuname)
129SYSCALL(ni_syscall) 129SYSCALL(ni_syscall)
130COMPAT_SYS_SPU(adjtimex) 130COMPAT_SYS_SPU(adjtimex)
131SYSCALL_SPU(mprotect) 131SYSCALL_SPU(mprotect)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index f6ca76176766..f0a10266e7f7 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -364,6 +364,7 @@
364#define __ARCH_WANT_STAT64 364#define __ARCH_WANT_STAT64
365#define __ARCH_WANT_SYS_ALARM 365#define __ARCH_WANT_SYS_ALARM
366#define __ARCH_WANT_SYS_GETHOSTNAME 366#define __ARCH_WANT_SYS_GETHOSTNAME
367#define __ARCH_WANT_SYS_IPC
367#define __ARCH_WANT_SYS_PAUSE 368#define __ARCH_WANT_SYS_PAUSE
368#define __ARCH_WANT_SYS_SGETMASK 369#define __ARCH_WANT_SYS_SGETMASK
369#define __ARCH_WANT_SYS_SIGNAL 370#define __ARCH_WANT_SYS_SIGNAL
@@ -376,6 +377,7 @@
376#define __ARCH_WANT_SYS_LLSEEK 377#define __ARCH_WANT_SYS_LLSEEK
377#define __ARCH_WANT_SYS_NICE 378#define __ARCH_WANT_SYS_NICE
378#define __ARCH_WANT_SYS_OLD_GETRLIMIT 379#define __ARCH_WANT_SYS_OLD_GETRLIMIT
380#define __ARCH_WANT_SYS_OLD_UNAME
379#define __ARCH_WANT_SYS_OLDUMOUNT 381#define __ARCH_WANT_SYS_OLDUMOUNT
380#define __ARCH_WANT_SYS_SIGPENDING 382#define __ARCH_WANT_SYS_SIGPENDING
381#define __ARCH_WANT_SYS_SIGPROCMASK 383#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index c002b0410219..877326320e74 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -98,11 +98,16 @@ obj64-$(CONFIG_AUDIT) += compat_audit.o
98 98
99obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 99obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
100obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o 100obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
101obj-$(CONFIG_PPC_PERF_CTRS) += perf_event.o perf_callchain.o 101obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
102
103obj-$(CONFIG_PPC_PERF_CTRS) += perf_event.o
102obj64-$(CONFIG_PPC_PERF_CTRS) += power4-pmu.o ppc970-pmu.o power5-pmu.o \ 104obj64-$(CONFIG_PPC_PERF_CTRS) += power4-pmu.o ppc970-pmu.o power5-pmu.o \
103 power5+-pmu.o power6-pmu.o power7-pmu.o 105 power5+-pmu.o power6-pmu.o power7-pmu.o
104obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o 106obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o
105 107
108obj-$(CONFIG_FSL_EMB_PERF_EVENT) += perf_event_fsl_emb.o
109obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o
110
106obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o 111obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
107 112
108ifneq ($(CONFIG_PPC_INDIRECT_IO),y) 113ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 2fc82bac3bbc..8af4949434b2 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -1808,7 +1808,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
1808 .icache_bsize = 64, 1808 .icache_bsize = 64,
1809 .dcache_bsize = 64, 1809 .dcache_bsize = 64,
1810 .num_pmcs = 4, 1810 .num_pmcs = 4,
1811 .oprofile_cpu_type = "ppc/e500", /* xxx - galak, e500mc? */ 1811 .oprofile_cpu_type = "ppc/e500mc",
1812 .oprofile_type = PPC_OPROFILE_FSL_EMB, 1812 .oprofile_type = PPC_OPROFILE_FSL_EMB,
1813 .cpu_setup = __setup_cpu_e500mc, 1813 .cpu_setup = __setup_cpu_e500mc,
1814 .machine_check = machine_check_e500, 1814 .machine_check = machine_check_e500,
diff --git a/arch/powerpc/kernel/e500-pmu.c b/arch/powerpc/kernel/e500-pmu.c
new file mode 100644
index 000000000000..7c07de0d8943
--- /dev/null
+++ b/arch/powerpc/kernel/e500-pmu.c
@@ -0,0 +1,129 @@
1/*
2 * Performance counter support for e500 family processors.
3 *
4 * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
5 * Copyright 2010 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12#include <linux/string.h>
13#include <linux/perf_event.h>
14#include <asm/reg.h>
15#include <asm/cputable.h>
16
17/*
18 * Map of generic hardware event types to hardware events
19 * Zero if unsupported
20 */
21static int e500_generic_events[] = {
22 [PERF_COUNT_HW_CPU_CYCLES] = 1,
23 [PERF_COUNT_HW_INSTRUCTIONS] = 2,
24 [PERF_COUNT_HW_CACHE_MISSES] = 41, /* Data L1 cache reloads */
25 [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 12,
26 [PERF_COUNT_HW_BRANCH_MISSES] = 15,
27};
28
29#define C(x) PERF_COUNT_HW_CACHE_##x
30
31/*
32 * Table of generalized cache-related events.
33 * 0 means not supported, -1 means nonsensical, other values
34 * are event codes.
35 */
36static int e500_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
37 /*
38 * D-cache misses are not split into read/write/prefetch;
39 * use raw event 41.
40 */
41 [C(L1D)] = { /* RESULT_ACCESS RESULT_MISS */
42 [C(OP_READ)] = { 27, 0 },
43 [C(OP_WRITE)] = { 28, 0 },
44 [C(OP_PREFETCH)] = { 29, 0 },
45 },
46 [C(L1I)] = { /* RESULT_ACCESS RESULT_MISS */
47 [C(OP_READ)] = { 2, 60 },
48 [C(OP_WRITE)] = { -1, -1 },
49 [C(OP_PREFETCH)] = { 0, 0 },
50 },
51 /*
52 * Assuming LL means L2, it's not a good match for this model.
53 * It allocates only on L1 castout or explicit prefetch, and
54 * does not have separate read/write events (but it does have
55 * separate instruction/data events).
56 */
57 [C(LL)] = { /* RESULT_ACCESS RESULT_MISS */
58 [C(OP_READ)] = { 0, 0 },
59 [C(OP_WRITE)] = { 0, 0 },
60 [C(OP_PREFETCH)] = { 0, 0 },
61 },
62 /*
63 * There are data/instruction MMU misses, but that's a miss on
64 * the chip's internal level-one TLB which is probably not
65 * what the user wants. Instead, unified level-two TLB misses
66 * are reported here.
67 */
68 [C(DTLB)] = { /* RESULT_ACCESS RESULT_MISS */
69 [C(OP_READ)] = { 26, 66 },
70 [C(OP_WRITE)] = { -1, -1 },
71 [C(OP_PREFETCH)] = { -1, -1 },
72 },
73 [C(BPU)] = { /* RESULT_ACCESS RESULT_MISS */
74 [C(OP_READ)] = { 12, 15 },
75 [C(OP_WRITE)] = { -1, -1 },
76 [C(OP_PREFETCH)] = { -1, -1 },
77 },
78};
79
80static int num_events = 128;
81
82/* Upper half of event id is PMLCb, for threshold events */
83static u64 e500_xlate_event(u64 event_id)
84{
85 u32 event_low = (u32)event_id;
86 u64 ret;
87
88 if (event_low >= num_events)
89 return 0;
90
91 ret = FSL_EMB_EVENT_VALID;
92
93 if (event_low >= 76 && event_low <= 81) {
94 ret |= FSL_EMB_EVENT_RESTRICTED;
95 ret |= event_id &
96 (FSL_EMB_EVENT_THRESHMUL | FSL_EMB_EVENT_THRESH);
97 } else if (event_id &
98 (FSL_EMB_EVENT_THRESHMUL | FSL_EMB_EVENT_THRESH)) {
99 /* Threshold requested on non-threshold event */
100 return 0;
101 }
102
103 return ret;
104}
105
106static struct fsl_emb_pmu e500_pmu = {
107 .name = "e500 family",
108 .n_counter = 4,
109 .n_restricted = 2,
110 .xlate_event = e500_xlate_event,
111 .n_generic = ARRAY_SIZE(e500_generic_events),
112 .generic_events = e500_generic_events,
113 .cache_events = &e500_cache_events,
114};
115
116static int init_e500_pmu(void)
117{
118 if (!cur_cpu_spec->oprofile_cpu_type)
119 return -ENODEV;
120
121 if (!strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/e500mc"))
122 num_events = 256;
123 else if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/e500"))
124 return -ENODEV;
125
126 return register_fsl_emb_pmu(&e500_pmu);
127}
128
129arch_initcall(init_e500_pmu);
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 925807488022..bed9a29ee383 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -219,7 +219,8 @@ generic_secondary_common_init:
219 * physical cpu id in r24, we need to search the pacas to find 219 * physical cpu id in r24, we need to search the pacas to find
220 * which logical id maps to our physical one. 220 * which logical id maps to our physical one.
221 */ 221 */
222 LOAD_REG_ADDR(r13, paca) /* Get base vaddr of paca array */ 222 LOAD_REG_ADDR(r13, paca) /* Load paca pointer */
223 ld r13,0(r13) /* Get base vaddr of paca array */
223 li r5,0 /* logical cpu id */ 224 li r5,0 /* logical cpu id */
2241: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */ 2251: lhz r6,PACAHWCPUID(r13) /* Load HW procid from paca */
225 cmpw r6,r24 /* Compare to our id */ 226 cmpw r6,r24 /* Compare to our id */
@@ -536,7 +537,8 @@ _GLOBAL(pmac_secondary_start)
536 mtmsrd r3 /* RI on */ 537 mtmsrd r3 /* RI on */
537 538
538 /* Set up a paca value for this processor. */ 539 /* Set up a paca value for this processor. */
539 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */ 540 LOAD_REG_ADDR(r4,paca) /* Load paca pointer */
541 ld r4,0(r4) /* Get base vaddr of paca array */
540 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ 542 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
541 add r13,r13,r4 /* for this processor. */ 543 add r13,r13,r4 /* for this processor. */
542 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/ 544 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/
@@ -615,6 +617,17 @@ _GLOBAL(start_secondary_prolog)
615 std r3,0(r1) /* Zero the stack frame pointer */ 617 std r3,0(r1) /* Zero the stack frame pointer */
616 bl .start_secondary 618 bl .start_secondary
617 b . 619 b .
620/*
621 * Reset stack pointer and call start_secondary
622 * to continue with online operation when woken up
623 * from cede in cpu offline.
624 */
625_GLOBAL(start_secondary_resume)
626 ld r1,PACAKSAVE(r13) /* Reload kernel stack pointer */
627 li r3,0
628 std r3,0(r1) /* Zero the stack frame pointer */
629 bl .start_secondary
630 b .
618#endif 631#endif
619 632
620/* 633/*
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 9ddfaef1a184..035ada5443ee 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -469,7 +469,7 @@ static int __init serial_dev_init(void)
469 return -ENODEV; 469 return -ENODEV;
470 470
471 /* 471 /*
472 * Before we register the platfrom serial devices, we need 472 * Before we register the platform serial devices, we need
473 * to fixup their interrupts and their IO ports. 473 * to fixup their interrupts and their IO ports.
474 */ 474 */
475 DBG("Fixing serial ports interrupts and IO ports ...\n"); 475 DBG("Fixing serial ports interrupts and IO ports ...\n");
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index d16b1ea55d44..0c40c6f476fe 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -9,11 +9,15 @@
9 9
10#include <linux/threads.h> 10#include <linux/threads.h>
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/lmb.h>
12 13
14#include <asm/firmware.h>
13#include <asm/lppaca.h> 15#include <asm/lppaca.h>
14#include <asm/paca.h> 16#include <asm/paca.h>
15#include <asm/sections.h> 17#include <asm/sections.h>
16#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/iseries/lpar_map.h>
20#include <asm/iseries/hv_types.h>
17 21
18/* This symbol is provided by the linker - let it fill in the paca 22/* This symbol is provided by the linker - let it fill in the paca
19 * field correctly */ 23 * field correctly */
@@ -70,37 +74,82 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
70 * processors. The processor VPD array needs one entry per physical 74 * processors. The processor VPD array needs one entry per physical
71 * processor (not thread). 75 * processor (not thread).
72 */ 76 */
73struct paca_struct paca[NR_CPUS]; 77struct paca_struct *paca;
74EXPORT_SYMBOL(paca); 78EXPORT_SYMBOL(paca);
75 79
76void __init initialise_pacas(void) 80struct paca_struct boot_paca;
77{
78 int cpu;
79 81
80 /* The TOC register (GPR2) points 32kB into the TOC, so that 64kB 82void __init initialise_paca(struct paca_struct *new_paca, int cpu)
81 * of the TOC can be addressed using a single machine instruction. 83{
82 */ 84 /* The TOC register (GPR2) points 32kB into the TOC, so that 64kB
85 * of the TOC can be addressed using a single machine instruction.
86 */
83 unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL; 87 unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL;
84 88
85 /* Can't use for_each_*_cpu, as they aren't functional yet */
86 for (cpu = 0; cpu < NR_CPUS; cpu++) {
87 struct paca_struct *new_paca = &paca[cpu];
88
89#ifdef CONFIG_PPC_BOOK3S 89#ifdef CONFIG_PPC_BOOK3S
90 new_paca->lppaca_ptr = &lppaca[cpu]; 90 new_paca->lppaca_ptr = &lppaca[cpu];
91#else 91#else
92 new_paca->kernel_pgd = swapper_pg_dir; 92 new_paca->kernel_pgd = swapper_pg_dir;
93#endif 93#endif
94 new_paca->lock_token = 0x8000; 94 new_paca->lock_token = 0x8000;
95 new_paca->paca_index = cpu; 95 new_paca->paca_index = cpu;
96 new_paca->kernel_toc = kernel_toc; 96 new_paca->kernel_toc = kernel_toc;
97 new_paca->kernelbase = (unsigned long) _stext; 97 new_paca->kernelbase = (unsigned long) _stext;
98 new_paca->kernel_msr = MSR_KERNEL; 98 new_paca->kernel_msr = MSR_KERNEL;
99 new_paca->hw_cpu_id = 0xffff; 99 new_paca->hw_cpu_id = 0xffff;
100 new_paca->__current = &init_task; 100 new_paca->__current = &init_task;
101#ifdef CONFIG_PPC_STD_MMU_64 101#ifdef CONFIG_PPC_STD_MMU_64
102 new_paca->slb_shadow_ptr = &slb_shadow[cpu]; 102 new_paca->slb_shadow_ptr = &slb_shadow[cpu];
103#endif /* CONFIG_PPC_STD_MMU_64 */ 103#endif /* CONFIG_PPC_STD_MMU_64 */
104}
105
106static int __initdata paca_size;
107
108void __init allocate_pacas(void)
109{
110 int nr_cpus, cpu, limit;
111
112 /*
113 * We can't take SLB misses on the paca, and we want to access them
114 * in real mode, so allocate them within the RMA and also within
115 * the first segment. On iSeries they must be within the area mapped
116 * by the HV, which is HvPagesToMap * HVPAGESIZE bytes.
117 */
118 limit = min(0x10000000ULL, lmb.rmo_size);
119 if (firmware_has_feature(FW_FEATURE_ISERIES))
120 limit = min(limit, HvPagesToMap * HVPAGESIZE);
121
122 nr_cpus = NR_CPUS;
123 /* On iSeries we know we can never have more than 64 cpus */
124 if (firmware_has_feature(FW_FEATURE_ISERIES))
125 nr_cpus = min(64, nr_cpus);
126
127 paca_size = PAGE_ALIGN(sizeof(struct paca_struct) * nr_cpus);
128
129 paca = __va(lmb_alloc_base(paca_size, PAGE_SIZE, limit));
130 memset(paca, 0, paca_size);
131
132 printk(KERN_DEBUG "Allocated %u bytes for %d pacas at %p\n",
133 paca_size, nr_cpus, paca);
134
135 /* Can't use for_each_*_cpu, as they aren't functional yet */
136 for (cpu = 0; cpu < nr_cpus; cpu++)
137 initialise_paca(&paca[cpu], cpu);
138}
139
140void __init free_unused_pacas(void)
141{
142 int new_size;
143
144 new_size = PAGE_ALIGN(sizeof(struct paca_struct) * num_possible_cpus());
145
146 if (new_size >= paca_size)
147 return;
148
149 lmb_free(__pa(paca) + new_size, paca_size - new_size);
150
151 printk(KERN_DEBUG "Freed %u bytes for unused pacas\n",
152 paca_size - new_size);
104 153
105 } 154 paca_size = new_size;
106} 155}
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 2597f9545d8a..f3c42ce516e7 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -63,21 +63,6 @@ struct dma_map_ops *get_pci_dma_ops(void)
63} 63}
64EXPORT_SYMBOL(get_pci_dma_ops); 64EXPORT_SYMBOL(get_pci_dma_ops);
65 65
66int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
67{
68 return dma_set_mask(&dev->dev, mask);
69}
70
71int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
72{
73 int rc;
74
75 rc = dma_set_mask(&dev->dev, mask);
76 dev->dev.coherent_dma_mask = dev->dma_mask;
77
78 return rc;
79}
80
81struct pci_controller *pcibios_alloc_controller(struct device_node *dev) 66struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
82{ 67{
83 struct pci_controller *phb; 68 struct pci_controller *phb;
diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c
new file mode 100644
index 000000000000..369872f6cf78
--- /dev/null
+++ b/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -0,0 +1,654 @@
1/*
2 * Performance event support - Freescale Embedded Performance Monitor
3 *
4 * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
5 * Copyright 2010 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/perf_event.h>
15#include <linux/percpu.h>
16#include <linux/hardirq.h>
17#include <asm/reg_fsl_emb.h>
18#include <asm/pmc.h>
19#include <asm/machdep.h>
20#include <asm/firmware.h>
21#include <asm/ptrace.h>
22
23struct cpu_hw_events {
24 int n_events;
25 int disabled;
26 u8 pmcs_enabled;
27 struct perf_event *event[MAX_HWEVENTS];
28};
29static DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events);
30
31static struct fsl_emb_pmu *ppmu;
32
33/* Number of perf_events counting hardware events */
34static atomic_t num_events;
35/* Used to avoid races in calling reserve/release_pmc_hardware */
36static DEFINE_MUTEX(pmc_reserve_mutex);
37
38/*
39 * If interrupts were soft-disabled when a PMU interrupt occurs, treat
40 * it as an NMI.
41 */
42static inline int perf_intr_is_nmi(struct pt_regs *regs)
43{
44#ifdef __powerpc64__
45 return !regs->softe;
46#else
47 return 0;
48#endif
49}
50
51static void perf_event_interrupt(struct pt_regs *regs);
52
53/*
54 * Read one performance monitor counter (PMC).
55 */
56static unsigned long read_pmc(int idx)
57{
58 unsigned long val;
59
60 switch (idx) {
61 case 0:
62 val = mfpmr(PMRN_PMC0);
63 break;
64 case 1:
65 val = mfpmr(PMRN_PMC1);
66 break;
67 case 2:
68 val = mfpmr(PMRN_PMC2);
69 break;
70 case 3:
71 val = mfpmr(PMRN_PMC3);
72 break;
73 default:
74 printk(KERN_ERR "oops trying to read PMC%d\n", idx);
75 val = 0;
76 }
77 return val;
78}
79
80/*
81 * Write one PMC.
82 */
83static void write_pmc(int idx, unsigned long val)
84{
85 switch (idx) {
86 case 0:
87 mtpmr(PMRN_PMC0, val);
88 break;
89 case 1:
90 mtpmr(PMRN_PMC1, val);
91 break;
92 case 2:
93 mtpmr(PMRN_PMC2, val);
94 break;
95 case 3:
96 mtpmr(PMRN_PMC3, val);
97 break;
98 default:
99 printk(KERN_ERR "oops trying to write PMC%d\n", idx);
100 }
101
102 isync();
103}
104
105/*
106 * Write one local control A register
107 */
108static void write_pmlca(int idx, unsigned long val)
109{
110 switch (idx) {
111 case 0:
112 mtpmr(PMRN_PMLCA0, val);
113 break;
114 case 1:
115 mtpmr(PMRN_PMLCA1, val);
116 break;
117 case 2:
118 mtpmr(PMRN_PMLCA2, val);
119 break;
120 case 3:
121 mtpmr(PMRN_PMLCA3, val);
122 break;
123 default:
124 printk(KERN_ERR "oops trying to write PMLCA%d\n", idx);
125 }
126
127 isync();
128}
129
130/*
131 * Write one local control B register
132 */
133static void write_pmlcb(int idx, unsigned long val)
134{
135 switch (idx) {
136 case 0:
137 mtpmr(PMRN_PMLCB0, val);
138 break;
139 case 1:
140 mtpmr(PMRN_PMLCB1, val);
141 break;
142 case 2:
143 mtpmr(PMRN_PMLCB2, val);
144 break;
145 case 3:
146 mtpmr(PMRN_PMLCB3, val);
147 break;
148 default:
149 printk(KERN_ERR "oops trying to write PMLCB%d\n", idx);
150 }
151
152 isync();
153}
154
155static void fsl_emb_pmu_read(struct perf_event *event)
156{
157 s64 val, delta, prev;
158
159 /*
160 * Performance monitor interrupts come even when interrupts
161 * are soft-disabled, as long as interrupts are hard-enabled.
162 * Therefore we treat them like NMIs.
163 */
164 do {
165 prev = atomic64_read(&event->hw.prev_count);
166 barrier();
167 val = read_pmc(event->hw.idx);
168 } while (atomic64_cmpxchg(&event->hw.prev_count, prev, val) != prev);
169
170 /* The counters are only 32 bits wide */
171 delta = (val - prev) & 0xfffffffful;
172 atomic64_add(delta, &event->count);
173 atomic64_sub(delta, &event->hw.period_left);
174}
175
176/*
177 * Disable all events to prevent PMU interrupts and to allow
178 * events to be added or removed.
179 */
180void hw_perf_disable(void)
181{
182 struct cpu_hw_events *cpuhw;
183 unsigned long flags;
184
185 local_irq_save(flags);
186 cpuhw = &__get_cpu_var(cpu_hw_events);
187
188 if (!cpuhw->disabled) {
189 cpuhw->disabled = 1;
190
191 /*
192 * Check if we ever enabled the PMU on this cpu.
193 */
194 if (!cpuhw->pmcs_enabled) {
195 ppc_enable_pmcs();
196 cpuhw->pmcs_enabled = 1;
197 }
198
199 if (atomic_read(&num_events)) {
200 /*
201 * Set the 'freeze all counters' bit, and disable
202 * interrupts. The barrier is to make sure the
203 * mtpmr has been executed and the PMU has frozen
204 * the events before we return.
205 */
206
207 mtpmr(PMRN_PMGC0, PMGC0_FAC);
208 isync();
209 }
210 }
211 local_irq_restore(flags);
212}
213
214/*
215 * Re-enable all events if disable == 0.
216 * If we were previously disabled and events were added, then
217 * put the new config on the PMU.
218 */
219void hw_perf_enable(void)
220{
221 struct cpu_hw_events *cpuhw;
222 unsigned long flags;
223
224 local_irq_save(flags);
225 cpuhw = &__get_cpu_var(cpu_hw_events);
226 if (!cpuhw->disabled)
227 goto out;
228
229 cpuhw->disabled = 0;
230 ppc_set_pmu_inuse(cpuhw->n_events != 0);
231
232 if (cpuhw->n_events > 0) {
233 mtpmr(PMRN_PMGC0, PMGC0_PMIE | PMGC0_FCECE);
234 isync();
235 }
236
237 out:
238 local_irq_restore(flags);
239}
240
241static int collect_events(struct perf_event *group, int max_count,
242 struct perf_event *ctrs[])
243{
244 int n = 0;
245 struct perf_event *event;
246
247 if (!is_software_event(group)) {
248 if (n >= max_count)
249 return -1;
250 ctrs[n] = group;
251 n++;
252 }
253 list_for_each_entry(event, &group->sibling_list, group_entry) {
254 if (!is_software_event(event) &&
255 event->state != PERF_EVENT_STATE_OFF) {
256 if (n >= max_count)
257 return -1;
258 ctrs[n] = event;
259 n++;
260 }
261 }
262 return n;
263}
264
265/* perf must be disabled, context locked on entry */
266static int fsl_emb_pmu_enable(struct perf_event *event)
267{
268 struct cpu_hw_events *cpuhw;
269 int ret = -EAGAIN;
270 int num_counters = ppmu->n_counter;
271 u64 val;
272 int i;
273
274 cpuhw = &get_cpu_var(cpu_hw_events);
275
276 if (event->hw.config & FSL_EMB_EVENT_RESTRICTED)
277 num_counters = ppmu->n_restricted;
278
279 /*
280 * Allocate counters from top-down, so that restricted-capable
281 * counters are kept free as long as possible.
282 */
283 for (i = num_counters - 1; i >= 0; i--) {
284 if (cpuhw->event[i])
285 continue;
286
287 break;
288 }
289
290 if (i < 0)
291 goto out;
292
293 event->hw.idx = i;
294 cpuhw->event[i] = event;
295 ++cpuhw->n_events;
296
297 val = 0;
298 if (event->hw.sample_period) {
299 s64 left = atomic64_read(&event->hw.period_left);
300 if (left < 0x80000000L)
301 val = 0x80000000L - left;
302 }
303 atomic64_set(&event->hw.prev_count, val);
304 write_pmc(i, val);
305 perf_event_update_userpage(event);
306
307 write_pmlcb(i, event->hw.config >> 32);
308 write_pmlca(i, event->hw.config_base);
309
310 ret = 0;
311 out:
312 put_cpu_var(cpu_hw_events);
313 return ret;
314}
315
316/* perf must be disabled, context locked on entry */
317static void fsl_emb_pmu_disable(struct perf_event *event)
318{
319 struct cpu_hw_events *cpuhw;
320 int i = event->hw.idx;
321
322 if (i < 0)
323 goto out;
324
325 fsl_emb_pmu_read(event);
326
327 cpuhw = &get_cpu_var(cpu_hw_events);
328
329 WARN_ON(event != cpuhw->event[event->hw.idx]);
330
331 write_pmlca(i, 0);
332 write_pmlcb(i, 0);
333 write_pmc(i, 0);
334
335 cpuhw->event[i] = NULL;
336 event->hw.idx = -1;
337
338 /*
339 * TODO: if at least one restricted event exists, and we
340 * just freed up a non-restricted-capable counter, and
341 * there is a restricted-capable counter occupied by
342 * a non-restricted event, migrate that event to the
343 * vacated counter.
344 */
345
346 cpuhw->n_events--;
347
348 out:
349 put_cpu_var(cpu_hw_events);
350}
351
352/*
353 * Re-enable interrupts on a event after they were throttled
354 * because they were coming too fast.
355 *
356 * Context is locked on entry, but perf is not disabled.
357 */
358static void fsl_emb_pmu_unthrottle(struct perf_event *event)
359{
360 s64 val, left;
361 unsigned long flags;
362
363 if (event->hw.idx < 0 || !event->hw.sample_period)
364 return;
365 local_irq_save(flags);
366 perf_disable();
367 fsl_emb_pmu_read(event);
368 left = event->hw.sample_period;
369 event->hw.last_period = left;
370 val = 0;
371 if (left < 0x80000000L)
372 val = 0x80000000L - left;
373 write_pmc(event->hw.idx, val);
374 atomic64_set(&event->hw.prev_count, val);
375 atomic64_set(&event->hw.period_left, left);
376 perf_event_update_userpage(event);
377 perf_enable();
378 local_irq_restore(flags);
379}
380
381static struct pmu fsl_emb_pmu = {
382 .enable = fsl_emb_pmu_enable,
383 .disable = fsl_emb_pmu_disable,
384 .read = fsl_emb_pmu_read,
385 .unthrottle = fsl_emb_pmu_unthrottle,
386};
387
388/*
389 * Release the PMU if this is the last perf_event.
390 */
391static void hw_perf_event_destroy(struct perf_event *event)
392{
393 if (!atomic_add_unless(&num_events, -1, 1)) {
394 mutex_lock(&pmc_reserve_mutex);
395 if (atomic_dec_return(&num_events) == 0)
396 release_pmc_hardware();
397 mutex_unlock(&pmc_reserve_mutex);
398 }
399}
400
401/*
402 * Translate a generic cache event_id config to a raw event_id code.
403 */
404static int hw_perf_cache_event(u64 config, u64 *eventp)
405{
406 unsigned long type, op, result;
407 int ev;
408
409 if (!ppmu->cache_events)
410 return -EINVAL;
411
412 /* unpack config */
413 type = config & 0xff;
414 op = (config >> 8) & 0xff;
415 result = (config >> 16) & 0xff;
416
417 if (type >= PERF_COUNT_HW_CACHE_MAX ||
418 op >= PERF_COUNT_HW_CACHE_OP_MAX ||
419 result >= PERF_COUNT_HW_CACHE_RESULT_MAX)
420 return -EINVAL;
421
422 ev = (*ppmu->cache_events)[type][op][result];
423 if (ev == 0)
424 return -EOPNOTSUPP;
425 if (ev == -1)
426 return -EINVAL;
427 *eventp = ev;
428 return 0;
429}
430
431const struct pmu *hw_perf_event_init(struct perf_event *event)
432{
433 u64 ev;
434 struct perf_event *events[MAX_HWEVENTS];
435 int n;
436 int err;
437 int num_restricted;
438 int i;
439
440 switch (event->attr.type) {
441 case PERF_TYPE_HARDWARE:
442 ev = event->attr.config;
443 if (ev >= ppmu->n_generic || ppmu->generic_events[ev] == 0)
444 return ERR_PTR(-EOPNOTSUPP);
445 ev = ppmu->generic_events[ev];
446 break;
447
448 case PERF_TYPE_HW_CACHE:
449 err = hw_perf_cache_event(event->attr.config, &ev);
450 if (err)
451 return ERR_PTR(err);
452 break;
453
454 case PERF_TYPE_RAW:
455 ev = event->attr.config;
456 break;
457
458 default:
459 return ERR_PTR(-EINVAL);
460 }
461
462 event->hw.config = ppmu->xlate_event(ev);
463 if (!(event->hw.config & FSL_EMB_EVENT_VALID))
464 return ERR_PTR(-EINVAL);
465
466 /*
467 * If this is in a group, check if it can go on with all the
468 * other hardware events in the group. We assume the event
469 * hasn't been linked into its leader's sibling list at this point.
470 */
471 n = 0;
472 if (event->group_leader != event) {
473 n = collect_events(event->group_leader,
474 ppmu->n_counter - 1, events);
475 if (n < 0)
476 return ERR_PTR(-EINVAL);
477 }
478
479 if (event->hw.config & FSL_EMB_EVENT_RESTRICTED) {
480 num_restricted = 0;
481 for (i = 0; i < n; i++) {
482 if (events[i]->hw.config & FSL_EMB_EVENT_RESTRICTED)
483 num_restricted++;
484 }
485
486 if (num_restricted >= ppmu->n_restricted)
487 return ERR_PTR(-EINVAL);
488 }
489
490 event->hw.idx = -1;
491
492 event->hw.config_base = PMLCA_CE | PMLCA_FCM1 |
493 (u32)((ev << 16) & PMLCA_EVENT_MASK);
494
495 if (event->attr.exclude_user)
496 event->hw.config_base |= PMLCA_FCU;
497 if (event->attr.exclude_kernel)
498 event->hw.config_base |= PMLCA_FCS;
499 if (event->attr.exclude_idle)
500 return ERR_PTR(-ENOTSUPP);
501
502 event->hw.last_period = event->hw.sample_period;
503 atomic64_set(&event->hw.period_left, event->hw.last_period);
504
505 /*
506 * See if we need to reserve the PMU.
507 * If no events are currently in use, then we have to take a
508 * mutex to ensure that we don't race with another task doing
509 * reserve_pmc_hardware or release_pmc_hardware.
510 */
511 err = 0;
512 if (!atomic_inc_not_zero(&num_events)) {
513 mutex_lock(&pmc_reserve_mutex);
514 if (atomic_read(&num_events) == 0 &&
515 reserve_pmc_hardware(perf_event_interrupt))
516 err = -EBUSY;
517 else
518 atomic_inc(&num_events);
519 mutex_unlock(&pmc_reserve_mutex);
520
521 mtpmr(PMRN_PMGC0, PMGC0_FAC);
522 isync();
523 }
524 event->destroy = hw_perf_event_destroy;
525
526 if (err)
527 return ERR_PTR(err);
528 return &fsl_emb_pmu;
529}
530
531/*
532 * A counter has overflowed; update its count and record
533 * things if requested. Note that interrupts are hard-disabled
534 * here so there is no possibility of being interrupted.
535 */
536static void record_and_restart(struct perf_event *event, unsigned long val,
537 struct pt_regs *regs, int nmi)
538{
539 u64 period = event->hw.sample_period;
540 s64 prev, delta, left;
541 int record = 0;
542
543 /* we don't have to worry about interrupts here */
544 prev = atomic64_read(&event->hw.prev_count);
545 delta = (val - prev) & 0xfffffffful;
546 atomic64_add(delta, &event->count);
547
548 /*
549 * See if the total period for this event has expired,
550 * and update for the next period.
551 */
552 val = 0;
553 left = atomic64_read(&event->hw.period_left) - delta;
554 if (period) {
555 if (left <= 0) {
556 left += period;
557 if (left <= 0)
558 left = period;
559 record = 1;
560 }
561 if (left < 0x80000000LL)
562 val = 0x80000000LL - left;
563 }
564
565 /*
566 * Finally record data if requested.
567 */
568 if (record) {
569 struct perf_sample_data data = {
570 .period = event->hw.last_period,
571 };
572
573 if (perf_event_overflow(event, nmi, &data, regs)) {
574 /*
575 * Interrupts are coming too fast - throttle them
576 * by setting the event to 0, so it will be
577 * at least 2^30 cycles until the next interrupt
578 * (assuming each event counts at most 2 counts
579 * per cycle).
580 */
581 val = 0;
582 left = ~0ULL >> 1;
583 }
584 }
585
586 write_pmc(event->hw.idx, val);
587 atomic64_set(&event->hw.prev_count, val);
588 atomic64_set(&event->hw.period_left, left);
589 perf_event_update_userpage(event);
590}
591
592static void perf_event_interrupt(struct pt_regs *regs)
593{
594 int i;
595 struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events);
596 struct perf_event *event;
597 unsigned long val;
598 int found = 0;
599 int nmi;
600
601 nmi = perf_intr_is_nmi(regs);
602 if (nmi)
603 nmi_enter();
604 else
605 irq_enter();
606
607 for (i = 0; i < ppmu->n_counter; ++i) {
608 event = cpuhw->event[i];
609
610 val = read_pmc(i);
611 if ((int)val < 0) {
612 if (event) {
613 /* event has overflowed */
614 found = 1;
615 record_and_restart(event, val, regs, nmi);
616 } else {
617 /*
618 * Disabled counter is negative,
619 * reset it just in case.
620 */
621 write_pmc(i, 0);
622 }
623 }
624 }
625
626 /* PMM will keep counters frozen until we return from the interrupt. */
627 mtmsr(mfmsr() | MSR_PMM);
628 mtpmr(PMRN_PMGC0, PMGC0_PMIE | PMGC0_FCECE);
629 isync();
630
631 if (nmi)
632 nmi_exit();
633 else
634 irq_exit();
635}
636
637void hw_perf_event_setup(int cpu)
638{
639 struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
640
641 memset(cpuhw, 0, sizeof(*cpuhw));
642}
643
644int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
645{
646 if (ppmu)
647 return -EBUSY; /* something's already registered */
648
649 ppmu = pmu;
650 pr_info("%s performance monitor hardware support registered\n",
651 pmu->name);
652
653 return 0;
654}
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 43238b2054b6..05131d634e73 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -43,6 +43,7 @@
43#include <asm/smp.h> 43#include <asm/smp.h>
44#include <asm/system.h> 44#include <asm/system.h>
45#include <asm/mmu.h> 45#include <asm/mmu.h>
46#include <asm/paca.h>
46#include <asm/pgtable.h> 47#include <asm/pgtable.h>
47#include <asm/pci.h> 48#include <asm/pci.h>
48#include <asm/iommu.h> 49#include <asm/iommu.h>
@@ -721,6 +722,8 @@ void __init early_init_devtree(void *params)
721 * FIXME .. and the initrd too? */ 722 * FIXME .. and the initrd too? */
722 move_device_tree(); 723 move_device_tree();
723 724
725 allocate_pacas();
726
724 DBG("Scanning CPUs ...\n"); 727 DBG("Scanning CPUs ...\n");
725 728
726 /* Retreive CPU related informations from the flat tree 729 /* Retreive CPU related informations from the flat tree
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index d9b05866615f..ed2cfe17d25e 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -940,7 +940,7 @@ static int del_instruction_bp(struct task_struct *child, int slot)
940{ 940{
941 switch (slot) { 941 switch (slot) {
942 case 1: 942 case 1:
943 if (child->thread.iac1 == 0) 943 if ((child->thread.dbcr0 & DBCR0_IAC1) == 0)
944 return -ENOENT; 944 return -ENOENT;
945 945
946 if (dbcr_iac_range(child) & DBCR_IAC12MODE) { 946 if (dbcr_iac_range(child) & DBCR_IAC12MODE) {
@@ -952,7 +952,7 @@ static int del_instruction_bp(struct task_struct *child, int slot)
952 child->thread.dbcr0 &= ~DBCR0_IAC1; 952 child->thread.dbcr0 &= ~DBCR0_IAC1;
953 break; 953 break;
954 case 2: 954 case 2:
955 if (child->thread.iac2 == 0) 955 if ((child->thread.dbcr0 & DBCR0_IAC2) == 0)
956 return -ENOENT; 956 return -ENOENT;
957 957
958 if (dbcr_iac_range(child) & DBCR_IAC12MODE) 958 if (dbcr_iac_range(child) & DBCR_IAC12MODE)
@@ -963,7 +963,7 @@ static int del_instruction_bp(struct task_struct *child, int slot)
963 break; 963 break;
964#if CONFIG_PPC_ADV_DEBUG_IACS > 2 964#if CONFIG_PPC_ADV_DEBUG_IACS > 2
965 case 3: 965 case 3:
966 if (child->thread.iac3 == 0) 966 if ((child->thread.dbcr0 & DBCR0_IAC3) == 0)
967 return -ENOENT; 967 return -ENOENT;
968 968
969 if (dbcr_iac_range(child) & DBCR_IAC34MODE) { 969 if (dbcr_iac_range(child) & DBCR_IAC34MODE) {
@@ -975,7 +975,7 @@ static int del_instruction_bp(struct task_struct *child, int slot)
975 child->thread.dbcr0 &= ~DBCR0_IAC3; 975 child->thread.dbcr0 &= ~DBCR0_IAC3;
976 break; 976 break;
977 case 4: 977 case 4:
978 if (child->thread.iac4 == 0) 978 if ((child->thread.dbcr0 & DBCR0_IAC4) == 0)
979 return -ENOENT; 979 return -ENOENT;
980 980
981 if (dbcr_iac_range(child) & DBCR_IAC34MODE) 981 if (dbcr_iac_range(child) & DBCR_IAC34MODE)
@@ -1054,7 +1054,7 @@ static int set_dac(struct task_struct *child, struct ppc_hw_breakpoint *bp_info)
1054static int del_dac(struct task_struct *child, int slot) 1054static int del_dac(struct task_struct *child, int slot)
1055{ 1055{
1056 if (slot == 1) { 1056 if (slot == 1) {
1057 if (child->thread.dac1 == 0) 1057 if ((dbcr_dac(child) & (DBCR_DAC1R | DBCR_DAC1W)) == 0)
1058 return -ENOENT; 1058 return -ENOENT;
1059 1059
1060 child->thread.dac1 = 0; 1060 child->thread.dac1 = 0;
@@ -1070,7 +1070,7 @@ static int del_dac(struct task_struct *child, int slot)
1070 child->thread.dvc1 = 0; 1070 child->thread.dvc1 = 0;
1071#endif 1071#endif
1072 } else if (slot == 2) { 1072 } else if (slot == 2) {
1073 if (child->thread.dac1 == 0) 1073 if ((dbcr_dac(child) & (DBCR_DAC2R | DBCR_DAC2W)) == 0)
1074 return -ENOENT; 1074 return -ENOENT;
1075 1075
1076#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE 1076#ifdef CONFIG_PPC_ADV_DEBUG_DAC_RANGE
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 03dd6a248198..48f0a008b20b 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -36,6 +36,7 @@
36#include <linux/lmb.h> 36#include <linux/lmb.h>
37#include <linux/of_platform.h> 37#include <linux/of_platform.h>
38#include <asm/io.h> 38#include <asm/io.h>
39#include <asm/paca.h>
39#include <asm/prom.h> 40#include <asm/prom.h>
40#include <asm/processor.h> 41#include <asm/processor.h>
41#include <asm/vdso_datapage.h> 42#include <asm/vdso_datapage.h>
@@ -493,6 +494,8 @@ void __init smp_setup_cpu_maps(void)
493 * here will have to be reworked 494 * here will have to be reworked
494 */ 495 */
495 cpu_init_thread_core_maps(nthreads); 496 cpu_init_thread_core_maps(nthreads);
497
498 free_unused_pacas();
496} 499}
497#endif /* CONFIG_SMP */ 500#endif /* CONFIG_SMP */
498 501
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6568406b2a30..63547394048c 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -144,9 +144,9 @@ early_param("smt-enabled", early_smt_enabled);
144#endif /* CONFIG_SMP */ 144#endif /* CONFIG_SMP */
145 145
146/* Put the paca pointer into r13 and SPRG_PACA */ 146/* Put the paca pointer into r13 and SPRG_PACA */
147void __init setup_paca(int cpu) 147static void __init setup_paca(struct paca_struct *new_paca)
148{ 148{
149 local_paca = &paca[cpu]; 149 local_paca = new_paca;
150 mtspr(SPRN_SPRG_PACA, local_paca); 150 mtspr(SPRN_SPRG_PACA, local_paca);
151#ifdef CONFIG_PPC_BOOK3E 151#ifdef CONFIG_PPC_BOOK3E
152 mtspr(SPRN_SPRG_TLB_EXFRAME, local_paca->extlb); 152 mtspr(SPRN_SPRG_TLB_EXFRAME, local_paca->extlb);
@@ -176,14 +176,12 @@ void __init early_setup(unsigned long dt_ptr)
176{ 176{
177 /* -------- printk is _NOT_ safe to use here ! ------- */ 177 /* -------- printk is _NOT_ safe to use here ! ------- */
178 178
179 /* Fill in any unititialised pacas */
180 initialise_pacas();
181
182 /* Identify CPU type */ 179 /* Identify CPU type */
183 identify_cpu(0, mfspr(SPRN_PVR)); 180 identify_cpu(0, mfspr(SPRN_PVR));
184 181
185 /* Assume we're on cpu 0 for now. Don't write to the paca yet! */ 182 /* Assume we're on cpu 0 for now. Don't write to the paca yet! */
186 setup_paca(0); 183 initialise_paca(&boot_paca, 0);
184 setup_paca(&boot_paca);
187 185
188 /* Initialize lockdep early or else spinlocks will blow */ 186 /* Initialize lockdep early or else spinlocks will blow */
189 lockdep_init(); 187 lockdep_init();
@@ -203,7 +201,7 @@ void __init early_setup(unsigned long dt_ptr)
203 early_init_devtree(__va(dt_ptr)); 201 early_init_devtree(__va(dt_ptr));
204 202
205 /* Now we know the logical id of our boot cpu, setup the paca. */ 203 /* Now we know the logical id of our boot cpu, setup the paca. */
206 setup_paca(boot_cpuid); 204 setup_paca(&paca[boot_cpuid]);
207 205
208 /* Fix up paca fields required for the boot cpu */ 206 /* Fix up paca fields required for the boot cpu */
209 get_paca()->cpu_start = 1; 207 get_paca()->cpu_start = 1;
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index 3370e62e43d4..f2496f2faecc 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -42,100 +42,6 @@
42#include <asm/time.h> 42#include <asm/time.h>
43#include <asm/unistd.h> 43#include <asm/unistd.h>
44 44
45/*
46 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
47 *
48 * This is really horribly ugly.
49 */
50int sys_ipc(uint call, int first, unsigned long second, long third,
51 void __user *ptr, long fifth)
52{
53 int version, ret;
54
55 version = call >> 16; /* hack for backward compatibility */
56 call &= 0xffff;
57
58 ret = -ENOSYS;
59 switch (call) {
60 case SEMOP:
61 ret = sys_semtimedop(first, (struct sembuf __user *)ptr,
62 (unsigned)second, NULL);
63 break;
64 case SEMTIMEDOP:
65 ret = sys_semtimedop(first, (struct sembuf __user *)ptr,
66 (unsigned)second,
67 (const struct timespec __user *) fifth);
68 break;
69 case SEMGET:
70 ret = sys_semget (first, (int)second, third);
71 break;
72 case SEMCTL: {
73 union semun fourth;
74
75 ret = -EINVAL;
76 if (!ptr)
77 break;
78 if ((ret = get_user(fourth.__pad, (void __user * __user *)ptr)))
79 break;
80 ret = sys_semctl(first, (int)second, third, fourth);
81 break;
82 }
83 case MSGSND:
84 ret = sys_msgsnd(first, (struct msgbuf __user *)ptr,
85 (size_t)second, third);
86 break;
87 case MSGRCV:
88 switch (version) {
89 case 0: {
90 struct ipc_kludge tmp;
91
92 ret = -EINVAL;
93 if (!ptr)
94 break;
95 if ((ret = copy_from_user(&tmp,
96 (struct ipc_kludge __user *) ptr,
97 sizeof (tmp)) ? -EFAULT : 0))
98 break;
99 ret = sys_msgrcv(first, tmp.msgp, (size_t) second,
100 tmp.msgtyp, third);
101 break;
102 }
103 default:
104 ret = sys_msgrcv (first, (struct msgbuf __user *) ptr,
105 (size_t)second, fifth, third);
106 break;
107 }
108 break;
109 case MSGGET:
110 ret = sys_msgget((key_t)first, (int)second);
111 break;
112 case MSGCTL:
113 ret = sys_msgctl(first, (int)second,
114 (struct msqid_ds __user *)ptr);
115 break;
116 case SHMAT: {
117 ulong raddr;
118 ret = do_shmat(first, (char __user *)ptr, (int)second, &raddr);
119 if (ret)
120 break;
121 ret = put_user(raddr, (ulong __user *) third);
122 break;
123 }
124 case SHMDT:
125 ret = sys_shmdt((char __user *)ptr);
126 break;
127 case SHMGET:
128 ret = sys_shmget(first, (size_t)second, third);
129 break;
130 case SHMCTL:
131 ret = sys_shmctl(first, (int)second,
132 (struct shmid_ds __user *)ptr);
133 break;
134 }
135
136 return ret;
137}
138
139static inline unsigned long do_mmap2(unsigned long addr, size_t len, 45static inline unsigned long do_mmap2(unsigned long addr, size_t len,
140 unsigned long prot, unsigned long flags, 46 unsigned long prot, unsigned long flags,
141 unsigned long fd, unsigned long off, int shift) 47 unsigned long fd, unsigned long off, int shift)
@@ -210,76 +116,6 @@ long ppc64_personality(unsigned long personality)
210} 116}
211#endif 117#endif
212 118
213#ifdef CONFIG_PPC64
214#define OVERRIDE_MACHINE (personality(current->personality) == PER_LINUX32)
215#else
216#define OVERRIDE_MACHINE 0
217#endif
218
219static inline int override_machine(char __user *mach)
220{
221 if (OVERRIDE_MACHINE) {
222 /* change ppc64 to ppc */
223 if (__put_user(0, mach+3) || __put_user(0, mach+4))
224 return -EFAULT;
225 }
226 return 0;
227}
228
229long ppc_newuname(struct new_utsname __user * name)
230{
231 int err = 0;
232
233 down_read(&uts_sem);
234 if (copy_to_user(name, utsname(), sizeof(*name)))
235 err = -EFAULT;
236 up_read(&uts_sem);
237 if (!err)
238 err = override_machine(name->machine);
239 return err;
240}
241
242int sys_uname(struct old_utsname __user *name)
243{
244 int err = 0;
245
246 down_read(&uts_sem);
247 if (copy_to_user(name, utsname(), sizeof(*name)))
248 err = -EFAULT;
249 up_read(&uts_sem);
250 if (!err)
251 err = override_machine(name->machine);
252 return err;
253}
254
255int sys_olduname(struct oldold_utsname __user *name)
256{
257 int error;
258
259 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
260 return -EFAULT;
261
262 down_read(&uts_sem);
263 error = __copy_to_user(&name->sysname, &utsname()->sysname,
264 __OLD_UTS_LEN);
265 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
266 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
267 __OLD_UTS_LEN);
268 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
269 error |= __copy_to_user(&name->release, &utsname()->release,
270 __OLD_UTS_LEN);
271 error |= __put_user(0, name->release + __OLD_UTS_LEN);
272 error |= __copy_to_user(&name->version, &utsname()->version,
273 __OLD_UTS_LEN);
274 error |= __put_user(0, name->version + __OLD_UTS_LEN);
275 error |= __copy_to_user(&name->machine, &utsname()->machine,
276 __OLD_UTS_LEN);
277 error |= override_machine(name->machine);
278 up_read(&uts_sem);
279
280 return error? -EFAULT: 0;
281}
282
283long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, 119long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
284 u32 len_high, u32 len_low) 120 u32 len_high, u32 len_low)
285{ 121{
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 4ec900af332f..b1dbd9ee87cc 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -47,7 +47,7 @@
47#include "mmu_decl.h" 47#include "mmu_decl.h"
48 48
49#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL) 49#if defined(CONFIG_KERNEL_START_BOOL) || defined(CONFIG_LOWMEM_SIZE_BOOL)
50/* The ammount of lowmem must be within 0xF0000000 - KERNELBASE. */ 50/* The amount of lowmem must be within 0xF0000000 - KERNELBASE. */
51#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET)) 51#if (CONFIG_LOWMEM_SIZE > (0xF0000000 - PAGE_OFFSET))
52#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL" 52#error "You must adjust CONFIG_LOWMEM_SIZE or CONFIG_START_KERNEL"
53#endif 53#endif
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index 9d962d7c72c1..d4a09f8705b5 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -24,7 +24,7 @@
24 24
25#include "pq2.h" 25#include "pq2.h"
26 26
27static DEFINE_SPINLOCK(pci_pic_lock); 27static DEFINE_RAW_SPINLOCK(pci_pic_lock);
28 28
29struct pq2ads_pci_pic { 29struct pq2ads_pci_pic {
30 struct device_node *node; 30 struct device_node *node;
@@ -45,12 +45,12 @@ static void pq2ads_pci_mask_irq(unsigned int virq)
45 45
46 if (irq != -1) { 46 if (irq != -1) {
47 unsigned long flags; 47 unsigned long flags;
48 spin_lock_irqsave(&pci_pic_lock, flags); 48 raw_spin_lock_irqsave(&pci_pic_lock, flags);
49 49
50 setbits32(&priv->regs->mask, 1 << irq); 50 setbits32(&priv->regs->mask, 1 << irq);
51 mb(); 51 mb();
52 52
53 spin_unlock_irqrestore(&pci_pic_lock, flags); 53 raw_spin_unlock_irqrestore(&pci_pic_lock, flags);
54 } 54 }
55} 55}
56 56
@@ -62,9 +62,9 @@ static void pq2ads_pci_unmask_irq(unsigned int virq)
62 if (irq != -1) { 62 if (irq != -1) {
63 unsigned long flags; 63 unsigned long flags;
64 64
65 spin_lock_irqsave(&pci_pic_lock, flags); 65 raw_spin_lock_irqsave(&pci_pic_lock, flags);
66 clrbits32(&priv->regs->mask, 1 << irq); 66 clrbits32(&priv->regs->mask, 1 << irq);
67 spin_unlock_irqrestore(&pci_pic_lock, flags); 67 raw_spin_unlock_irqrestore(&pci_pic_lock, flags);
68 } 68 }
69} 69}
70 70
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
index 42e87f08aa01..d48527ffc425 100644
--- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -50,7 +50,7 @@ static struct socrates_fpga_irq_info fpga_irqs[SOCRATES_FPGA_NUM_IRQS] = {
50 50
51#define socrates_fpga_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) 51#define socrates_fpga_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
52 52
53static DEFINE_SPINLOCK(socrates_fpga_pic_lock); 53static DEFINE_RAW_SPINLOCK(socrates_fpga_pic_lock);
54 54
55static void __iomem *socrates_fpga_pic_iobase; 55static void __iomem *socrates_fpga_pic_iobase;
56static struct irq_host *socrates_fpga_pic_irq_host; 56static struct irq_host *socrates_fpga_pic_irq_host;
@@ -80,9 +80,9 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq)
80 if (i == 3) 80 if (i == 3)
81 return NO_IRQ; 81 return NO_IRQ;
82 82
83 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 83 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
84 cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i)); 84 cause = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(i));
85 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 85 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
86 for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) { 86 for (i = SOCRATES_FPGA_NUM_IRQS - 1; i >= 0; i--) {
87 if (cause >> (i + 16)) 87 if (cause >> (i + 16))
88 break; 88 break;
@@ -116,12 +116,12 @@ static void socrates_fpga_pic_ack(unsigned int virq)
116 hwirq = socrates_fpga_irq_to_hw(virq); 116 hwirq = socrates_fpga_irq_to_hw(virq);
117 117
118 irq_line = fpga_irqs[hwirq].irq_line; 118 irq_line = fpga_irqs[hwirq].irq_line;
119 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 119 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
120 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) 120 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
121 & SOCRATES_FPGA_IRQ_MASK; 121 & SOCRATES_FPGA_IRQ_MASK;
122 mask |= (1 << (hwirq + 16)); 122 mask |= (1 << (hwirq + 16));
123 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); 123 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
124 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 124 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
125} 125}
126 126
127static void socrates_fpga_pic_mask(unsigned int virq) 127static void socrates_fpga_pic_mask(unsigned int virq)
@@ -134,12 +134,12 @@ static void socrates_fpga_pic_mask(unsigned int virq)
134 hwirq = socrates_fpga_irq_to_hw(virq); 134 hwirq = socrates_fpga_irq_to_hw(virq);
135 135
136 irq_line = fpga_irqs[hwirq].irq_line; 136 irq_line = fpga_irqs[hwirq].irq_line;
137 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 137 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
138 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) 138 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
139 & SOCRATES_FPGA_IRQ_MASK; 139 & SOCRATES_FPGA_IRQ_MASK;
140 mask &= ~(1 << hwirq); 140 mask &= ~(1 << hwirq);
141 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); 141 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
142 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 142 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
143} 143}
144 144
145static void socrates_fpga_pic_mask_ack(unsigned int virq) 145static void socrates_fpga_pic_mask_ack(unsigned int virq)
@@ -152,13 +152,13 @@ static void socrates_fpga_pic_mask_ack(unsigned int virq)
152 hwirq = socrates_fpga_irq_to_hw(virq); 152 hwirq = socrates_fpga_irq_to_hw(virq);
153 153
154 irq_line = fpga_irqs[hwirq].irq_line; 154 irq_line = fpga_irqs[hwirq].irq_line;
155 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 155 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
156 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) 156 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
157 & SOCRATES_FPGA_IRQ_MASK; 157 & SOCRATES_FPGA_IRQ_MASK;
158 mask &= ~(1 << hwirq); 158 mask &= ~(1 << hwirq);
159 mask |= (1 << (hwirq + 16)); 159 mask |= (1 << (hwirq + 16));
160 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); 160 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
161 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 161 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
162} 162}
163 163
164static void socrates_fpga_pic_unmask(unsigned int virq) 164static void socrates_fpga_pic_unmask(unsigned int virq)
@@ -171,12 +171,12 @@ static void socrates_fpga_pic_unmask(unsigned int virq)
171 hwirq = socrates_fpga_irq_to_hw(virq); 171 hwirq = socrates_fpga_irq_to_hw(virq);
172 172
173 irq_line = fpga_irqs[hwirq].irq_line; 173 irq_line = fpga_irqs[hwirq].irq_line;
174 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 174 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
175 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) 175 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
176 & SOCRATES_FPGA_IRQ_MASK; 176 & SOCRATES_FPGA_IRQ_MASK;
177 mask |= (1 << hwirq); 177 mask |= (1 << hwirq);
178 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); 178 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
179 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 179 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
180} 180}
181 181
182static void socrates_fpga_pic_eoi(unsigned int virq) 182static void socrates_fpga_pic_eoi(unsigned int virq)
@@ -189,12 +189,12 @@ static void socrates_fpga_pic_eoi(unsigned int virq)
189 hwirq = socrates_fpga_irq_to_hw(virq); 189 hwirq = socrates_fpga_irq_to_hw(virq);
190 190
191 irq_line = fpga_irqs[hwirq].irq_line; 191 irq_line = fpga_irqs[hwirq].irq_line;
192 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 192 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
193 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line)) 193 mask = socrates_fpga_pic_read(FPGA_PIC_IRQMASK(irq_line))
194 & SOCRATES_FPGA_IRQ_MASK; 194 & SOCRATES_FPGA_IRQ_MASK;
195 mask |= (1 << (hwirq + 16)); 195 mask |= (1 << (hwirq + 16));
196 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask); 196 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(irq_line), mask);
197 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 197 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
198} 198}
199 199
200static int socrates_fpga_pic_set_type(unsigned int virq, 200static int socrates_fpga_pic_set_type(unsigned int virq,
@@ -220,14 +220,14 @@ static int socrates_fpga_pic_set_type(unsigned int virq,
220 default: 220 default:
221 return -EINVAL; 221 return -EINVAL;
222 } 222 }
223 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 223 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
224 mask = socrates_fpga_pic_read(FPGA_PIC_IRQCFG); 224 mask = socrates_fpga_pic_read(FPGA_PIC_IRQCFG);
225 if (polarity) 225 if (polarity)
226 mask |= (1 << hwirq); 226 mask |= (1 << hwirq);
227 else 227 else
228 mask &= ~(1 << hwirq); 228 mask &= ~(1 << hwirq);
229 socrates_fpga_pic_write(FPGA_PIC_IRQCFG, mask); 229 socrates_fpga_pic_write(FPGA_PIC_IRQCFG, mask);
230 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 230 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
231 return 0; 231 return 0;
232} 232}
233 233
@@ -314,14 +314,14 @@ void socrates_fpga_pic_init(struct device_node *pic)
314 314
315 socrates_fpga_pic_iobase = of_iomap(pic, 0); 315 socrates_fpga_pic_iobase = of_iomap(pic, 0);
316 316
317 spin_lock_irqsave(&socrates_fpga_pic_lock, flags); 317 raw_spin_lock_irqsave(&socrates_fpga_pic_lock, flags);
318 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(0), 318 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(0),
319 SOCRATES_FPGA_IRQ_MASK << 16); 319 SOCRATES_FPGA_IRQ_MASK << 16);
320 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(1), 320 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(1),
321 SOCRATES_FPGA_IRQ_MASK << 16); 321 SOCRATES_FPGA_IRQ_MASK << 16);
322 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(2), 322 socrates_fpga_pic_write(FPGA_PIC_IRQMASK(2),
323 SOCRATES_FPGA_IRQ_MASK << 16); 323 SOCRATES_FPGA_IRQ_MASK << 16);
324 spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags); 324 raw_spin_unlock_irqrestore(&socrates_fpga_pic_lock, flags);
325 325
326 pr_info("FPGA PIC: Setting up Socrates FPGA PIC\n"); 326 pr_info("FPGA PIC: Setting up Socrates FPGA PIC\n");
327} 327}
diff --git a/arch/powerpc/platforms/86xx/Kconfig b/arch/powerpc/platforms/86xx/Kconfig
index 2bbfd530d6d8..fbe9f3621424 100644
--- a/arch/powerpc/platforms/86xx/Kconfig
+++ b/arch/powerpc/platforms/86xx/Kconfig
@@ -33,32 +33,32 @@ config MPC8610_HPCD
33 This option enables support for the MPC8610 HPCD board. 33 This option enables support for the MPC8610 HPCD board.
34 34
35config GEF_PPC9A 35config GEF_PPC9A
36 bool "GE Fanuc PPC9A" 36 bool "GE PPC9A"
37 select DEFAULT_UIMAGE 37 select DEFAULT_UIMAGE
38 select MMIO_NVRAM 38 select MMIO_NVRAM
39 select GENERIC_GPIO 39 select GENERIC_GPIO
40 select ARCH_REQUIRE_GPIOLIB 40 select ARCH_REQUIRE_GPIOLIB
41 help 41 help
42 This option enables support for GE Fanuc's PPC9A. 42 This option enables support for the GE PPC9A.
43 43
44config GEF_SBC310 44config GEF_SBC310
45 bool "GE Fanuc SBC310" 45 bool "GE SBC310"
46 select DEFAULT_UIMAGE 46 select DEFAULT_UIMAGE
47 select MMIO_NVRAM 47 select MMIO_NVRAM
48 select GENERIC_GPIO 48 select GENERIC_GPIO
49 select ARCH_REQUIRE_GPIOLIB 49 select ARCH_REQUIRE_GPIOLIB
50 help 50 help
51 This option enables support for GE Fanuc's SBC310. 51 This option enables support for the GE SBC310.
52 52
53config GEF_SBC610 53config GEF_SBC610
54 bool "GE Fanuc SBC610" 54 bool "GE SBC610"
55 select DEFAULT_UIMAGE 55 select DEFAULT_UIMAGE
56 select MMIO_NVRAM 56 select MMIO_NVRAM
57 select GENERIC_GPIO 57 select GENERIC_GPIO
58 select ARCH_REQUIRE_GPIOLIB 58 select ARCH_REQUIRE_GPIOLIB
59 select HAS_RAPIDIO 59 select HAS_RAPIDIO
60 help 60 help
61 This option enables support for GE Fanuc's SBC610. 61 This option enables support for the GE SBC610.
62 62
63endif 63endif
64 64
diff --git a/arch/powerpc/platforms/86xx/gef_gpio.c b/arch/powerpc/platforms/86xx/gef_gpio.c
index b2ea8875adba..11f7b2b6f49e 100644
--- a/arch/powerpc/platforms/86xx/gef_gpio.c
+++ b/arch/powerpc/platforms/86xx/gef_gpio.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Driver for GE Fanuc's FPGA based GPIO pins 2 * Driver for GE FPGA based GPIO
3 * 3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 * Author: Martyn Welch <martyn.welch@ge.com>
5 * 5 *
6 * 2008 (c) GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc.
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public License 8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any 9 * version 2. This program is licensed "as is" without any warranty of any
@@ -164,6 +164,6 @@ static int __init gef_gpio_init(void)
164}; 164};
165arch_initcall(gef_gpio_init); 165arch_initcall(gef_gpio_init);
166 166
167MODULE_DESCRIPTION("GE Fanuc I/O FPGA GPIO driver"); 167MODULE_DESCRIPTION("GE I/O FPGA GPIO driver");
168MODULE_AUTHOR("Martyn Welch <martyn.welch@gefanuc.com"); 168MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com");
169MODULE_LICENSE("GPL"); 169MODULE_LICENSE("GPL");
diff --git a/arch/powerpc/platforms/86xx/gef_pic.c b/arch/powerpc/platforms/86xx/gef_pic.c
index 0110a8736d33..6df9e2561c06 100644
--- a/arch/powerpc/platforms/86xx/gef_pic.c
+++ b/arch/powerpc/platforms/86xx/gef_pic.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Interrupt handling for GE Fanuc's FPGA based PIC 2 * Interrupt handling for GE FPGA based PIC
3 * 3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 * Author: Martyn Welch <martyn.welch@ge.com>
5 * 5 *
6 * 2008 (c) GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc.
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public License 8 * This file is licensed under the terms of the GNU General Public License
9 * version 2. This program is licensed "as is" without any warranty of any 9 * version 2. This program is licensed "as is" without any warranty of any
@@ -49,7 +49,7 @@
49#define gef_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq) 49#define gef_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
50 50
51 51
52static DEFINE_SPINLOCK(gef_pic_lock); 52static DEFINE_RAW_SPINLOCK(gef_pic_lock);
53 53
54static void __iomem *gef_pic_irq_reg_base; 54static void __iomem *gef_pic_irq_reg_base;
55static struct irq_host *gef_pic_irq_host; 55static struct irq_host *gef_pic_irq_host;
@@ -118,11 +118,11 @@ static void gef_pic_mask(unsigned int virq)
118 118
119 hwirq = gef_irq_to_hw(virq); 119 hwirq = gef_irq_to_hw(virq);
120 120
121 spin_lock_irqsave(&gef_pic_lock, flags); 121 raw_spin_lock_irqsave(&gef_pic_lock, flags);
122 mask = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0)); 122 mask = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0));
123 mask &= ~(1 << hwirq); 123 mask &= ~(1 << hwirq);
124 out_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0), mask); 124 out_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0), mask);
125 spin_unlock_irqrestore(&gef_pic_lock, flags); 125 raw_spin_unlock_irqrestore(&gef_pic_lock, flags);
126} 126}
127 127
128static void gef_pic_mask_ack(unsigned int virq) 128static void gef_pic_mask_ack(unsigned int virq)
@@ -141,11 +141,11 @@ static void gef_pic_unmask(unsigned int virq)
141 141
142 hwirq = gef_irq_to_hw(virq); 142 hwirq = gef_irq_to_hw(virq);
143 143
144 spin_lock_irqsave(&gef_pic_lock, flags); 144 raw_spin_lock_irqsave(&gef_pic_lock, flags);
145 mask = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0)); 145 mask = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0));
146 mask |= (1 << hwirq); 146 mask |= (1 << hwirq);
147 out_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0), mask); 147 out_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_MASK(0), mask);
148 spin_unlock_irqrestore(&gef_pic_lock, flags); 148 raw_spin_unlock_irqrestore(&gef_pic_lock, flags);
149} 149}
150 150
151static struct irq_chip gef_pic_chip = { 151static struct irq_chip gef_pic_chip = {
@@ -199,7 +199,7 @@ void __init gef_pic_init(struct device_node *np)
199 /* Map the devices registers into memory */ 199 /* Map the devices registers into memory */
200 gef_pic_irq_reg_base = of_iomap(np, 0); 200 gef_pic_irq_reg_base = of_iomap(np, 0);
201 201
202 spin_lock_irqsave(&gef_pic_lock, flags); 202 raw_spin_lock_irqsave(&gef_pic_lock, flags);
203 203
204 /* Initialise everything as masked. */ 204 /* Initialise everything as masked. */
205 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU0_INTR_MASK, 0); 205 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU0_INTR_MASK, 0);
@@ -208,7 +208,7 @@ void __init gef_pic_init(struct device_node *np)
208 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU0_MCP_MASK, 0); 208 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU0_MCP_MASK, 0);
209 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU1_MCP_MASK, 0); 209 out_be32(gef_pic_irq_reg_base + GEF_PIC_CPU1_MCP_MASK, 0);
210 210
211 spin_unlock_irqrestore(&gef_pic_lock, flags); 211 raw_spin_unlock_irqrestore(&gef_pic_lock, flags);
212 212
213 /* Map controller */ 213 /* Map controller */
214 gef_pic_cascade_irq = irq_of_parse_and_map(np, 0); 214 gef_pic_cascade_irq = irq_of_parse_and_map(np, 0);
diff --git a/arch/powerpc/platforms/86xx/gef_ppc9a.c b/arch/powerpc/platforms/86xx/gef_ppc9a.c
index a792e5d85813..60ce07e39100 100644
--- a/arch/powerpc/platforms/86xx/gef_ppc9a.c
+++ b/arch/powerpc/platforms/86xx/gef_ppc9a.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * GE Fanuc PPC9A board support 2 * GE PPC9A board support
3 * 3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 * Author: Martyn Welch <martyn.welch@ge.com>
5 * 5 *
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -82,7 +82,7 @@ static void __init gef_ppc9a_setup_arch(void)
82 } 82 }
83#endif 83#endif
84 84
85 printk(KERN_INFO "GE Fanuc Intelligent Platforms PPC9A 6U VME SBC\n"); 85 printk(KERN_INFO "GE Intelligent Platforms PPC9A 6U VME SBC\n");
86 86
87#ifdef CONFIG_SMP 87#ifdef CONFIG_SMP
88 mpc86xx_smp_init(); 88 mpc86xx_smp_init();
@@ -151,7 +151,7 @@ static void gef_ppc9a_show_cpuinfo(struct seq_file *m)
151{ 151{
152 uint svid = mfspr(SPRN_SVR); 152 uint svid = mfspr(SPRN_SVR);
153 153
154 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n"); 154 seq_printf(m, "Vendor\t\t: GE Intelligent Platforms\n");
155 155
156 seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(), 156 seq_printf(m, "Revision\t: %u%c\n", gef_ppc9a_get_pcb_rev(),
157 ('A' + gef_ppc9a_get_board_rev())); 157 ('A' + gef_ppc9a_get_board_rev()));
@@ -235,7 +235,7 @@ static int __init declare_of_platform_devices(void)
235machine_device_initcall(gef_ppc9a, declare_of_platform_devices); 235machine_device_initcall(gef_ppc9a, declare_of_platform_devices);
236 236
237define_machine(gef_ppc9a) { 237define_machine(gef_ppc9a) {
238 .name = "GE Fanuc PPC9A", 238 .name = "GE PPC9A",
239 .probe = gef_ppc9a_probe, 239 .probe = gef_ppc9a_probe,
240 .setup_arch = gef_ppc9a_setup_arch, 240 .setup_arch = gef_ppc9a_setup_arch,
241 .init_IRQ = gef_ppc9a_init_irq, 241 .init_IRQ = gef_ppc9a_init_irq,
diff --git a/arch/powerpc/platforms/86xx/gef_sbc310.c b/arch/powerpc/platforms/86xx/gef_sbc310.c
index 6a1a613836c2..3ecee25bf3ed 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc310.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc310.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * GE Fanuc SBC310 board support 2 * GE SBC310 board support
3 * 3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 * Author: Martyn Welch <martyn.welch@ge.com>
5 * 5 *
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -82,7 +82,7 @@ static void __init gef_sbc310_setup_arch(void)
82 } 82 }
83#endif 83#endif
84 84
85 printk(KERN_INFO "GE Fanuc Intelligent Platforms SBC310 6U VPX SBC\n"); 85 printk(KERN_INFO "GE Intelligent Platforms SBC310 6U VPX SBC\n");
86 86
87#ifdef CONFIG_SMP 87#ifdef CONFIG_SMP
88 mpc86xx_smp_init(); 88 mpc86xx_smp_init();
@@ -142,7 +142,7 @@ static void gef_sbc310_show_cpuinfo(struct seq_file *m)
142{ 142{
143 uint svid = mfspr(SPRN_SVR); 143 uint svid = mfspr(SPRN_SVR);
144 144
145 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n"); 145 seq_printf(m, "Vendor\t\t: GE Intelligent Platforms\n");
146 146
147 seq_printf(m, "Board ID\t: 0x%2.2x\n", gef_sbc310_get_board_id()); 147 seq_printf(m, "Board ID\t: 0x%2.2x\n", gef_sbc310_get_board_id());
148 seq_printf(m, "Revision\t: %u%c\n", gef_sbc310_get_pcb_rev(), 148 seq_printf(m, "Revision\t: %u%c\n", gef_sbc310_get_pcb_rev(),
@@ -223,7 +223,7 @@ static int __init declare_of_platform_devices(void)
223machine_device_initcall(gef_sbc310, declare_of_platform_devices); 223machine_device_initcall(gef_sbc310, declare_of_platform_devices);
224 224
225define_machine(gef_sbc310) { 225define_machine(gef_sbc310) {
226 .name = "GE Fanuc SBC310", 226 .name = "GE SBC310",
227 .probe = gef_sbc310_probe, 227 .probe = gef_sbc310_probe,
228 .setup_arch = gef_sbc310_setup_arch, 228 .setup_arch = gef_sbc310_setup_arch,
229 .init_IRQ = gef_sbc310_init_irq, 229 .init_IRQ = gef_sbc310_init_irq,
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c
index e10688a0fc4e..5090d608d9ee 100644
--- a/arch/powerpc/platforms/86xx/gef_sbc610.c
+++ b/arch/powerpc/platforms/86xx/gef_sbc610.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * GE Fanuc SBC610 board support 2 * GE SBC610 board support
3 * 3 *
4 * Author: Martyn Welch <martyn.welch@gefanuc.com> 4 * Author: Martyn Welch <martyn.welch@ge.com>
5 * 5 *
6 * Copyright 2008 GE Fanuc Intelligent Platforms Embedded Systems, Inc. 6 * Copyright 2008 GE Intelligent Platforms Embedded Systems, Inc.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
@@ -82,7 +82,7 @@ static void __init gef_sbc610_setup_arch(void)
82 } 82 }
83#endif 83#endif
84 84
85 printk(KERN_INFO "GE Fanuc Intelligent Platforms SBC610 6U VPX SBC\n"); 85 printk(KERN_INFO "GE Intelligent Platforms SBC610 6U VPX SBC\n");
86 86
87#ifdef CONFIG_SMP 87#ifdef CONFIG_SMP
88 mpc86xx_smp_init(); 88 mpc86xx_smp_init();
@@ -133,7 +133,7 @@ static void gef_sbc610_show_cpuinfo(struct seq_file *m)
133{ 133{
134 uint svid = mfspr(SPRN_SVR); 134 uint svid = mfspr(SPRN_SVR);
135 135
136 seq_printf(m, "Vendor\t\t: GE Fanuc Intelligent Platforms\n"); 136 seq_printf(m, "Vendor\t\t: GE Intelligent Platforms\n");
137 137
138 seq_printf(m, "Revision\t: %u%c\n", gef_sbc610_get_pcb_rev(), 138 seq_printf(m, "Revision\t: %u%c\n", gef_sbc610_get_pcb_rev(),
139 ('A' + gef_sbc610_get_board_rev() - 1)); 139 ('A' + gef_sbc610_get_board_rev() - 1));
@@ -212,7 +212,7 @@ static int __init declare_of_platform_devices(void)
212machine_device_initcall(gef_sbc610, declare_of_platform_devices); 212machine_device_initcall(gef_sbc610, declare_of_platform_devices);
213 213
214define_machine(gef_sbc610) { 214define_machine(gef_sbc610) {
215 .name = "GE Fanuc SBC610", 215 .name = "GE SBC610",
216 .probe = gef_sbc610_probe, 216 .probe = gef_sbc610_probe,
217 .setup_arch = gef_sbc610_setup_arch, 217 .setup_arch = gef_sbc610_setup_arch,
218 .init_IRQ = gef_sbc610_init_irq, 218 .init_IRQ = gef_sbc610_init_irq,
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index fa0f690d3867..a8aae0b54579 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -144,6 +144,16 @@ config FSL_EMB_PERFMON
144 and some e300 cores (c3 and c4). Select this only if your 144 and some e300 cores (c3 and c4). Select this only if your
145 core supports the Embedded Performance Monitor APU 145 core supports the Embedded Performance Monitor APU
146 146
147config FSL_EMB_PERF_EVENT
148 bool
149 depends on FSL_EMB_PERFMON && PERF_EVENTS && !PPC_PERF_CTRS
150 default y
151
152config FSL_EMB_PERF_EVENT_E500
153 bool
154 depends on FSL_EMB_PERF_EVENT && E500
155 default y
156
147config 4xx 157config 4xx
148 bool 158 bool
149 depends on 40x || 44x 159 depends on 40x || 44x
diff --git a/arch/powerpc/platforms/iseries/exception.S b/arch/powerpc/platforms/iseries/exception.S
index 5369653dcf6a..fba5bf915073 100644
--- a/arch/powerpc/platforms/iseries/exception.S
+++ b/arch/powerpc/platforms/iseries/exception.S
@@ -43,17 +43,14 @@ system_reset_iSeries:
43 LOAD_REG_ADDR(r23, alpaca) 43 LOAD_REG_ADDR(r23, alpaca)
44 li r0,ALPACA_SIZE 44 li r0,ALPACA_SIZE
45 sub r23,r13,r23 45 sub r23,r13,r23
46 divdu r23,r23,r0 /* r23 has cpu number */ 46 divdu r24,r23,r0 /* r24 has cpu number */
47 LOAD_REG_ADDR(r13, paca)
48 mulli r0,r23,PACA_SIZE
49 add r13,r13,r0
50 mtspr SPRN_SPRG_PACA,r13 /* Save it away for the future */
51 mfmsr r24
52 ori r24,r24,MSR_RI
53 mtmsrd r24 /* RI on */
54 mr r24,r23
55 cmpwi 0,r24,0 /* Are we processor 0? */ 47 cmpwi 0,r24,0 /* Are we processor 0? */
56 bne 1f 48 bne 1f
49 LOAD_REG_ADDR(r13, boot_paca)
50 mtspr SPRN_SPRG_PACA,r13 /* Save it away for the future */
51 mfmsr r23
52 ori r23,r23,MSR_RI
53 mtmsrd r23 /* RI on */
57 b .__start_initialization_iSeries /* Start up the first processor */ 54 b .__start_initialization_iSeries /* Start up the first processor */
581: mfspr r4,SPRN_CTRLF 551: mfspr r4,SPRN_CTRLF
59 li r5,CTRL_RUNLATCH /* Turn off the run light */ 56 li r5,CTRL_RUNLATCH /* Turn off the run light */
@@ -86,6 +83,16 @@ system_reset_iSeries:
86#endif 83#endif
87 84
882: 852:
86 /* Load our paca now that it's been allocated */
87 LOAD_REG_ADDR(r13, paca)
88 ld r13,0(r13)
89 mulli r0,r24,PACA_SIZE
90 add r13,r13,r0
91 mtspr SPRN_SPRG_PACA,r13 /* Save it away for the future */
92 mfmsr r23
93 ori r23,r23,MSR_RI
94 mtmsrd r23 /* RI on */
95
89 HMT_LOW 96 HMT_LOW
90#ifdef CONFIG_SMP 97#ifdef CONFIG_SMP
91 lbz r23,PACAPROCSTART(r13) /* Test if this processor 98 lbz r23,PACAPROCSTART(r13) /* Test if this processor
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index d1b124e44d77..a8e1d5d17a28 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -122,44 +122,32 @@ static void pseries_mach_cpu_die(void)
122 if (!get_lppaca()->shared_proc) 122 if (!get_lppaca()->shared_proc)
123 get_lppaca()->donate_dedicated_cpu = 1; 123 get_lppaca()->donate_dedicated_cpu = 1;
124 124
125 printk(KERN_INFO
126 "cpu %u (hwid %u) ceding for offline with hint %d\n",
127 cpu, hwcpu, cede_latency_hint);
128 while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) { 125 while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
129 extended_cede_processor(cede_latency_hint); 126 extended_cede_processor(cede_latency_hint);
130 printk(KERN_INFO "cpu %u (hwid %u) returned from cede.\n",
131 cpu, hwcpu);
132 printk(KERN_INFO
133 "Decrementer value = %x Timebase value = %llx\n",
134 get_dec(), get_tb());
135 } 127 }
136 128
137 printk(KERN_INFO "cpu %u (hwid %u) got prodded to go online\n",
138 cpu, hwcpu);
139
140 if (!get_lppaca()->shared_proc) 129 if (!get_lppaca()->shared_proc)
141 get_lppaca()->donate_dedicated_cpu = 0; 130 get_lppaca()->donate_dedicated_cpu = 0;
142 get_lppaca()->idle = 0; 131 get_lppaca()->idle = 0;
143 }
144 132
145 if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) { 133 if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
146 unregister_slb_shadow(hwcpu, __pa(get_slb_shadow())); 134 unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
147 135
148 /* 136 /*
149 * NOTE: Calling start_secondary() here for now to 137 * Call to start_secondary_resume() will not return.
150 * start new context. 138 * Kernel stack will be reset and start_secondary()
151 * However, need to do it cleanly by resetting the 139 * will be called to continue the online operation.
152 * stack pointer. 140 */
153 */ 141 start_secondary_resume();
154 start_secondary(); 142 }
143 }
155 144
156 } else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) { 145 /* Requested state is CPU_STATE_OFFLINE at this point */
146 WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE);
157 147
158 set_cpu_current_state(cpu, CPU_STATE_OFFLINE); 148 set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
159 unregister_slb_shadow(hard_smp_processor_id(), 149 unregister_slb_shadow(hwcpu, __pa(get_slb_shadow()));
160 __pa(get_slb_shadow())); 150 rtas_stop_self();
161 rtas_stop_self();
162 }
163 151
164 /* Should never get here... */ 152 /* Should never get here... */
165 BUG(); 153 BUG();
diff --git a/arch/powerpc/platforms/pseries/offline_states.h b/arch/powerpc/platforms/pseries/offline_states.h
index 22574e0d9d91..75a6f480d931 100644
--- a/arch/powerpc/platforms/pseries/offline_states.h
+++ b/arch/powerpc/platforms/pseries/offline_states.h
@@ -9,10 +9,31 @@ enum cpu_state_vals {
9 CPU_MAX_OFFLINE_STATES 9 CPU_MAX_OFFLINE_STATES
10}; 10};
11 11
12#ifdef CONFIG_HOTPLUG_CPU
12extern enum cpu_state_vals get_cpu_current_state(int cpu); 13extern enum cpu_state_vals get_cpu_current_state(int cpu);
13extern void set_cpu_current_state(int cpu, enum cpu_state_vals state); 14extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
14extern enum cpu_state_vals get_preferred_offline_state(int cpu);
15extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state); 15extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
16extern void set_default_offline_state(int cpu); 16extern void set_default_offline_state(int cpu);
17#else
18static inline enum cpu_state_vals get_cpu_current_state(int cpu)
19{
20 return CPU_STATE_ONLINE;
21}
22
23static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state)
24{
25}
26
27static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state)
28{
29}
30
31static inline void set_default_offline_state(int cpu)
32{
33}
34#endif
35
36extern enum cpu_state_vals get_preferred_offline_state(int cpu);
17extern int start_secondary(void); 37extern int start_secondary(void);
38extern void start_secondary_resume(void);
18#endif 39#endif
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h
index 0603c91538ae..a05f8d427856 100644
--- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
+++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
@@ -259,12 +259,12 @@ static inline long plpar_ipi(unsigned long servernum, unsigned long mfrr)
259 return plpar_hcall_norets(H_IPI, servernum, mfrr); 259 return plpar_hcall_norets(H_IPI, servernum, mfrr);
260} 260}
261 261
262static inline long plpar_xirr(unsigned long *xirr_ret) 262static inline long plpar_xirr(unsigned long *xirr_ret, unsigned char cppr)
263{ 263{
264 long rc; 264 long rc;
265 unsigned long retbuf[PLPAR_HCALL_BUFSIZE]; 265 unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
266 266
267 rc = plpar_hcall(H_XIRR, retbuf); 267 rc = plpar_hcall(H_XIRR, retbuf, cppr);
268 268
269 *xirr_ret = retbuf[0]; 269 *xirr_ret = retbuf[0];
270 270
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 4ca641042ec3..1bcedd8b4616 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -120,12 +120,12 @@ static inline void direct_qirr_info(int n_cpu, u8 value)
120 120
121/* LPAR low level accessors */ 121/* LPAR low level accessors */
122 122
123static inline unsigned int lpar_xirr_info_get(void) 123static inline unsigned int lpar_xirr_info_get(unsigned char cppr)
124{ 124{
125 unsigned long lpar_rc; 125 unsigned long lpar_rc;
126 unsigned long return_value; 126 unsigned long return_value;
127 127
128 lpar_rc = plpar_xirr(&return_value); 128 lpar_rc = plpar_xirr(&return_value, cppr);
129 if (lpar_rc != H_SUCCESS) 129 if (lpar_rc != H_SUCCESS)
130 panic(" bad return code xirr - rc = %lx\n", lpar_rc); 130 panic(" bad return code xirr - rc = %lx\n", lpar_rc);
131 return (unsigned int)return_value; 131 return (unsigned int)return_value;
@@ -331,7 +331,8 @@ static unsigned int xics_get_irq_direct(void)
331 331
332static unsigned int xics_get_irq_lpar(void) 332static unsigned int xics_get_irq_lpar(void)
333{ 333{
334 unsigned int xirr = lpar_xirr_info_get(); 334 struct xics_cppr *os_cppr = &__get_cpu_var(xics_cppr);
335 unsigned int xirr = lpar_xirr_info_get(os_cppr->stack[os_cppr->index]);
335 unsigned int vec = xics_xirr_vector(xirr); 336 unsigned int vec = xics_xirr_vector(xirr);
336 unsigned int irq; 337 unsigned int irq;
337 338
diff --git a/arch/powerpc/sysdev/cpm2_pic.h b/arch/powerpc/sysdev/cpm2_pic.h
index 30e5828a2781..2c5f70c24485 100644
--- a/arch/powerpc/sysdev/cpm2_pic.h
+++ b/arch/powerpc/sysdev/cpm2_pic.h
@@ -3,6 +3,6 @@
3 3
4extern unsigned int cpm2_get_irq(void); 4extern unsigned int cpm2_get_irq(void);
5 5
6extern void cpm2_pic_init(struct device_node*); 6extern void cpm2_pic_init(struct device_node *);
7 7
8#endif /* _PPC_KERNEL_CPM2_H */ 8#endif /* _PPC_KERNEL_CPM2_H */
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index d927da893ec4..541ba9863647 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -33,7 +33,7 @@
33 33
34#include "qe_ic.h" 34#include "qe_ic.h"
35 35
36static DEFINE_SPINLOCK(qe_ic_lock); 36static DEFINE_RAW_SPINLOCK(qe_ic_lock);
37 37
38static struct qe_ic_info qe_ic_info[] = { 38static struct qe_ic_info qe_ic_info[] = {
39 [1] = { 39 [1] = {
@@ -201,13 +201,13 @@ static void qe_ic_unmask_irq(unsigned int virq)
201 unsigned long flags; 201 unsigned long flags;
202 u32 temp; 202 u32 temp;
203 203
204 spin_lock_irqsave(&qe_ic_lock, flags); 204 raw_spin_lock_irqsave(&qe_ic_lock, flags);
205 205
206 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg); 206 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg);
207 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg, 207 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg,
208 temp | qe_ic_info[src].mask); 208 temp | qe_ic_info[src].mask);
209 209
210 spin_unlock_irqrestore(&qe_ic_lock, flags); 210 raw_spin_unlock_irqrestore(&qe_ic_lock, flags);
211} 211}
212 212
213static void qe_ic_mask_irq(unsigned int virq) 213static void qe_ic_mask_irq(unsigned int virq)
@@ -217,7 +217,7 @@ static void qe_ic_mask_irq(unsigned int virq)
217 unsigned long flags; 217 unsigned long flags;
218 u32 temp; 218 u32 temp;
219 219
220 spin_lock_irqsave(&qe_ic_lock, flags); 220 raw_spin_lock_irqsave(&qe_ic_lock, flags);
221 221
222 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg); 222 temp = qe_ic_read(qe_ic->regs, qe_ic_info[src].mask_reg);
223 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg, 223 qe_ic_write(qe_ic->regs, qe_ic_info[src].mask_reg,
@@ -233,7 +233,7 @@ static void qe_ic_mask_irq(unsigned int virq)
233 */ 233 */
234 mb(); 234 mb();
235 235
236 spin_unlock_irqrestore(&qe_ic_lock, flags); 236 raw_spin_unlock_irqrestore(&qe_ic_lock, flags);
237} 237}
238 238
239static struct irq_chip qe_ic_irq_chip = { 239static struct irq_chip qe_ic_irq_chip = {
diff --git a/arch/s390/crypto/sha_common.c b/arch/s390/crypto/sha_common.c
index 7903ec47e6b9..f42dbabc0d30 100644
--- a/arch/s390/crypto/sha_common.c
+++ b/arch/s390/crypto/sha_common.c
@@ -79,7 +79,7 @@ int s390_sha_final(struct shash_desc *desc, u8 *out)
79 memset(ctx->buf + index, 0x00, end - index - 8); 79 memset(ctx->buf + index, 0x00, end - index - 8);
80 80
81 /* 81 /*
82 * Append message length. Well, SHA-512 wants a 128 bit lenght value, 82 * Append message length. Well, SHA-512 wants a 128 bit length value,
83 * nevertheless we use u64, should be enough for now... 83 * nevertheless we use u64, should be enough for now...
84 */ 84 */
85 bits = ctx->count * 8; 85 bits = ctx->count * 8;
diff --git a/arch/s390/include/asm/cio.h b/arch/s390/include/asm/cio.h
index e85679af54dd..e34347d567a6 100644
--- a/arch/s390/include/asm/cio.h
+++ b/arch/s390/include/asm/cio.h
@@ -20,7 +20,7 @@
20/** 20/**
21 * struct ccw1 - channel command word 21 * struct ccw1 - channel command word
22 * @cmd_code: command code 22 * @cmd_code: command code
23 * @flags: flags, like IDA adressing, etc. 23 * @flags: flags, like IDA addressing, etc.
24 * @count: byte count 24 * @count: byte count
25 * @cda: data address 25 * @cda: data address
26 * 26 *
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 01a08020bc0e..104f2007f097 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -35,7 +35,8 @@
35 35
36extern long psw32_user_bits; 36extern long psw32_user_bits;
37 37
38#define COMPAT_USER_HZ 100 38#define COMPAT_USER_HZ 100
39#define COMPAT_UTS_MACHINE "s390\0\0\0\0"
39 40
40typedef u32 compat_size_t; 41typedef u32 compat_size_t;
41typedef s32 compat_ssize_t; 42typedef s32 compat_ssize_t;
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index dd2d913afcae..fef9b33cdd59 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -489,9 +489,6 @@ struct user_regs_struct
489 * These are defined as per linux/ptrace.h, which see. 489 * These are defined as per linux/ptrace.h, which see.
490 */ 490 */
491#define arch_has_single_step() (1) 491#define arch_has_single_step() (1)
492struct task_struct;
493extern void user_enable_single_step(struct task_struct *);
494extern void user_disable_single_step(struct task_struct *);
495extern void show_regs(struct pt_regs * regs); 492extern void show_regs(struct pt_regs * regs);
496 493
497#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0) 494#define user_mode(regs) (((regs)->psw.mask & PSW_MASK_PSTATE) != 0)
diff --git a/arch/s390/include/asm/unistd.h b/arch/s390/include/asm/unistd.h
index 6e9f049fa823..5f0075150a65 100644
--- a/arch/s390/include/asm/unistd.h
+++ b/arch/s390/include/asm/unistd.h
@@ -392,6 +392,7 @@
392#define __ARCH_WANT_SYS_LLSEEK 392#define __ARCH_WANT_SYS_LLSEEK
393#define __ARCH_WANT_SYS_NICE 393#define __ARCH_WANT_SYS_NICE
394#define __ARCH_WANT_SYS_OLD_GETRLIMIT 394#define __ARCH_WANT_SYS_OLD_GETRLIMIT
395#define __ARCH_WANT_SYS_OLD_MMAP
395#define __ARCH_WANT_SYS_OLDUMOUNT 396#define __ARCH_WANT_SYS_OLDUMOUNT
396#define __ARCH_WANT_SYS_SIGPENDING 397#define __ARCH_WANT_SYS_SIGPENDING
397#define __ARCH_WANT_SYS_SIGPROCMASK 398#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 30de2d0e52bb..672ce52341b4 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper:
547 .globl sys32_newuname_wrapper 547 .globl sys32_newuname_wrapper
548sys32_newuname_wrapper: 548sys32_newuname_wrapper:
549 llgtr %r2,%r2 # struct new_utsname * 549 llgtr %r2,%r2 # struct new_utsname *
550 jg sys_s390_newuname # branch to system call 550 jg sys_newuname # branch to system call
551 551
552 .globl compat_sys_adjtimex_wrapper 552 .globl compat_sys_adjtimex_wrapper
553compat_sys_adjtimex_wrapper: 553compat_sys_adjtimex_wrapper:
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index e1e5e767ab56..eb15c12ec158 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -24,17 +24,13 @@ int __cpuinit start_secondary(void *cpuvoid);
24void __init startup_init(void); 24void __init startup_init(void);
25void die(const char * str, struct pt_regs * regs, long err); 25void die(const char * str, struct pt_regs * regs, long err);
26 26
27struct new_utsname; 27struct s390_mmap_arg_struct;
28struct mmap_arg_struct;
29struct fadvise64_64_args; 28struct fadvise64_64_args;
30struct old_sigaction; 29struct old_sigaction;
31struct sel_arg_struct;
32 30
33long sys_mmap2(struct mmap_arg_struct __user *arg); 31long sys_mmap2(struct s390_mmap_arg_struct __user *arg);
34long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); 32long sys_s390_ipc(uint call, int first, unsigned long second,
35long sys_ipc(uint call, int first, unsigned long second,
36 unsigned long third, void __user *ptr); 33 unsigned long third, void __user *ptr);
37long sys_s390_newuname(struct new_utsname __user *name);
38long sys_s390_personality(unsigned long personality); 34long sys_s390_personality(unsigned long personality);
39long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, 35long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low,
40 size_t len, int advice); 36 size_t len, int advice);
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S
index 27af3bf3a009..2e82fdd89320 100644
--- a/arch/s390/kernel/sclp.S
+++ b/arch/s390/kernel/sclp.S
@@ -235,7 +235,7 @@ _sclp_print:
235 lh %r9,0(%r8) # update sccb length 235 lh %r9,0(%r8) # update sccb length
236 ar %r9,%r6 236 ar %r9,%r6
237 sth %r9,0(%r8) 237 sth %r9,0(%r8)
238 ar %r7,%r6 # update current mto adress 238 ar %r7,%r6 # update current mto address
239 ltr %r0,%r0 # more characters? 239 ltr %r0,%r0 # more characters?
240 jnz .LinitmtoS4 240 jnz .LinitmtoS4
241 l %r2,.LwritedataS4-.LbaseS4(%r13)# write data 241 l %r2,.LwritedataS4-.LbaseS4(%r13)# write data
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 86a74c9c9e63..7b6b0f81a283 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -33,13 +33,12 @@
33#include "entry.h" 33#include "entry.h"
34 34
35/* 35/*
36 * Perform the select(nd, in, out, ex, tv) and mmap() system 36 * Perform the mmap() system call. Linux for S/390 isn't able to handle more
37 * calls. Linux for S/390 isn't able to handle more than 5 37 * than 5 system call parameters, so this system call uses a memory block
38 * system call parameters, so these system calls used a memory 38 * for parameter passing.
39 * block for parameter passing..
40 */ 39 */
41 40
42struct mmap_arg_struct { 41struct s390_mmap_arg_struct {
43 unsigned long addr; 42 unsigned long addr;
44 unsigned long len; 43 unsigned long len;
45 unsigned long prot; 44 unsigned long prot;
@@ -48,9 +47,9 @@ struct mmap_arg_struct {
48 unsigned long offset; 47 unsigned long offset;
49}; 48};
50 49
51SYSCALL_DEFINE1(mmap2, struct mmap_arg_struct __user *, arg) 50SYSCALL_DEFINE1(mmap2, struct s390_mmap_arg_struct __user *, arg)
52{ 51{
53 struct mmap_arg_struct a; 52 struct s390_mmap_arg_struct a;
54 int error = -EFAULT; 53 int error = -EFAULT;
55 54
56 if (copy_from_user(&a, arg, sizeof(a))) 55 if (copy_from_user(&a, arg, sizeof(a)))
@@ -60,29 +59,12 @@ out:
60 return error; 59 return error;
61} 60}
62 61
63SYSCALL_DEFINE1(s390_old_mmap, struct mmap_arg_struct __user *, arg)
64{
65 struct mmap_arg_struct a;
66 long error = -EFAULT;
67
68 if (copy_from_user(&a, arg, sizeof(a)))
69 goto out;
70
71 error = -EINVAL;
72 if (a.offset & ~PAGE_MASK)
73 goto out;
74
75 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT);
76out:
77 return error;
78}
79
80/* 62/*
81 * sys_ipc() is the de-multiplexer for the SysV IPC calls.. 63 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
82 * 64 *
83 * This is really horribly ugly. 65 * This is really horribly ugly.
84 */ 66 */
85SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second, 67SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second,
86 unsigned long, third, void __user *, ptr) 68 unsigned long, third, void __user *, ptr)
87{ 69{
88 struct ipc_kludge tmp; 70 struct ipc_kludge tmp;
@@ -149,17 +131,6 @@ SYSCALL_DEFINE5(ipc, uint, call, int, first, unsigned long, second,
149} 131}
150 132
151#ifdef CONFIG_64BIT 133#ifdef CONFIG_64BIT
152SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name)
153{
154 int ret = sys_newuname(name);
155
156 if (personality(current->personality) == PER_LINUX32 && !ret) {
157 ret = copy_to_user(name->machine, "s390\0\0\0\0", 8);
158 if (ret) ret = -EFAULT;
159 }
160 return ret;
161}
162
163SYSCALL_DEFINE1(s390_personality, unsigned long, personality) 134SYSCALL_DEFINE1(s390_personality, unsigned long, personality)
164{ 135{
165 int ret; 136 int ret;
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 30eca070d426..201ce6bed34e 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -98,7 +98,7 @@ SYSCALL(sys_uselib,sys_uselib,sys32_uselib_wrapper)
98SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper) 98SYSCALL(sys_swapon,sys_swapon,sys32_swapon_wrapper)
99SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper) 99SYSCALL(sys_reboot,sys_reboot,sys32_reboot_wrapper)
100SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */ 100SYSCALL(sys_ni_syscall,sys_ni_syscall,old32_readdir_wrapper) /* old readdir syscall */
101SYSCALL(sys_s390_old_mmap,sys_s390_old_mmap,old32_mmap_wrapper) /* 90 */ 101SYSCALL(sys_old_mmap,sys_old_mmap,old32_mmap_wrapper) /* 90 */
102SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper) 102SYSCALL(sys_munmap,sys_munmap,sys32_munmap_wrapper)
103SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper) 103SYSCALL(sys_truncate,sys_truncate,sys32_truncate_wrapper)
104SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper) 104SYSCALL(sys_ftruncate,sys_ftruncate,sys32_ftruncate_wrapper)
@@ -125,12 +125,12 @@ NI_SYSCALL /* vm86old for i386 */
125SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4_wrapper) 125SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4_wrapper)
126SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */ 126SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */
127SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) 127SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper)
128SYSCALL(sys_ipc,sys_ipc,sys32_ipc_wrapper) 128SYSCALL(sys_s390_ipc,sys_s390_ipc,sys32_ipc_wrapper)
129SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) 129SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper)
130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) 130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn)
131SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ 131SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */
132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) 132SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper)
133SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) 133SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper)
134NI_SYSCALL /* modify_ldt for i386 */ 134NI_SYSCALL /* modify_ldt for i386 */
135SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) 135SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper)
136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ 136SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */
diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h
index d40e691f23e2..e89dc9b1ef49 100644
--- a/arch/score/include/asm/ptrace.h
+++ b/arch/score/include/asm/ptrace.h
@@ -90,8 +90,7 @@ extern int read_tsk_short(struct task_struct *, unsigned long,
90 unsigned short *); 90 unsigned short *);
91 91
92#define arch_has_single_step() (1) 92#define arch_has_single_step() (1)
93extern void user_enable_single_step(struct task_struct *); 93
94extern void user_disable_single_step(struct task_struct *);
95#endif /* __KERNEL__ */ 94#endif /* __KERNEL__ */
96 95
97#endif /* _ASM_SCORE_PTRACE_H */ 96#endif /* _ASM_SCORE_PTRACE_H */
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 05cef5061293..8d90564c2bcf 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -183,6 +183,9 @@ config DMA_COHERENT
183config DMA_NONCOHERENT 183config DMA_NONCOHERENT
184 def_bool !DMA_COHERENT 184 def_bool !DMA_COHERENT
185 185
186config NEED_DMA_MAP_STATE
187 def_bool DMA_NONCOHERENT
188
186source "init/Kconfig" 189source "init/Kconfig"
187 190
188source "kernel/Kconfig.freezer" 191source "kernel/Kconfig.freezer"
diff --git a/arch/sh/include/asm/pci.h b/arch/sh/include/asm/pci.h
index 1042f7f0a48b..8bd952fcf3ba 100644
--- a/arch/sh/include/asm/pci.h
+++ b/arch/sh/include/asm/pci.h
@@ -83,25 +83,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
83 */ 83 */
84#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) 84#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
85 85
86/* pci_unmap_{single,page} being a nop depends upon the
87 * configuration.
88 */
89#ifdef CONFIG_DMA_NONCOHERENT
90#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
91#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
92#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
93#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
94#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
95#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
96#else
97#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
98#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
99#define pci_unmap_addr(PTR, ADDR_NAME) (0)
100#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
101#define pci_unmap_len(PTR, LEN_NAME) (0)
102#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
103#endif
104
105#ifdef CONFIG_PCI 86#ifdef CONFIG_PCI
106/* 87/*
107 * None of the SH PCI controllers support MWI, it is always treated as a 88 * None of the SH PCI controllers support MWI, it is always treated as a
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h
index e11b14ea2c43..2168fde25611 100644
--- a/arch/sh/include/asm/ptrace.h
+++ b/arch/sh/include/asm/ptrace.h
@@ -123,8 +123,6 @@ extern void show_regs(struct pt_regs *);
123struct task_struct; 123struct task_struct;
124 124
125#define arch_has_single_step() (1) 125#define arch_has_single_step() (1)
126extern void user_enable_single_step(struct task_struct *);
127extern void user_disable_single_step(struct task_struct *);
128 126
129struct perf_event; 127struct perf_event;
130struct perf_sample_data; 128struct perf_sample_data;
diff --git a/arch/sh/include/asm/syscalls.h b/arch/sh/include/asm/syscalls.h
index c1e2b8deb837..507725af2e54 100644
--- a/arch/sh/include/asm/syscalls.h
+++ b/arch/sh/include/asm/syscalls.h
@@ -3,17 +3,12 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6struct old_utsname;
7
8asmlinkage int old_mmap(unsigned long addr, unsigned long len, 6asmlinkage int old_mmap(unsigned long addr, unsigned long len,
9 unsigned long prot, unsigned long flags, 7 unsigned long prot, unsigned long flags,
10 int fd, unsigned long off); 8 int fd, unsigned long off);
11asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 9asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
12 unsigned long prot, unsigned long flags, 10 unsigned long prot, unsigned long flags,
13 unsigned long fd, unsigned long pgoff); 11 unsigned long fd, unsigned long pgoff);
14asmlinkage int sys_ipc(uint call, int first, int second,
15 int third, void __user *ptr, long fifth);
16asmlinkage int sys_uname(struct old_utsname __user *name);
17 12
18#ifdef CONFIG_SUPERH32 13#ifdef CONFIG_SUPERH32
19# include "syscalls_32.h" 14# include "syscalls_32.h"
diff --git a/arch/sh/include/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h
index 365744b05269..0e7f0fc8f086 100644
--- a/arch/sh/include/asm/unistd_32.h
+++ b/arch/sh/include/asm/unistd_32.h
@@ -358,6 +358,7 @@
358#define __ARCH_WANT_STAT64 358#define __ARCH_WANT_STAT64
359#define __ARCH_WANT_SYS_ALARM 359#define __ARCH_WANT_SYS_ALARM
360#define __ARCH_WANT_SYS_GETHOSTNAME 360#define __ARCH_WANT_SYS_GETHOSTNAME
361#define __ARCH_WANT_SYS_IPC
361#define __ARCH_WANT_SYS_PAUSE 362#define __ARCH_WANT_SYS_PAUSE
362#define __ARCH_WANT_SYS_SGETMASK 363#define __ARCH_WANT_SYS_SGETMASK
363#define __ARCH_WANT_SYS_SIGNAL 364#define __ARCH_WANT_SYS_SIGNAL
@@ -370,6 +371,7 @@
370#define __ARCH_WANT_SYS_LLSEEK 371#define __ARCH_WANT_SYS_LLSEEK
371#define __ARCH_WANT_SYS_NICE 372#define __ARCH_WANT_SYS_NICE
372#define __ARCH_WANT_SYS_OLD_GETRLIMIT 373#define __ARCH_WANT_SYS_OLD_GETRLIMIT
374#define __ARCH_WANT_SYS_OLD_UNAME
373#define __ARCH_WANT_SYS_OLDUMOUNT 375#define __ARCH_WANT_SYS_OLDUMOUNT
374#define __ARCH_WANT_SYS_SIGPENDING 376#define __ARCH_WANT_SYS_SIGPENDING
375#define __ARCH_WANT_SYS_SIGPROCMASK 377#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/sh/include/asm/unistd_64.h b/arch/sh/include/asm/unistd_64.h
index 25de158aac3a..0580c33a1e04 100644
--- a/arch/sh/include/asm/unistd_64.h
+++ b/arch/sh/include/asm/unistd_64.h
@@ -398,6 +398,7 @@
398#define __ARCH_WANT_STAT64 398#define __ARCH_WANT_STAT64
399#define __ARCH_WANT_SYS_ALARM 399#define __ARCH_WANT_SYS_ALARM
400#define __ARCH_WANT_SYS_GETHOSTNAME 400#define __ARCH_WANT_SYS_GETHOSTNAME
401#define __ARCH_WANT_SYS_IPC
401#define __ARCH_WANT_SYS_PAUSE 402#define __ARCH_WANT_SYS_PAUSE
402#define __ARCH_WANT_SYS_SGETMASK 403#define __ARCH_WANT_SYS_SGETMASK
403#define __ARCH_WANT_SYS_SIGNAL 404#define __ARCH_WANT_SYS_SIGNAL
@@ -410,6 +411,7 @@
410#define __ARCH_WANT_SYS_LLSEEK 411#define __ARCH_WANT_SYS_LLSEEK
411#define __ARCH_WANT_SYS_NICE 412#define __ARCH_WANT_SYS_NICE
412#define __ARCH_WANT_SYS_OLD_GETRLIMIT 413#define __ARCH_WANT_SYS_OLD_GETRLIMIT
414#define __ARCH_WANT_SYS_OLD_UNAME
413#define __ARCH_WANT_SYS_OLDUMOUNT 415#define __ARCH_WANT_SYS_OLDUMOUNT
414#define __ARCH_WANT_SYS_SIGPENDING 416#define __ARCH_WANT_SYS_SIGPENDING
415#define __ARCH_WANT_SYS_SIGPROCMASK 417#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 83da5debeedf..e9fa1bfed53e 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -404,7 +404,7 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
404 * If an entry has a device ID, it must match 404 * If an entry has a device ID, it must match
405 * If an entry has a connection ID, it must match 405 * If an entry has a connection ID, it must match
406 * Then we take the most specific entry - with the following 406 * Then we take the most specific entry - with the following
407 * order of precidence: dev+con > dev only > con only. 407 * order of precedence: dev+con > dev only > con only.
408 */ 408 */
409static struct clk *clk_find(const char *dev_id, const char *con_id) 409static struct clk *clk_find(const char *dev_id, const char *con_id)
410{ 410{
diff --git a/arch/sh/kernel/sys_sh.c b/arch/sh/kernel/sys_sh.c
index 71399cde03b5..81f58371613d 100644
--- a/arch/sh/kernel/sys_sh.c
+++ b/arch/sh/kernel/sys_sh.c
@@ -53,110 +53,6 @@ asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
53 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); 53 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
54} 54}
55 55
56/*
57 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
58 *
59 * This is really horribly ugly.
60 */
61asmlinkage int sys_ipc(uint call, int first, int second,
62 int third, void __user *ptr, long fifth)
63{
64 int version, ret;
65
66 version = call >> 16; /* hack for backward compatibility */
67 call &= 0xffff;
68
69 if (call <= SEMTIMEDOP)
70 switch (call) {
71 case SEMOP:
72 return sys_semtimedop(first,
73 (struct sembuf __user *)ptr,
74 second, NULL);
75 case SEMTIMEDOP:
76 return sys_semtimedop(first,
77 (struct sembuf __user *)ptr, second,
78 (const struct timespec __user *)fifth);
79 case SEMGET:
80 return sys_semget (first, second, third);
81 case SEMCTL: {
82 union semun fourth;
83 if (!ptr)
84 return -EINVAL;
85 if (get_user(fourth.__pad, (void __user * __user *) ptr))
86 return -EFAULT;
87 return sys_semctl (first, second, third, fourth);
88 }
89 default:
90 return -EINVAL;
91 }
92
93 if (call <= MSGCTL)
94 switch (call) {
95 case MSGSND:
96 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
97 second, third);
98 case MSGRCV:
99 switch (version) {
100 case 0:
101 {
102 struct ipc_kludge tmp;
103
104 if (!ptr)
105 return -EINVAL;
106
107 if (copy_from_user(&tmp,
108 (struct ipc_kludge __user *) ptr,
109 sizeof (tmp)))
110 return -EFAULT;
111
112 return sys_msgrcv (first, tmp.msgp, second,
113 tmp.msgtyp, third);
114 }
115 default:
116 return sys_msgrcv (first,
117 (struct msgbuf __user *) ptr,
118 second, fifth, third);
119 }
120 case MSGGET:
121 return sys_msgget ((key_t) first, second);
122 case MSGCTL:
123 return sys_msgctl (first, second,
124 (struct msqid_ds __user *) ptr);
125 default:
126 return -EINVAL;
127 }
128 if (call <= SHMCTL)
129 switch (call) {
130 case SHMAT:
131 switch (version) {
132 default: {
133 ulong raddr;
134 ret = do_shmat (first, (char __user *) ptr,
135 second, &raddr);
136 if (ret)
137 return ret;
138 return put_user (raddr, (ulong __user *) third);
139 }
140 case 1: /* iBCS2 emulator entry point */
141 if (!segment_eq(get_fs(), get_ds()))
142 return -EINVAL;
143 return do_shmat (first, (char __user *) ptr,
144 second, (ulong *) third);
145 }
146 case SHMDT:
147 return sys_shmdt ((char __user *)ptr);
148 case SHMGET:
149 return sys_shmget (first, second, third);
150 case SHMCTL:
151 return sys_shmctl (first, second,
152 (struct shmid_ds __user *) ptr);
153 default:
154 return -EINVAL;
155 }
156
157 return -EINVAL;
158}
159
160/* sys_cacheflush -- flush (part of) the processor cache. */ 56/* sys_cacheflush -- flush (part of) the processor cache. */
161asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op) 57asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op)
162{ 58{
@@ -197,14 +93,3 @@ asmlinkage int sys_cacheflush(unsigned long addr, unsigned long len, int op)
197 up_read(&current->mm->mmap_sem); 93 up_read(&current->mm->mmap_sem);
198 return 0; 94 return 0;
199} 95}
200
201asmlinkage int sys_uname(struct old_utsname __user *name)
202{
203 int err;
204 if (!name)
205 return -EFAULT;
206 down_read(&uts_sem);
207 err = copy_to_user(name, utsname(), sizeof(*name));
208 up_read(&uts_sem);
209 return err?-EFAULT:0;
210}
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 4097f6a10860..6db513674050 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -127,6 +127,9 @@ config ZONE_DMA
127 bool 127 bool
128 default y if SPARC32 128 default y if SPARC32
129 129
130config NEED_DMA_MAP_STATE
131 def_bool y
132
130config GENERIC_ISA_DMA 133config GENERIC_ISA_DMA
131 bool 134 bool
132 default y if SPARC32 135 default y if SPARC32
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 0e706257918f..5016f76ea98a 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -5,7 +5,8 @@
5 */ 5 */
6#include <linux/types.h> 6#include <linux/types.h>
7 7
8#define COMPAT_USER_HZ 100 8#define COMPAT_USER_HZ 100
9#define COMPAT_UTS_MACHINE "sparc\0\0"
9 10
10typedef u32 compat_size_t; 11typedef u32 compat_size_t;
11typedef s32 compat_ssize_t; 12typedef s32 compat_ssize_t;
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h
index 5a8c308e2b5c..4b4a0c0b0ccd 100644
--- a/arch/sparc/include/asm/dma-mapping.h
+++ b/arch/sparc/include/asm/dma-mapping.h
@@ -8,7 +8,6 @@
8#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 8#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
9 9
10extern int dma_supported(struct device *dev, u64 mask); 10extern int dma_supported(struct device *dev, u64 mask);
11extern int dma_set_mask(struct device *dev, u64 dma_mask);
12 11
13#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
14#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
@@ -62,4 +61,17 @@ static inline int dma_get_cache_alignment(void)
62 return (1 << INTERNODE_CACHE_SHIFT); 61 return (1 << INTERNODE_CACHE_SHIFT);
63} 62}
64 63
64static inline int dma_set_mask(struct device *dev, u64 mask)
65{
66#ifdef CONFIG_PCI
67 if (dev->bus == &pci_bus_type) {
68 if (!dev->dma_mask || !dma_supported(dev, mask))
69 return -EINVAL;
70 *dev->dma_mask = mask;
71 return 0;
72 }
73#endif
74 return -EINVAL;
75}
76
65#endif 77#endif
diff --git a/arch/sparc/include/asm/fbio.h b/arch/sparc/include/asm/fbio.h
index b9215a0907d3..0a21da87f7d6 100644
--- a/arch/sparc/include/asm/fbio.h
+++ b/arch/sparc/include/asm/fbio.h
@@ -173,7 +173,7 @@ struct mdi_cfginfo {
173 int mdi_ncluts; /* Number of implemented CLUTs in this MDI */ 173 int mdi_ncluts; /* Number of implemented CLUTs in this MDI */
174 int mdi_type; /* FBTYPE name */ 174 int mdi_type; /* FBTYPE name */
175 int mdi_height; /* height */ 175 int mdi_height; /* height */
176 int mdi_width; /* widht */ 176 int mdi_width; /* width */
177 int mdi_size; /* available ram */ 177 int mdi_size; /* available ram */
178 int mdi_mode; /* 8bpp, 16bpp or 32bpp */ 178 int mdi_mode; /* 8bpp, 16bpp or 32bpp */
179 int mdi_pixfreq; /* pixel clock (from PROM) */ 179 int mdi_pixfreq; /* pixel clock (from PROM) */
diff --git a/arch/sparc/include/asm/pci_32.h b/arch/sparc/include/asm/pci_32.h
index e769f668a4b5..332ac9ab36bc 100644
--- a/arch/sparc/include/asm/pci_32.h
+++ b/arch/sparc/include/asm/pci_32.h
@@ -32,20 +32,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
32 32
33struct pci_dev; 33struct pci_dev;
34 34
35/* pci_unmap_{single,page} is not a nop, thus... */
36#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
37 dma_addr_t ADDR_NAME;
38#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
39 __u32 LEN_NAME;
40#define pci_unmap_addr(PTR, ADDR_NAME) \
41 ((PTR)->ADDR_NAME)
42#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
43 (((PTR)->ADDR_NAME) = (VAL))
44#define pci_unmap_len(PTR, LEN_NAME) \
45 ((PTR)->LEN_NAME)
46#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
47 (((PTR)->LEN_NAME) = (VAL))
48
49#ifdef CONFIG_PCI 35#ifdef CONFIG_PCI
50static inline void pci_dma_burst_advice(struct pci_dev *pdev, 36static inline void pci_dma_burst_advice(struct pci_dev *pdev,
51 enum pci_dma_burst_strategy *strat, 37 enum pci_dma_burst_strategy *strat,
diff --git a/arch/sparc/include/asm/pci_64.h b/arch/sparc/include/asm/pci_64.h
index b0576df6ec83..5312782f0b5e 100644
--- a/arch/sparc/include/asm/pci_64.h
+++ b/arch/sparc/include/asm/pci_64.h
@@ -32,20 +32,6 @@ static inline void pcibios_penalize_isa_irq(int irq, int active)
32 */ 32 */
33#define PCI_DMA_BUS_IS_PHYS (0) 33#define PCI_DMA_BUS_IS_PHYS (0)
34 34
35/* pci_unmap_{single,page} is not a nop, thus... */
36#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
37 dma_addr_t ADDR_NAME;
38#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
39 __u32 LEN_NAME;
40#define pci_unmap_addr(PTR, ADDR_NAME) \
41 ((PTR)->ADDR_NAME)
42#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
43 (((PTR)->ADDR_NAME) = (VAL))
44#define pci_unmap_len(PTR, LEN_NAME) \
45 ((PTR)->LEN_NAME)
46#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
47 (((PTR)->LEN_NAME) = (VAL))
48
49/* PCI IOMMU mapping bypass support. */ 35/* PCI IOMMU mapping bypass support. */
50 36
51/* PCI 64-bit addressing works for all slots on all controller 37/* PCI 64-bit addressing works for all slots on all controller
diff --git a/arch/sparc/include/asm/unistd.h b/arch/sparc/include/asm/unistd.h
index cb4b9bfd0d87..d0b3b01ac9d4 100644
--- a/arch/sparc/include/asm/unistd.h
+++ b/arch/sparc/include/asm/unistd.h
@@ -432,7 +432,9 @@
432#define __ARCH_WANT_SYS_SIGPENDING 432#define __ARCH_WANT_SYS_SIGPENDING
433#define __ARCH_WANT_SYS_SIGPROCMASK 433#define __ARCH_WANT_SYS_SIGPROCMASK
434#define __ARCH_WANT_SYS_RT_SIGSUSPEND 434#define __ARCH_WANT_SYS_RT_SIGSUSPEND
435#ifndef __32bit_syscall_numbers__ 435#ifdef __32bit_syscall_numbers__
436#define __ARCH_WANT_SYS_IPC
437#else
436#define __ARCH_WANT_COMPAT_SYS_TIME 438#define __ARCH_WANT_COMPAT_SYS_TIME
437#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND 439#define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
438#endif 440#endif
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 5fad94950e76..8414549c1834 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -862,13 +862,3 @@ int dma_supported(struct device *dev, u64 device_mask)
862 return 0; 862 return 0;
863} 863}
864EXPORT_SYMBOL(dma_supported); 864EXPORT_SYMBOL(dma_supported);
865
866int dma_set_mask(struct device *dev, u64 dma_mask)
867{
868#ifdef CONFIG_PCI
869 if (dev->bus == &pci_bus_type)
870 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
871#endif
872 return -EINVAL;
873}
874EXPORT_SYMBOL(dma_set_mask);
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 3c8c44f6a41c..84e5386714cd 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -676,17 +676,6 @@ int dma_supported(struct device *dev, u64 mask)
676} 676}
677EXPORT_SYMBOL(dma_supported); 677EXPORT_SYMBOL(dma_supported);
678 678
679int dma_set_mask(struct device *dev, u64 dma_mask)
680{
681#ifdef CONFIG_PCI
682 if (dev->bus == &pci_bus_type)
683 return pci_set_dma_mask(to_pci_dev(dev), dma_mask);
684#endif
685 return -EOPNOTSUPP;
686}
687EXPORT_SYMBOL(dma_set_mask);
688
689
690#ifdef CONFIG_PROC_FS 679#ifdef CONFIG_PROC_FS
691 680
692static int sparc_io_proc_show(struct seq_file *m, void *v) 681static int sparc_io_proc_show(struct seq_file *m, void *v)
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 9f2b2bac8b2b..b867ab3353b4 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -1353,7 +1353,7 @@ static void perf_callchain_user_32(struct pt_regs *regs,
1353} 1353}
1354 1354
1355/* Like powerpc we can't get PMU interrupts within the PMU handler, 1355/* Like powerpc we can't get PMU interrupts within the PMU handler,
1356 * so no need for seperate NMI and IRQ chains as on x86. 1356 * so no need for separate NMI and IRQ chains as on x86.
1357 */ 1357 */
1358static DEFINE_PER_CPU(struct perf_callchain_entry, callchain); 1358static DEFINE_PER_CPU(struct perf_callchain_entry, callchain);
1359 1359
diff --git a/arch/sparc/kernel/sys_sparc_32.c b/arch/sparc/kernel/sys_sparc_32.c
index 3a82e65d8db2..ee995b7dae7e 100644
--- a/arch/sparc/kernel/sys_sparc_32.c
+++ b/arch/sparc/kernel/sys_sparc_32.c
@@ -98,119 +98,6 @@ out:
98 return error; 98 return error;
99} 99}
100 100
101/*
102 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
103 *
104 * This is really horribly ugly.
105 */
106
107asmlinkage int sys_ipc (uint call, int first, int second, int third, void __user *ptr, long fifth)
108{
109 int version, err;
110
111 version = call >> 16; /* hack for backward compatibility */
112 call &= 0xffff;
113
114 if (call <= SEMCTL)
115 switch (call) {
116 case SEMOP:
117 err = sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
118 goto out;
119 case SEMTIMEDOP:
120 err = sys_semtimedop (first, (struct sembuf __user *)ptr, second, (const struct timespec __user *) fifth);
121 goto out;
122 case SEMGET:
123 err = sys_semget (first, second, third);
124 goto out;
125 case SEMCTL: {
126 union semun fourth;
127 err = -EINVAL;
128 if (!ptr)
129 goto out;
130 err = -EFAULT;
131 if (get_user(fourth.__pad,
132 (void __user * __user *)ptr))
133 goto out;
134 err = sys_semctl (first, second, third, fourth);
135 goto out;
136 }
137 default:
138 err = -ENOSYS;
139 goto out;
140 }
141 if (call <= MSGCTL)
142 switch (call) {
143 case MSGSND:
144 err = sys_msgsnd (first, (struct msgbuf __user *) ptr,
145 second, third);
146 goto out;
147 case MSGRCV:
148 switch (version) {
149 case 0: {
150 struct ipc_kludge tmp;
151 err = -EINVAL;
152 if (!ptr)
153 goto out;
154 err = -EFAULT;
155 if (copy_from_user(&tmp, (struct ipc_kludge __user *) ptr, sizeof (tmp)))
156 goto out;
157 err = sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third);
158 goto out;
159 }
160 case 1: default:
161 err = sys_msgrcv (first,
162 (struct msgbuf __user *) ptr,
163 second, fifth, third);
164 goto out;
165 }
166 case MSGGET:
167 err = sys_msgget ((key_t) first, second);
168 goto out;
169 case MSGCTL:
170 err = sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
171 goto out;
172 default:
173 err = -ENOSYS;
174 goto out;
175 }
176 if (call <= SHMCTL)
177 switch (call) {
178 case SHMAT:
179 switch (version) {
180 case 0: default: {
181 ulong raddr;
182 err = do_shmat (first, (char __user *) ptr, second, &raddr);
183 if (err)
184 goto out;
185 err = -EFAULT;
186 if (put_user (raddr, (ulong __user *) third))
187 goto out;
188 err = 0;
189 goto out;
190 }
191 case 1: /* iBCS2 emulator entry point */
192 err = -EINVAL;
193 goto out;
194 }
195 case SHMDT:
196 err = sys_shmdt ((char __user *)ptr);
197 goto out;
198 case SHMGET:
199 err = sys_shmget (first, second, third);
200 goto out;
201 case SHMCTL:
202 err = sys_shmctl (first, second, (struct shmid_ds __user *) ptr);
203 goto out;
204 default:
205 err = -ENOSYS;
206 goto out;
207 }
208 else
209 err = -ENOSYS;
210out:
211 return err;
212}
213
214int sparc_mmap_check(unsigned long addr, unsigned long len) 101int sparc_mmap_check(unsigned long addr, unsigned long len)
215{ 102{
216 if (ARCH_SUN4C && 103 if (ARCH_SUN4C &&
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index cb1bef6f14b7..3d435c42e6db 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -426,7 +426,7 @@ out:
426 * This is really horribly ugly. 426 * This is really horribly ugly.
427 */ 427 */
428 428
429SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second, 429SYSCALL_DEFINE6(sparc_ipc, unsigned int, call, int, first, unsigned long, second,
430 unsigned long, third, void __user *, ptr, long, fifth) 430 unsigned long, third, void __user *, ptr, long, fifth)
431{ 431{
432 long err; 432 long err;
@@ -510,17 +510,6 @@ out:
510 return err; 510 return err;
511} 511}
512 512
513SYSCALL_DEFINE1(sparc64_newuname, struct new_utsname __user *, name)
514{
515 int ret = sys_newuname(name);
516
517 if (current->personality == PER_LINUX32 && !ret) {
518 ret = (copy_to_user(name->machine, "sparc\0\0", 8)
519 ? -EFAULT : 0);
520 }
521 return ret;
522}
523
524SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality) 513SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality)
525{ 514{
526 int ret; 515 int ret;
diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h
index 68312fe8da74..118759cd7342 100644
--- a/arch/sparc/kernel/systbls.h
+++ b/arch/sparc/kernel/systbls.h
@@ -6,15 +6,12 @@
6#include <asm/utrap.h> 6#include <asm/utrap.h>
7#include <asm/signal.h> 7#include <asm/signal.h>
8 8
9struct new_utsname;
10
11extern asmlinkage unsigned long sys_getpagesize(void); 9extern asmlinkage unsigned long sys_getpagesize(void);
12extern asmlinkage long sparc_pipe(struct pt_regs *regs); 10extern asmlinkage long sparc_pipe(struct pt_regs *regs);
13extern asmlinkage long sys_ipc(unsigned int call, int first, 11extern asmlinkage long sys_sparc_ipc(unsigned int call, int first,
14 unsigned long second, 12 unsigned long second,
15 unsigned long third, 13 unsigned long third,
16 void __user *ptr, long fifth); 14 void __user *ptr, long fifth);
17extern asmlinkage long sparc64_newuname(struct new_utsname __user *name);
18extern asmlinkage long sparc64_personality(unsigned long personality); 15extern asmlinkage long sparc64_personality(unsigned long personality);
19extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); 16extern asmlinkage long sys64_munmap(unsigned long addr, size_t len);
20extern asmlinkage unsigned long sys64_mremap(unsigned long addr, 17extern asmlinkage unsigned long sys64_mremap(unsigned long addr,
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 17614251fb6d..9db058dd039e 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -55,7 +55,7 @@ sys_call_table32:
55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents 55/*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents
56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr 56 .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr
57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall 57/*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall
58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_sparc64_newuname 58 .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_newuname
59/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl 59/*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl
60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask 60 .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask
61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir 61/*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir
@@ -130,13 +130,13 @@ sys_call_table:
130/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents 130/*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents
131 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr 131 .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr
132/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall 132/*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall
133 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_sparc64_newuname 133 .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname
134/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl 134/*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl
135 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask 135 .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask
136/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall 136/*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall
137 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64 137 .word sys_readahead, sys_socketcall, sys_syslog, sys_lookup_dcookie, sys_fadvise64
138/*210*/ .word sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo 138/*210*/ .word sys_fadvise64_64, sys_tgkill, sys_waitpid, sys_swapoff, sys_sysinfo
139 .word sys_ipc, sys_nis_syscall, sys_clone, sys_ioprio_get, sys_adjtimex 139 .word sys_sparc_ipc, sys_nis_syscall, sys_clone, sys_ioprio_get, sys_adjtimex
140/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid 140/*220*/ .word sys_nis_syscall, sys_ni_syscall, sys_delete_module, sys_ni_syscall, sys_getpgid
141 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid 141 .word sys_bdflush, sys_sysfs, sys_nis_syscall, sys_setfsuid, sys_setfsgid
142/*230*/ .word sys_select, sys_nis_syscall, sys_splice, sys_stime, sys_statfs64 142/*230*/ .word sys_select, sys_nis_syscall, sys_splice, sys_stime, sys_statfs64
diff --git a/arch/um/include/asm/dma-mapping.h b/arch/um/include/asm/dma-mapping.h
index 378de4bbf49f..b948c14a7867 100644
--- a/arch/um/include/asm/dma-mapping.h
+++ b/arch/um/include/asm/dma-mapping.h
@@ -104,14 +104,6 @@ dma_get_cache_alignment(void)
104} 104}
105 105
106static inline void 106static inline void
107dma_sync_single_range(struct device *dev, dma_addr_t dma_handle,
108 unsigned long offset, size_t size,
109 enum dma_data_direction direction)
110{
111 BUG();
112}
113
114static inline void
115dma_cache_sync(struct device *dev, void *vaddr, size_t size, 107dma_cache_sync(struct device *dev, void *vaddr, size_t size,
116 enum dma_data_direction direction) 108 enum dma_data_direction direction)
117{ 109{
diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h
index 6c8899013c92..2cd899f75a3c 100644
--- a/arch/um/include/asm/ptrace-generic.h
+++ b/arch/um/include/asm/ptrace-generic.h
@@ -16,6 +16,8 @@ struct pt_regs {
16 struct uml_pt_regs regs; 16 struct uml_pt_regs regs;
17}; 17};
18 18
19#define arch_has_single_step() (1)
20
19#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS } 21#define EMPTY_REGS { .regs = EMPTY_UML_PT_REGS }
20 22
21#define PT_REGS_IP(r) UPT_IP(&(r)->regs) 23#define PT_REGS_IP(r) UPT_IP(&(r)->regs)
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 8e3d69e4fcb5..484509948ee9 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -12,16 +12,25 @@
12#endif 12#endif
13#include "skas_ptrace.h" 13#include "skas_ptrace.h"
14 14
15static inline void set_singlestepping(struct task_struct *child, int on) 15
16
17void user_enable_single_step(struct task_struct *child)
16{ 18{
17 if (on) 19 child->ptrace |= PT_DTRACE;
18 child->ptrace |= PT_DTRACE;
19 else
20 child->ptrace &= ~PT_DTRACE;
21 child->thread.singlestep_syscall = 0; 20 child->thread.singlestep_syscall = 0;
22 21
23#ifdef SUBARCH_SET_SINGLESTEPPING 22#ifdef SUBARCH_SET_SINGLESTEPPING
24 SUBARCH_SET_SINGLESTEPPING(child, on); 23 SUBARCH_SET_SINGLESTEPPING(child, 1);
24#endif
25}
26
27void user_disable_single_step(struct task_struct *child)
28{
29 child->ptrace &= ~PT_DTRACE;
30 child->thread.singlestep_syscall = 0;
31
32#ifdef SUBARCH_SET_SINGLESTEPPING
33 SUBARCH_SET_SINGLESTEPPING(child, 0);
25#endif 34#endif
26} 35}
27 36
@@ -30,7 +39,7 @@ static inline void set_singlestepping(struct task_struct *child, int on)
30 */ 39 */
31void ptrace_disable(struct task_struct *child) 40void ptrace_disable(struct task_struct *child)
32{ 41{
33 set_singlestepping(child,0); 42 user_disable_single_step(child);
34} 43}
35 44
36extern int peek_user(struct task_struct * child, long addr, long data); 45extern int peek_user(struct task_struct * child, long addr, long data);
@@ -69,53 +78,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
69 ret = -EIO; 78 ret = -EIO;
70 break; 79 break;
71 80
72 /* continue and stop at next (return from) syscall */
73 case PTRACE_SYSCALL:
74 /* restart after signal. */
75 case PTRACE_CONT: {
76 ret = -EIO;
77 if (!valid_signal(data))
78 break;
79
80 set_singlestepping(child, 0);
81 if (request == PTRACE_SYSCALL)
82 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
83 else clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
84 child->exit_code = data;
85 wake_up_process(child);
86 ret = 0;
87 break;
88 }
89
90/*
91 * make the child exit. Best I can do is send it a sigkill.
92 * perhaps it should be put in the status that it wants to
93 * exit.
94 */
95 case PTRACE_KILL: {
96 ret = 0;
97 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
98 break;
99
100 set_singlestepping(child, 0);
101 child->exit_code = SIGKILL;
102 wake_up_process(child);
103 break;
104 }
105
106 case PTRACE_SINGLESTEP: { /* set the trap flag. */
107 ret = -EIO;
108 if (!valid_signal(data))
109 break;
110 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
111 set_singlestepping(child, 1);
112 child->exit_code = data;
113 /* give it a chance to run. */
114 wake_up_process(child);
115 ret = 0;
116 break;
117 }
118
119#ifdef PTRACE_GETREGS 81#ifdef PTRACE_GETREGS
120 case PTRACE_GETREGS: { /* Get all gp regs from the child. */ 82 case PTRACE_GETREGS: { /* Get all gp regs from the child. */
121 if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) { 83 if (!access_ok(VERIFY_WRITE, p, MAX_REG_OFFSET)) {
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index cccab850c27e..4393173923f5 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -51,51 +51,6 @@ long old_mmap(unsigned long addr, unsigned long len,
51 return err; 51 return err;
52} 52}
53 53
54long sys_uname(struct old_utsname __user * name)
55{
56 long err;
57 if (!name)
58 return -EFAULT;
59 down_read(&uts_sem);
60 err = copy_to_user(name, utsname(), sizeof (*name));
61 up_read(&uts_sem);
62 return err?-EFAULT:0;
63}
64
65long sys_olduname(struct oldold_utsname __user * name)
66{
67 long error;
68
69 if (!name)
70 return -EFAULT;
71 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
72 return -EFAULT;
73
74 down_read(&uts_sem);
75
76 error = __copy_to_user(&name->sysname, &utsname()->sysname,
77 __OLD_UTS_LEN);
78 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
79 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
80 __OLD_UTS_LEN);
81 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
82 error |= __copy_to_user(&name->release, &utsname()->release,
83 __OLD_UTS_LEN);
84 error |= __put_user(0, name->release + __OLD_UTS_LEN);
85 error |= __copy_to_user(&name->version, &utsname()->version,
86 __OLD_UTS_LEN);
87 error |= __put_user(0, name->version + __OLD_UTS_LEN);
88 error |= __copy_to_user(&name->machine, &utsname()->machine,
89 __OLD_UTS_LEN);
90 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
91
92 up_read(&uts_sem);
93
94 error = error ? -EFAULT : 0;
95
96 return error;
97}
98
99int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 54int kernel_execve(const char *filename, char *const argv[], char *const envp[])
100{ 55{
101 mm_segment_t fs; 56 mm_segment_t fs;
diff --git a/arch/um/sys-i386/shared/sysdep/syscalls.h b/arch/um/sys-i386/shared/sysdep/syscalls.h
index e7787679e317..05cb796aecb5 100644
--- a/arch/um/sys-i386/shared/sysdep/syscalls.h
+++ b/arch/um/sys-i386/shared/sysdep/syscalls.h
@@ -13,8 +13,6 @@ typedef long syscall_handler_t(struct pt_regs);
13 */ 13 */
14extern syscall_handler_t sys_rt_sigaction; 14extern syscall_handler_t sys_rt_sigaction;
15 15
16extern syscall_handler_t old_mmap_i386;
17
18extern syscall_handler_t *sys_call_table[]; 16extern syscall_handler_t *sys_call_table[];
19 17
20#define EXECUTE_SYSCALL(syscall, regs) \ 18#define EXECUTE_SYSCALL(syscall, regs) \
diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S
index c6260dd6ebb9..de274071455d 100644
--- a/arch/um/sys-i386/sys_call_table.S
+++ b/arch/um/sys-i386/sys_call_table.S
@@ -7,7 +7,7 @@
7#define sys_vm86old sys_ni_syscall 7#define sys_vm86old sys_ni_syscall
8#define sys_vm86 sys_ni_syscall 8#define sys_vm86 sys_ni_syscall
9 9
10#define old_mmap old_mmap_i386 10#define old_mmap sys_old_mmap
11 11
12#define ptregs_fork sys_fork 12#define ptregs_fork sys_fork
13#define ptregs_execve sys_execve 13#define ptregs_execve sys_execve
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c
index 857ca0b3bdef..70ca357393b8 100644
--- a/arch/um/sys-i386/syscalls.c
+++ b/arch/um/sys-i386/syscalls.c
@@ -12,57 +12,6 @@
12#include "asm/unistd.h" 12#include "asm/unistd.h"
13 13
14/* 14/*
15 * Perform the select(nd, in, out, ex, tv) and mmap() system
16 * calls. Linux/i386 didn't use to be able to handle more than
17 * 4 system call parameters, so these system calls used a memory
18 * block for parameter passing..
19 */
20
21struct mmap_arg_struct {
22 unsigned long addr;
23 unsigned long len;
24 unsigned long prot;
25 unsigned long flags;
26 unsigned long fd;
27 unsigned long offset;
28};
29
30extern int old_mmap(unsigned long addr, unsigned long len,
31 unsigned long prot, unsigned long flags,
32 unsigned long fd, unsigned long offset);
33
34long old_mmap_i386(struct mmap_arg_struct __user *arg)
35{
36 struct mmap_arg_struct a;
37 int err = -EFAULT;
38
39 if (copy_from_user(&a, arg, sizeof(a)))
40 goto out;
41
42 err = old_mmap(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
43 out:
44 return err;
45}
46
47struct sel_arg_struct {
48 unsigned long n;
49 fd_set __user *inp;
50 fd_set __user *outp;
51 fd_set __user *exp;
52 struct timeval __user *tvp;
53};
54
55long old_select(struct sel_arg_struct __user *arg)
56{
57 struct sel_arg_struct a;
58
59 if (copy_from_user(&a, arg, sizeof(a)))
60 return -EFAULT;
61 /* sys_select() does the appropriate kernel locking */
62 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
63}
64
65/*
66 * The prototype on i386 is: 15 * The prototype on i386 is:
67 * 16 *
68 * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr) 17 * int clone(int flags, void * child_stack, int * parent_tidptr, struct user_desc * newtls, int * child_tidptr)
@@ -85,92 +34,6 @@ long sys_clone(unsigned long clone_flags, unsigned long newsp,
85 return ret; 34 return ret;
86} 35}
87 36
88/*
89 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
90 *
91 * This is really horribly ugly.
92 */
93long sys_ipc (uint call, int first, int second,
94 int third, void __user *ptr, long fifth)
95{
96 int version, ret;
97
98 version = call >> 16; /* hack for backward compatibility */
99 call &= 0xffff;
100
101 switch (call) {
102 case SEMOP:
103 return sys_semtimedop(first, (struct sembuf __user *) ptr,
104 second, NULL);
105 case SEMTIMEDOP:
106 return sys_semtimedop(first, (struct sembuf __user *) ptr,
107 second,
108 (const struct timespec __user *) fifth);
109 case SEMGET:
110 return sys_semget (first, second, third);
111 case SEMCTL: {
112 union semun fourth;
113 if (!ptr)
114 return -EINVAL;
115 if (get_user(fourth.__pad, (void __user * __user *) ptr))
116 return -EFAULT;
117 return sys_semctl (first, second, third, fourth);
118 }
119
120 case MSGSND:
121 return sys_msgsnd (first, (struct msgbuf *) ptr,
122 second, third);
123 case MSGRCV:
124 switch (version) {
125 case 0: {
126 struct ipc_kludge tmp;
127 if (!ptr)
128 return -EINVAL;
129
130 if (copy_from_user(&tmp,
131 (struct ipc_kludge *) ptr,
132 sizeof (tmp)))
133 return -EFAULT;
134 return sys_msgrcv (first, tmp.msgp, second,
135 tmp.msgtyp, third);
136 }
137 default:
138 panic("msgrcv with version != 0");
139 return sys_msgrcv (first,
140 (struct msgbuf *) ptr,
141 second, fifth, third);
142 }
143 case MSGGET:
144 return sys_msgget ((key_t) first, second);
145 case MSGCTL:
146 return sys_msgctl (first, second, (struct msqid_ds *) ptr);
147
148 case SHMAT:
149 switch (version) {
150 default: {
151 ulong raddr;
152 ret = do_shmat (first, (char *) ptr, second, &raddr);
153 if (ret)
154 return ret;
155 return put_user (raddr, (ulong *) third);
156 }
157 case 1: /* iBCS2 emulator entry point */
158 if (!segment_eq(get_fs(), get_ds()))
159 return -EINVAL;
160 return do_shmat (first, (char *) ptr, second, (ulong *) third);
161 }
162 case SHMDT:
163 return sys_shmdt ((char *)ptr);
164 case SHMGET:
165 return sys_shmget (first, second, third);
166 case SHMCTL:
167 return sys_shmctl (first, second,
168 (struct shmid_ds *) ptr);
169 default:
170 return -ENOSYS;
171 }
172}
173
174long sys_sigaction(int sig, const struct old_sigaction __user *act, 37long sys_sigaction(int sig, const struct old_sigaction __user *act,
175 struct old_sigaction __user *oact) 38 struct old_sigaction __user *oact)
176{ 39{
diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c
index dd21d69715e6..47d469e7e7ce 100644
--- a/arch/um/sys-x86_64/syscall_table.c
+++ b/arch/um/sys-x86_64/syscall_table.c
@@ -26,11 +26,6 @@
26 26
27/* On UML we call it this way ("old" means it's not mmap2) */ 27/* On UML we call it this way ("old" means it's not mmap2) */
28#define sys_mmap old_mmap 28#define sys_mmap old_mmap
29/*
30 * On x86-64 sys_uname is actually sys_newuname plus a compatibility trick.
31 * See arch/x86_64/kernel/sys_x86_64.c
32 */
33#define sys_uname sys_uname64
34 29
35#define stub_clone sys_clone 30#define stub_clone sys_clone
36#define stub_fork sys_fork 31#define stub_fork sys_fork
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c
index f1199fd34d38..f3d82bb6e15a 100644
--- a/arch/um/sys-x86_64/syscalls.c
+++ b/arch/um/sys-x86_64/syscalls.c
@@ -12,20 +12,6 @@
12#include "asm/uaccess.h" 12#include "asm/uaccess.h"
13#include "os.h" 13#include "os.h"
14 14
15asmlinkage long sys_uname64(struct new_utsname __user * name)
16{
17 int err;
18
19 down_read(&uts_sem);
20 err = copy_to_user(name, utsname(), sizeof (*name));
21 up_read(&uts_sem);
22
23 if (personality(current->personality) == PER_LINUX32)
24 err |= copy_to_user(&name->machine, "i686", 5);
25
26 return err ? -EFAULT : 0;
27}
28
29long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) 15long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr)
30{ 16{
31 unsigned long *ptr = addr, tmp; 17 unsigned long *ptr = addr, tmp;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e98440371525..93936de67796 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -102,6 +102,9 @@ config ZONE_DMA
102config SBUS 102config SBUS
103 bool 103 bool
104 104
105config NEED_DMA_MAP_STATE
106 def_bool (X86_64 || DMAR || DMA_API_DEBUG)
107
105config GENERIC_ISA_DMA 108config GENERIC_ISA_DMA
106 def_bool y 109 def_bool y
107 110
diff --git a/arch/x86/crypto/twofish-i586-asm_32.S b/arch/x86/crypto/twofish-i586-asm_32.S
index 39b98ed2c1b9..575331cb2a8a 100644
--- a/arch/x86/crypto/twofish-i586-asm_32.S
+++ b/arch/x86/crypto/twofish-i586-asm_32.S
@@ -22,7 +22,7 @@
22 22
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24 24
25/* return adress at 0 */ 25/* return address at 0 */
26 26
27#define in_blk 12 /* input byte array address parameter*/ 27#define in_blk 12 /* input byte array address parameter*/
28#define out_blk 8 /* output byte array address parameter*/ 28#define out_blk 8 /* output byte array address parameter*/
@@ -230,8 +230,8 @@ twofish_enc_blk:
230 push %edi 230 push %edi
231 231
232 mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ 232 mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */
233 add $crypto_tfm_ctx_offset, %ebp /* ctx adress */ 233 add $crypto_tfm_ctx_offset, %ebp /* ctx address */
234 mov in_blk+16(%esp),%edi /* input adress in edi */ 234 mov in_blk+16(%esp),%edi /* input address in edi */
235 235
236 mov (%edi), %eax 236 mov (%edi), %eax
237 mov b_offset(%edi), %ebx 237 mov b_offset(%edi), %ebx
@@ -286,8 +286,8 @@ twofish_dec_blk:
286 286
287 287
288 mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */ 288 mov tfm + 16(%esp), %ebp /* abuse the base pointer: set new base bointer to the crypto tfm */
289 add $crypto_tfm_ctx_offset, %ebp /* ctx adress */ 289 add $crypto_tfm_ctx_offset, %ebp /* ctx address */
290 mov in_blk+16(%esp),%edi /* input adress in edi */ 290 mov in_blk+16(%esp),%edi /* input address in edi */
291 291
292 mov (%edi), %eax 292 mov (%edi), %eax
293 mov b_offset(%edi), %ebx 293 mov b_offset(%edi), %ebx
diff --git a/arch/x86/crypto/twofish-x86_64-asm_64.S b/arch/x86/crypto/twofish-x86_64-asm_64.S
index 35974a586615..573aa102542e 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64.S
@@ -221,11 +221,11 @@
221twofish_enc_blk: 221twofish_enc_blk:
222 pushq R1 222 pushq R1
223 223
224 /* %rdi contains the crypto tfm adress */ 224 /* %rdi contains the crypto tfm address */
225 /* %rsi contains the output adress */ 225 /* %rsi contains the output address */
226 /* %rdx contains the input adress */ 226 /* %rdx contains the input address */
227 add $crypto_tfm_ctx_offset, %rdi /* set ctx adress */ 227 add $crypto_tfm_ctx_offset, %rdi /* set ctx address */
228 /* ctx adress is moved to free one non-rex register 228 /* ctx address is moved to free one non-rex register
229 as target for the 8bit high operations */ 229 as target for the 8bit high operations */
230 mov %rdi, %r11 230 mov %rdi, %r11
231 231
@@ -274,11 +274,11 @@ twofish_enc_blk:
274twofish_dec_blk: 274twofish_dec_blk:
275 pushq R1 275 pushq R1
276 276
277 /* %rdi contains the crypto tfm adress */ 277 /* %rdi contains the crypto tfm address */
278 /* %rsi contains the output adress */ 278 /* %rsi contains the output address */
279 /* %rdx contains the input adress */ 279 /* %rdx contains the input address */
280 add $crypto_tfm_ctx_offset, %rdi /* set ctx adress */ 280 add $crypto_tfm_ctx_offset, %rdi /* set ctx address */
281 /* ctx adress is moved to free one non-rex register 281 /* ctx address is moved to free one non-rex register
282 as target for the 8bit high operations */ 282 as target for the 8bit high operations */
283 mov %rdi, %r11 283 mov %rdi, %r11
284 284
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 53147ad85b96..59b4556a5b92 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -563,7 +563,7 @@ ia32_sys_call_table:
563 .quad quiet_ni_syscall /* old mpx syscall holder */ 563 .quad quiet_ni_syscall /* old mpx syscall holder */
564 .quad sys_setpgid 564 .quad sys_setpgid
565 .quad quiet_ni_syscall /* old ulimit syscall holder */ 565 .quad quiet_ni_syscall /* old ulimit syscall holder */
566 .quad sys32_olduname 566 .quad sys_olduname
567 .quad sys_umask /* 60 */ 567 .quad sys_umask /* 60 */
568 .quad sys_chroot 568 .quad sys_chroot
569 .quad compat_sys_ustat 569 .quad compat_sys_ustat
@@ -586,7 +586,7 @@ ia32_sys_call_table:
586 .quad compat_sys_settimeofday 586 .quad compat_sys_settimeofday
587 .quad sys_getgroups16 /* 80 */ 587 .quad sys_getgroups16 /* 80 */
588 .quad sys_setgroups16 588 .quad sys_setgroups16
589 .quad sys32_old_select 589 .quad compat_sys_old_select
590 .quad sys_symlink 590 .quad sys_symlink
591 .quad sys_lstat 591 .quad sys_lstat
592 .quad sys_readlink /* 85 */ 592 .quad sys_readlink /* 85 */
@@ -613,7 +613,7 @@ ia32_sys_call_table:
613 .quad compat_sys_newstat 613 .quad compat_sys_newstat
614 .quad compat_sys_newlstat 614 .quad compat_sys_newlstat
615 .quad compat_sys_newfstat 615 .quad compat_sys_newfstat
616 .quad sys32_uname 616 .quad sys_uname
617 .quad stub32_iopl /* 110 */ 617 .quad stub32_iopl /* 110 */
618 .quad sys_vhangup 618 .quad sys_vhangup
619 .quad quiet_ni_syscall /* old "idle" system call */ 619 .quad quiet_ni_syscall /* old "idle" system call */
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 422572c77923..74c35431b7d8 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -143,7 +143,7 @@ asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
143 * block for parameter passing.. 143 * block for parameter passing..
144 */ 144 */
145 145
146struct mmap_arg_struct { 146struct mmap_arg_struct32 {
147 unsigned int addr; 147 unsigned int addr;
148 unsigned int len; 148 unsigned int len;
149 unsigned int prot; 149 unsigned int prot;
@@ -152,9 +152,9 @@ struct mmap_arg_struct {
152 unsigned int offset; 152 unsigned int offset;
153}; 153};
154 154
155asmlinkage long sys32_mmap(struct mmap_arg_struct __user *arg) 155asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *arg)
156{ 156{
157 struct mmap_arg_struct a; 157 struct mmap_arg_struct32 a;
158 158
159 if (copy_from_user(&a, arg, sizeof(a))) 159 if (copy_from_user(&a, arg, sizeof(a)))
160 return -EFAULT; 160 return -EFAULT;
@@ -332,24 +332,6 @@ asmlinkage long sys32_alarm(unsigned int seconds)
332 return alarm_setitimer(seconds); 332 return alarm_setitimer(seconds);
333} 333}
334 334
335struct sel_arg_struct {
336 unsigned int n;
337 unsigned int inp;
338 unsigned int outp;
339 unsigned int exp;
340 unsigned int tvp;
341};
342
343asmlinkage long sys32_old_select(struct sel_arg_struct __user *arg)
344{
345 struct sel_arg_struct a;
346
347 if (copy_from_user(&a, arg, sizeof(a)))
348 return -EFAULT;
349 return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
350 compat_ptr(a.exp), compat_ptr(a.tvp));
351}
352
353asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, 335asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
354 int options) 336 int options)
355{ 337{
@@ -466,58 +448,6 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
466 return ret; 448 return ret;
467} 449}
468 450
469asmlinkage long sys32_olduname(struct oldold_utsname __user *name)
470{
471 char *arch = "x86_64";
472 int err;
473
474 if (!name)
475 return -EFAULT;
476 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
477 return -EFAULT;
478
479 down_read(&uts_sem);
480
481 err = __copy_to_user(&name->sysname, &utsname()->sysname,
482 __OLD_UTS_LEN);
483 err |= __put_user(0, name->sysname+__OLD_UTS_LEN);
484 err |= __copy_to_user(&name->nodename, &utsname()->nodename,
485 __OLD_UTS_LEN);
486 err |= __put_user(0, name->nodename+__OLD_UTS_LEN);
487 err |= __copy_to_user(&name->release, &utsname()->release,
488 __OLD_UTS_LEN);
489 err |= __put_user(0, name->release+__OLD_UTS_LEN);
490 err |= __copy_to_user(&name->version, &utsname()->version,
491 __OLD_UTS_LEN);
492 err |= __put_user(0, name->version+__OLD_UTS_LEN);
493
494 if (personality(current->personality) == PER_LINUX32)
495 arch = "i686";
496
497 err |= __copy_to_user(&name->machine, arch, strlen(arch) + 1);
498
499 up_read(&uts_sem);
500
501 err = err ? -EFAULT : 0;
502
503 return err;
504}
505
506long sys32_uname(struct old_utsname __user *name)
507{
508 int err;
509
510 if (!name)
511 return -EFAULT;
512 down_read(&uts_sem);
513 err = copy_to_user(name, utsname(), sizeof(*name));
514 up_read(&uts_sem);
515 if (personality(current->personality) == PER_LINUX32)
516 err |= copy_to_user(&name->machine, "i686", 5);
517
518 return err ? -EFAULT : 0;
519}
520
521asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, 451asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
522 compat_uptr_t __user *envp, struct pt_regs *regs) 452 compat_uptr_t __user *envp, struct pt_regs *regs)
523{ 453{
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index 9a9c7bdc923d..306160e58b48 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -8,7 +8,8 @@
8#include <linux/sched.h> 8#include <linux/sched.h>
9#include <asm/user32.h> 9#include <asm/user32.h>
10 10
11#define COMPAT_USER_HZ 100 11#define COMPAT_USER_HZ 100
12#define COMPAT_UTS_MACHINE "i686\0\0"
12 13
13typedef u32 compat_size_t; 14typedef u32 compat_size_t;
14typedef s32 compat_ssize_t; 15typedef s32 compat_ssize_t;
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 3e002ca5a287..404a880ea325 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -97,34 +97,6 @@ extern void pci_iommu_alloc(void);
97 97
98#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys) 98#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
99 99
100#if defined(CONFIG_X86_64) || defined(CONFIG_DMAR) || defined(CONFIG_DMA_API_DEBUG)
101
102#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
103 dma_addr_t ADDR_NAME;
104#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
105 __u32 LEN_NAME;
106#define pci_unmap_addr(PTR, ADDR_NAME) \
107 ((PTR)->ADDR_NAME)
108#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
109 (((PTR)->ADDR_NAME) = (VAL))
110#define pci_unmap_len(PTR, LEN_NAME) \
111 ((PTR)->LEN_NAME)
112#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
113 (((PTR)->LEN_NAME) = (VAL))
114
115#else
116
117#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME[0];
118#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) unsigned LEN_NAME[0];
119#define pci_unmap_addr(PTR, ADDR_NAME) sizeof((PTR)->ADDR_NAME)
120#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
121 do { break; } while (pci_unmap_addr(PTR, ADDR_NAME))
122#define pci_unmap_len(PTR, LEN_NAME) sizeof((PTR)->LEN_NAME)
123#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
124 do { break; } while (pci_unmap_len(PTR, LEN_NAME))
125
126#endif
127
128#endif /* __KERNEL__ */ 100#endif /* __KERNEL__ */
129 101
130#ifdef CONFIG_X86_64 102#ifdef CONFIG_X86_64
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 20102808b191..69a686a7dff0 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -274,14 +274,7 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
274 return 0; 274 return 0;
275} 275}
276 276
277/*
278 * These are defined as per linux/ptrace.h, which see.
279 */
280#define arch_has_single_step() (1) 277#define arch_has_single_step() (1)
281extern void user_enable_single_step(struct task_struct *);
282extern void user_disable_single_step(struct task_struct *);
283
284extern void user_enable_block_step(struct task_struct *);
285#ifdef CONFIG_X86_DEBUGCTLMSR 278#ifdef CONFIG_X86_DEBUGCTLMSR
286#define arch_has_block_step() (1) 279#define arch_has_block_step() (1)
287#else 280#else
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index d5f69045c100..3ad421784ae7 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -26,8 +26,8 @@ asmlinkage long sys32_lstat64(char __user *, struct stat64 __user *);
26asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *); 26asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *);
27asmlinkage long sys32_fstatat(unsigned int, char __user *, 27asmlinkage long sys32_fstatat(unsigned int, char __user *,
28 struct stat64 __user *, int); 28 struct stat64 __user *, int);
29struct mmap_arg_struct; 29struct mmap_arg_struct32;
30asmlinkage long sys32_mmap(struct mmap_arg_struct __user *); 30asmlinkage long sys32_mmap(struct mmap_arg_struct32 __user *);
31asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long); 31asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long);
32 32
33struct sigaction32; 33struct sigaction32;
@@ -40,8 +40,6 @@ asmlinkage long sys32_rt_sigprocmask(int, compat_sigset_t __user *,
40 compat_sigset_t __user *, unsigned int); 40 compat_sigset_t __user *, unsigned int);
41asmlinkage long sys32_alarm(unsigned int); 41asmlinkage long sys32_alarm(unsigned int);
42 42
43struct sel_arg_struct;
44asmlinkage long sys32_old_select(struct sel_arg_struct __user *);
45asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int); 43asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int);
46asmlinkage long sys32_sysfs(int, u32, u32); 44asmlinkage long sys32_sysfs(int, u32, u32);
47 45
@@ -56,11 +54,6 @@ asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
56asmlinkage long sys32_personality(unsigned long); 54asmlinkage long sys32_personality(unsigned long);
57asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32); 55asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32);
58 56
59struct oldold_utsname;
60struct old_utsname;
61asmlinkage long sys32_olduname(struct oldold_utsname __user *);
62long sys32_uname(struct old_utsname __user *);
63
64asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *, 57asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *,
65 compat_uptr_t __user *, struct pt_regs *); 58 compat_uptr_t __user *, struct pt_regs *);
66asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *); 59asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h
index 8868b9420b0e..5c044b43e9a7 100644
--- a/arch/x86/include/asm/syscalls.h
+++ b/arch/x86/include/asm/syscalls.h
@@ -50,18 +50,6 @@ asmlinkage int sys_sigaction(int, const struct old_sigaction __user *,
50 struct old_sigaction __user *); 50 struct old_sigaction __user *);
51unsigned long sys_sigreturn(struct pt_regs *); 51unsigned long sys_sigreturn(struct pt_regs *);
52 52
53/* kernel/sys_i386_32.c */
54struct mmap_arg_struct;
55struct sel_arg_struct;
56struct oldold_utsname;
57struct old_utsname;
58
59asmlinkage int old_mmap(struct mmap_arg_struct __user *);
60asmlinkage int old_select(struct sel_arg_struct __user *);
61asmlinkage int sys_ipc(uint, int, int, int, void __user *, long);
62asmlinkage int sys_uname(struct old_utsname __user *);
63asmlinkage int sys_olduname(struct oldold_utsname __user *);
64
65/* kernel/vm86_32.c */ 53/* kernel/vm86_32.c */
66int sys_vm86old(struct vm86_struct __user *, struct pt_regs *); 54int sys_vm86old(struct vm86_struct __user *, struct pt_regs *);
67int sys_vm86(unsigned long, unsigned long, struct pt_regs *); 55int sys_vm86(unsigned long, unsigned long, struct pt_regs *);
@@ -73,11 +61,8 @@ int sys_vm86(unsigned long, unsigned long, struct pt_regs *);
73long sys_arch_prctl(int, unsigned long); 61long sys_arch_prctl(int, unsigned long);
74 62
75/* kernel/sys_x86_64.c */ 63/* kernel/sys_x86_64.c */
76struct new_utsname;
77
78asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, 64asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long,
79 unsigned long, unsigned long, unsigned long); 65 unsigned long, unsigned long, unsigned long);
80asmlinkage long sys_uname(struct new_utsname __user *);
81 66
82#endif /* CONFIG_X86_32 */ 67#endif /* CONFIG_X86_32 */
83#endif /* _ASM_X86_SYSCALLS_H */ 68#endif /* _ASM_X86_SYSCALLS_H */
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h
index 3baf379fa840..beb9b5f8f8a4 100644
--- a/arch/x86/include/asm/unistd_32.h
+++ b/arch/x86/include/asm/unistd_32.h
@@ -354,6 +354,7 @@
354#define __ARCH_WANT_STAT64 354#define __ARCH_WANT_STAT64
355#define __ARCH_WANT_SYS_ALARM 355#define __ARCH_WANT_SYS_ALARM
356#define __ARCH_WANT_SYS_GETHOSTNAME 356#define __ARCH_WANT_SYS_GETHOSTNAME
357#define __ARCH_WANT_SYS_IPC
357#define __ARCH_WANT_SYS_PAUSE 358#define __ARCH_WANT_SYS_PAUSE
358#define __ARCH_WANT_SYS_SGETMASK 359#define __ARCH_WANT_SYS_SGETMASK
359#define __ARCH_WANT_SYS_SIGNAL 360#define __ARCH_WANT_SYS_SIGNAL
@@ -366,6 +367,9 @@
366#define __ARCH_WANT_SYS_LLSEEK 367#define __ARCH_WANT_SYS_LLSEEK
367#define __ARCH_WANT_SYS_NICE 368#define __ARCH_WANT_SYS_NICE
368#define __ARCH_WANT_SYS_OLD_GETRLIMIT 369#define __ARCH_WANT_SYS_OLD_GETRLIMIT
370#define __ARCH_WANT_SYS_OLD_UNAME
371#define __ARCH_WANT_SYS_OLD_MMAP
372#define __ARCH_WANT_SYS_OLD_SELECT
369#define __ARCH_WANT_SYS_OLDUMOUNT 373#define __ARCH_WANT_SYS_OLDUMOUNT
370#define __ARCH_WANT_SYS_SIGPENDING 374#define __ARCH_WANT_SYS_SIGPENDING
371#define __ARCH_WANT_SYS_SIGPROCMASK 375#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h
index 4843f7ba754a..ff4307b0e81e 100644
--- a/arch/x86/include/asm/unistd_64.h
+++ b/arch/x86/include/asm/unistd_64.h
@@ -146,7 +146,7 @@ __SYSCALL(__NR_wait4, sys_wait4)
146#define __NR_kill 62 146#define __NR_kill 62
147__SYSCALL(__NR_kill, sys_kill) 147__SYSCALL(__NR_kill, sys_kill)
148#define __NR_uname 63 148#define __NR_uname 63
149__SYSCALL(__NR_uname, sys_uname) 149__SYSCALL(__NR_uname, sys_newuname)
150 150
151#define __NR_semget 64 151#define __NR_semget 64
152__SYSCALL(__NR_semget, sys_semget) 152__SYSCALL(__NR_semget, sys_semget)
@@ -680,6 +680,7 @@ __SYSCALL(__NR_recvmmsg, sys_recvmmsg)
680#define __ARCH_WANT_SYS_LLSEEK 680#define __ARCH_WANT_SYS_LLSEEK
681#define __ARCH_WANT_SYS_NICE 681#define __ARCH_WANT_SYS_NICE
682#define __ARCH_WANT_SYS_OLD_GETRLIMIT 682#define __ARCH_WANT_SYS_OLD_GETRLIMIT
683#define __ARCH_WANT_SYS_OLD_UNAME
683#define __ARCH_WANT_SYS_OLDUMOUNT 684#define __ARCH_WANT_SYS_OLDUMOUNT
684#define __ARCH_WANT_SYS_SIGPENDING 685#define __ARCH_WANT_SYS_SIGPENDING
685#define __ARCH_WANT_SYS_SIGPROCMASK 686#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c
index e3c3d820c325..09d3b17ce0c2 100644
--- a/arch/x86/kernel/apic/apic_flat_64.c
+++ b/arch/x86/kernel/apic/apic_flat_64.c
@@ -223,7 +223,7 @@ struct apic apic_flat = {
223}; 223};
224 224
225/* 225/*
226 * Physflat mode is used when there are more than 8 CPUs on a AMD system. 226 * Physflat mode is used when there are more than 8 CPUs on a system.
227 * We cannot use logical delivery in this case because the mask 227 * We cannot use logical delivery in this case because the mask
228 * overflows, so use physical mode. 228 * overflows, so use physical mode.
229 */ 229 */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 2d8b5035371c..3d1e6f16b7a6 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -27,7 +27,7 @@
27#define GET_CR2_INTO_RCX movq %cr2, %rcx 27#define GET_CR2_INTO_RCX movq %cr2, %rcx
28#endif 28#endif
29 29
30/* we are not able to switch in one step to the final KERNEL ADRESS SPACE 30/* we are not able to switch in one step to the final KERNEL ADDRESS SPACE
31 * because we need identity-mapped pages. 31 * because we need identity-mapped pages.
32 * 32 *
33 */ 33 */
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 2bbde6078143..fb99f7edb341 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -1309,7 +1309,7 @@ static void calgary_init_bitmap_from_tce_table(struct iommu_table *tbl)
1309/* 1309/*
1310 * get_tce_space_from_tar(): 1310 * get_tce_space_from_tar():
1311 * Function for kdump case. Get the tce tables from first kernel 1311 * Function for kdump case. Get the tce tables from first kernel
1312 * by reading the contents of the base adress register of calgary iommu 1312 * by reading the contents of the base address register of calgary iommu
1313 */ 1313 */
1314static void __init get_tce_space_from_tar(void) 1314static void __init get_tce_space_from_tar(void)
1315{ 1315{
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 1aa966c565f9..a4ac764a6880 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -38,7 +38,7 @@ int iommu_detected __read_mostly = 0;
38 * This variable becomes 1 if iommu=pt is passed on the kernel command line. 38 * This variable becomes 1 if iommu=pt is passed on the kernel command line.
39 * If this variable is 1, IOMMU implementations do no DMA translation for 39 * If this variable is 1, IOMMU implementations do no DMA translation for
40 * devices and allow every device to access to whole physical memory. This is 40 * devices and allow every device to access to whole physical memory. This is
41 * useful if a user want to use an IOMMU only for KVM device assignment to 41 * useful if a user wants to use an IOMMU only for KVM device assignment to
42 * guests and not for driver dma translation. 42 * guests and not for driver dma translation.
43 */ 43 */
44int iommu_pass_through __read_mostly; 44int iommu_pass_through __read_mostly;
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 2d96aab82a48..a503b1fd04e5 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -581,7 +581,7 @@ ptrace_modify_breakpoint(struct perf_event *bp, int len, int type,
581 struct perf_event_attr attr; 581 struct perf_event_attr attr;
582 582
583 /* 583 /*
584 * We shoud have at least an inactive breakpoint at this 584 * We should have at least an inactive breakpoint at this
585 * slot. It means the user is writing dr7 without having 585 * slot. It means the user is writing dr7 without having
586 * written the address register first 586 * written the address register first
587 */ 587 */
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
index dee1ff7cba58..196552bb412c 100644
--- a/arch/x86/kernel/sys_i386_32.c
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -25,191 +25,6 @@
25#include <asm/syscalls.h> 25#include <asm/syscalls.h>
26 26
27/* 27/*
28 * Perform the select(nd, in, out, ex, tv) and mmap() system
29 * calls. Linux/i386 didn't use to be able to handle more than
30 * 4 system call parameters, so these system calls used a memory
31 * block for parameter passing..
32 */
33
34struct mmap_arg_struct {
35 unsigned long addr;
36 unsigned long len;
37 unsigned long prot;
38 unsigned long flags;
39 unsigned long fd;
40 unsigned long offset;
41};
42
43asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
44{
45 struct mmap_arg_struct a;
46 int err = -EFAULT;
47
48 if (copy_from_user(&a, arg, sizeof(a)))
49 goto out;
50
51 err = -EINVAL;
52 if (a.offset & ~PAGE_MASK)
53 goto out;
54
55 err = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags,
56 a.fd, a.offset >> PAGE_SHIFT);
57out:
58 return err;
59}
60
61
62struct sel_arg_struct {
63 unsigned long n;
64 fd_set __user *inp, *outp, *exp;
65 struct timeval __user *tvp;
66};
67
68asmlinkage int old_select(struct sel_arg_struct __user *arg)
69{
70 struct sel_arg_struct a;
71
72 if (copy_from_user(&a, arg, sizeof(a)))
73 return -EFAULT;
74 /* sys_select() does the appropriate kernel locking */
75 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
76}
77
78/*
79 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
80 *
81 * This is really horribly ugly.
82 */
83asmlinkage int sys_ipc(uint call, int first, int second,
84 int third, void __user *ptr, long fifth)
85{
86 int version, ret;
87
88 version = call >> 16; /* hack for backward compatibility */
89 call &= 0xffff;
90
91 switch (call) {
92 case SEMOP:
93 return sys_semtimedop(first, (struct sembuf __user *)ptr, second, NULL);
94 case SEMTIMEDOP:
95 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
96 (const struct timespec __user *)fifth);
97
98 case SEMGET:
99 return sys_semget(first, second, third);
100 case SEMCTL: {
101 union semun fourth;
102 if (!ptr)
103 return -EINVAL;
104 if (get_user(fourth.__pad, (void __user * __user *) ptr))
105 return -EFAULT;
106 return sys_semctl(first, second, third, fourth);
107 }
108
109 case MSGSND:
110 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
111 second, third);
112 case MSGRCV:
113 switch (version) {
114 case 0: {
115 struct ipc_kludge tmp;
116 if (!ptr)
117 return -EINVAL;
118
119 if (copy_from_user(&tmp,
120 (struct ipc_kludge __user *) ptr,
121 sizeof(tmp)))
122 return -EFAULT;
123 return sys_msgrcv(first, tmp.msgp, second,
124 tmp.msgtyp, third);
125 }
126 default:
127 return sys_msgrcv(first,
128 (struct msgbuf __user *) ptr,
129 second, fifth, third);
130 }
131 case MSGGET:
132 return sys_msgget((key_t) first, second);
133 case MSGCTL:
134 return sys_msgctl(first, second, (struct msqid_ds __user *) ptr);
135
136 case SHMAT:
137 switch (version) {
138 default: {
139 ulong raddr;
140 ret = do_shmat(first, (char __user *) ptr, second, &raddr);
141 if (ret)
142 return ret;
143 return put_user(raddr, (ulong __user *) third);
144 }
145 case 1: /* iBCS2 emulator entry point */
146 if (!segment_eq(get_fs(), get_ds()))
147 return -EINVAL;
148 /* The "(ulong *) third" is valid _only_ because of the kernel segment thing */
149 return do_shmat(first, (char __user *) ptr, second, (ulong *) third);
150 }
151 case SHMDT:
152 return sys_shmdt((char __user *)ptr);
153 case SHMGET:
154 return sys_shmget(first, second, third);
155 case SHMCTL:
156 return sys_shmctl(first, second,
157 (struct shmid_ds __user *) ptr);
158 default:
159 return -ENOSYS;
160 }
161}
162
163/*
164 * Old cruft
165 */
166asmlinkage int sys_uname(struct old_utsname __user *name)
167{
168 int err;
169 if (!name)
170 return -EFAULT;
171 down_read(&uts_sem);
172 err = copy_to_user(name, utsname(), sizeof(*name));
173 up_read(&uts_sem);
174 return err? -EFAULT:0;
175}
176
177asmlinkage int sys_olduname(struct oldold_utsname __user *name)
178{
179 int error;
180
181 if (!name)
182 return -EFAULT;
183 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
184 return -EFAULT;
185
186 down_read(&uts_sem);
187
188 error = __copy_to_user(&name->sysname, &utsname()->sysname,
189 __OLD_UTS_LEN);
190 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
191 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
192 __OLD_UTS_LEN);
193 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
194 error |= __copy_to_user(&name->release, &utsname()->release,
195 __OLD_UTS_LEN);
196 error |= __put_user(0, name->release + __OLD_UTS_LEN);
197 error |= __copy_to_user(&name->version, &utsname()->version,
198 __OLD_UTS_LEN);
199 error |= __put_user(0, name->version + __OLD_UTS_LEN);
200 error |= __copy_to_user(&name->machine, &utsname()->machine,
201 __OLD_UTS_LEN);
202 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
203
204 up_read(&uts_sem);
205
206 error = error ? -EFAULT : 0;
207
208 return error;
209}
210
211
212/*
213 * Do a system call from kernel instead of calling sys_execve so we 28 * Do a system call from kernel instead of calling sys_execve so we
214 * end up with proper pt_regs. 29 * end up with proper pt_regs.
215 */ 30 */
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index 8aa2057efd12..ff14a5044ce6 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -209,15 +209,3 @@ bottomup:
209 209
210 return addr; 210 return addr;
211} 211}
212
213
214SYSCALL_DEFINE1(uname, struct new_utsname __user *, name)
215{
216 int err;
217 down_read(&uts_sem);
218 err = copy_to_user(name, utsname(), sizeof(*name));
219 up_read(&uts_sem);
220 if (personality(current->personality) == PER_LINUX32)
221 err |= copy_to_user(&name->machine, "i686", 5);
222 return err ? -EFAULT : 0;
223}
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S
index 15228b5d3eb7..8b3729341216 100644
--- a/arch/x86/kernel/syscall_table_32.S
+++ b/arch/x86/kernel/syscall_table_32.S
@@ -81,7 +81,7 @@ ENTRY(sys_call_table)
81 .long sys_settimeofday 81 .long sys_settimeofday
82 .long sys_getgroups16 /* 80 */ 82 .long sys_getgroups16 /* 80 */
83 .long sys_setgroups16 83 .long sys_setgroups16
84 .long old_select 84 .long sys_old_select
85 .long sys_symlink 85 .long sys_symlink
86 .long sys_lstat 86 .long sys_lstat
87 .long sys_readlink /* 85 */ 87 .long sys_readlink /* 85 */
@@ -89,7 +89,7 @@ ENTRY(sys_call_table)
89 .long sys_swapon 89 .long sys_swapon
90 .long sys_reboot 90 .long sys_reboot
91 .long sys_old_readdir 91 .long sys_old_readdir
92 .long old_mmap /* 90 */ 92 .long sys_old_mmap /* 90 */
93 .long sys_munmap 93 .long sys_munmap
94 .long sys_truncate 94 .long sys_truncate
95 .long sys_ftruncate 95 .long sys_ftruncate
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 208a857c679f..9faf91ae1841 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -50,7 +50,7 @@ u64 native_sched_clock(void)
50 * unstable. We do this because unlike Time Of Day, 50 * unstable. We do this because unlike Time Of Day,
51 * the scheduler clock tolerates small errors and it's 51 * the scheduler clock tolerates small errors and it's
52 * very important for it to be as fast as the platform 52 * very important for it to be as fast as the platform
53 * can achive it. ) 53 * can achieve it. )
54 */ 54 */
55 if (unlikely(tsc_disabled)) { 55 if (unlikely(tsc_disabled)) {
56 /* No locking but a rare wrong value is not a big deal: */ 56 /* No locking but a rare wrong value is not a big deal: */
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 2f1ca5614292..5e1ff66ecd73 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -167,7 +167,7 @@ static int vmi_timer_next_event(unsigned long delta,
167{ 167{
168 /* Unfortunately, set_next_event interface only passes relative 168 /* Unfortunately, set_next_event interface only passes relative
169 * expiry, but we want absolute expiry. It'd be better if were 169 * expiry, but we want absolute expiry. It'd be better if were
170 * were passed an aboslute expiry, since a bunch of time may 170 * were passed an absolute expiry, since a bunch of time may
171 * have been stolen between the time the delta is computed and 171 * have been stolen between the time the delta is computed and
172 * when we set the alarm below. */ 172 * when we set the alarm below. */
173 cycle_t now = vmi_timer_ops.get_cycle_counter(vmi_counter(VMI_ONESHOT)); 173 cycle_t now = vmi_timer_ops.get_cycle_counter(vmi_counter(VMI_ONESHOT));
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 563d20504988..deafb65ef44e 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -361,7 +361,7 @@ static void xen_cpu_die(unsigned int cpu)
361 alternatives_smp_switch(0); 361 alternatives_smp_switch(0);
362} 362}
363 363
364static void __cpuinit xen_play_dead(void) /* used only with CPU_HOTPLUG */ 364static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */
365{ 365{
366 play_dead_common(); 366 play_dead_common();
367 HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL); 367 HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h
index 66410acf18b4..4609b0f15f1f 100644
--- a/arch/xtensa/include/asm/pci.h
+++ b/arch/xtensa/include/asm/pci.h
@@ -56,14 +56,6 @@ struct pci_dev;
56 56
57#define PCI_DMA_BUS_IS_PHYS (1) 57#define PCI_DMA_BUS_IS_PHYS (1)
58 58
59/* pci_unmap_{page,single} is a no-op, so */
60#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
61#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
62#define pci_unmap_addr(PTR, ADDR_NAME) (0)
63#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
64#define pci_ubnmap_len(PTR, LEN_NAME) (0)
65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
66
67/* Map a range of PCI memory or I/O space for a device into user space */ 59/* Map a range of PCI memory or I/O space for a device into user space */
68int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, 60int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
69 enum pci_mmap_state mmap_state, int write_combine); 61 enum pci_mmap_state mmap_state, int write_combine);
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h
index 905e1e619654..3c549f798727 100644
--- a/arch/xtensa/include/asm/ptrace.h
+++ b/arch/xtensa/include/asm/ptrace.h
@@ -113,6 +113,7 @@ struct pt_regs {
113 113
114#include <variant/core.h> 114#include <variant/core.h>
115 115
116# define arch_has_single_step() (1)
116# define task_pt_regs(tsk) ((struct pt_regs*) \ 117# define task_pt_regs(tsk) ((struct pt_regs*) \
117 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) 118 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
118# define user_mode(regs) (((regs)->ps & 0x00000020)!=0) 119# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index 80d24c485fd3..77fc9f6dc016 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -104,7 +104,7 @@
104 * excsave has been restored, and 104 * excsave has been restored, and
105 * stack pointer (a1) has been set. 105 * stack pointer (a1) has been set.
106 * 106 *
107 * Note: _user_exception might be at an odd adress. Don't use call0..call12 107 * Note: _user_exception might be at an odd address. Don't use call0..call12
108 */ 108 */
109 109
110ENTRY(user_exception) 110ENTRY(user_exception)
@@ -244,7 +244,7 @@ _user_exception:
244 * excsave has been restored, and 244 * excsave has been restored, and
245 * stack pointer (a1) has been set. 245 * stack pointer (a1) has been set.
246 * 246 *
247 * Note: _kernel_exception might be at an odd adress. Don't use call0..call12 247 * Note: _kernel_exception might be at an odd address. Don't use call0..call12
248 */ 248 */
249 249
250ENTRY(kernel_exception) 250ENTRY(kernel_exception)
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 9486882ef0af..9d4e1ceb3f09 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -30,6 +30,17 @@
30#include <asm/elf.h> 30#include <asm/elf.h>
31#include <asm/coprocessor.h> 31#include <asm/coprocessor.h>
32 32
33
34void user_enable_single_step(struct task_struct *child)
35{
36 child->ptrace |= PT_SINGLESTEP;
37}
38
39void user_disable_single_step(struct task_struct *child)
40{
41 child->ptrace &= ~PT_SINGLESTEP;
42}
43
33/* 44/*
34 * Called by kernel/ptrace.c when detaching to disable single stepping. 45 * Called by kernel/ptrace.c when detaching to disable single stepping.
35 */ 46 */
@@ -268,51 +279,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
268 ret = ptrace_pokeusr(child, addr, data); 279 ret = ptrace_pokeusr(child, addr, data);
269 break; 280 break;
270 281
271 /* continue and stop at next (return from) syscall */
272
273 case PTRACE_SYSCALL:
274 case PTRACE_CONT: /* restart after signal. */
275 {
276 ret = -EIO;
277 if (!valid_signal(data))
278 break;
279 if (request == PTRACE_SYSCALL)
280 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
281 else
282 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
283 child->exit_code = data;
284 /* Make sure the single step bit is not set. */
285 child->ptrace &= ~PT_SINGLESTEP;
286 wake_up_process(child);
287 ret = 0;
288 break;
289 }
290
291 /*
292 * make the child exit. Best I can do is send it a sigkill.
293 * perhaps it should be put in the status that it wants to
294 * exit.
295 */
296 case PTRACE_KILL:
297 ret = 0;
298 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
299 break;
300 child->exit_code = SIGKILL;
301 child->ptrace &= ~PT_SINGLESTEP;
302 wake_up_process(child);
303 break;
304
305 case PTRACE_SINGLESTEP:
306 ret = -EIO;
307 if (!valid_signal(data))
308 break;
309 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
310 child->ptrace |= PT_SINGLESTEP;
311 child->exit_code = data;
312 wake_up_process(child);
313 ret = 0;
314 break;
315
316 case PTRACE_GETREGS: 282 case PTRACE_GETREGS:
317 ret = ptrace_getregs(child, (void __user *) data); 283 ret = ptrace_getregs(child, (void __user *) data);
318 break; 284 break;
diff --git a/block/Kconfig b/block/Kconfig
index e20fbde0875c..62a5921321cd 100644
--- a/block/Kconfig
+++ b/block/Kconfig
@@ -78,7 +78,7 @@ config BLK_DEV_INTEGRITY
78 Protection. If in doubt, say N. 78 Protection. If in doubt, say N.
79 79
80config BLK_CGROUP 80config BLK_CGROUP
81 bool 81 tristate
82 depends on CGROUPS 82 depends on CGROUPS
83 default n 83 default n
84 ---help--- 84 ---help---
diff --git a/block/Kconfig.iosched b/block/Kconfig.iosched
index b71abfb0d726..fc71cf071fb2 100644
--- a/block/Kconfig.iosched
+++ b/block/Kconfig.iosched
@@ -23,6 +23,7 @@ config IOSCHED_DEADLINE
23 23
24config IOSCHED_CFQ 24config IOSCHED_CFQ
25 tristate "CFQ I/O scheduler" 25 tristate "CFQ I/O scheduler"
26 select BLK_CGROUP if CFQ_GROUP_IOSCHED
26 default y 27 default y
27 ---help--- 28 ---help---
28 The CFQ I/O scheduler tries to distribute bandwidth equally 29 The CFQ I/O scheduler tries to distribute bandwidth equally
@@ -35,7 +36,6 @@ config IOSCHED_CFQ
35config CFQ_GROUP_IOSCHED 36config CFQ_GROUP_IOSCHED
36 bool "CFQ Group Scheduling support" 37 bool "CFQ Group Scheduling support"
37 depends on IOSCHED_CFQ && CGROUPS 38 depends on IOSCHED_CFQ && CGROUPS
38 select BLK_CGROUP
39 default n 39 default n
40 ---help--- 40 ---help---
41 Enable group IO scheduling in CFQ. 41 Enable group IO scheduling in CFQ.
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index c85d74cae200..4b686ad08eaa 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -23,6 +23,31 @@ static LIST_HEAD(blkio_list);
23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; 23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
24EXPORT_SYMBOL_GPL(blkio_root_cgroup); 24EXPORT_SYMBOL_GPL(blkio_root_cgroup);
25 25
26static struct cgroup_subsys_state *blkiocg_create(struct cgroup_subsys *,
27 struct cgroup *);
28static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *,
29 struct task_struct *, bool);
30static void blkiocg_attach(struct cgroup_subsys *, struct cgroup *,
31 struct cgroup *, struct task_struct *, bool);
32static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *);
33static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *);
34
35struct cgroup_subsys blkio_subsys = {
36 .name = "blkio",
37 .create = blkiocg_create,
38 .can_attach = blkiocg_can_attach,
39 .attach = blkiocg_attach,
40 .destroy = blkiocg_destroy,
41 .populate = blkiocg_populate,
42#ifdef CONFIG_BLK_CGROUP
43 /* note: blkio_subsys_id is otherwise defined in blk-cgroup.h */
44 .subsys_id = blkio_subsys_id,
45#endif
46 .use_id = 1,
47 .module = THIS_MODULE,
48};
49EXPORT_SYMBOL_GPL(blkio_subsys);
50
26struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) 51struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup)
27{ 52{
28 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), 53 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id),
@@ -253,7 +278,8 @@ remove_entry:
253done: 278done:
254 free_css_id(&blkio_subsys, &blkcg->css); 279 free_css_id(&blkio_subsys, &blkcg->css);
255 rcu_read_unlock(); 280 rcu_read_unlock();
256 kfree(blkcg); 281 if (blkcg != &blkio_root_cgroup)
282 kfree(blkcg);
257} 283}
258 284
259static struct cgroup_subsys_state * 285static struct cgroup_subsys_state *
@@ -319,17 +345,6 @@ static void blkiocg_attach(struct cgroup_subsys *subsys, struct cgroup *cgroup,
319 task_unlock(tsk); 345 task_unlock(tsk);
320} 346}
321 347
322struct cgroup_subsys blkio_subsys = {
323 .name = "blkio",
324 .create = blkiocg_create,
325 .can_attach = blkiocg_can_attach,
326 .attach = blkiocg_attach,
327 .destroy = blkiocg_destroy,
328 .populate = blkiocg_populate,
329 .subsys_id = blkio_subsys_id,
330 .use_id = 1,
331};
332
333void blkio_policy_register(struct blkio_policy_type *blkiop) 348void blkio_policy_register(struct blkio_policy_type *blkiop)
334{ 349{
335 spin_lock(&blkio_list_lock); 350 spin_lock(&blkio_list_lock);
@@ -345,3 +360,17 @@ void blkio_policy_unregister(struct blkio_policy_type *blkiop)
345 spin_unlock(&blkio_list_lock); 360 spin_unlock(&blkio_list_lock);
346} 361}
347EXPORT_SYMBOL_GPL(blkio_policy_unregister); 362EXPORT_SYMBOL_GPL(blkio_policy_unregister);
363
364static int __init init_cgroup_blkio(void)
365{
366 return cgroup_load_subsys(&blkio_subsys);
367}
368
369static void __exit exit_cgroup_blkio(void)
370{
371 cgroup_unload_subsys(&blkio_subsys);
372}
373
374module_init(init_cgroup_blkio);
375module_exit(exit_cgroup_blkio);
376MODULE_LICENSE("GPL");
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 84bf745fa775..8ccc20464dae 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -15,7 +15,13 @@
15 15
16#include <linux/cgroup.h> 16#include <linux/cgroup.h>
17 17
18#ifdef CONFIG_BLK_CGROUP 18#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
19
20#ifndef CONFIG_BLK_CGROUP
21/* When blk-cgroup is a module, its subsys_id isn't a compile-time constant */
22extern struct cgroup_subsys blkio_subsys;
23#define blkio_subsys_id blkio_subsys.subsys_id
24#endif
19 25
20struct blkio_cgroup { 26struct blkio_cgroup {
21 struct cgroup_subsys_state css; 27 struct cgroup_subsys_state css;
@@ -91,7 +97,7 @@ static inline void blkiocg_update_blkio_group_dequeue_stats(
91 struct blkio_group *blkg, unsigned long dequeue) {} 97 struct blkio_group *blkg, unsigned long dequeue) {}
92#endif 98#endif
93 99
94#ifdef CONFIG_BLK_CGROUP 100#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
95extern struct blkio_cgroup blkio_root_cgroup; 101extern struct blkio_cgroup blkio_root_cgroup;
96extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup); 102extern struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup);
97extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg, 103extern void blkiocg_add_blkio_group(struct blkio_cgroup *blkcg,
diff --git a/block/bsg.c b/block/bsg.c
index a9fd2d84b53a..46597a6bd112 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -260,7 +260,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
260 return ERR_PTR(ret); 260 return ERR_PTR(ret);
261 261
262 /* 262 /*
263 * map scatter-gather elements seperately and string them to request 263 * map scatter-gather elements separately and string them to request
264 */ 264 */
265 rq = blk_get_request(q, rw, GFP_KERNEL); 265 rq = blk_get_request(q, rw, GFP_KERNEL);
266 if (!rq) 266 if (!rq)
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 6a2e295ee227..403857ad06d4 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -826,8 +826,8 @@ config CRYPTO_ANSI_CPRNG
826 help 826 help
827 This option enables the generic pseudo random number generator 827 This option enables the generic pseudo random number generator
828 for cryptographic modules. Uses the Algorithm specified in 828 for cryptographic modules. Uses the Algorithm specified in
829 ANSI X9.31 A.2.4. Not this option must be enabled if CRYPTO_FIPS 829 ANSI X9.31 A.2.4. Note that this option must be enabled if
830 is selected 830 CRYPTO_FIPS is selected
831 831
832source "drivers/crypto/Kconfig" 832source "drivers/crypto/Kconfig"
833 833
diff --git a/drivers/Makefile b/drivers/Makefile
index 81e36596b1e9..34f1e1064dbc 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -99,6 +99,7 @@ obj-$(CONFIG_SGI_SN) += sn/
99obj-y += firmware/ 99obj-y += firmware/
100obj-$(CONFIG_CRYPTO) += crypto/ 100obj-$(CONFIG_CRYPTO) += crypto/
101obj-$(CONFIG_SUPERH) += sh/ 101obj-$(CONFIG_SUPERH) += sh/
102obj-$(CONFIG_ARCH_SHMOBILE) += sh/
102obj-$(CONFIG_GENERIC_TIME) += clocksource/ 103obj-$(CONFIG_GENERIC_TIME) += clocksource/
103obj-$(CONFIG_DMA_ENGINE) += dma/ 104obj-$(CONFIG_DMA_ENGINE) += dma/
104obj-$(CONFIG_DCA) += dca/ 105obj-$(CONFIG_DCA) += dca/
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index b2586f57e1f5..d9a85f1ddde6 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -605,7 +605,7 @@ register_hotplug_dock_device(acpi_handle handle, struct acpi_dock_ops *ops,
605 list_for_each_entry(dock_station, &dock_stations, sibling) { 605 list_for_each_entry(dock_station, &dock_stations, sibling) {
606 /* 606 /*
607 * An ATA bay can be in a dock and itself can be ejected 607 * An ATA bay can be in a dock and itself can be ejected
608 * seperately, so there are two 'dock stations' which need the 608 * separately, so there are two 'dock stations' which need the
609 * ops 609 * ops
610 */ 610 */
611 dd = find_dock_dependent_device(dock_station, handle); 611 dd = find_dock_dependent_device(dock_station, handle);
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c
index d0d25e2e1ced..1ac678d2c51c 100644
--- a/drivers/acpi/proc.c
+++ b/drivers/acpi/proc.c
@@ -435,7 +435,7 @@ acpi_system_write_wakeup_device(struct file *file,
435 found_dev->wakeup.gpe_device)) { 435 found_dev->wakeup.gpe_device)) {
436 printk(KERN_WARNING 436 printk(KERN_WARNING
437 "ACPI: '%s' and '%s' have the same GPE, " 437 "ACPI: '%s' and '%s' have the same GPE, "
438 "can't disable/enable one seperately\n", 438 "can't disable/enable one separately\n",
439 dev->pnp.bus_id, found_dev->pnp.bus_id); 439 dev->pnp.bus_id, found_dev->pnp.bus_id);
440 dev->wakeup.state.enabled = 440 dev->wakeup.state.enabled =
441 found_dev->wakeup.state.enabled; 441 found_dev->wakeup.state.enabled;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 9c77b0d1a9d0..4a28420efff2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2232,7 +2232,7 @@ retry:
2232 * Some drives were very specific about that exact sequence. 2232 * Some drives were very specific about that exact sequence.
2233 * 2233 *
2234 * Note that ATA4 says lba is mandatory so the second check 2234 * Note that ATA4 says lba is mandatory so the second check
2235 * shoud never trigger. 2235 * should never trigger.
2236 */ 2236 */
2237 if (ata_id_major_version(id) < 4 || !ata_id_has_lba(id)) { 2237 if (ata_id_major_version(id) < 4 || !ata_id_has_lba(id)) {
2238 err_mask = ata_dev_init_params(dev, id[3], id[6]); 2238 err_mask = ata_dev_init_params(dev, id[3], id[6]);
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 02441fd57e9e..561dec2481cb 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -2287,7 +2287,7 @@ EXPORT_SYMBOL_GPL(ata_sff_postreset);
2287 * @qc: command 2287 * @qc: command
2288 * 2288 *
2289 * Drain the FIFO and device of any stuck data following a command 2289 * Drain the FIFO and device of any stuck data following a command
2290 * failing to complete. In some cases this is neccessary before a 2290 * failing to complete. In some cases this is necessary before a
2291 * reset will recover the device. 2291 * reset will recover the device.
2292 * 2292 *
2293 */ 2293 */
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index 294f3020a78a..8e5e13210426 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -161,7 +161,7 @@ static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
161 * 161 *
162 * Called when the libata layer is about to issue a command. We wrap 162 * Called when the libata layer is about to issue a command. We wrap
163 * this interface so that we can load the correct ATA timings if 163 * this interface so that we can load the correct ATA timings if
164 * neccessary. 164 * necessary.
165 */ 165 */
166 166
167static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc) 167static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc)
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c
index c86c71639a95..727a81ce4c9f 100644
--- a/drivers/ata/pata_hpt3x3.c
+++ b/drivers/ata/pata_hpt3x3.c
@@ -180,7 +180,7 @@ static void hpt3x3_init_chipset(struct pci_dev *dev)
180 * @id: Entry in match table 180 * @id: Entry in match table
181 * 181 *
182 * Perform basic initialisation. We set the device up so we access all 182 * Perform basic initialisation. We set the device up so we access all
183 * ports via BAR4. This is neccessary to work around errata. 183 * ports via BAR4. This is necessary to work around errata.
184 */ 184 */
185 185
186static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 186static int hpt3x3_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 36103531feeb..147de2fd66d2 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -131,7 +131,7 @@ static unsigned int ata_data_xfer_8bit(struct ata_device *dev,
131 * @qc: command 131 * @qc: command
132 * 132 *
133 * Drain the FIFO and device of any stuck data following a command 133 * Drain the FIFO and device of any stuck data following a command
134 * failing to complete. In some cases this is neccessary before a 134 * failing to complete. In some cases this is necessary before a
135 * reset will recover the device. 135 * reset will recover the device.
136 * 136 *
137 */ 137 */
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 2bf3a6ef3684..d9301e861d9f 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -95,7 +95,7 @@ extern char usermode_helper[];
95 95
96/* All EEs on the free list should have ID_VACANT (== 0) 96/* All EEs on the free list should have ID_VACANT (== 0)
97 * freshly allocated EEs get !ID_VACANT (== 1) 97 * freshly allocated EEs get !ID_VACANT (== 1)
98 * so if it says "cannot dereference null pointer at adress 0x00000001", 98 * so if it says "cannot dereference null pointer at address 0x00000001",
99 * it is most likely one of these :( */ 99 * it is most likely one of these :( */
100 100
101#define ID_IN_SYNC (4711ULL) 101#define ID_IN_SYNC (4711ULL)
@@ -1171,7 +1171,7 @@ extern int drbd_bitmap_io(struct drbd_conf *mdev, int (*io_fn)(struct drbd_conf
1171/* Meta data layout 1171/* Meta data layout
1172 We reserve a 128MB Block (4k aligned) 1172 We reserve a 128MB Block (4k aligned)
1173 * either at the end of the backing device 1173 * either at the end of the backing device
1174 * or on a seperate meta data device. */ 1174 * or on a separate meta data device. */
1175 1175
1176#define MD_RESERVED_SECT (128LU << 11) /* 128 MB, unit sectors */ 1176#define MD_RESERVED_SECT (128LU << 11) /* 128 MB, unit sectors */
1177/* The following numbers are sectors */ 1177/* The following numbers are sectors */
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h
index f22c1bc8ec7e..16119d7056cc 100644
--- a/drivers/block/drbd/drbd_req.h
+++ b/drivers/block/drbd/drbd_req.h
@@ -57,7 +57,7 @@
57 * 57 *
58 * It may me handed over to the local disk subsystem. 58 * It may me handed over to the local disk subsystem.
59 * It may be completed by the local disk subsystem, 59 * It may be completed by the local disk subsystem,
60 * either sucessfully or with io-error. 60 * either successfully or with io-error.
61 * In case it is a READ request, and it failed locally, 61 * In case it is a READ request, and it failed locally,
62 * it may be retried remotely. 62 * it may be retried remotely.
63 * 63 *
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index b9b117059b62..90c4038702da 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -144,13 +144,23 @@
144 * Better audit of register_blkdev. 144 * Better audit of register_blkdev.
145 */ 145 */
146 146
147#define FLOPPY_SANITY_CHECK
148#undef FLOPPY_SILENT_DCL_CLEAR 147#undef FLOPPY_SILENT_DCL_CLEAR
149 148
150#define REALLY_SLOW_IO 149#define REALLY_SLOW_IO
151 150
152#define DEBUGT 2 151#define DEBUGT 2
153#define DCL_DEBUG /* debug disk change line */ 152
153#define DPRINT(format, args...) \
154 pr_info("floppy%d: " format, current_drive, ##args)
155
156#define DCL_DEBUG /* debug disk change line */
157#ifdef DCL_DEBUG
158#define debug_dcl(test, fmt, args...) \
159 do { if ((test) & FD_DEBUG) DPRINT(fmt, ##args); } while (0)
160#else
161#define debug_dcl(test, fmt, args...) \
162 do { if (0) DPRINT(fmt, ##args); } while (0)
163#endif
154 164
155/* do print messages for unexpected interrupts */ 165/* do print messages for unexpected interrupts */
156static int print_unex = 1; 166static int print_unex = 1;
@@ -180,6 +190,8 @@ static int print_unex = 1;
180#include <linux/mod_devicetable.h> 190#include <linux/mod_devicetable.h>
181#include <linux/buffer_head.h> /* for invalidate_buffers() */ 191#include <linux/buffer_head.h> /* for invalidate_buffers() */
182#include <linux/mutex.h> 192#include <linux/mutex.h>
193#include <linux/io.h>
194#include <linux/uaccess.h>
183 195
184/* 196/*
185 * PS/2 floppies have much slower step rates than regular floppies. 197 * PS/2 floppies have much slower step rates than regular floppies.
@@ -191,8 +203,6 @@ static int slow_floppy;
191#include <asm/dma.h> 203#include <asm/dma.h>
192#include <asm/irq.h> 204#include <asm/irq.h>
193#include <asm/system.h> 205#include <asm/system.h>
194#include <asm/io.h>
195#include <asm/uaccess.h>
196 206
197static int FLOPPY_IRQ = 6; 207static int FLOPPY_IRQ = 6;
198static int FLOPPY_DMA = 2; 208static int FLOPPY_DMA = 2;
@@ -241,8 +251,6 @@ static int allowed_drive_mask = 0x33;
241 251
242static int irqdma_allocated; 252static int irqdma_allocated;
243 253
244#define DEVICE_NAME "floppy"
245
246#include <linux/blkdev.h> 254#include <linux/blkdev.h>
247#include <linux/blkpg.h> 255#include <linux/blkpg.h>
248#include <linux/cdrom.h> /* for the compatibility eject ioctl */ 256#include <linux/cdrom.h> /* for the compatibility eject ioctl */
@@ -250,7 +258,7 @@ static int irqdma_allocated;
250 258
251static struct request *current_req; 259static struct request *current_req;
252static struct request_queue *floppy_queue; 260static struct request_queue *floppy_queue;
253static void do_fd_request(struct request_queue * q); 261static void do_fd_request(struct request_queue *q);
254 262
255#ifndef fd_get_dma_residue 263#ifndef fd_get_dma_residue
256#define fd_get_dma_residue() get_dma_residue(FLOPPY_DMA) 264#define fd_get_dma_residue() get_dma_residue(FLOPPY_DMA)
@@ -263,7 +271,7 @@ static void do_fd_request(struct request_queue * q);
263#endif 271#endif
264 272
265#ifndef fd_dma_mem_alloc 273#ifndef fd_dma_mem_alloc
266#define fd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL,get_order(size)) 274#define fd_dma_mem_alloc(size) __get_dma_pages(GFP_KERNEL, get_order(size))
267#endif 275#endif
268 276
269static inline void fallback_on_nodma_alloc(char **addr, size_t l) 277static inline void fallback_on_nodma_alloc(char **addr, size_t l)
@@ -273,7 +281,7 @@ static inline void fallback_on_nodma_alloc(char **addr, size_t l)
273 return; /* we have the memory */ 281 return; /* we have the memory */
274 if (can_use_virtual_dma != 2) 282 if (can_use_virtual_dma != 2)
275 return; /* no fallback allowed */ 283 return; /* no fallback allowed */
276 printk("DMA memory shortage. Temporarily falling back on virtual DMA\n"); 284 pr_info("DMA memory shortage. Temporarily falling back on virtual DMA\n");
277 *addr = (char *)nodma_mem_alloc(l); 285 *addr = (char *)nodma_mem_alloc(l);
278#else 286#else
279 return; 287 return;
@@ -283,59 +291,50 @@ static inline void fallback_on_nodma_alloc(char **addr, size_t l)
283/* End dma memory related stuff */ 291/* End dma memory related stuff */
284 292
285static unsigned long fake_change; 293static unsigned long fake_change;
286static int initialising = 1; 294static bool initialized;
287 295
288#define ITYPE(x) (((x)>>2) & 0x1f) 296#define ITYPE(x) (((x) >> 2) & 0x1f)
289#define TOMINOR(x) ((x & 3) | ((x & 4) << 5)) 297#define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
290#define UNIT(x) ((x) & 0x03) /* drive on fdc */ 298#define UNIT(x) ((x) & 0x03) /* drive on fdc */
291#define FDC(x) (((x) & 0x04) >> 2) /* fdc of drive */ 299#define FDC(x) (((x) & 0x04) >> 2) /* fdc of drive */
292 /* reverse mapping from unit and fdc to drive */ 300 /* reverse mapping from unit and fdc to drive */
293#define REVDRIVE(fdc, unit) ((unit) + ((fdc) << 2)) 301#define REVDRIVE(fdc, unit) ((unit) + ((fdc) << 2))
294#define DP (&drive_params[current_drive])
295#define DRS (&drive_state[current_drive])
296#define DRWE (&write_errors[current_drive])
297#define FDCS (&fdc_state[fdc])
298#define CLEARF(x) clear_bit(x##_BIT, &DRS->flags)
299#define SETF(x) set_bit(x##_BIT, &DRS->flags)
300#define TESTF(x) test_bit(x##_BIT, &DRS->flags)
301 302
302#define UDP (&drive_params[drive]) 303#define DP (&drive_params[current_drive])
303#define UDRS (&drive_state[drive]) 304#define DRS (&drive_state[current_drive])
304#define UDRWE (&write_errors[drive]) 305#define DRWE (&write_errors[current_drive])
305#define UFDCS (&fdc_state[FDC(drive)]) 306#define FDCS (&fdc_state[fdc])
306#define UCLEARF(x) clear_bit(x##_BIT, &UDRS->flags)
307#define USETF(x) set_bit(x##_BIT, &UDRS->flags)
308#define UTESTF(x) test_bit(x##_BIT, &UDRS->flags)
309 307
310#define DPRINT(format, args...) printk(DEVICE_NAME "%d: " format, current_drive , ## args) 308#define UDP (&drive_params[drive])
309#define UDRS (&drive_state[drive])
310#define UDRWE (&write_errors[drive])
311#define UFDCS (&fdc_state[FDC(drive)])
311 312
312#define PH_HEAD(floppy,head) (((((floppy)->stretch & 2) >>1) ^ head) << 2) 313#define PH_HEAD(floppy, head) (((((floppy)->stretch & 2) >> 1) ^ head) << 2)
313#define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH) 314#define STRETCH(floppy) ((floppy)->stretch & FD_STRETCH)
314
315#define CLEARSTRUCT(x) memset((x), 0, sizeof(*(x)))
316 315
317/* read/write */ 316/* read/write */
318#define COMMAND raw_cmd->cmd[0] 317#define COMMAND (raw_cmd->cmd[0])
319#define DR_SELECT raw_cmd->cmd[1] 318#define DR_SELECT (raw_cmd->cmd[1])
320#define TRACK raw_cmd->cmd[2] 319#define TRACK (raw_cmd->cmd[2])
321#define HEAD raw_cmd->cmd[3] 320#define HEAD (raw_cmd->cmd[3])
322#define SECTOR raw_cmd->cmd[4] 321#define SECTOR (raw_cmd->cmd[4])
323#define SIZECODE raw_cmd->cmd[5] 322#define SIZECODE (raw_cmd->cmd[5])
324#define SECT_PER_TRACK raw_cmd->cmd[6] 323#define SECT_PER_TRACK (raw_cmd->cmd[6])
325#define GAP raw_cmd->cmd[7] 324#define GAP (raw_cmd->cmd[7])
326#define SIZECODE2 raw_cmd->cmd[8] 325#define SIZECODE2 (raw_cmd->cmd[8])
327#define NR_RW 9 326#define NR_RW 9
328 327
329/* format */ 328/* format */
330#define F_SIZECODE raw_cmd->cmd[2] 329#define F_SIZECODE (raw_cmd->cmd[2])
331#define F_SECT_PER_TRACK raw_cmd->cmd[3] 330#define F_SECT_PER_TRACK (raw_cmd->cmd[3])
332#define F_GAP raw_cmd->cmd[4] 331#define F_GAP (raw_cmd->cmd[4])
333#define F_FILL raw_cmd->cmd[5] 332#define F_FILL (raw_cmd->cmd[5])
334#define NR_F 6 333#define NR_F 6
335 334
336/* 335/*
337 * Maximum disk size (in kilobytes). This default is used whenever the 336 * Maximum disk size (in kilobytes).
338 * current disk size is unknown. 337 * This default is used whenever the current disk size is unknown.
339 * [Now it is rather a minimum] 338 * [Now it is rather a minimum]
340 */ 339 */
341#define MAX_DISK_SIZE 4 /* 3984 */ 340#define MAX_DISK_SIZE 4 /* 3984 */
@@ -345,16 +344,17 @@ static int initialising = 1;
345 */ 344 */
346#define MAX_REPLIES 16 345#define MAX_REPLIES 16
347static unsigned char reply_buffer[MAX_REPLIES]; 346static unsigned char reply_buffer[MAX_REPLIES];
348static int inr; /* size of reply buffer, when called from interrupt */ 347static int inr; /* size of reply buffer, when called from interrupt */
349#define ST0 (reply_buffer[0]) 348#define ST0 (reply_buffer[0])
350#define ST1 (reply_buffer[1]) 349#define ST1 (reply_buffer[1])
351#define ST2 (reply_buffer[2]) 350#define ST2 (reply_buffer[2])
352#define ST3 (reply_buffer[0]) /* result of GETSTATUS */ 351#define ST3 (reply_buffer[0]) /* result of GETSTATUS */
353#define R_TRACK (reply_buffer[3]) 352#define R_TRACK (reply_buffer[3])
354#define R_HEAD (reply_buffer[4]) 353#define R_HEAD (reply_buffer[4])
355#define R_SECTOR (reply_buffer[5]) 354#define R_SECTOR (reply_buffer[5])
356#define R_SIZECODE (reply_buffer[6]) 355#define R_SIZECODE (reply_buffer[6])
357#define SEL_DLY (2*HZ/100) 356
357#define SEL_DLY (2 * HZ / 100)
358 358
359/* 359/*
360 * this struct defines the different floppy drive types. 360 * this struct defines the different floppy drive types.
@@ -505,9 +505,9 @@ static char floppy_device_name[] = "floppy";
505static int probing; 505static int probing;
506 506
507/* Synchronization of FDC access. */ 507/* Synchronization of FDC access. */
508#define FD_COMMAND_NONE -1 508#define FD_COMMAND_NONE -1
509#define FD_COMMAND_ERROR 2 509#define FD_COMMAND_ERROR 2
510#define FD_COMMAND_OKAY 3 510#define FD_COMMAND_OKAY 3
511 511
512static volatile int command_status = FD_COMMAND_NONE; 512static volatile int command_status = FD_COMMAND_NONE;
513static unsigned long fdc_busy; 513static unsigned long fdc_busy;
@@ -515,11 +515,6 @@ static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
515static DECLARE_WAIT_QUEUE_HEAD(command_done); 515static DECLARE_WAIT_QUEUE_HEAD(command_done);
516 516
517#define NO_SIGNAL (!interruptible || !signal_pending(current)) 517#define NO_SIGNAL (!interruptible || !signal_pending(current))
518#define CALL(x) if ((x) == -EINTR) return -EINTR
519#define ECALL(x) if ((ret = (x))) return ret;
520#define _WAIT(x,i) CALL(ret=wait_til_done((x),i))
521#define WAIT(x) _WAIT((x),interruptible)
522#define IWAIT(x) _WAIT((x),1)
523 518
524/* Errors during formatting are counted here. */ 519/* Errors during formatting are counted here. */
525static int format_errors; 520static int format_errors;
@@ -545,8 +540,9 @@ static int max_buffer_sectors;
545static int *errors; 540static int *errors;
546typedef void (*done_f)(int); 541typedef void (*done_f)(int);
547static struct cont_t { 542static struct cont_t {
548 void (*interrupt)(void); /* this is called after the interrupt of the 543 void (*interrupt)(void);
549 * main command */ 544 /* this is called after the interrupt of the
545 * main command */
550 void (*redo)(void); /* this is called to retry the operation */ 546 void (*redo)(void); /* this is called to retry the operation */
551 void (*error)(void); /* this is called to tally an error */ 547 void (*error)(void); /* this is called to tally an error */
552 done_f done; /* this is called to say if the operation has 548 done_f done; /* this is called to say if the operation has
@@ -571,7 +567,6 @@ static void floppy_release_irq_and_dma(void);
571 * reset doesn't need to be tested before sending commands, because 567 * reset doesn't need to be tested before sending commands, because
572 * output_byte is automatically disabled when reset is set. 568 * output_byte is automatically disabled when reset is set.
573 */ 569 */
574#define CHECK_RESET { if (FDCS->reset){ reset_fdc(); return; } }
575static void reset_fdc(void); 570static void reset_fdc(void);
576 571
577/* 572/*
@@ -579,9 +574,9 @@ static void reset_fdc(void);
579 * information to interrupts. They are the data used for the current 574 * information to interrupts. They are the data used for the current
580 * request. 575 * request.
581 */ 576 */
582#define NO_TRACK -1 577#define NO_TRACK -1
583#define NEED_1_RECAL -2 578#define NEED_1_RECAL -2
584#define NEED_2_RECAL -3 579#define NEED_2_RECAL -3
585 580
586static int usage_count; 581static int usage_count;
587 582
@@ -621,39 +616,35 @@ static inline void set_debugt(void)
621 debugtimer = jiffies; 616 debugtimer = jiffies;
622} 617}
623 618
624static inline void debugt(const char *message) 619static inline void debugt(const char *func, const char *msg)
625{ 620{
626 if (DP->flags & DEBUGT) 621 if (DP->flags & DEBUGT)
627 printk("%s dtime=%lu\n", message, jiffies - debugtimer); 622 pr_info("%s:%s dtime=%lu\n", func, msg, jiffies - debugtimer);
628} 623}
629#else 624#else
630static inline void set_debugt(void) { } 625static inline void set_debugt(void) { }
631static inline void debugt(const char *message) { } 626static inline void debugt(const char *func, const char *msg) { }
632#endif /* DEBUGT */ 627#endif /* DEBUGT */
633 628
634typedef void (*timeout_fn) (unsigned long); 629typedef void (*timeout_fn)(unsigned long);
635static DEFINE_TIMER(fd_timeout, floppy_shutdown, 0, 0); 630static DEFINE_TIMER(fd_timeout, floppy_shutdown, 0, 0);
636 631
637static const char *timeout_message; 632static const char *timeout_message;
638 633
639#ifdef FLOPPY_SANITY_CHECK 634static void is_alive(const char *func, const char *message)
640static void is_alive(const char *message)
641{ 635{
642 /* this routine checks whether the floppy driver is "alive" */ 636 /* this routine checks whether the floppy driver is "alive" */
643 if (test_bit(0, &fdc_busy) && command_status < 2 637 if (test_bit(0, &fdc_busy) && command_status < 2 &&
644 && !timer_pending(&fd_timeout)) { 638 !timer_pending(&fd_timeout)) {
645 DPRINT("timeout handler died: %s\n", message); 639 DPRINT("%s: timeout handler died. %s\n", func, message);
646 } 640 }
647} 641}
648#endif
649 642
650static void (*do_floppy) (void) = NULL; 643static void (*do_floppy)(void) = NULL;
651
652#ifdef FLOPPY_SANITY_CHECK
653 644
654#define OLOGSIZE 20 645#define OLOGSIZE 20
655 646
656static void (*lasthandler) (void); 647static void (*lasthandler)(void);
657static unsigned long interruptjiffies; 648static unsigned long interruptjiffies;
658static unsigned long resultjiffies; 649static unsigned long resultjiffies;
659static int resultsize; 650static int resultsize;
@@ -666,12 +657,11 @@ static struct output_log {
666} output_log[OLOGSIZE]; 657} output_log[OLOGSIZE];
667 658
668static int output_log_pos; 659static int output_log_pos;
669#endif
670 660
671#define current_reqD -1 661#define current_reqD -1
672#define MAXTIMEOUT -2 662#define MAXTIMEOUT -2
673 663
674static void __reschedule_timeout(int drive, const char *message, int marg) 664static void __reschedule_timeout(int drive, const char *message)
675{ 665{
676 if (drive == current_reqD) 666 if (drive == current_reqD)
677 drive = current_drive; 667 drive = current_drive;
@@ -682,25 +672,22 @@ static void __reschedule_timeout(int drive, const char *message, int marg)
682 } else 672 } else
683 fd_timeout.expires = jiffies + UDP->timeout; 673 fd_timeout.expires = jiffies + UDP->timeout;
684 add_timer(&fd_timeout); 674 add_timer(&fd_timeout);
685 if (UDP->flags & FD_DEBUG) { 675 if (UDP->flags & FD_DEBUG)
686 DPRINT("reschedule timeout "); 676 DPRINT("reschedule timeout %s\n", message);
687 printk(message, marg);
688 printk("\n");
689 }
690 timeout_message = message; 677 timeout_message = message;
691} 678}
692 679
693static void reschedule_timeout(int drive, const char *message, int marg) 680static void reschedule_timeout(int drive, const char *message)
694{ 681{
695 unsigned long flags; 682 unsigned long flags;
696 683
697 spin_lock_irqsave(&floppy_lock, flags); 684 spin_lock_irqsave(&floppy_lock, flags);
698 __reschedule_timeout(drive, message, marg); 685 __reschedule_timeout(drive, message);
699 spin_unlock_irqrestore(&floppy_lock, flags); 686 spin_unlock_irqrestore(&floppy_lock, flags);
700} 687}
701 688
702#define INFBOUND(a,b) (a)=max_t(int, a, b) 689#define INFBOUND(a, b) (a) = max_t(int, a, b)
703#define SUPBOUND(a,b) (a)=min_t(int, a, b) 690#define SUPBOUND(a, b) (a) = min_t(int, a, b)
704 691
705/* 692/*
706 * Bottom half floppy driver. 693 * Bottom half floppy driver.
@@ -739,7 +726,6 @@ static int disk_change(int drive)
739{ 726{
740 int fdc = FDC(drive); 727 int fdc = FDC(drive);
741 728
742#ifdef FLOPPY_SANITY_CHECK
743 if (time_before(jiffies, UDRS->select_date + UDP->select_delay)) 729 if (time_before(jiffies, UDRS->select_date + UDP->select_delay))
744 DPRINT("WARNING disk change called early\n"); 730 DPRINT("WARNING disk change called early\n");
745 if (!(FDCS->dor & (0x10 << UNIT(drive))) || 731 if (!(FDCS->dor & (0x10 << UNIT(drive))) ||
@@ -748,31 +734,27 @@ static int disk_change(int drive)
748 DPRINT("drive=%d fdc=%d dor=%x\n", drive, FDC(drive), 734 DPRINT("drive=%d fdc=%d dor=%x\n", drive, FDC(drive),
749 (unsigned int)FDCS->dor); 735 (unsigned int)FDCS->dor);
750 } 736 }
751#endif
752 737
753#ifdef DCL_DEBUG 738 debug_dcl(UDP->flags,
754 if (UDP->flags & FD_DEBUG) { 739 "checking disk change line for drive %d\n", drive);
755 DPRINT("checking disk change line for drive %d\n", drive); 740 debug_dcl(UDP->flags, "jiffies=%lu\n", jiffies);
756 DPRINT("jiffies=%lu\n", jiffies); 741 debug_dcl(UDP->flags, "disk change line=%x\n", fd_inb(FD_DIR) & 0x80);
757 DPRINT("disk change line=%x\n", fd_inb(FD_DIR) & 0x80); 742 debug_dcl(UDP->flags, "flags=%lx\n", UDRS->flags);
758 DPRINT("flags=%lx\n", UDRS->flags); 743
759 }
760#endif
761 if (UDP->flags & FD_BROKEN_DCL) 744 if (UDP->flags & FD_BROKEN_DCL)
762 return UTESTF(FD_DISK_CHANGED); 745 return test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
763 if ((fd_inb(FD_DIR) ^ UDP->flags) & 0x80) { 746 if ((fd_inb(FD_DIR) ^ UDP->flags) & 0x80) {
764 USETF(FD_VERIFY); /* verify write protection */ 747 set_bit(FD_VERIFY_BIT, &UDRS->flags);
765 if (UDRS->maxblock) { 748 /* verify write protection */
766 /* mark it changed */ 749
767 USETF(FD_DISK_CHANGED); 750 if (UDRS->maxblock) /* mark it changed */
768 } 751 set_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
769 752
770 /* invalidate its geometry */ 753 /* invalidate its geometry */
771 if (UDRS->keep_data >= 0) { 754 if (UDRS->keep_data >= 0) {
772 if ((UDP->flags & FTD_MSG) && 755 if ((UDP->flags & FTD_MSG) &&
773 current_type[drive] != NULL) 756 current_type[drive] != NULL)
774 DPRINT("Disk type is undefined after " 757 DPRINT("Disk type is undefined after disk change\n");
775 "disk change\n");
776 current_type[drive] = NULL; 758 current_type[drive] = NULL;
777 floppy_sizes[TOMINOR(drive)] = MAX_DISK_SIZE << 1; 759 floppy_sizes[TOMINOR(drive)] = MAX_DISK_SIZE << 1;
778 } 760 }
@@ -780,7 +762,7 @@ static int disk_change(int drive)
780 return 1; 762 return 1;
781 } else { 763 } else {
782 UDRS->last_checked = jiffies; 764 UDRS->last_checked = jiffies;
783 UCLEARF(FD_DISK_NEWCHANGE); 765 clear_bit(FD_DISK_NEWCHANGE_BIT, &UDRS->flags);
784 } 766 }
785 return 0; 767 return 0;
786} 768}
@@ -790,6 +772,12 @@ static inline int is_selected(int dor, int unit)
790 return ((dor & (0x10 << unit)) && (dor & 3) == unit); 772 return ((dor & (0x10 << unit)) && (dor & 3) == unit);
791} 773}
792 774
775static bool is_ready_state(int status)
776{
777 int state = status & (STATUS_READY | STATUS_DIR | STATUS_DMA);
778 return state == STATUS_READY;
779}
780
793static int set_dor(int fdc, char mask, char data) 781static int set_dor(int fdc, char mask, char data)
794{ 782{
795 unsigned char unit; 783 unsigned char unit;
@@ -806,11 +794,8 @@ static int set_dor(int fdc, char mask, char data)
806 unit = olddor & 0x3; 794 unit = olddor & 0x3;
807 if (is_selected(olddor, unit) && !is_selected(newdor, unit)) { 795 if (is_selected(olddor, unit) && !is_selected(newdor, unit)) {
808 drive = REVDRIVE(fdc, unit); 796 drive = REVDRIVE(fdc, unit);
809#ifdef DCL_DEBUG 797 debug_dcl(UDP->flags,
810 if (UDP->flags & FD_DEBUG) { 798 "calling disk change from set_dor\n");
811 DPRINT("calling disk change from set_dor\n");
812 }
813#endif
814 disk_change(drive); 799 disk_change(drive);
815 } 800 }
816 FDCS->dor = newdor; 801 FDCS->dor = newdor;
@@ -834,8 +819,10 @@ static void twaddle(void)
834 DRS->select_date = jiffies; 819 DRS->select_date = jiffies;
835} 820}
836 821
837/* reset all driver information about the current fdc. This is needed after 822/*
838 * a reset, and after a raw command. */ 823 * Reset all driver information about the current fdc.
824 * This is needed after a reset, and after a raw command.
825 */
839static void reset_fdc_info(int mode) 826static void reset_fdc_info(int mode)
840{ 827{
841 int drive; 828 int drive;
@@ -857,7 +844,7 @@ static void set_fdc(int drive)
857 current_drive = drive; 844 current_drive = drive;
858 } 845 }
859 if (fdc != 1 && fdc != 0) { 846 if (fdc != 1 && fdc != 0) {
860 printk("bad fdc value\n"); 847 pr_info("bad fdc value\n");
861 return; 848 return;
862 } 849 }
863 set_dor(fdc, ~0, 8); 850 set_dor(fdc, ~0, 8);
@@ -871,11 +858,10 @@ static void set_fdc(int drive)
871} 858}
872 859
873/* locks the driver */ 860/* locks the driver */
874static int _lock_fdc(int drive, int interruptible, int line) 861static int _lock_fdc(int drive, bool interruptible, int line)
875{ 862{
876 if (!usage_count) { 863 if (!usage_count) {
877 printk(KERN_ERR 864 pr_err("Trying to lock fdc while usage count=0 at line %d\n",
878 "Trying to lock fdc while usage count=0 at line %d\n",
879 line); 865 line);
880 return -1; 866 return -1;
881 } 867 }
@@ -904,15 +890,13 @@ static int _lock_fdc(int drive, int interruptible, int line)
904 } 890 }
905 command_status = FD_COMMAND_NONE; 891 command_status = FD_COMMAND_NONE;
906 892
907 __reschedule_timeout(drive, "lock fdc", 0); 893 __reschedule_timeout(drive, "lock fdc");
908 set_fdc(drive); 894 set_fdc(drive);
909 return 0; 895 return 0;
910} 896}
911 897
912#define lock_fdc(drive,interruptible) _lock_fdc(drive,interruptible, __LINE__) 898#define lock_fdc(drive, interruptible) \
913 899 _lock_fdc(drive, interruptible, __LINE__)
914#define LOCK_FDC(drive,interruptible) \
915if (lock_fdc(drive,interruptible)) return -EINTR;
916 900
917/* unlocks the driver */ 901/* unlocks the driver */
918static inline void unlock_fdc(void) 902static inline void unlock_fdc(void)
@@ -924,7 +908,7 @@ static inline void unlock_fdc(void)
924 DPRINT("FDC access conflict!\n"); 908 DPRINT("FDC access conflict!\n");
925 909
926 if (do_floppy) 910 if (do_floppy)
927 DPRINT("device interrupt still active at FDC release: %p!\n", 911 DPRINT("device interrupt still active at FDC release: %pf!\n",
928 do_floppy); 912 do_floppy);
929 command_status = FD_COMMAND_NONE; 913 command_status = FD_COMMAND_NONE;
930 spin_lock_irqsave(&floppy_lock, flags); 914 spin_lock_irqsave(&floppy_lock, flags);
@@ -1003,7 +987,7 @@ static void empty(void)
1003 987
1004static DECLARE_WORK(floppy_work, NULL); 988static DECLARE_WORK(floppy_work, NULL);
1005 989
1006static void schedule_bh(void (*handler) (void)) 990static void schedule_bh(void (*handler)(void))
1007{ 991{
1008 PREPARE_WORK(&floppy_work, (work_func_t)handler); 992 PREPARE_WORK(&floppy_work, (work_func_t)handler);
1009 schedule_work(&floppy_work); 993 schedule_work(&floppy_work);
@@ -1026,11 +1010,7 @@ static void cancel_activity(void)
1026 * transfer */ 1010 * transfer */
1027static void fd_watchdog(void) 1011static void fd_watchdog(void)
1028{ 1012{
1029#ifdef DCL_DEBUG 1013 debug_dcl(DP->flags, "calling disk change from watchdog\n");
1030 if (DP->flags & FD_DEBUG) {
1031 DPRINT("calling disk change from watchdog\n");
1032 }
1033#endif
1034 1014
1035 if (disk_change(current_drive)) { 1015 if (disk_change(current_drive)) {
1036 DPRINT("disk removed during i/o\n"); 1016 DPRINT("disk removed during i/o\n");
@@ -1039,7 +1019,7 @@ static void fd_watchdog(void)
1039 reset_fdc(); 1019 reset_fdc();
1040 } else { 1020 } else {
1041 del_timer(&fd_timer); 1021 del_timer(&fd_timer);
1042 fd_timer.function = (timeout_fn) fd_watchdog; 1022 fd_timer.function = (timeout_fn)fd_watchdog;
1043 fd_timer.expires = jiffies + HZ / 10; 1023 fd_timer.expires = jiffies + HZ / 10;
1044 add_timer(&fd_timer); 1024 add_timer(&fd_timer);
1045 } 1025 }
@@ -1105,25 +1085,23 @@ static void setup_DMA(void)
1105{ 1085{
1106 unsigned long f; 1086 unsigned long f;
1107 1087
1108#ifdef FLOPPY_SANITY_CHECK
1109 if (raw_cmd->length == 0) { 1088 if (raw_cmd->length == 0) {
1110 int i; 1089 int i;
1111 1090
1112 printk("zero dma transfer size:"); 1091 pr_info("zero dma transfer size:");
1113 for (i = 0; i < raw_cmd->cmd_count; i++) 1092 for (i = 0; i < raw_cmd->cmd_count; i++)
1114 printk("%x,", raw_cmd->cmd[i]); 1093 pr_cont("%x,", raw_cmd->cmd[i]);
1115 printk("\n"); 1094 pr_cont("\n");
1116 cont->done(0); 1095 cont->done(0);
1117 FDCS->reset = 1; 1096 FDCS->reset = 1;
1118 return; 1097 return;
1119 } 1098 }
1120 if (((unsigned long)raw_cmd->kernel_data) % 512) { 1099 if (((unsigned long)raw_cmd->kernel_data) % 512) {
1121 printk("non aligned address: %p\n", raw_cmd->kernel_data); 1100 pr_info("non aligned address: %p\n", raw_cmd->kernel_data);
1122 cont->done(0); 1101 cont->done(0);
1123 FDCS->reset = 1; 1102 FDCS->reset = 1;
1124 return; 1103 return;
1125 } 1104 }
1126#endif
1127 f = claim_dma_lock(); 1105 f = claim_dma_lock();
1128 fd_disable_dma(); 1106 fd_disable_dma();
1129#ifdef fd_dma_setup 1107#ifdef fd_dma_setup
@@ -1165,7 +1143,7 @@ static int wait_til_ready(void)
1165 if (status & STATUS_READY) 1143 if (status & STATUS_READY)
1166 return status; 1144 return status;
1167 } 1145 }
1168 if (!initialising) { 1146 if (initialized) {
1169 DPRINT("Getstatus times out (%x) on fdc %d\n", status, fdc); 1147 DPRINT("Getstatus times out (%x) on fdc %d\n", status, fdc);
1170 show_floppy(); 1148 show_floppy();
1171 } 1149 }
@@ -1176,22 +1154,21 @@ static int wait_til_ready(void)
1176/* sends a command byte to the fdc */ 1154/* sends a command byte to the fdc */
1177static int output_byte(char byte) 1155static int output_byte(char byte)
1178{ 1156{
1179 int status; 1157 int status = wait_til_ready();
1180 1158
1181 if ((status = wait_til_ready()) < 0) 1159 if (status < 0)
1182 return -1; 1160 return -1;
1183 if ((status & (STATUS_READY | STATUS_DIR | STATUS_DMA)) == STATUS_READY) { 1161
1162 if (is_ready_state(status)) {
1184 fd_outb(byte, FD_DATA); 1163 fd_outb(byte, FD_DATA);
1185#ifdef FLOPPY_SANITY_CHECK
1186 output_log[output_log_pos].data = byte; 1164 output_log[output_log_pos].data = byte;
1187 output_log[output_log_pos].status = status; 1165 output_log[output_log_pos].status = status;
1188 output_log[output_log_pos].jiffies = jiffies; 1166 output_log[output_log_pos].jiffies = jiffies;
1189 output_log_pos = (output_log_pos + 1) % OLOGSIZE; 1167 output_log_pos = (output_log_pos + 1) % OLOGSIZE;
1190#endif
1191 return 0; 1168 return 0;
1192 } 1169 }
1193 FDCS->reset = 1; 1170 FDCS->reset = 1;
1194 if (!initialising) { 1171 if (initialized) {
1195 DPRINT("Unable to send byte %x to FDC. Fdc=%x Status=%x\n", 1172 DPRINT("Unable to send byte %x to FDC. Fdc=%x Status=%x\n",
1196 byte, fdc, status); 1173 byte, fdc, status);
1197 show_floppy(); 1174 show_floppy();
@@ -1199,8 +1176,6 @@ static int output_byte(char byte)
1199 return -1; 1176 return -1;
1200} 1177}
1201 1178
1202#define LAST_OUT(x) if (output_byte(x)<0){ reset_fdc();return;}
1203
1204/* gets the response from the fdc */ 1179/* gets the response from the fdc */
1205static int result(void) 1180static int result(void)
1206{ 1181{
@@ -1208,14 +1183,13 @@ static int result(void)
1208 int status = 0; 1183 int status = 0;
1209 1184
1210 for (i = 0; i < MAX_REPLIES; i++) { 1185 for (i = 0; i < MAX_REPLIES; i++) {
1211 if ((status = wait_til_ready()) < 0) 1186 status = wait_til_ready();
1187 if (status < 0)
1212 break; 1188 break;
1213 status &= STATUS_DIR | STATUS_READY | STATUS_BUSY | STATUS_DMA; 1189 status &= STATUS_DIR | STATUS_READY | STATUS_BUSY | STATUS_DMA;
1214 if ((status & ~STATUS_BUSY) == STATUS_READY) { 1190 if ((status & ~STATUS_BUSY) == STATUS_READY) {
1215#ifdef FLOPPY_SANITY_CHECK
1216 resultjiffies = jiffies; 1191 resultjiffies = jiffies;
1217 resultsize = i; 1192 resultsize = i;
1218#endif
1219 return i; 1193 return i;
1220 } 1194 }
1221 if (status == (STATUS_DIR | STATUS_READY | STATUS_BUSY)) 1195 if (status == (STATUS_DIR | STATUS_READY | STATUS_BUSY))
@@ -1223,10 +1197,9 @@ static int result(void)
1223 else 1197 else
1224 break; 1198 break;
1225 } 1199 }
1226 if (!initialising) { 1200 if (initialized) {
1227 DPRINT 1201 DPRINT("get result error. Fdc=%d Last status=%x Read bytes=%d\n",
1228 ("get result error. Fdc=%d Last status=%x Read bytes=%d\n", 1202 fdc, status, i);
1229 fdc, status, i);
1230 show_floppy(); 1203 show_floppy();
1231 } 1204 }
1232 FDCS->reset = 1; 1205 FDCS->reset = 1;
@@ -1237,12 +1210,14 @@ static int result(void)
1237/* does the fdc need more output? */ 1210/* does the fdc need more output? */
1238static int need_more_output(void) 1211static int need_more_output(void)
1239{ 1212{
1240 int status; 1213 int status = wait_til_ready();
1241 1214
1242 if ((status = wait_til_ready()) < 0) 1215 if (status < 0)
1243 return -1; 1216 return -1;
1244 if ((status & (STATUS_READY | STATUS_DIR | STATUS_DMA)) == STATUS_READY) 1217
1218 if (is_ready_state(status))
1245 return MORE_OUTPUT; 1219 return MORE_OUTPUT;
1220
1246 return result(); 1221 return result();
1247} 1222}
1248 1223
@@ -1264,9 +1239,12 @@ static inline void perpendicular_mode(void)
1264 default: 1239 default:
1265 DPRINT("Invalid data rate for perpendicular mode!\n"); 1240 DPRINT("Invalid data rate for perpendicular mode!\n");
1266 cont->done(0); 1241 cont->done(0);
1267 FDCS->reset = 1; /* convenient way to return to 1242 FDCS->reset = 1;
1268 * redo without to much hassle (deep 1243 /*
1269 * stack et al. */ 1244 * convenient way to return to
1245 * redo without too much hassle
1246 * (deep stack et al.)
1247 */
1270 return; 1248 return;
1271 } 1249 }
1272 } else 1250 } else
@@ -1366,9 +1344,9 @@ static void fdc_specify(void)
1366 1344
1367 /* Convert step rate from microseconds to milliseconds and 4 bits */ 1345 /* Convert step rate from microseconds to milliseconds and 4 bits */
1368 srt = 16 - DIV_ROUND_UP(DP->srt * scale_dtr / 1000, NOMINAL_DTR); 1346 srt = 16 - DIV_ROUND_UP(DP->srt * scale_dtr / 1000, NOMINAL_DTR);
1369 if (slow_floppy) { 1347 if (slow_floppy)
1370 srt = srt / 4; 1348 srt = srt / 4;
1371 } 1349
1372 SUPBOUND(srt, 0xf); 1350 SUPBOUND(srt, 0xf);
1373 INFBOUND(srt, 0); 1351 INFBOUND(srt, 0);
1374 1352
@@ -1415,16 +1393,46 @@ static int fdc_dtr(void)
1415 * Pause 5 msec to avoid trouble. (Needs to be 2 jiffies) 1393 * Pause 5 msec to avoid trouble. (Needs to be 2 jiffies)
1416 */ 1394 */
1417 FDCS->dtr = raw_cmd->rate & 3; 1395 FDCS->dtr = raw_cmd->rate & 3;
1418 return (fd_wait_for_completion(jiffies + 2UL * HZ / 100, 1396 return fd_wait_for_completion(jiffies + 2UL * HZ / 100,
1419 (timeout_fn) floppy_ready)); 1397 (timeout_fn)floppy_ready);
1420} /* fdc_dtr */ 1398} /* fdc_dtr */
1421 1399
1422static void tell_sector(void) 1400static void tell_sector(void)
1423{ 1401{
1424 printk(": track %d, head %d, sector %d, size %d", 1402 pr_cont(": track %d, head %d, sector %d, size %d",
1425 R_TRACK, R_HEAD, R_SECTOR, R_SIZECODE); 1403 R_TRACK, R_HEAD, R_SECTOR, R_SIZECODE);
1426} /* tell_sector */ 1404} /* tell_sector */
1427 1405
1406static void print_errors(void)
1407{
1408 DPRINT("");
1409 if (ST0 & ST0_ECE) {
1410 pr_cont("Recalibrate failed!");
1411 } else if (ST2 & ST2_CRC) {
1412 pr_cont("data CRC error");
1413 tell_sector();
1414 } else if (ST1 & ST1_CRC) {
1415 pr_cont("CRC error");
1416 tell_sector();
1417 } else if ((ST1 & (ST1_MAM | ST1_ND)) ||
1418 (ST2 & ST2_MAM)) {
1419 if (!probing) {
1420 pr_cont("sector not found");
1421 tell_sector();
1422 } else
1423 pr_cont("probe failed...");
1424 } else if (ST2 & ST2_WC) { /* seek error */
1425 pr_cont("wrong cylinder");
1426 } else if (ST2 & ST2_BC) { /* cylinder marked as bad */
1427 pr_cont("bad cylinder");
1428 } else {
1429 pr_cont("unknown error. ST[0..2] are: 0x%x 0x%x 0x%x",
1430 ST0, ST1, ST2);
1431 tell_sector();
1432 }
1433 pr_cont("\n");
1434}
1435
1428/* 1436/*
1429 * OK, this error interpreting routine is called after a 1437 * OK, this error interpreting routine is called after a
1430 * DMA read/write has succeeded 1438 * DMA read/write has succeeded
@@ -1437,7 +1445,7 @@ static int interpret_errors(void)
1437 char bad; 1445 char bad;
1438 1446
1439 if (inr != 7) { 1447 if (inr != 7) {
1440 DPRINT("-- FDC reply error"); 1448 DPRINT("-- FDC reply error\n");
1441 FDCS->reset = 1; 1449 FDCS->reset = 1;
1442 return 1; 1450 return 1;
1443 } 1451 }
@@ -1450,43 +1458,17 @@ static int interpret_errors(void)
1450 bad = 1; 1458 bad = 1;
1451 if (ST1 & ST1_WP) { 1459 if (ST1 & ST1_WP) {
1452 DPRINT("Drive is write protected\n"); 1460 DPRINT("Drive is write protected\n");
1453 CLEARF(FD_DISK_WRITABLE); 1461 clear_bit(FD_DISK_WRITABLE_BIT, &DRS->flags);
1454 cont->done(0); 1462 cont->done(0);
1455 bad = 2; 1463 bad = 2;
1456 } else if (ST1 & ST1_ND) { 1464 } else if (ST1 & ST1_ND) {
1457 SETF(FD_NEED_TWADDLE); 1465 set_bit(FD_NEED_TWADDLE_BIT, &DRS->flags);
1458 } else if (ST1 & ST1_OR) { 1466 } else if (ST1 & ST1_OR) {
1459 if (DP->flags & FTD_MSG) 1467 if (DP->flags & FTD_MSG)
1460 DPRINT("Over/Underrun - retrying\n"); 1468 DPRINT("Over/Underrun - retrying\n");
1461 bad = 0; 1469 bad = 0;
1462 } else if (*errors >= DP->max_errors.reporting) { 1470 } else if (*errors >= DP->max_errors.reporting) {
1463 DPRINT(""); 1471 print_errors();
1464 if (ST0 & ST0_ECE) {
1465 printk("Recalibrate failed!");
1466 } else if (ST2 & ST2_CRC) {
1467 printk("data CRC error");
1468 tell_sector();
1469 } else if (ST1 & ST1_CRC) {
1470 printk("CRC error");
1471 tell_sector();
1472 } else if ((ST1 & (ST1_MAM | ST1_ND))
1473 || (ST2 & ST2_MAM)) {
1474 if (!probing) {
1475 printk("sector not found");
1476 tell_sector();
1477 } else
1478 printk("probe failed...");
1479 } else if (ST2 & ST2_WC) { /* seek error */
1480 printk("wrong cylinder");
1481 } else if (ST2 & ST2_BC) { /* cylinder marked as bad */
1482 printk("bad cylinder");
1483 } else {
1484 printk
1485 ("unknown error. ST[0..2] are: 0x%x 0x%x 0x%x",
1486 ST0, ST1, ST2);
1487 tell_sector();
1488 }
1489 printk("\n");
1490 } 1472 }
1491 if (ST2 & ST2_WC || ST2 & ST2_BC) 1473 if (ST2 & ST2_WC || ST2 & ST2_BC)
1492 /* wrong cylinder => recal */ 1474 /* wrong cylinder => recal */
@@ -1531,9 +1513,9 @@ static void setup_rw_floppy(void)
1531 */ 1513 */
1532 if (time_after(ready_date, jiffies + DP->select_delay)) { 1514 if (time_after(ready_date, jiffies + DP->select_delay)) {
1533 ready_date -= DP->select_delay; 1515 ready_date -= DP->select_delay;
1534 function = (timeout_fn) floppy_start; 1516 function = (timeout_fn)floppy_start;
1535 } else 1517 } else
1536 function = (timeout_fn) setup_rw_floppy; 1518 function = (timeout_fn)setup_rw_floppy;
1537 1519
1538 /* wait until the floppy is spinning fast enough */ 1520 /* wait until the floppy is spinning fast enough */
1539 if (fd_wait_for_completion(ready_date, function)) 1521 if (fd_wait_for_completion(ready_date, function))
@@ -1551,7 +1533,7 @@ static void setup_rw_floppy(void)
1551 for (i = 0; i < raw_cmd->cmd_count; i++) 1533 for (i = 0; i < raw_cmd->cmd_count; i++)
1552 r |= output_byte(raw_cmd->cmd[i]); 1534 r |= output_byte(raw_cmd->cmd[i]);
1553 1535
1554 debugt("rw_command: "); 1536 debugt(__func__, "rw_command");
1555 1537
1556 if (r) { 1538 if (r) {
1557 cont->error(); 1539 cont->error();
@@ -1574,7 +1556,7 @@ static int blind_seek;
1574 */ 1556 */
1575static void seek_interrupt(void) 1557static void seek_interrupt(void)
1576{ 1558{
1577 debugt("seek interrupt:"); 1559 debugt(__func__, "");
1578 if (inr != 2 || (ST0 & 0xF8) != 0x20) { 1560 if (inr != 2 || (ST0 & 0xF8) != 0x20) {
1579 DPRINT("seek failed\n"); 1561 DPRINT("seek failed\n");
1580 DRS->track = NEED_2_RECAL; 1562 DRS->track = NEED_2_RECAL;
@@ -1583,14 +1565,11 @@ static void seek_interrupt(void)
1583 return; 1565 return;
1584 } 1566 }
1585 if (DRS->track >= 0 && DRS->track != ST1 && !blind_seek) { 1567 if (DRS->track >= 0 && DRS->track != ST1 && !blind_seek) {
1586#ifdef DCL_DEBUG 1568 debug_dcl(DP->flags,
1587 if (DP->flags & FD_DEBUG) { 1569 "clearing NEWCHANGE flag because of effective seek\n");
1588 DPRINT 1570 debug_dcl(DP->flags, "jiffies=%lu\n", jiffies);
1589 ("clearing NEWCHANGE flag because of effective seek\n"); 1571 clear_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags);
1590 DPRINT("jiffies=%lu\n", jiffies); 1572 /* effective seek */
1591 }
1592#endif
1593 CLEARF(FD_DISK_NEWCHANGE); /* effective seek */
1594 DRS->select_date = jiffies; 1573 DRS->select_date = jiffies;
1595 } 1574 }
1596 DRS->track = ST1; 1575 DRS->track = ST1;
@@ -1599,26 +1578,23 @@ static void seek_interrupt(void)
1599 1578
1600static void check_wp(void) 1579static void check_wp(void)
1601{ 1580{
1602 if (TESTF(FD_VERIFY)) { 1581 if (test_bit(FD_VERIFY_BIT, &DRS->flags)) {
1603 /* check write protection */ 1582 /* check write protection */
1604 output_byte(FD_GETSTATUS); 1583 output_byte(FD_GETSTATUS);
1605 output_byte(UNIT(current_drive)); 1584 output_byte(UNIT(current_drive));
1606 if (result() != 1) { 1585 if (result() != 1) {
1607 FDCS->reset = 1; 1586 FDCS->reset = 1;
1608 return; 1587 return;
1609 } 1588 }
1610 CLEARF(FD_VERIFY); 1589 clear_bit(FD_VERIFY_BIT, &DRS->flags);
1611 CLEARF(FD_NEED_TWADDLE); 1590 clear_bit(FD_NEED_TWADDLE_BIT, &DRS->flags);
1612#ifdef DCL_DEBUG 1591 debug_dcl(DP->flags,
1613 if (DP->flags & FD_DEBUG) { 1592 "checking whether disk is write protected\n");
1614 DPRINT("checking whether disk is write protected\n"); 1593 debug_dcl(DP->flags, "wp=%x\n", ST3 & 0x40);
1615 DPRINT("wp=%x\n", ST3 & 0x40);
1616 }
1617#endif
1618 if (!(ST3 & 0x40)) 1594 if (!(ST3 & 0x40))
1619 SETF(FD_DISK_WRITABLE); 1595 set_bit(FD_DISK_WRITABLE_BIT, &DRS->flags);
1620 else 1596 else
1621 CLEARF(FD_DISK_WRITABLE); 1597 clear_bit(FD_DISK_WRITABLE_BIT, &DRS->flags);
1622 } 1598 }
1623} 1599}
1624 1600
@@ -1628,19 +1604,15 @@ static void seek_floppy(void)
1628 1604
1629 blind_seek = 0; 1605 blind_seek = 0;
1630 1606
1631#ifdef DCL_DEBUG 1607 debug_dcl(DP->flags, "calling disk change from %s\n", __func__);
1632 if (DP->flags & FD_DEBUG) {
1633 DPRINT("calling disk change from seek\n");
1634 }
1635#endif
1636 1608
1637 if (!TESTF(FD_DISK_NEWCHANGE) && 1609 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags) &&
1638 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) { 1610 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) {
1639 /* the media changed flag should be cleared after the seek. 1611 /* the media changed flag should be cleared after the seek.
1640 * If it isn't, this means that there is really no disk in 1612 * If it isn't, this means that there is really no disk in
1641 * the drive. 1613 * the drive.
1642 */ 1614 */
1643 SETF(FD_DISK_CHANGED); 1615 set_bit(FD_DISK_CHANGED_BIT, &DRS->flags);
1644 cont->done(0); 1616 cont->done(0);
1645 cont->redo(); 1617 cont->redo();
1646 return; 1618 return;
@@ -1648,7 +1620,7 @@ static void seek_floppy(void)
1648 if (DRS->track <= NEED_1_RECAL) { 1620 if (DRS->track <= NEED_1_RECAL) {
1649 recalibrate_floppy(); 1621 recalibrate_floppy();
1650 return; 1622 return;
1651 } else if (TESTF(FD_DISK_NEWCHANGE) && 1623 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags) &&
1652 (raw_cmd->flags & FD_RAW_NEED_DISK) && 1624 (raw_cmd->flags & FD_RAW_NEED_DISK) &&
1653 (DRS->track <= NO_TRACK || DRS->track == raw_cmd->track)) { 1625 (DRS->track <= NO_TRACK || DRS->track == raw_cmd->track)) {
1654 /* we seek to clear the media-changed condition. Does anybody 1626 /* we seek to clear the media-changed condition. Does anybody
@@ -1677,19 +1649,22 @@ static void seek_floppy(void)
1677 do_floppy = seek_interrupt; 1649 do_floppy = seek_interrupt;
1678 output_byte(FD_SEEK); 1650 output_byte(FD_SEEK);
1679 output_byte(UNIT(current_drive)); 1651 output_byte(UNIT(current_drive));
1680 LAST_OUT(track); 1652 if (output_byte(track) < 0) {
1681 debugt("seek command:"); 1653 reset_fdc();
1654 return;
1655 }
1656 debugt(__func__, "");
1682} 1657}
1683 1658
1684static void recal_interrupt(void) 1659static void recal_interrupt(void)
1685{ 1660{
1686 debugt("recal interrupt:"); 1661 debugt(__func__, "");
1687 if (inr != 2) 1662 if (inr != 2)
1688 FDCS->reset = 1; 1663 FDCS->reset = 1;
1689 else if (ST0 & ST0_ECE) { 1664 else if (ST0 & ST0_ECE) {
1690 switch (DRS->track) { 1665 switch (DRS->track) {
1691 case NEED_1_RECAL: 1666 case NEED_1_RECAL:
1692 debugt("recal interrupt need 1 recal:"); 1667 debugt(__func__, "need 1 recal");
1693 /* after a second recalibrate, we still haven't 1668 /* after a second recalibrate, we still haven't
1694 * reached track 0. Probably no drive. Raise an 1669 * reached track 0. Probably no drive. Raise an
1695 * error, as failing immediately might upset 1670 * error, as failing immediately might upset
@@ -1698,25 +1673,21 @@ static void recal_interrupt(void)
1698 cont->redo(); 1673 cont->redo();
1699 return; 1674 return;
1700 case NEED_2_RECAL: 1675 case NEED_2_RECAL:
1701 debugt("recal interrupt need 2 recal:"); 1676 debugt(__func__, "need 2 recal");
1702 /* If we already did a recalibrate, 1677 /* If we already did a recalibrate,
1703 * and we are not at track 0, this 1678 * and we are not at track 0, this
1704 * means we have moved. (The only way 1679 * means we have moved. (The only way
1705 * not to move at recalibration is to 1680 * not to move at recalibration is to
1706 * be already at track 0.) Clear the 1681 * be already at track 0.) Clear the
1707 * new change flag */ 1682 * new change flag */
1708#ifdef DCL_DEBUG 1683 debug_dcl(DP->flags,
1709 if (DP->flags & FD_DEBUG) { 1684 "clearing NEWCHANGE flag because of second recalibrate\n");
1710 DPRINT
1711 ("clearing NEWCHANGE flag because of second recalibrate\n");
1712 }
1713#endif
1714 1685
1715 CLEARF(FD_DISK_NEWCHANGE); 1686 clear_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags);
1716 DRS->select_date = jiffies; 1687 DRS->select_date = jiffies;
1717 /* fall through */ 1688 /* fall through */
1718 default: 1689 default:
1719 debugt("recal interrupt default:"); 1690 debugt(__func__, "default");
1720 /* Recalibrate moves the head by at 1691 /* Recalibrate moves the head by at
1721 * most 80 steps. If after one 1692 * most 80 steps. If after one
1722 * recalibrate we don't have reached 1693 * recalibrate we don't have reached
@@ -1738,8 +1709,8 @@ static void print_result(char *message, int inr)
1738 DPRINT("%s ", message); 1709 DPRINT("%s ", message);
1739 if (inr >= 0) 1710 if (inr >= 0)
1740 for (i = 0; i < inr; i++) 1711 for (i = 0; i < inr; i++)
1741 printk("repl[%d]=%x ", i, reply_buffer[i]); 1712 pr_cont("repl[%d]=%x ", i, reply_buffer[i]);
1742 printk("\n"); 1713 pr_cont("\n");
1743} 1714}
1744 1715
1745/* interrupt handler. Note that this can be called externally on the Sparc */ 1716/* interrupt handler. Note that this can be called externally on the Sparc */
@@ -1760,10 +1731,10 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
1760 do_floppy = NULL; 1731 do_floppy = NULL;
1761 if (fdc >= N_FDC || FDCS->address == -1) { 1732 if (fdc >= N_FDC || FDCS->address == -1) {
1762 /* we don't even know which FDC is the culprit */ 1733 /* we don't even know which FDC is the culprit */
1763 printk("DOR0=%x\n", fdc_state[0].dor); 1734 pr_info("DOR0=%x\n", fdc_state[0].dor);
1764 printk("floppy interrupt on bizarre fdc %d\n", fdc); 1735 pr_info("floppy interrupt on bizarre fdc %d\n", fdc);
1765 printk("handler=%p\n", handler); 1736 pr_info("handler=%pf\n", handler);
1766 is_alive("bizarre fdc"); 1737 is_alive(__func__, "bizarre fdc");
1767 return IRQ_NONE; 1738 return IRQ_NONE;
1768 } 1739 }
1769 1740
@@ -1777,7 +1748,7 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
1777 * activity. 1748 * activity.
1778 */ 1749 */
1779 1750
1780 do_print = !handler && print_unex && !initialising; 1751 do_print = !handler && print_unex && initialized;
1781 1752
1782 inr = result(); 1753 inr = result();
1783 if (do_print) 1754 if (do_print)
@@ -1790,15 +1761,15 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
1790 if (do_print) 1761 if (do_print)
1791 print_result("sensei", inr); 1762 print_result("sensei", inr);
1792 max_sensei--; 1763 max_sensei--;
1793 } while ((ST0 & 0x83) != UNIT(current_drive) && inr == 2 1764 } while ((ST0 & 0x83) != UNIT(current_drive) &&
1794 && max_sensei); 1765 inr == 2 && max_sensei);
1795 } 1766 }
1796 if (!handler) { 1767 if (!handler) {
1797 FDCS->reset = 1; 1768 FDCS->reset = 1;
1798 return IRQ_NONE; 1769 return IRQ_NONE;
1799 } 1770 }
1800 schedule_bh(handler); 1771 schedule_bh(handler);
1801 is_alive("normal interrupt end"); 1772 is_alive(__func__, "normal interrupt end");
1802 1773
1803 /* FIXME! Was it really for us? */ 1774 /* FIXME! Was it really for us? */
1804 return IRQ_HANDLED; 1775 return IRQ_HANDLED;
@@ -1806,10 +1777,11 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
1806 1777
1807static void recalibrate_floppy(void) 1778static void recalibrate_floppy(void)
1808{ 1779{
1809 debugt("recalibrate floppy:"); 1780 debugt(__func__, "");
1810 do_floppy = recal_interrupt; 1781 do_floppy = recal_interrupt;
1811 output_byte(FD_RECALIBRATE); 1782 output_byte(FD_RECALIBRATE);
1812 LAST_OUT(UNIT(current_drive)); 1783 if (output_byte(UNIT(current_drive)) < 0)
1784 reset_fdc();
1813} 1785}
1814 1786
1815/* 1787/*
@@ -1817,10 +1789,10 @@ static void recalibrate_floppy(void)
1817 */ 1789 */
1818static void reset_interrupt(void) 1790static void reset_interrupt(void)
1819{ 1791{
1820 debugt("reset interrupt:"); 1792 debugt(__func__, "");
1821 result(); /* get the status ready for set_fdc */ 1793 result(); /* get the status ready for set_fdc */
1822 if (FDCS->reset) { 1794 if (FDCS->reset) {
1823 printk("reset set in interrupt, calling %p\n", cont->error); 1795 pr_info("reset set in interrupt, calling %pf\n", cont->error);
1824 cont->error(); /* a reset just after a reset. BAD! */ 1796 cont->error(); /* a reset just after a reset. BAD! */
1825 } 1797 }
1826 cont->redo(); 1798 cont->redo();
@@ -1858,53 +1830,49 @@ static void show_floppy(void)
1858{ 1830{
1859 int i; 1831 int i;
1860 1832
1861 printk("\n"); 1833 pr_info("\n");
1862 printk("floppy driver state\n"); 1834 pr_info("floppy driver state\n");
1863 printk("-------------------\n"); 1835 pr_info("-------------------\n");
1864 printk("now=%lu last interrupt=%lu diff=%lu last called handler=%p\n", 1836 pr_info("now=%lu last interrupt=%lu diff=%lu last called handler=%pf\n",
1865 jiffies, interruptjiffies, jiffies - interruptjiffies, 1837 jiffies, interruptjiffies, jiffies - interruptjiffies,
1866 lasthandler); 1838 lasthandler);
1867 1839
1868#ifdef FLOPPY_SANITY_CHECK 1840 pr_info("timeout_message=%s\n", timeout_message);
1869 printk("timeout_message=%s\n", timeout_message); 1841 pr_info("last output bytes:\n");
1870 printk("last output bytes:\n");
1871 for (i = 0; i < OLOGSIZE; i++) 1842 for (i = 0; i < OLOGSIZE; i++)
1872 printk("%2x %2x %lu\n", 1843 pr_info("%2x %2x %lu\n",
1873 output_log[(i + output_log_pos) % OLOGSIZE].data, 1844 output_log[(i + output_log_pos) % OLOGSIZE].data,
1874 output_log[(i + output_log_pos) % OLOGSIZE].status, 1845 output_log[(i + output_log_pos) % OLOGSIZE].status,
1875 output_log[(i + output_log_pos) % OLOGSIZE].jiffies); 1846 output_log[(i + output_log_pos) % OLOGSIZE].jiffies);
1876 printk("last result at %lu\n", resultjiffies); 1847 pr_info("last result at %lu\n", resultjiffies);
1877 printk("last redo_fd_request at %lu\n", lastredo); 1848 pr_info("last redo_fd_request at %lu\n", lastredo);
1878 for (i = 0; i < resultsize; i++) { 1849 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1,
1879 printk("%2x ", reply_buffer[i]); 1850 reply_buffer, resultsize, true);
1880 } 1851
1881 printk("\n"); 1852 pr_info("status=%x\n", fd_inb(FD_STATUS));
1882#endif 1853 pr_info("fdc_busy=%lu\n", fdc_busy);
1883
1884 printk("status=%x\n", fd_inb(FD_STATUS));
1885 printk("fdc_busy=%lu\n", fdc_busy);
1886 if (do_floppy) 1854 if (do_floppy)
1887 printk("do_floppy=%p\n", do_floppy); 1855 pr_info("do_floppy=%pf\n", do_floppy);
1888 if (work_pending(&floppy_work)) 1856 if (work_pending(&floppy_work))
1889 printk("floppy_work.func=%p\n", floppy_work.func); 1857 pr_info("floppy_work.func=%pf\n", floppy_work.func);
1890 if (timer_pending(&fd_timer)) 1858 if (timer_pending(&fd_timer))
1891 printk("fd_timer.function=%p\n", fd_timer.function); 1859 pr_info("fd_timer.function=%pf\n", fd_timer.function);
1892 if (timer_pending(&fd_timeout)) { 1860 if (timer_pending(&fd_timeout)) {
1893 printk("timer_function=%p\n", fd_timeout.function); 1861 pr_info("timer_function=%pf\n", fd_timeout.function);
1894 printk("expires=%lu\n", fd_timeout.expires - jiffies); 1862 pr_info("expires=%lu\n", fd_timeout.expires - jiffies);
1895 printk("now=%lu\n", jiffies); 1863 pr_info("now=%lu\n", jiffies);
1896 } 1864 }
1897 printk("cont=%p\n", cont); 1865 pr_info("cont=%p\n", cont);
1898 printk("current_req=%p\n", current_req); 1866 pr_info("current_req=%p\n", current_req);
1899 printk("command_status=%d\n", command_status); 1867 pr_info("command_status=%d\n", command_status);
1900 printk("\n"); 1868 pr_info("\n");
1901} 1869}
1902 1870
1903static void floppy_shutdown(unsigned long data) 1871static void floppy_shutdown(unsigned long data)
1904{ 1872{
1905 unsigned long flags; 1873 unsigned long flags;
1906 1874
1907 if (!initialising) 1875 if (initialized)
1908 show_floppy(); 1876 show_floppy();
1909 cancel_activity(); 1877 cancel_activity();
1910 1878
@@ -1916,17 +1884,17 @@ static void floppy_shutdown(unsigned long data)
1916 1884
1917 /* avoid dma going to a random drive after shutdown */ 1885 /* avoid dma going to a random drive after shutdown */
1918 1886
1919 if (!initialising) 1887 if (initialized)
1920 DPRINT("floppy timeout called\n"); 1888 DPRINT("floppy timeout called\n");
1921 FDCS->reset = 1; 1889 FDCS->reset = 1;
1922 if (cont) { 1890 if (cont) {
1923 cont->done(0); 1891 cont->done(0);
1924 cont->redo(); /* this will recall reset when needed */ 1892 cont->redo(); /* this will recall reset when needed */
1925 } else { 1893 } else {
1926 printk("no cont in shutdown!\n"); 1894 pr_info("no cont in shutdown!\n");
1927 process_fd_request(); 1895 process_fd_request();
1928 } 1896 }
1929 is_alive("floppy shutdown"); 1897 is_alive(__func__, "");
1930} 1898}
1931 1899
1932/* start motor, check media-changed condition and write protection */ 1900/* start motor, check media-changed condition and write protection */
@@ -1954,27 +1922,26 @@ static int start_motor(void (*function)(void))
1954 set_dor(fdc, mask, data); 1922 set_dor(fdc, mask, data);
1955 1923
1956 /* wait_for_completion also schedules reset if needed. */ 1924 /* wait_for_completion also schedules reset if needed. */
1957 return (fd_wait_for_completion(DRS->select_date + DP->select_delay, 1925 return fd_wait_for_completion(DRS->select_date + DP->select_delay,
1958 (timeout_fn) function)); 1926 (timeout_fn)function);
1959} 1927}
1960 1928
1961static void floppy_ready(void) 1929static void floppy_ready(void)
1962{ 1930{
1963 CHECK_RESET; 1931 if (FDCS->reset) {
1932 reset_fdc();
1933 return;
1934 }
1964 if (start_motor(floppy_ready)) 1935 if (start_motor(floppy_ready))
1965 return; 1936 return;
1966 if (fdc_dtr()) 1937 if (fdc_dtr())
1967 return; 1938 return;
1968 1939
1969#ifdef DCL_DEBUG 1940 debug_dcl(DP->flags, "calling disk change from floppy_ready\n");
1970 if (DP->flags & FD_DEBUG) {
1971 DPRINT("calling disk change from floppy_ready\n");
1972 }
1973#endif
1974 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && 1941 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) &&
1975 disk_change(current_drive) && !DP->select_delay) 1942 disk_change(current_drive) && !DP->select_delay)
1976 twaddle(); /* this clears the dcl on certain drive/controller 1943 twaddle(); /* this clears the dcl on certain
1977 * combinations */ 1944 * drive/controller combinations */
1978 1945
1979#ifdef fd_chose_dma_mode 1946#ifdef fd_chose_dma_mode
1980 if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { 1947 if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) {
@@ -1998,15 +1965,11 @@ static void floppy_ready(void)
1998 1965
1999static void floppy_start(void) 1966static void floppy_start(void)
2000{ 1967{
2001 reschedule_timeout(current_reqD, "floppy start", 0); 1968 reschedule_timeout(current_reqD, "floppy start");
2002 1969
2003 scandrives(); 1970 scandrives();
2004#ifdef DCL_DEBUG 1971 debug_dcl(DP->flags, "setting NEWCHANGE in floppy_start\n");
2005 if (DP->flags & FD_DEBUG) { 1972 set_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags);
2006 DPRINT("setting NEWCHANGE in floppy_start\n");
2007 }
2008#endif
2009 SETF(FD_DISK_NEWCHANGE);
2010 floppy_ready(); 1973 floppy_ready();
2011} 1974}
2012 1975
@@ -2026,7 +1989,7 @@ static void floppy_start(void)
2026 1989
2027static void do_wakeup(void) 1990static void do_wakeup(void)
2028{ 1991{
2029 reschedule_timeout(MAXTIMEOUT, "do wakeup", 0); 1992 reschedule_timeout(MAXTIMEOUT, "do wakeup");
2030 cont = NULL; 1993 cont = NULL;
2031 command_status += 2; 1994 command_status += 2;
2032 wake_up(&command_done); 1995 wake_up(&command_done);
@@ -2046,7 +2009,7 @@ static struct cont_t intr_cont = {
2046 .done = (done_f)empty 2009 .done = (done_f)empty
2047}; 2010};
2048 2011
2049static int wait_til_done(void (*handler)(void), int interruptible) 2012static int wait_til_done(void (*handler)(void), bool interruptible)
2050{ 2013{
2051 int ret; 2014 int ret;
2052 2015
@@ -2064,7 +2027,7 @@ static int wait_til_done(void (*handler)(void), int interruptible)
2064 if (command_status >= 2 || !NO_SIGNAL) 2027 if (command_status >= 2 || !NO_SIGNAL)
2065 break; 2028 break;
2066 2029
2067 is_alive("wait_til_done"); 2030 is_alive(__func__, "");
2068 schedule(); 2031 schedule();
2069 } 2032 }
2070 2033
@@ -2180,9 +2143,9 @@ static void format_interrupt(void)
2180 cont->redo(); 2143 cont->redo();
2181} 2144}
2182 2145
2183#define CODE2SIZE (ssize = ((1 << SIZECODE) + 3) >> 2) 2146#define FM_MODE(x, y) ((y) & ~(((x)->rate & 0x80) >> 1))
2184#define FM_MODE(x,y) ((y) & ~(((x)->rate & 0x80) >>1))
2185#define CT(x) ((x) | 0xc0) 2147#define CT(x) ((x) | 0xc0)
2148
2186static void setup_format_params(int track) 2149static void setup_format_params(int track)
2187{ 2150{
2188 int n; 2151 int n;
@@ -2197,8 +2160,8 @@ static void setup_format_params(int track)
2197 raw_cmd = &default_raw_cmd; 2160 raw_cmd = &default_raw_cmd;
2198 raw_cmd->track = track; 2161 raw_cmd->track = track;
2199 2162
2200 raw_cmd->flags = FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN | 2163 raw_cmd->flags = (FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN |
2201 FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK; 2164 FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK);
2202 raw_cmd->rate = _floppy->rate & 0x43; 2165 raw_cmd->rate = _floppy->rate & 0x43;
2203 raw_cmd->cmd_count = NR_F; 2166 raw_cmd->cmd_count = NR_F;
2204 COMMAND = FM_MODE(_floppy, FD_FORMAT); 2167 COMMAND = FM_MODE(_floppy, FD_FORMAT);
@@ -2257,7 +2220,7 @@ static void redo_format(void)
2257 buffer_track = -1; 2220 buffer_track = -1;
2258 setup_format_params(format_req.track << STRETCH(_floppy)); 2221 setup_format_params(format_req.track << STRETCH(_floppy));
2259 floppy_start(); 2222 floppy_start();
2260 debugt("queue format request"); 2223 debugt(__func__, "queue format request");
2261} 2224}
2262 2225
2263static struct cont_t format_cont = { 2226static struct cont_t format_cont = {
@@ -2271,7 +2234,9 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
2271{ 2234{
2272 int ret; 2235 int ret;
2273 2236
2274 LOCK_FDC(drive, 1); 2237 if (lock_fdc(drive, true))
2238 return -EINTR;
2239
2275 set_floppy(drive); 2240 set_floppy(drive);
2276 if (!_floppy || 2241 if (!_floppy ||
2277 _floppy->track > DP->tracks || 2242 _floppy->track > DP->tracks ||
@@ -2286,7 +2251,9 @@ static int do_format(int drive, struct format_descr *tmp_format_req)
2286 format_errors = 0; 2251 format_errors = 0;
2287 cont = &format_cont; 2252 cont = &format_cont;
2288 errors = &format_errors; 2253 errors = &format_errors;
2289 IWAIT(redo_format); 2254 ret = wait_til_done(redo_format, true);
2255 if (ret == -EINTR)
2256 return -EINTR;
2290 process_fd_request(); 2257 process_fd_request();
2291 return ret; 2258 return ret;
2292} 2259}
@@ -2320,12 +2287,14 @@ static void request_done(int uptodate)
2320 struct request *req = current_req; 2287 struct request *req = current_req;
2321 unsigned long flags; 2288 unsigned long flags;
2322 int block; 2289 int block;
2290 char msg[sizeof("request done ") + sizeof(int) * 3];
2323 2291
2324 probing = 0; 2292 probing = 0;
2325 reschedule_timeout(MAXTIMEOUT, "request done %d", uptodate); 2293 snprintf(msg, sizeof(msg), "request done %d", uptodate);
2294 reschedule_timeout(MAXTIMEOUT, msg);
2326 2295
2327 if (!req) { 2296 if (!req) {
2328 printk("floppy.c: no request in request_done\n"); 2297 pr_info("floppy.c: no request in request_done\n");
2329 return; 2298 return;
2330 } 2299 }
2331 2300
@@ -2377,7 +2346,7 @@ static void rw_interrupt(void)
2377 DRS->first_read_date = jiffies; 2346 DRS->first_read_date = jiffies;
2378 2347
2379 nr_sectors = 0; 2348 nr_sectors = 0;
2380 CODE2SIZE; 2349 ssize = DIV_ROUND_UP(1 << SIZECODE, 4);
2381 2350
2382 if (ST1 & ST1_EOC) 2351 if (ST1 & ST1_EOC)
2383 eoc = 1; 2352 eoc = 1;
@@ -2393,20 +2362,18 @@ static void rw_interrupt(void)
2393 R_HEAD - HEAD) * SECT_PER_TRACK + 2362 R_HEAD - HEAD) * SECT_PER_TRACK +
2394 R_SECTOR - SECTOR + eoc) << SIZECODE >> 2; 2363 R_SECTOR - SECTOR + eoc) << SIZECODE >> 2;
2395 2364
2396#ifdef FLOPPY_SANITY_CHECK
2397 if (nr_sectors / ssize > 2365 if (nr_sectors / ssize >
2398 DIV_ROUND_UP(in_sector_offset + current_count_sectors, ssize)) { 2366 DIV_ROUND_UP(in_sector_offset + current_count_sectors, ssize)) {
2399 DPRINT("long rw: %x instead of %lx\n", 2367 DPRINT("long rw: %x instead of %lx\n",
2400 nr_sectors, current_count_sectors); 2368 nr_sectors, current_count_sectors);
2401 printk("rs=%d s=%d\n", R_SECTOR, SECTOR); 2369 pr_info("rs=%d s=%d\n", R_SECTOR, SECTOR);
2402 printk("rh=%d h=%d\n", R_HEAD, HEAD); 2370 pr_info("rh=%d h=%d\n", R_HEAD, HEAD);
2403 printk("rt=%d t=%d\n", R_TRACK, TRACK); 2371 pr_info("rt=%d t=%d\n", R_TRACK, TRACK);
2404 printk("heads=%d eoc=%d\n", heads, eoc); 2372 pr_info("heads=%d eoc=%d\n", heads, eoc);
2405 printk("spt=%d st=%d ss=%d\n", SECT_PER_TRACK, 2373 pr_info("spt=%d st=%d ss=%d\n",
2406 fsector_t, ssize); 2374 SECT_PER_TRACK, fsector_t, ssize);
2407 printk("in_sector_offset=%d\n", in_sector_offset); 2375 pr_info("in_sector_offset=%d\n", in_sector_offset);
2408 } 2376 }
2409#endif
2410 2377
2411 nr_sectors -= in_sector_offset; 2378 nr_sectors -= in_sector_offset;
2412 INFBOUND(nr_sectors, 0); 2379 INFBOUND(nr_sectors, 0);
@@ -2511,19 +2478,17 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
2511 blk_rq_sectors(current_req)); 2478 blk_rq_sectors(current_req));
2512 2479
2513 remaining = current_count_sectors << 9; 2480 remaining = current_count_sectors << 9;
2514#ifdef FLOPPY_SANITY_CHECK
2515 if (remaining > blk_rq_bytes(current_req) && CT(COMMAND) == FD_WRITE) { 2481 if (remaining > blk_rq_bytes(current_req) && CT(COMMAND) == FD_WRITE) {
2516 DPRINT("in copy buffer\n"); 2482 DPRINT("in copy buffer\n");
2517 printk("current_count_sectors=%ld\n", current_count_sectors); 2483 pr_info("current_count_sectors=%ld\n", current_count_sectors);
2518 printk("remaining=%d\n", remaining >> 9); 2484 pr_info("remaining=%d\n", remaining >> 9);
2519 printk("current_req->nr_sectors=%u\n", 2485 pr_info("current_req->nr_sectors=%u\n",
2520 blk_rq_sectors(current_req)); 2486 blk_rq_sectors(current_req));
2521 printk("current_req->current_nr_sectors=%u\n", 2487 pr_info("current_req->current_nr_sectors=%u\n",
2522 blk_rq_cur_sectors(current_req)); 2488 blk_rq_cur_sectors(current_req));
2523 printk("max_sector=%d\n", max_sector); 2489 pr_info("max_sector=%d\n", max_sector);
2524 printk("ssize=%d\n", ssize); 2490 pr_info("ssize=%d\n", ssize);
2525 } 2491 }
2526#endif
2527 2492
2528 buffer_max = max(max_sector, buffer_max); 2493 buffer_max = max(max_sector, buffer_max);
2529 2494
@@ -2539,26 +2504,24 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
2539 SUPBOUND(size, remaining); 2504 SUPBOUND(size, remaining);
2540 2505
2541 buffer = page_address(bv->bv_page) + bv->bv_offset; 2506 buffer = page_address(bv->bv_page) + bv->bv_offset;
2542#ifdef FLOPPY_SANITY_CHECK
2543 if (dma_buffer + size > 2507 if (dma_buffer + size >
2544 floppy_track_buffer + (max_buffer_sectors << 10) || 2508 floppy_track_buffer + (max_buffer_sectors << 10) ||
2545 dma_buffer < floppy_track_buffer) { 2509 dma_buffer < floppy_track_buffer) {
2546 DPRINT("buffer overrun in copy buffer %d\n", 2510 DPRINT("buffer overrun in copy buffer %d\n",
2547 (int)((floppy_track_buffer - 2511 (int)((floppy_track_buffer - dma_buffer) >> 9));
2548 dma_buffer) >> 9)); 2512 pr_info("fsector_t=%d buffer_min=%d\n",
2549 printk("fsector_t=%d buffer_min=%d\n", 2513 fsector_t, buffer_min);
2550 fsector_t, buffer_min); 2514 pr_info("current_count_sectors=%ld\n",
2551 printk("current_count_sectors=%ld\n", 2515 current_count_sectors);
2552 current_count_sectors);
2553 if (CT(COMMAND) == FD_READ) 2516 if (CT(COMMAND) == FD_READ)
2554 printk("read\n"); 2517 pr_info("read\n");
2555 if (CT(COMMAND) == FD_WRITE) 2518 if (CT(COMMAND) == FD_WRITE)
2556 printk("write\n"); 2519 pr_info("write\n");
2557 break; 2520 break;
2558 } 2521 }
2559 if (((unsigned long)buffer) % 512) 2522 if (((unsigned long)buffer) % 512)
2560 DPRINT("%p buffer not aligned\n", buffer); 2523 DPRINT("%p buffer not aligned\n", buffer);
2561#endif 2524
2562 if (CT(COMMAND) == FD_READ) 2525 if (CT(COMMAND) == FD_READ)
2563 memcpy(buffer, dma_buffer, size); 2526 memcpy(buffer, dma_buffer, size);
2564 else 2527 else
@@ -2567,13 +2530,11 @@ static void copy_buffer(int ssize, int max_sector, int max_sector_2)
2567 remaining -= size; 2530 remaining -= size;
2568 dma_buffer += size; 2531 dma_buffer += size;
2569 } 2532 }
2570#ifdef FLOPPY_SANITY_CHECK
2571 if (remaining) { 2533 if (remaining) {
2572 if (remaining > 0) 2534 if (remaining > 0)
2573 max_sector -= remaining >> 9; 2535 max_sector -= remaining >> 9;
2574 DPRINT("weirdness: remaining %d\n", remaining >> 9); 2536 DPRINT("weirdness: remaining %d\n", remaining >> 9);
2575 } 2537 }
2576#endif
2577} 2538}
2578 2539
2579/* work around a bug in pseudo DMA 2540/* work around a bug in pseudo DMA
@@ -2593,15 +2554,14 @@ static void virtualdmabug_workaround(void)
2593 2554
2594 hard_sectors = raw_cmd->length >> (7 + SIZECODE); 2555 hard_sectors = raw_cmd->length >> (7 + SIZECODE);
2595 end_sector = SECTOR + hard_sectors - 1; 2556 end_sector = SECTOR + hard_sectors - 1;
2596#ifdef FLOPPY_SANITY_CHECK
2597 if (end_sector > SECT_PER_TRACK) { 2557 if (end_sector > SECT_PER_TRACK) {
2598 printk("too many sectors %d > %d\n", 2558 pr_info("too many sectors %d > %d\n",
2599 end_sector, SECT_PER_TRACK); 2559 end_sector, SECT_PER_TRACK);
2600 return; 2560 return;
2601 } 2561 }
2602#endif 2562 SECT_PER_TRACK = end_sector;
2603 SECT_PER_TRACK = end_sector; /* make sure SECT_PER_TRACK points 2563 /* make sure SECT_PER_TRACK
2604 * to end of transfer */ 2564 * points to end of transfer */
2605 } 2565 }
2606} 2566}
2607 2567
@@ -2624,7 +2584,7 @@ static int make_raw_rw_request(void)
2624 int ssize; 2584 int ssize;
2625 2585
2626 if (max_buffer_sectors == 0) { 2586 if (max_buffer_sectors == 0) {
2627 printk("VFS: Block I/O scheduled on unopened device\n"); 2587 pr_info("VFS: Block I/O scheduled on unopened device\n");
2628 return 0; 2588 return 0;
2629 } 2589 }
2630 2590
@@ -2641,7 +2601,7 @@ static int make_raw_rw_request(void)
2641 raw_cmd->flags |= FD_RAW_WRITE; 2601 raw_cmd->flags |= FD_RAW_WRITE;
2642 COMMAND = FM_MODE(_floppy, FD_WRITE); 2602 COMMAND = FM_MODE(_floppy, FD_WRITE);
2643 } else { 2603 } else {
2644 DPRINT("make_raw_rw_request: unknown command\n"); 2604 DPRINT("%s: unknown command\n", __func__);
2645 return 0; 2605 return 0;
2646 } 2606 }
2647 2607
@@ -2659,7 +2619,8 @@ static int make_raw_rw_request(void)
2659 HEAD = fsector_t / _floppy->sect; 2619 HEAD = fsector_t / _floppy->sect;
2660 2620
2661 if (((_floppy->stretch & (FD_SWAPSIDES | FD_SECTBASEMASK)) || 2621 if (((_floppy->stretch & (FD_SWAPSIDES | FD_SECTBASEMASK)) ||
2662 TESTF(FD_NEED_TWADDLE)) && fsector_t < _floppy->sect) 2622 test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags)) &&
2623 fsector_t < _floppy->sect)
2663 max_sector = _floppy->sect; 2624 max_sector = _floppy->sect;
2664 2625
2665 /* 2M disks have phantom sectors on the first track */ 2626 /* 2M disks have phantom sectors on the first track */
@@ -2685,7 +2646,7 @@ static int make_raw_rw_request(void)
2685 raw_cmd->track = TRACK << STRETCH(_floppy); 2646 raw_cmd->track = TRACK << STRETCH(_floppy);
2686 DR_SELECT = UNIT(current_drive) + PH_HEAD(_floppy, HEAD); 2647 DR_SELECT = UNIT(current_drive) + PH_HEAD(_floppy, HEAD);
2687 GAP = _floppy->gap; 2648 GAP = _floppy->gap;
2688 CODE2SIZE; 2649 ssize = DIV_ROUND_UP(1 << SIZECODE, 4);
2689 SECT_PER_TRACK = _floppy->sect << 2 >> SIZECODE; 2650 SECT_PER_TRACK = _floppy->sect << 2 >> SIZECODE;
2690 SECTOR = ((fsector_t % _floppy->sect) << 2 >> SIZECODE) + 2651 SECTOR = ((fsector_t % _floppy->sect) << 2 >> SIZECODE) +
2691 FD_SECTBASE(_floppy); 2652 FD_SECTBASE(_floppy);
@@ -2730,8 +2691,10 @@ static int make_raw_rw_request(void)
2730 } 2691 }
2731 } else if (in_sector_offset || blk_rq_sectors(current_req) < ssize) { 2692 } else if (in_sector_offset || blk_rq_sectors(current_req) < ssize) {
2732 if (CT(COMMAND) == FD_WRITE) { 2693 if (CT(COMMAND) == FD_WRITE) {
2733 if (fsector_t + blk_rq_sectors(current_req) > ssize && 2694 unsigned int sectors;
2734 fsector_t + blk_rq_sectors(current_req) < ssize + ssize) 2695
2696 sectors = fsector_t + blk_rq_sectors(current_req);
2697 if (sectors > ssize && sectors < ssize + ssize)
2735 max_size = ssize + ssize; 2698 max_size = ssize + ssize;
2736 else 2699 else
2737 max_size = ssize; 2700 max_size = ssize;
@@ -2752,12 +2715,10 @@ static int make_raw_rw_request(void)
2752 * on a 64 bit machine! 2715 * on a 64 bit machine!
2753 */ 2716 */
2754 max_size = buffer_chain_size(); 2717 max_size = buffer_chain_size();
2755 dma_limit = 2718 dma_limit = (MAX_DMA_ADDRESS -
2756 (MAX_DMA_ADDRESS - 2719 ((unsigned long)current_req->buffer)) >> 9;
2757 ((unsigned long)current_req->buffer)) >> 9; 2720 if ((unsigned long)max_size > dma_limit)
2758 if ((unsigned long)max_size > dma_limit) {
2759 max_size = dma_limit; 2721 max_size = dma_limit;
2760 }
2761 /* 64 kb boundaries */ 2722 /* 64 kb boundaries */
2762 if (CROSS_64KB(current_req->buffer, max_size << 9)) 2723 if (CROSS_64KB(current_req->buffer, max_size << 9))
2763 max_size = (K_64 - 2724 max_size = (K_64 -
@@ -2773,16 +2734,16 @@ static int make_raw_rw_request(void)
2773 */ 2734 */
2774 if (!direct || 2735 if (!direct ||
2775 (indirect * 2 > direct * 3 && 2736 (indirect * 2 > direct * 3 &&
2776 *errors < DP->max_errors.read_track && ((!probing 2737 *errors < DP->max_errors.read_track &&
2777 || (DP->read_track & (1 << DRS->probed_format)))))) { 2738 ((!probing ||
2739 (DP->read_track & (1 << DRS->probed_format)))))) {
2778 max_size = blk_rq_sectors(current_req); 2740 max_size = blk_rq_sectors(current_req);
2779 } else { 2741 } else {
2780 raw_cmd->kernel_data = current_req->buffer; 2742 raw_cmd->kernel_data = current_req->buffer;
2781 raw_cmd->length = current_count_sectors << 9; 2743 raw_cmd->length = current_count_sectors << 9;
2782 if (raw_cmd->length == 0) { 2744 if (raw_cmd->length == 0) {
2783 DPRINT 2745 DPRINT("%s: zero dma transfer attempted\n", __func__);
2784 ("zero dma transfer attempted from make_raw_request\n"); 2746 DPRINT("indirect=%d direct=%d fsector_t=%d\n",
2785 DPRINT("indirect=%d direct=%d fsector_t=%d",
2786 indirect, direct, fsector_t); 2747 indirect, direct, fsector_t);
2787 return 0; 2748 return 0;
2788 } 2749 }
@@ -2802,25 +2763,22 @@ static int make_raw_rw_request(void)
2802 ((CT(COMMAND) == FD_READ || 2763 ((CT(COMMAND) == FD_READ ||
2803 (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) && 2764 (!in_sector_offset && blk_rq_sectors(current_req) >= ssize)) &&
2804 max_sector > 2 * max_buffer_sectors + buffer_min && 2765 max_sector > 2 * max_buffer_sectors + buffer_min &&
2805 max_size + fsector_t > 2 * max_buffer_sectors + buffer_min) 2766 max_size + fsector_t > 2 * max_buffer_sectors + buffer_min)) {
2806 /* not enough space */ 2767 /* not enough space */
2807 ) {
2808 buffer_track = -1; 2768 buffer_track = -1;
2809 buffer_drive = current_drive; 2769 buffer_drive = current_drive;
2810 buffer_max = buffer_min = aligned_sector_t; 2770 buffer_max = buffer_min = aligned_sector_t;
2811 } 2771 }
2812 raw_cmd->kernel_data = floppy_track_buffer + 2772 raw_cmd->kernel_data = floppy_track_buffer +
2813 ((aligned_sector_t - buffer_min) << 9); 2773 ((aligned_sector_t - buffer_min) << 9);
2814 2774
2815 if (CT(COMMAND) == FD_WRITE) { 2775 if (CT(COMMAND) == FD_WRITE) {
2816 /* copy write buffer to track buffer. 2776 /* copy write buffer to track buffer.
2817 * if we get here, we know that the write 2777 * if we get here, we know that the write
2818 * is either aligned or the data already in the buffer 2778 * is either aligned or the data already in the buffer
2819 * (buffer will be overwritten) */ 2779 * (buffer will be overwritten) */
2820#ifdef FLOPPY_SANITY_CHECK
2821 if (in_sector_offset && buffer_track == -1) 2780 if (in_sector_offset && buffer_track == -1)
2822 DPRINT("internal error offset !=0 on write\n"); 2781 DPRINT("internal error offset !=0 on write\n");
2823#endif
2824 buffer_track = raw_cmd->track; 2782 buffer_track = raw_cmd->track;
2825 buffer_drive = current_drive; 2783 buffer_drive = current_drive;
2826 copy_buffer(ssize, max_sector, 2784 copy_buffer(ssize, max_sector,
@@ -2834,7 +2792,6 @@ static int make_raw_rw_request(void)
2834 raw_cmd->length = in_sector_offset + current_count_sectors; 2792 raw_cmd->length = in_sector_offset + current_count_sectors;
2835 raw_cmd->length = ((raw_cmd->length - 1) | (ssize - 1)) + 1; 2793 raw_cmd->length = ((raw_cmd->length - 1) | (ssize - 1)) + 1;
2836 raw_cmd->length <<= 9; 2794 raw_cmd->length <<= 9;
2837#ifdef FLOPPY_SANITY_CHECK
2838 if ((raw_cmd->length < current_count_sectors << 9) || 2795 if ((raw_cmd->length < current_count_sectors << 9) ||
2839 (raw_cmd->kernel_data != current_req->buffer && 2796 (raw_cmd->kernel_data != current_req->buffer &&
2840 CT(COMMAND) == FD_WRITE && 2797 CT(COMMAND) == FD_WRITE &&
@@ -2845,19 +2802,19 @@ static int make_raw_rw_request(void)
2845 DPRINT("fractionary current count b=%lx s=%lx\n", 2802 DPRINT("fractionary current count b=%lx s=%lx\n",
2846 raw_cmd->length, current_count_sectors); 2803 raw_cmd->length, current_count_sectors);
2847 if (raw_cmd->kernel_data != current_req->buffer) 2804 if (raw_cmd->kernel_data != current_req->buffer)
2848 printk("addr=%d, length=%ld\n", 2805 pr_info("addr=%d, length=%ld\n",
2849 (int)((raw_cmd->kernel_data - 2806 (int)((raw_cmd->kernel_data -
2850 floppy_track_buffer) >> 9), 2807 floppy_track_buffer) >> 9),
2851 current_count_sectors); 2808 current_count_sectors);
2852 printk("st=%d ast=%d mse=%d msi=%d\n", 2809 pr_info("st=%d ast=%d mse=%d msi=%d\n",
2853 fsector_t, aligned_sector_t, max_sector, max_size); 2810 fsector_t, aligned_sector_t, max_sector, max_size);
2854 printk("ssize=%x SIZECODE=%d\n", ssize, SIZECODE); 2811 pr_info("ssize=%x SIZECODE=%d\n", ssize, SIZECODE);
2855 printk("command=%x SECTOR=%d HEAD=%d, TRACK=%d\n", 2812 pr_info("command=%x SECTOR=%d HEAD=%d, TRACK=%d\n",
2856 COMMAND, SECTOR, HEAD, TRACK); 2813 COMMAND, SECTOR, HEAD, TRACK);
2857 printk("buffer drive=%d\n", buffer_drive); 2814 pr_info("buffer drive=%d\n", buffer_drive);
2858 printk("buffer track=%d\n", buffer_track); 2815 pr_info("buffer track=%d\n", buffer_track);
2859 printk("buffer_min=%d\n", buffer_min); 2816 pr_info("buffer_min=%d\n", buffer_min);
2860 printk("buffer_max=%d\n", buffer_max); 2817 pr_info("buffer_max=%d\n", buffer_max);
2861 return 0; 2818 return 0;
2862 } 2819 }
2863 2820
@@ -2868,14 +2825,14 @@ static int make_raw_rw_request(void)
2868 raw_cmd->kernel_data + raw_cmd->length > 2825 raw_cmd->kernel_data + raw_cmd->length >
2869 floppy_track_buffer + (max_buffer_sectors << 10)) { 2826 floppy_track_buffer + (max_buffer_sectors << 10)) {
2870 DPRINT("buffer overrun in schedule dma\n"); 2827 DPRINT("buffer overrun in schedule dma\n");
2871 printk("fsector_t=%d buffer_min=%d current_count=%ld\n", 2828 pr_info("fsector_t=%d buffer_min=%d current_count=%ld\n",
2872 fsector_t, buffer_min, raw_cmd->length >> 9); 2829 fsector_t, buffer_min, raw_cmd->length >> 9);
2873 printk("current_count_sectors=%ld\n", 2830 pr_info("current_count_sectors=%ld\n",
2874 current_count_sectors); 2831 current_count_sectors);
2875 if (CT(COMMAND) == FD_READ) 2832 if (CT(COMMAND) == FD_READ)
2876 printk("read\n"); 2833 pr_info("read\n");
2877 if (CT(COMMAND) == FD_WRITE) 2834 if (CT(COMMAND) == FD_WRITE)
2878 printk("write\n"); 2835 pr_info("write\n");
2879 return 0; 2836 return 0;
2880 } 2837 }
2881 } else if (raw_cmd->length > blk_rq_bytes(current_req) || 2838 } else if (raw_cmd->length > blk_rq_bytes(current_req) ||
@@ -2884,14 +2841,13 @@ static int make_raw_rw_request(void)
2884 return 0; 2841 return 0;
2885 } else if (raw_cmd->length < current_count_sectors << 9) { 2842 } else if (raw_cmd->length < current_count_sectors << 9) {
2886 DPRINT("more sectors than bytes\n"); 2843 DPRINT("more sectors than bytes\n");
2887 printk("bytes=%ld\n", raw_cmd->length >> 9); 2844 pr_info("bytes=%ld\n", raw_cmd->length >> 9);
2888 printk("sectors=%ld\n", current_count_sectors); 2845 pr_info("sectors=%ld\n", current_count_sectors);
2889 } 2846 }
2890 if (raw_cmd->length == 0) { 2847 if (raw_cmd->length == 0) {
2891 DPRINT("zero dma transfer attempted from make_raw_request\n"); 2848 DPRINT("zero dma transfer attempted from make_raw_request\n");
2892 return 0; 2849 return 0;
2893 } 2850 }
2894#endif
2895 2851
2896 virtualdmabug_workaround(); 2852 virtualdmabug_workaround();
2897 return 2; 2853 return 2;
@@ -2899,7 +2855,6 @@ static int make_raw_rw_request(void)
2899 2855
2900static void redo_fd_request(void) 2856static void redo_fd_request(void)
2901{ 2857{
2902#define REPEAT {request_done(0); continue; }
2903 int drive; 2858 int drive;
2904 int tmp; 2859 int tmp;
2905 2860
@@ -2907,63 +2862,63 @@ static void redo_fd_request(void)
2907 if (current_drive < N_DRIVE) 2862 if (current_drive < N_DRIVE)
2908 floppy_off(current_drive); 2863 floppy_off(current_drive);
2909 2864
2910 for (;;) { 2865do_request:
2911 if (!current_req) { 2866 if (!current_req) {
2912 struct request *req; 2867 struct request *req;
2913
2914 spin_lock_irq(floppy_queue->queue_lock);
2915 req = blk_fetch_request(floppy_queue);
2916 spin_unlock_irq(floppy_queue->queue_lock);
2917 if (!req) {
2918 do_floppy = NULL;
2919 unlock_fdc();
2920 return;
2921 }
2922 current_req = req;
2923 }
2924 drive = (long)current_req->rq_disk->private_data;
2925 set_fdc(drive);
2926 reschedule_timeout(current_reqD, "redo fd request", 0);
2927 2868
2928 set_floppy(drive); 2869 spin_lock_irq(floppy_queue->queue_lock);
2929 raw_cmd = &default_raw_cmd; 2870 req = blk_fetch_request(floppy_queue);
2930 raw_cmd->flags = 0; 2871 spin_unlock_irq(floppy_queue->queue_lock);
2931 if (start_motor(redo_fd_request)) 2872 if (!req) {
2873 do_floppy = NULL;
2874 unlock_fdc();
2932 return; 2875 return;
2933 disk_change(current_drive);
2934 if (test_bit(current_drive, &fake_change) ||
2935 TESTF(FD_DISK_CHANGED)) {
2936 DPRINT("disk absent or changed during operation\n");
2937 REPEAT;
2938 }
2939 if (!_floppy) { /* Autodetection */
2940 if (!probing) {
2941 DRS->probed_format = 0;
2942 if (next_valid_format()) {
2943 DPRINT("no autodetectable formats\n");
2944 _floppy = NULL;
2945 REPEAT;
2946 }
2947 }
2948 probing = 1;
2949 _floppy =
2950 floppy_type + DP->autodetect[DRS->probed_format];
2951 } else
2952 probing = 0;
2953 errors = &(current_req->errors);
2954 tmp = make_raw_rw_request();
2955 if (tmp < 2) {
2956 request_done(tmp);
2957 continue;
2958 } 2876 }
2877 current_req = req;
2878 }
2879 drive = (long)current_req->rq_disk->private_data;
2880 set_fdc(drive);
2881 reschedule_timeout(current_reqD, "redo fd request");
2959 2882
2960 if (TESTF(FD_NEED_TWADDLE)) 2883 set_floppy(drive);
2961 twaddle(); 2884 raw_cmd = &default_raw_cmd;
2962 schedule_bh(floppy_start); 2885 raw_cmd->flags = 0;
2963 debugt("queue fd request"); 2886 if (start_motor(redo_fd_request))
2964 return; 2887 return;
2888
2889 disk_change(current_drive);
2890 if (test_bit(current_drive, &fake_change) ||
2891 test_bit(FD_DISK_CHANGED_BIT, &DRS->flags)) {
2892 DPRINT("disk absent or changed during operation\n");
2893 request_done(0);
2894 goto do_request;
2895 }
2896 if (!_floppy) { /* Autodetection */
2897 if (!probing) {
2898 DRS->probed_format = 0;
2899 if (next_valid_format()) {
2900 DPRINT("no autodetectable formats\n");
2901 _floppy = NULL;
2902 request_done(0);
2903 goto do_request;
2904 }
2905 }
2906 probing = 1;
2907 _floppy = floppy_type + DP->autodetect[DRS->probed_format];
2908 } else
2909 probing = 0;
2910 errors = &(current_req->errors);
2911 tmp = make_raw_rw_request();
2912 if (tmp < 2) {
2913 request_done(tmp);
2914 goto do_request;
2965 } 2915 }
2966#undef REPEAT 2916
2917 if (test_bit(FD_NEED_TWADDLE_BIT, &DRS->flags))
2918 twaddle();
2919 schedule_bh(floppy_start);
2920 debugt(__func__, "queue fd request");
2921 return;
2967} 2922}
2968 2923
2969static struct cont_t rw_cont = { 2924static struct cont_t rw_cont = {
@@ -2979,30 +2934,30 @@ static void process_fd_request(void)
2979 schedule_bh(redo_fd_request); 2934 schedule_bh(redo_fd_request);
2980} 2935}
2981 2936
2982static void do_fd_request(struct request_queue * q) 2937static void do_fd_request(struct request_queue *q)
2983{ 2938{
2984 if (max_buffer_sectors == 0) { 2939 if (max_buffer_sectors == 0) {
2985 printk("VFS: do_fd_request called on non-open device\n"); 2940 pr_info("VFS: %s called on non-open device\n", __func__);
2986 return; 2941 return;
2987 } 2942 }
2988 2943
2989 if (usage_count == 0) { 2944 if (usage_count == 0) {
2990 printk("warning: usage count=0, current_req=%p exiting\n", 2945 pr_info("warning: usage count=0, current_req=%p exiting\n",
2991 current_req); 2946 current_req);
2992 printk("sect=%ld type=%x flags=%x\n", 2947 pr_info("sect=%ld type=%x flags=%x\n",
2993 (long)blk_rq_pos(current_req), current_req->cmd_type, 2948 (long)blk_rq_pos(current_req), current_req->cmd_type,
2994 current_req->cmd_flags); 2949 current_req->cmd_flags);
2995 return; 2950 return;
2996 } 2951 }
2997 if (test_bit(0, &fdc_busy)) { 2952 if (test_bit(0, &fdc_busy)) {
2998 /* fdc busy, this new request will be treated when the 2953 /* fdc busy, this new request will be treated when the
2999 current one is done */ 2954 current one is done */
3000 is_alive("do fd request, old request running"); 2955 is_alive(__func__, "old request running");
3001 return; 2956 return;
3002 } 2957 }
3003 lock_fdc(MAXTIMEOUT, 0); 2958 lock_fdc(MAXTIMEOUT, false);
3004 process_fd_request(); 2959 process_fd_request();
3005 is_alive("do fd request"); 2960 is_alive(__func__, "");
3006} 2961}
3007 2962
3008static struct cont_t poll_cont = { 2963static struct cont_t poll_cont = {
@@ -3012,24 +2967,18 @@ static struct cont_t poll_cont = {
3012 .done = generic_done 2967 .done = generic_done
3013}; 2968};
3014 2969
3015static int poll_drive(int interruptible, int flag) 2970static int poll_drive(bool interruptible, int flag)
3016{ 2971{
3017 int ret;
3018
3019 /* no auto-sense, just clear dcl */ 2972 /* no auto-sense, just clear dcl */
3020 raw_cmd = &default_raw_cmd; 2973 raw_cmd = &default_raw_cmd;
3021 raw_cmd->flags = flag; 2974 raw_cmd->flags = flag;
3022 raw_cmd->track = 0; 2975 raw_cmd->track = 0;
3023 raw_cmd->cmd_count = 0; 2976 raw_cmd->cmd_count = 0;
3024 cont = &poll_cont; 2977 cont = &poll_cont;
3025#ifdef DCL_DEBUG 2978 debug_dcl(DP->flags, "setting NEWCHANGE in poll_drive\n");
3026 if (DP->flags & FD_DEBUG) { 2979 set_bit(FD_DISK_NEWCHANGE_BIT, &DRS->flags);
3027 DPRINT("setting NEWCHANGE in poll_drive\n"); 2980
3028 } 2981 return wait_til_done(floppy_ready, interruptible);
3029#endif
3030 SETF(FD_DISK_NEWCHANGE);
3031 WAIT(floppy_ready);
3032 return ret;
3033} 2982}
3034 2983
3035/* 2984/*
@@ -3039,7 +2988,7 @@ static int poll_drive(int interruptible, int flag)
3039 2988
3040static void reset_intr(void) 2989static void reset_intr(void)
3041{ 2990{
3042 printk("weird, reset interrupt called\n"); 2991 pr_info("weird, reset interrupt called\n");
3043} 2992}
3044 2993
3045static struct cont_t reset_cont = { 2994static struct cont_t reset_cont = {
@@ -3049,20 +2998,23 @@ static struct cont_t reset_cont = {
3049 .done = generic_done 2998 .done = generic_done
3050}; 2999};
3051 3000
3052static int user_reset_fdc(int drive, int arg, int interruptible) 3001static int user_reset_fdc(int drive, int arg, bool interruptible)
3053{ 3002{
3054 int ret; 3003 int ret;
3055 3004
3056 ret = 0; 3005 if (lock_fdc(drive, interruptible))
3057 LOCK_FDC(drive, interruptible); 3006 return -EINTR;
3007
3058 if (arg == FD_RESET_ALWAYS) 3008 if (arg == FD_RESET_ALWAYS)
3059 FDCS->reset = 1; 3009 FDCS->reset = 1;
3060 if (FDCS->reset) { 3010 if (FDCS->reset) {
3061 cont = &reset_cont; 3011 cont = &reset_cont;
3062 WAIT(reset_fdc); 3012 ret = wait_til_done(reset_fdc, interruptible);
3013 if (ret == -EINTR)
3014 return -EINTR;
3063 } 3015 }
3064 process_fd_request(); 3016 process_fd_request();
3065 return ret; 3017 return 0;
3066} 3018}
3067 3019
3068/* 3020/*
@@ -3075,17 +3027,12 @@ static inline int fd_copyout(void __user *param, const void *address,
3075 return copy_to_user(param, address, size) ? -EFAULT : 0; 3027 return copy_to_user(param, address, size) ? -EFAULT : 0;
3076} 3028}
3077 3029
3078static inline int fd_copyin(void __user *param, void *address, unsigned long size) 3030static inline int fd_copyin(void __user *param, void *address,
3031 unsigned long size)
3079{ 3032{
3080 return copy_from_user(address, param, size) ? -EFAULT : 0; 3033 return copy_from_user(address, param, size) ? -EFAULT : 0;
3081} 3034}
3082 3035
3083#define _COPYOUT(x) (copy_to_user((void __user *)param, &(x), sizeof(x)) ? -EFAULT : 0)
3084#define _COPYIN(x) (copy_from_user(&(x), (void __user *)param, sizeof(x)) ? -EFAULT : 0)
3085
3086#define COPYOUT(x) ECALL(_COPYOUT(x))
3087#define COPYIN(x) ECALL(_COPYIN(x))
3088
3089static inline const char *drive_name(int type, int drive) 3036static inline const char *drive_name(int type, int drive)
3090{ 3037{
3091 struct floppy_struct *floppy; 3038 struct floppy_struct *floppy;
@@ -3156,23 +3103,29 @@ static struct cont_t raw_cmd_cont = {
3156 .done = raw_cmd_done 3103 .done = raw_cmd_done
3157}; 3104};
3158 3105
3159static inline int raw_cmd_copyout(int cmd, char __user *param, 3106static inline int raw_cmd_copyout(int cmd, void __user *param,
3160 struct floppy_raw_cmd *ptr) 3107 struct floppy_raw_cmd *ptr)
3161{ 3108{
3162 int ret; 3109 int ret;
3163 3110
3164 while (ptr) { 3111 while (ptr) {
3165 COPYOUT(*ptr); 3112 ret = copy_to_user(param, ptr, sizeof(*ptr));
3113 if (ret)
3114 return -EFAULT;
3166 param += sizeof(struct floppy_raw_cmd); 3115 param += sizeof(struct floppy_raw_cmd);
3167 if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) { 3116 if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
3168 if (ptr->length >= 0 3117 if (ptr->length >= 0 &&
3169 && ptr->length <= ptr->buffer_length) 3118 ptr->length <= ptr->buffer_length) {
3170 ECALL(fd_copyout 3119 long length = ptr->buffer_length - ptr->length;
3171 (ptr->data, ptr->kernel_data, 3120 ret = fd_copyout(ptr->data, ptr->kernel_data,
3172 ptr->buffer_length - ptr->length)); 3121 length);
3122 if (ret)
3123 return ret;
3124 }
3173 } 3125 }
3174 ptr = ptr->next; 3126 ptr = ptr->next;
3175 } 3127 }
3128
3176 return 0; 3129 return 0;
3177} 3130}
3178 3131
@@ -3195,7 +3148,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr)
3195 } 3148 }
3196} 3149}
3197 3150
3198static inline int raw_cmd_copyin(int cmd, char __user *param, 3151static inline int raw_cmd_copyin(int cmd, void __user *param,
3199 struct floppy_raw_cmd **rcmd) 3152 struct floppy_raw_cmd **rcmd)
3200{ 3153{
3201 struct floppy_raw_cmd *ptr; 3154 struct floppy_raw_cmd *ptr;
@@ -3203,17 +3156,19 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
3203 int i; 3156 int i;
3204 3157
3205 *rcmd = NULL; 3158 *rcmd = NULL;
3206 while (1) { 3159
3207 ptr = (struct floppy_raw_cmd *) 3160loop:
3208 kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); 3161 ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER);
3209 if (!ptr) 3162 if (!ptr)
3210 return -ENOMEM; 3163 return -ENOMEM;
3211 *rcmd = ptr; 3164 *rcmd = ptr;
3212 COPYIN(*ptr); 3165 ret = copy_from_user(ptr, param, sizeof(*ptr));
3213 ptr->next = NULL; 3166 if (ret)
3214 ptr->buffer_length = 0; 3167 return -EFAULT;
3215 param += sizeof(struct floppy_raw_cmd); 3168 ptr->next = NULL;
3216 if (ptr->cmd_count > 33) 3169 ptr->buffer_length = 0;
3170 param += sizeof(struct floppy_raw_cmd);
3171 if (ptr->cmd_count > 33)
3217 /* the command may now also take up the space 3172 /* the command may now also take up the space
3218 * initially intended for the reply & the 3173 * initially intended for the reply & the
3219 * reply count. Needed for long 82078 commands 3174 * reply count. Needed for long 82078 commands
@@ -3222,31 +3177,35 @@ static inline int raw_cmd_copyin(int cmd, char __user *param,
3222 * 16 bytes for a structure, you'll one day 3177 * 16 bytes for a structure, you'll one day
3223 * discover that you really need 17... 3178 * discover that you really need 17...
3224 */ 3179 */
3180 return -EINVAL;
3181
3182 for (i = 0; i < 16; i++)
3183 ptr->reply[i] = 0;
3184 ptr->resultcode = 0;
3185 ptr->kernel_data = NULL;
3186
3187 if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {
3188 if (ptr->length <= 0)
3225 return -EINVAL; 3189 return -EINVAL;
3190 ptr->kernel_data = (char *)fd_dma_mem_alloc(ptr->length);
3191 fallback_on_nodma_alloc(&ptr->kernel_data, ptr->length);
3192 if (!ptr->kernel_data)
3193 return -ENOMEM;
3194 ptr->buffer_length = ptr->length;
3195 }
3196 if (ptr->flags & FD_RAW_WRITE) {
3197 ret = fd_copyin(ptr->data, ptr->kernel_data, ptr->length);
3198 if (ret)
3199 return ret;
3200 }
3226 3201
3227 for (i = 0; i < 16; i++) 3202 if (ptr->flags & FD_RAW_MORE) {
3228 ptr->reply[i] = 0;
3229 ptr->resultcode = 0;
3230 ptr->kernel_data = NULL;
3231
3232 if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) {
3233 if (ptr->length <= 0)
3234 return -EINVAL;
3235 ptr->kernel_data =
3236 (char *)fd_dma_mem_alloc(ptr->length);
3237 fallback_on_nodma_alloc(&ptr->kernel_data, ptr->length);
3238 if (!ptr->kernel_data)
3239 return -ENOMEM;
3240 ptr->buffer_length = ptr->length;
3241 }
3242 if (ptr->flags & FD_RAW_WRITE)
3243 ECALL(fd_copyin(ptr->data, ptr->kernel_data,
3244 ptr->length));
3245 rcmd = &(ptr->next); 3203 rcmd = &(ptr->next);
3246 if (!(ptr->flags & FD_RAW_MORE))
3247 return 0;
3248 ptr->rate &= 0x43; 3204 ptr->rate &= 0x43;
3205 goto loop;
3249 } 3206 }
3207
3208 return 0;
3250} 3209}
3251 3210
3252static int raw_cmd_ioctl(int cmd, void __user *param) 3211static int raw_cmd_ioctl(int cmd, void __user *param)
@@ -3283,12 +3242,8 @@ static int raw_cmd_ioctl(int cmd, void __user *param)
3283 3242
3284 raw_cmd = my_raw_cmd; 3243 raw_cmd = my_raw_cmd;
3285 cont = &raw_cmd_cont; 3244 cont = &raw_cmd_cont;
3286 ret = wait_til_done(floppy_start, 1); 3245 ret = wait_til_done(floppy_start, true);
3287#ifdef DCL_DEBUG 3246 debug_dcl(DP->flags, "calling disk change from raw_cmd ioctl\n");
3288 if (DP->flags & FD_DEBUG) {
3289 DPRINT("calling disk change from raw_cmd ioctl\n");
3290 }
3291#endif
3292 3247
3293 if (ret != -EINTR && FDCS->reset) 3248 if (ret != -EINTR && FDCS->reset)
3294 ret = -EIO; 3249 ret = -EIO;
@@ -3327,7 +3282,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
3327 if (!capable(CAP_SYS_ADMIN)) 3282 if (!capable(CAP_SYS_ADMIN))
3328 return -EPERM; 3283 return -EPERM;
3329 mutex_lock(&open_lock); 3284 mutex_lock(&open_lock);
3330 if (lock_fdc(drive, 1)) { 3285 if (lock_fdc(drive, true)) {
3331 mutex_unlock(&open_lock); 3286 mutex_unlock(&open_lock);
3332 return -EINTR; 3287 return -EINTR;
3333 } 3288 }
@@ -3346,11 +3301,15 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
3346 mutex_unlock(&open_lock); 3301 mutex_unlock(&open_lock);
3347 } else { 3302 } else {
3348 int oldStretch; 3303 int oldStretch;
3349 LOCK_FDC(drive, 1); 3304
3350 if (cmd != FDDEFPRM) 3305 if (lock_fdc(drive, true))
3306 return -EINTR;
3307 if (cmd != FDDEFPRM) {
3351 /* notice a disk change immediately, else 3308 /* notice a disk change immediately, else
3352 * we lose our settings immediately*/ 3309 * we lose our settings immediately*/
3353 CALL(poll_drive(1, FD_RAW_NEED_DISK)); 3310 if (poll_drive(true, FD_RAW_NEED_DISK) == -EINTR)
3311 return -EINTR;
3312 }
3354 oldStretch = g->stretch; 3313 oldStretch = g->stretch;
3355 user_params[drive] = *g; 3314 user_params[drive] = *g;
3356 if (buffer_drive == drive) 3315 if (buffer_drive == drive)
@@ -3415,7 +3374,7 @@ static inline int normalize_ioctl(int *cmd, int *size)
3415 *size = _IOC_SIZE(*cmd); 3374 *size = _IOC_SIZE(*cmd);
3416 *cmd = ioctl_table[i]; 3375 *cmd = ioctl_table[i];
3417 if (*size > _IOC_SIZE(*cmd)) { 3376 if (*size > _IOC_SIZE(*cmd)) {
3418 printk("ioctl not yet supported\n"); 3377 pr_info("ioctl not yet supported\n");
3419 return -EFAULT; 3378 return -EFAULT;
3420 } 3379 }
3421 return 0; 3380 return 0;
@@ -3429,8 +3388,10 @@ static int get_floppy_geometry(int drive, int type, struct floppy_struct **g)
3429 if (type) 3388 if (type)
3430 *g = &floppy_type[type]; 3389 *g = &floppy_type[type];
3431 else { 3390 else {
3432 LOCK_FDC(drive, 0); 3391 if (lock_fdc(drive, false))
3433 CALL(poll_drive(0, 0)); 3392 return -EINTR;
3393 if (poll_drive(false, 0) == -EINTR)
3394 return -EINTR;
3434 process_fd_request(); 3395 process_fd_request();
3435 *g = current_type[drive]; 3396 *g = current_type[drive];
3436 } 3397 }
@@ -3459,10 +3420,6 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
3459static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, 3420static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3460 unsigned long param) 3421 unsigned long param)
3461{ 3422{
3462#define FD_IOCTL_ALLOWED (mode & (FMODE_WRITE|FMODE_WRITE_IOCTL))
3463#define OUT(c,x) case c: outparam = (const char *) (x); break
3464#define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0
3465
3466 int drive = (long)bdev->bd_disk->private_data; 3423 int drive = (long)bdev->bd_disk->private_data;
3467 int type = ITYPE(UDRS->fd_device); 3424 int type = ITYPE(UDRS->fd_device);
3468 int i; 3425 int i;
@@ -3474,26 +3431,28 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3474 struct floppy_max_errors max_errors; 3431 struct floppy_max_errors max_errors;
3475 struct floppy_drive_params dp; 3432 struct floppy_drive_params dp;
3476 } inparam; /* parameters coming from user space */ 3433 } inparam; /* parameters coming from user space */
3477 const char *outparam; /* parameters passed back to user space */ 3434 const void *outparam; /* parameters passed back to user space */
3478 3435
3479 /* convert compatibility eject ioctls into floppy eject ioctl. 3436 /* convert compatibility eject ioctls into floppy eject ioctl.
3480 * We do this in order to provide a means to eject floppy disks before 3437 * We do this in order to provide a means to eject floppy disks before
3481 * installing the new fdutils package */ 3438 * installing the new fdutils package */
3482 if (cmd == CDROMEJECT || /* CD-ROM eject */ 3439 if (cmd == CDROMEJECT || /* CD-ROM eject */
3483 cmd == 0x6470 /* SunOS floppy eject */ ) { 3440 cmd == 0x6470) { /* SunOS floppy eject */
3484 DPRINT("obsolete eject ioctl\n"); 3441 DPRINT("obsolete eject ioctl\n");
3485 DPRINT("please use floppycontrol --eject\n"); 3442 DPRINT("please use floppycontrol --eject\n");
3486 cmd = FDEJECT; 3443 cmd = FDEJECT;
3487 } 3444 }
3488 3445
3489 /* convert the old style command into a new style command */ 3446 if (!((cmd & 0xff00) == 0x0200))
3490 if ((cmd & 0xff00) == 0x0200) {
3491 ECALL(normalize_ioctl(&cmd, &size));
3492 } else
3493 return -EINVAL; 3447 return -EINVAL;
3494 3448
3449 /* convert the old style command into a new style command */
3450 ret = normalize_ioctl(&cmd, &size);
3451 if (ret)
3452 return ret;
3453
3495 /* permission checks */ 3454 /* permission checks */
3496 if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) || 3455 if (((cmd & 0x40) && !(mode & (FMODE_WRITE | FMODE_WRITE_IOCTL))) ||
3497 ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))) 3456 ((cmd & 0x80) && !capable(CAP_SYS_ADMIN)))
3498 return -EPERM; 3457 return -EPERM;
3499 3458
@@ -3501,129 +3460,142 @@ static int fd_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
3501 return -EINVAL; 3460 return -EINVAL;
3502 3461
3503 /* copyin */ 3462 /* copyin */
3504 CLEARSTRUCT(&inparam); 3463 memset(&inparam, 0, sizeof(inparam));
3505 if (_IOC_DIR(cmd) & _IOC_WRITE) 3464 if (_IOC_DIR(cmd) & _IOC_WRITE) {
3506 ECALL(fd_copyin((void __user *)param, &inparam, size)) 3465 ret = fd_copyin((void __user *)param, &inparam, size);
3507 3466 if (ret)
3508 switch (cmd) {
3509 case FDEJECT:
3510 if (UDRS->fd_ref != 1)
3511 /* somebody else has this drive open */
3512 return -EBUSY;
3513 LOCK_FDC(drive, 1);
3514
3515 /* do the actual eject. Fails on
3516 * non-Sparc architectures */
3517 ret = fd_eject(UNIT(drive));
3518
3519 USETF(FD_DISK_CHANGED);
3520 USETF(FD_VERIFY);
3521 process_fd_request();
3522 return ret; 3467 return ret;
3523 case FDCLRPRM: 3468 }
3524 LOCK_FDC(drive, 1);
3525 current_type[drive] = NULL;
3526 floppy_sizes[drive] = MAX_DISK_SIZE << 1;
3527 UDRS->keep_data = 0;
3528 return invalidate_drive(bdev);
3529 case FDSETPRM:
3530 case FDDEFPRM:
3531 return set_geometry(cmd, &inparam.g,
3532 drive, type, bdev);
3533 case FDGETPRM:
3534 ECALL(get_floppy_geometry(drive, type,
3535 (struct floppy_struct **)
3536 &outparam));
3537 break;
3538
3539 case FDMSGON:
3540 UDP->flags |= FTD_MSG;
3541 return 0;
3542 case FDMSGOFF:
3543 UDP->flags &= ~FTD_MSG;
3544 return 0;
3545
3546 case FDFMTBEG:
3547 LOCK_FDC(drive, 1);
3548 CALL(poll_drive(1, FD_RAW_NEED_DISK));
3549 ret = UDRS->flags;
3550 process_fd_request();
3551 if (ret & FD_VERIFY)
3552 return -ENODEV;
3553 if (!(ret & FD_DISK_WRITABLE))
3554 return -EROFS;
3555 return 0;
3556 case FDFMTTRK:
3557 if (UDRS->fd_ref != 1)
3558 return -EBUSY;
3559 return do_format(drive, &inparam.f);
3560 case FDFMTEND:
3561 case FDFLUSH:
3562 LOCK_FDC(drive, 1);
3563 return invalidate_drive(bdev);
3564
3565 case FDSETEMSGTRESH:
3566 UDP->max_errors.reporting =
3567 (unsigned short)(param & 0x0f);
3568 return 0;
3569 OUT(FDGETMAXERRS, &UDP->max_errors);
3570 IN(FDSETMAXERRS, &UDP->max_errors, max_errors);
3571
3572 case FDGETDRVTYP:
3573 outparam = drive_name(type, drive);
3574 SUPBOUND(size, strlen(outparam) + 1);
3575 break;
3576
3577 IN(FDSETDRVPRM, UDP, dp);
3578 OUT(FDGETDRVPRM, UDP);
3579
3580 case FDPOLLDRVSTAT:
3581 LOCK_FDC(drive, 1);
3582 CALL(poll_drive(1, FD_RAW_NEED_DISK));
3583 process_fd_request();
3584 /* fall through */
3585 OUT(FDGETDRVSTAT, UDRS);
3586
3587 case FDRESET:
3588 return user_reset_fdc(drive, (int)param, 1);
3589
3590 OUT(FDGETFDCSTAT, UFDCS);
3591 3469
3592 case FDWERRORCLR: 3470 switch (cmd) {
3593 CLEARSTRUCT(UDRWE); 3471 case FDEJECT:
3594 return 0; 3472 if (UDRS->fd_ref != 1)
3595 OUT(FDWERRORGET, UDRWE); 3473 /* somebody else has this drive open */
3596 3474 return -EBUSY;
3597 case FDRAWCMD: 3475 if (lock_fdc(drive, true))
3598 if (type) 3476 return -EINTR;
3599 return -EINVAL;
3600 LOCK_FDC(drive, 1);
3601 set_floppy(drive);
3602 CALL(i = raw_cmd_ioctl(cmd, (void __user *)param));
3603 process_fd_request();
3604 return i;
3605 3477
3606 case FDTWADDLE: 3478 /* do the actual eject. Fails on
3607 LOCK_FDC(drive, 1); 3479 * non-Sparc architectures */
3608 twaddle(); 3480 ret = fd_eject(UNIT(drive));
3609 process_fd_request();
3610 return 0;
3611 3481
3612 default: 3482 set_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
3483 set_bit(FD_VERIFY_BIT, &UDRS->flags);
3484 process_fd_request();
3485 return ret;
3486 case FDCLRPRM:
3487 if (lock_fdc(drive, true))
3488 return -EINTR;
3489 current_type[drive] = NULL;
3490 floppy_sizes[drive] = MAX_DISK_SIZE << 1;
3491 UDRS->keep_data = 0;
3492 return invalidate_drive(bdev);
3493 case FDSETPRM:
3494 case FDDEFPRM:
3495 return set_geometry(cmd, &inparam.g, drive, type, bdev);
3496 case FDGETPRM:
3497 ret = get_floppy_geometry(drive, type,
3498 (struct floppy_struct **)&outparam);
3499 if (ret)
3500 return ret;
3501 break;
3502 case FDMSGON:
3503 UDP->flags |= FTD_MSG;
3504 return 0;
3505 case FDMSGOFF:
3506 UDP->flags &= ~FTD_MSG;
3507 return 0;
3508 case FDFMTBEG:
3509 if (lock_fdc(drive, true))
3510 return -EINTR;
3511 if (poll_drive(true, FD_RAW_NEED_DISK) == -EINTR)
3512 return -EINTR;
3513 ret = UDRS->flags;
3514 process_fd_request();
3515 if (ret & FD_VERIFY)
3516 return -ENODEV;
3517 if (!(ret & FD_DISK_WRITABLE))
3518 return -EROFS;
3519 return 0;
3520 case FDFMTTRK:
3521 if (UDRS->fd_ref != 1)
3522 return -EBUSY;
3523 return do_format(drive, &inparam.f);
3524 case FDFMTEND:
3525 case FDFLUSH:
3526 if (lock_fdc(drive, true))
3527 return -EINTR;
3528 return invalidate_drive(bdev);
3529 case FDSETEMSGTRESH:
3530 UDP->max_errors.reporting = (unsigned short)(param & 0x0f);
3531 return 0;
3532 case FDGETMAXERRS:
3533 outparam = &UDP->max_errors;
3534 break;
3535 case FDSETMAXERRS:
3536 UDP->max_errors = inparam.max_errors;
3537 break;
3538 case FDGETDRVTYP:
3539 outparam = drive_name(type, drive);
3540 SUPBOUND(size, strlen((const char *)outparam) + 1);
3541 break;
3542 case FDSETDRVPRM:
3543 *UDP = inparam.dp;
3544 break;
3545 case FDGETDRVPRM:
3546 outparam = UDP;
3547 break;
3548 case FDPOLLDRVSTAT:
3549 if (lock_fdc(drive, true))
3550 return -EINTR;
3551 if (poll_drive(true, FD_RAW_NEED_DISK) == -EINTR)
3552 return -EINTR;
3553 process_fd_request();
3554 /* fall through */
3555 case FDGETDRVSTAT:
3556 outparam = UDRS;
3557 break;
3558 case FDRESET:
3559 return user_reset_fdc(drive, (int)param, true);
3560 case FDGETFDCSTAT:
3561 outparam = UFDCS;
3562 break;
3563 case FDWERRORCLR:
3564 memset(UDRWE, 0, sizeof(*UDRWE));
3565 return 0;
3566 case FDWERRORGET:
3567 outparam = UDRWE;
3568 break;
3569 case FDRAWCMD:
3570 if (type)
3613 return -EINVAL; 3571 return -EINVAL;
3614 } 3572 if (lock_fdc(drive, true))
3573 return -EINTR;
3574 set_floppy(drive);
3575 i = raw_cmd_ioctl(cmd, (void __user *)param);
3576 if (i == -EINTR)
3577 return -EINTR;
3578 process_fd_request();
3579 return i;
3580 case FDTWADDLE:
3581 if (lock_fdc(drive, true))
3582 return -EINTR;
3583 twaddle();
3584 process_fd_request();
3585 return 0;
3586 default:
3587 return -EINVAL;
3588 }
3615 3589
3616 if (_IOC_DIR(cmd) & _IOC_READ) 3590 if (_IOC_DIR(cmd) & _IOC_READ)
3617 return fd_copyout((void __user *)param, outparam, size); 3591 return fd_copyout((void __user *)param, outparam, size);
3618 else 3592
3619 return 0; 3593 return 0;
3620#undef OUT
3621#undef IN
3622} 3594}
3623 3595
3624static void __init config_types(void) 3596static void __init config_types(void)
3625{ 3597{
3626 int first = 1; 3598 bool has_drive = false;
3627 int drive; 3599 int drive;
3628 3600
3629 /* read drive info out of physical CMOS */ 3601 /* read drive info out of physical CMOS */
@@ -3655,17 +3627,22 @@ static void __init config_types(void)
3655 name = temparea; 3627 name = temparea;
3656 } 3628 }
3657 if (name) { 3629 if (name) {
3658 const char *prepend = ","; 3630 const char *prepend;
3659 if (first) { 3631 if (!has_drive) {
3660 prepend = KERN_INFO "Floppy drive(s):"; 3632 prepend = "";
3661 first = 0; 3633 has_drive = true;
3634 pr_info("Floppy drive(s):");
3635 } else {
3636 prepend = ",";
3662 } 3637 }
3663 printk("%s fd%d is %s", prepend, drive, name); 3638
3639 pr_cont("%s fd%d is %s", prepend, drive, name);
3664 } 3640 }
3665 *UDP = *params; 3641 *UDP = *params;
3666 } 3642 }
3667 if (!first) 3643
3668 printk("\n"); 3644 if (has_drive)
3645 pr_cont("\n");
3669} 3646}
3670 3647
3671static int floppy_release(struct gendisk *disk, fmode_t mode) 3648static int floppy_release(struct gendisk *disk, fmode_t mode)
@@ -3705,8 +3682,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
3705 goto out2; 3682 goto out2;
3706 3683
3707 if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)) { 3684 if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)) {
3708 USETF(FD_DISK_CHANGED); 3685 set_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
3709 USETF(FD_VERIFY); 3686 set_bit(FD_VERIFY_BIT, &UDRS->flags);
3710 } 3687 }
3711 3688
3712 if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (mode & FMODE_EXCL))) 3689 if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (mode & FMODE_EXCL)))
@@ -3735,9 +3712,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
3735 INFBOUND(try, 16); 3712 INFBOUND(try, 16);
3736 tmp = (char *)fd_dma_mem_alloc(1024 * try); 3713 tmp = (char *)fd_dma_mem_alloc(1024 * try);
3737 } 3714 }
3738 if (!tmp && !floppy_track_buffer) { 3715 if (!tmp && !floppy_track_buffer)
3739 fallback_on_nodma_alloc(&tmp, 2048 * try); 3716 fallback_on_nodma_alloc(&tmp, 2048 * try);
3740 }
3741 if (!tmp && !floppy_track_buffer) { 3717 if (!tmp && !floppy_track_buffer) {
3742 DPRINT("Unable to allocate DMA memory\n"); 3718 DPRINT("Unable to allocate DMA memory\n");
3743 goto out; 3719 goto out;
@@ -3767,11 +3743,12 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)
3767 if (mode & (FMODE_READ|FMODE_WRITE)) { 3743 if (mode & (FMODE_READ|FMODE_WRITE)) {
3768 UDRS->last_checked = 0; 3744 UDRS->last_checked = 0;
3769 check_disk_change(bdev); 3745 check_disk_change(bdev);
3770 if (UTESTF(FD_DISK_CHANGED)) 3746 if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags))
3771 goto out; 3747 goto out;
3772 } 3748 }
3773 res = -EROFS; 3749 res = -EROFS;
3774 if ((mode & FMODE_WRITE) && !(UTESTF(FD_DISK_WRITABLE))) 3750 if ((mode & FMODE_WRITE) &&
3751 !test_bit(FD_DISK_WRITABLE_BIT, &UDRS->flags))
3775 goto out; 3752 goto out;
3776 } 3753 }
3777 mutex_unlock(&open_lock); 3754 mutex_unlock(&open_lock);
@@ -3795,17 +3772,18 @@ static int check_floppy_change(struct gendisk *disk)
3795{ 3772{
3796 int drive = (long)disk->private_data; 3773 int drive = (long)disk->private_data;
3797 3774
3798 if (UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY)) 3775 if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
3776 test_bit(FD_VERIFY_BIT, &UDRS->flags))
3799 return 1; 3777 return 1;
3800 3778
3801 if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) { 3779 if (time_after(jiffies, UDRS->last_checked + UDP->checkfreq)) {
3802 lock_fdc(drive, 0); 3780 lock_fdc(drive, false);
3803 poll_drive(0, 0); 3781 poll_drive(false, 0);
3804 process_fd_request(); 3782 process_fd_request();
3805 } 3783 }
3806 3784
3807 if (UTESTF(FD_DISK_CHANGED) || 3785 if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
3808 UTESTF(FD_VERIFY) || 3786 test_bit(FD_VERIFY_BIT, &UDRS->flags) ||
3809 test_bit(drive, &fake_change) || 3787 test_bit(drive, &fake_change) ||
3810 (!ITYPE(UDRS->fd_device) && !current_type[drive])) 3788 (!ITYPE(UDRS->fd_device) && !current_type[drive]))
3811 return 1; 3789 return 1;
@@ -3818,8 +3796,7 @@ static int check_floppy_change(struct gendisk *disk)
3818 * a disk in the drive, and whether that disk is writable. 3796 * a disk in the drive, and whether that disk is writable.
3819 */ 3797 */
3820 3798
3821static void floppy_rb0_complete(struct bio *bio, 3799static void floppy_rb0_complete(struct bio *bio, int err)
3822 int err)
3823{ 3800{
3824 complete((struct completion *)bio->bi_private); 3801 complete((struct completion *)bio->bi_private);
3825} 3802}
@@ -3877,14 +3854,16 @@ static int floppy_revalidate(struct gendisk *disk)
3877 int cf; 3854 int cf;
3878 int res = 0; 3855 int res = 0;
3879 3856
3880 if (UTESTF(FD_DISK_CHANGED) || 3857 if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
3881 UTESTF(FD_VERIFY) || test_bit(drive, &fake_change) || NO_GEOM) { 3858 test_bit(FD_VERIFY_BIT, &UDRS->flags) ||
3859 test_bit(drive, &fake_change) || NO_GEOM) {
3882 if (usage_count == 0) { 3860 if (usage_count == 0) {
3883 printk("VFS: revalidate called on non-open device.\n"); 3861 pr_info("VFS: revalidate called on non-open device.\n");
3884 return -EFAULT; 3862 return -EFAULT;
3885 } 3863 }
3886 lock_fdc(drive, 0); 3864 lock_fdc(drive, false);
3887 cf = UTESTF(FD_DISK_CHANGED) || UTESTF(FD_VERIFY); 3865 cf = (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
3866 test_bit(FD_VERIFY_BIT, &UDRS->flags));
3888 if (!(cf || test_bit(drive, &fake_change) || NO_GEOM)) { 3867 if (!(cf || test_bit(drive, &fake_change) || NO_GEOM)) {
3889 process_fd_request(); /*already done by another thread */ 3868 process_fd_request(); /*already done by another thread */
3890 return 0; 3869 return 0;
@@ -3894,7 +3873,7 @@ static int floppy_revalidate(struct gendisk *disk)
3894 if (buffer_drive == drive) 3873 if (buffer_drive == drive)
3895 buffer_track = -1; 3874 buffer_track = -1;
3896 clear_bit(drive, &fake_change); 3875 clear_bit(drive, &fake_change);
3897 UCLEARF(FD_DISK_CHANGED); 3876 clear_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
3898 if (cf) 3877 if (cf)
3899 UDRS->generation++; 3878 UDRS->generation++;
3900 if (NO_GEOM) { 3879 if (NO_GEOM) {
@@ -3902,7 +3881,7 @@ static int floppy_revalidate(struct gendisk *disk)
3902 res = __floppy_read_block_0(opened_bdev[drive]); 3881 res = __floppy_read_block_0(opened_bdev[drive]);
3903 } else { 3882 } else {
3904 if (cf) 3883 if (cf)
3905 poll_drive(0, FD_RAW_NEED_DISK); 3884 poll_drive(false, FD_RAW_NEED_DISK);
3906 process_fd_request(); 3885 process_fd_request();
3907 } 3886 }
3908 } 3887 }
@@ -3934,21 +3913,21 @@ static char __init get_fdc_version(void)
3934 output_byte(FD_DUMPREGS); /* 82072 and better know DUMPREGS */ 3913 output_byte(FD_DUMPREGS); /* 82072 and better know DUMPREGS */
3935 if (FDCS->reset) 3914 if (FDCS->reset)
3936 return FDC_NONE; 3915 return FDC_NONE;
3937 if ((r = result()) <= 0x00) 3916 r = result();
3917 if (r <= 0x00)
3938 return FDC_NONE; /* No FDC present ??? */ 3918 return FDC_NONE; /* No FDC present ??? */
3939 if ((r == 1) && (reply_buffer[0] == 0x80)) { 3919 if ((r == 1) && (reply_buffer[0] == 0x80)) {
3940 printk(KERN_INFO "FDC %d is an 8272A\n", fdc); 3920 pr_info("FDC %d is an 8272A\n", fdc);
3941 return FDC_8272A; /* 8272a/765 don't know DUMPREGS */ 3921 return FDC_8272A; /* 8272a/765 don't know DUMPREGS */
3942 } 3922 }
3943 if (r != 10) { 3923 if (r != 10) {
3944 printk 3924 pr_info("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n",
3945 ("FDC %d init: DUMPREGS: unexpected return of %d bytes.\n", 3925 fdc, r);
3946 fdc, r);
3947 return FDC_UNKNOWN; 3926 return FDC_UNKNOWN;
3948 } 3927 }
3949 3928
3950 if (!fdc_configure()) { 3929 if (!fdc_configure()) {
3951 printk(KERN_INFO "FDC %d is an 82072\n", fdc); 3930 pr_info("FDC %d is an 82072\n", fdc);
3952 return FDC_82072; /* 82072 doesn't know CONFIGURE */ 3931 return FDC_82072; /* 82072 doesn't know CONFIGURE */
3953 } 3932 }
3954 3933
@@ -3956,52 +3935,50 @@ static char __init get_fdc_version(void)
3956 if (need_more_output() == MORE_OUTPUT) { 3935 if (need_more_output() == MORE_OUTPUT) {
3957 output_byte(0); 3936 output_byte(0);
3958 } else { 3937 } else {
3959 printk(KERN_INFO "FDC %d is an 82072A\n", fdc); 3938 pr_info("FDC %d is an 82072A\n", fdc);
3960 return FDC_82072A; /* 82072A as found on Sparcs. */ 3939 return FDC_82072A; /* 82072A as found on Sparcs. */
3961 } 3940 }
3962 3941
3963 output_byte(FD_UNLOCK); 3942 output_byte(FD_UNLOCK);
3964 r = result(); 3943 r = result();
3965 if ((r == 1) && (reply_buffer[0] == 0x80)) { 3944 if ((r == 1) && (reply_buffer[0] == 0x80)) {
3966 printk(KERN_INFO "FDC %d is a pre-1991 82077\n", fdc); 3945 pr_info("FDC %d is a pre-1991 82077\n", fdc);
3967 return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know 3946 return FDC_82077_ORIG; /* Pre-1991 82077, doesn't know
3968 * LOCK/UNLOCK */ 3947 * LOCK/UNLOCK */
3969 } 3948 }
3970 if ((r != 1) || (reply_buffer[0] != 0x00)) { 3949 if ((r != 1) || (reply_buffer[0] != 0x00)) {
3971 printk("FDC %d init: UNLOCK: unexpected return of %d bytes.\n", 3950 pr_info("FDC %d init: UNLOCK: unexpected return of %d bytes.\n",
3972 fdc, r); 3951 fdc, r);
3973 return FDC_UNKNOWN; 3952 return FDC_UNKNOWN;
3974 } 3953 }
3975 output_byte(FD_PARTID); 3954 output_byte(FD_PARTID);
3976 r = result(); 3955 r = result();
3977 if (r != 1) { 3956 if (r != 1) {
3978 printk("FDC %d init: PARTID: unexpected return of %d bytes.\n", 3957 pr_info("FDC %d init: PARTID: unexpected return of %d bytes.\n",
3979 fdc, r); 3958 fdc, r);
3980 return FDC_UNKNOWN; 3959 return FDC_UNKNOWN;
3981 } 3960 }
3982 if (reply_buffer[0] == 0x80) { 3961 if (reply_buffer[0] == 0x80) {
3983 printk(KERN_INFO "FDC %d is a post-1991 82077\n", fdc); 3962 pr_info("FDC %d is a post-1991 82077\n", fdc);
3984 return FDC_82077; /* Revised 82077AA passes all the tests */ 3963 return FDC_82077; /* Revised 82077AA passes all the tests */
3985 } 3964 }
3986 switch (reply_buffer[0] >> 5) { 3965 switch (reply_buffer[0] >> 5) {
3987 case 0x0: 3966 case 0x0:
3988 /* Either a 82078-1 or a 82078SL running at 5Volt */ 3967 /* Either a 82078-1 or a 82078SL running at 5Volt */
3989 printk(KERN_INFO "FDC %d is an 82078.\n", fdc); 3968 pr_info("FDC %d is an 82078.\n", fdc);
3990 return FDC_82078; 3969 return FDC_82078;
3991 case 0x1: 3970 case 0x1:
3992 printk(KERN_INFO "FDC %d is a 44pin 82078\n", fdc); 3971 pr_info("FDC %d is a 44pin 82078\n", fdc);
3993 return FDC_82078; 3972 return FDC_82078;
3994 case 0x2: 3973 case 0x2:
3995 printk(KERN_INFO "FDC %d is a S82078B\n", fdc); 3974 pr_info("FDC %d is a S82078B\n", fdc);
3996 return FDC_S82078B; 3975 return FDC_S82078B;
3997 case 0x3: 3976 case 0x3:
3998 printk(KERN_INFO "FDC %d is a National Semiconductor PC87306\n", 3977 pr_info("FDC %d is a National Semiconductor PC87306\n", fdc);
3999 fdc);
4000 return FDC_87306; 3978 return FDC_87306;
4001 default: 3979 default:
4002 printk(KERN_INFO 3980 pr_info("FDC %d init: 82078 variant with unknown PARTID=%d.\n",
4003 "FDC %d init: 82078 variant with unknown PARTID=%d.\n", 3981 fdc, reply_buffer[0] >> 5);
4004 fdc, reply_buffer[0] >> 5);
4005 return FDC_82078_UNKN; 3982 return FDC_82078_UNKN;
4006 } 3983 }
4007} /* get_fdc_version */ 3984} /* get_fdc_version */
@@ -4113,9 +4090,9 @@ static int __init floppy_setup(char *str)
4113 else 4090 else
4114 param = config_params[i].def_param; 4091 param = config_params[i].def_param;
4115 if (config_params[i].fn) 4092 if (config_params[i].fn)
4116 config_params[i]. 4093 config_params[i].fn(ints, param,
4117 fn(ints, param, 4094 config_params[i].
4118 config_params[i].param2); 4095 param2);
4119 if (config_params[i].var) { 4096 if (config_params[i].var) {
4120 DPRINT("%s=%d\n", str, param); 4097 DPRINT("%s=%d\n", str, param);
4121 *config_params[i].var = param; 4098 *config_params[i].var = param;
@@ -4129,8 +4106,8 @@ static int __init floppy_setup(char *str)
4129 4106
4130 DPRINT("allowed options are:"); 4107 DPRINT("allowed options are:");
4131 for (i = 0; i < ARRAY_SIZE(config_params); i++) 4108 for (i = 0; i < ARRAY_SIZE(config_params); i++)
4132 printk(" %s", config_params[i].name); 4109 pr_cont(" %s", config_params[i].name);
4133 printk("\n"); 4110 pr_cont("\n");
4134 } else 4111 } else
4135 DPRINT("botched floppy option\n"); 4112 DPRINT("botched floppy option\n");
4136 DPRINT("Read Documentation/blockdev/floppy.txt\n"); 4113 DPRINT("Read Documentation/blockdev/floppy.txt\n");
@@ -4148,7 +4125,8 @@ static ssize_t floppy_cmos_show(struct device *dev,
4148 drive = p->id; 4125 drive = p->id;
4149 return sprintf(buf, "%X\n", UDP->cmos); 4126 return sprintf(buf, "%X\n", UDP->cmos);
4150} 4127}
4151DEVICE_ATTR(cmos,S_IRUGO,floppy_cmos_show,NULL); 4128
4129DEVICE_ATTR(cmos, S_IRUGO, floppy_cmos_show, NULL);
4152 4130
4153static void floppy_device_release(struct device *dev) 4131static void floppy_device_release(struct device *dev)
4154{ 4132{
@@ -4160,7 +4138,7 @@ static int floppy_resume(struct device *dev)
4160 4138
4161 for (fdc = 0; fdc < N_FDC; fdc++) 4139 for (fdc = 0; fdc < N_FDC; fdc++)
4162 if (FDCS->address != -1) 4140 if (FDCS->address != -1)
4163 user_reset_fdc(-1, FD_RESET_ALWAYS, 0); 4141 user_reset_fdc(-1, FD_RESET_ALWAYS, false);
4164 4142
4165 return 0; 4143 return 0;
4166} 4144}
@@ -4172,8 +4150,8 @@ static const struct dev_pm_ops floppy_pm_ops = {
4172 4150
4173static struct platform_driver floppy_driver = { 4151static struct platform_driver floppy_driver = {
4174 .driver = { 4152 .driver = {
4175 .name = "floppy", 4153 .name = "floppy",
4176 .pm = &floppy_pm_ops, 4154 .pm = &floppy_pm_ops,
4177 }, 4155 },
4178}; 4156};
4179 4157
@@ -4245,16 +4223,16 @@ static int __init floppy_init(void)
4245 else 4223 else
4246 floppy_sizes[i] = MAX_DISK_SIZE << 1; 4224 floppy_sizes[i] = MAX_DISK_SIZE << 1;
4247 4225
4248 reschedule_timeout(MAXTIMEOUT, "floppy init", MAXTIMEOUT); 4226 reschedule_timeout(MAXTIMEOUT, "floppy init");
4249 config_types(); 4227 config_types();
4250 4228
4251 for (i = 0; i < N_FDC; i++) { 4229 for (i = 0; i < N_FDC; i++) {
4252 fdc = i; 4230 fdc = i;
4253 CLEARSTRUCT(FDCS); 4231 memset(FDCS, 0, sizeof(*FDCS));
4254 FDCS->dtr = -1; 4232 FDCS->dtr = -1;
4255 FDCS->dor = 0x4; 4233 FDCS->dor = 0x4;
4256#if defined(__sparc__) || defined(__mc68000__) 4234#if defined(__sparc__) || defined(__mc68000__)
4257 /*sparcs/sun3x don't have a DOR reset which we can fall back on to */ 4235 /*sparcs/sun3x don't have a DOR reset which we can fall back on to */
4258#ifdef __mc68000__ 4236#ifdef __mc68000__
4259 if (MACH_IS_SUN3X) 4237 if (MACH_IS_SUN3X)
4260#endif 4238#endif
@@ -4283,11 +4261,11 @@ static int __init floppy_init(void)
4283 4261
4284 /* initialise drive state */ 4262 /* initialise drive state */
4285 for (drive = 0; drive < N_DRIVE; drive++) { 4263 for (drive = 0; drive < N_DRIVE; drive++) {
4286 CLEARSTRUCT(UDRS); 4264 memset(UDRS, 0, sizeof(*UDRS));
4287 CLEARSTRUCT(UDRWE); 4265 memset(UDRWE, 0, sizeof(*UDRWE));
4288 USETF(FD_DISK_NEWCHANGE); 4266 set_bit(FD_DISK_NEWCHANGE_BIT, &UDRS->flags);
4289 USETF(FD_DISK_CHANGED); 4267 set_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
4290 USETF(FD_VERIFY); 4268 set_bit(FD_VERIFY_BIT, &UDRS->flags);
4291 UDRS->fd_device = -1; 4269 UDRS->fd_device = -1;
4292 floppy_track_buffer = NULL; 4270 floppy_track_buffer = NULL;
4293 max_buffer_sectors = 0; 4271 max_buffer_sectors = 0;
@@ -4307,7 +4285,7 @@ static int __init floppy_init(void)
4307 if (FDCS->address == -1) 4285 if (FDCS->address == -1)
4308 continue; 4286 continue;
4309 FDCS->rawcmd = 2; 4287 FDCS->rawcmd = 2;
4310 if (user_reset_fdc(-1, FD_RESET_ALWAYS, 0)) { 4288 if (user_reset_fdc(-1, FD_RESET_ALWAYS, false)) {
4311 /* free ioports reserved by floppy_grab_irq_and_dma() */ 4289 /* free ioports reserved by floppy_grab_irq_and_dma() */
4312 floppy_release_regions(fdc); 4290 floppy_release_regions(fdc);
4313 FDCS->address = -1; 4291 FDCS->address = -1;
@@ -4330,12 +4308,12 @@ static int __init floppy_init(void)
4330 * properly, so force a reset for the standard FDC clones, 4308 * properly, so force a reset for the standard FDC clones,
4331 * to avoid interrupt garbage. 4309 * to avoid interrupt garbage.
4332 */ 4310 */
4333 user_reset_fdc(-1, FD_RESET_ALWAYS, 0); 4311 user_reset_fdc(-1, FD_RESET_ALWAYS, false);
4334 } 4312 }
4335 fdc = 0; 4313 fdc = 0;
4336 del_timer(&fd_timeout); 4314 del_timer(&fd_timeout);
4337 current_drive = 0; 4315 current_drive = 0;
4338 initialising = 0; 4316 initialized = true;
4339 if (have_no_fdc) { 4317 if (have_no_fdc) {
4340 DPRINT("no floppy controllers found\n"); 4318 DPRINT("no floppy controllers found\n");
4341 err = have_no_fdc; 4319 err = have_no_fdc;
@@ -4356,7 +4334,8 @@ static int __init floppy_init(void)
4356 if (err) 4334 if (err)
4357 goto out_flush_work; 4335 goto out_flush_work;
4358 4336
4359 err = device_create_file(&floppy_device[drive].dev,&dev_attr_cmos); 4337 err = device_create_file(&floppy_device[drive].dev,
4338 &dev_attr_cmos);
4360 if (err) 4339 if (err)
4361 goto out_unreg_platform_dev; 4340 goto out_unreg_platform_dev;
4362 4341
@@ -4420,8 +4399,10 @@ static int floppy_request_regions(int fdc)
4420 const struct io_region *p; 4399 const struct io_region *p;
4421 4400
4422 for (p = io_regions; p < ARRAY_END(io_regions); p++) { 4401 for (p = io_regions; p < ARRAY_END(io_regions); p++) {
4423 if (!request_region(FDCS->address + p->offset, p->size, "floppy")) { 4402 if (!request_region(FDCS->address + p->offset,
4424 DPRINT("Floppy io-port 0x%04lx in use\n", FDCS->address + p->offset); 4403 p->size, "floppy")) {
4404 DPRINT("Floppy io-port 0x%04lx in use\n",
4405 FDCS->address + p->offset);
4425 floppy_release_allocated_regions(fdc, p); 4406 floppy_release_allocated_regions(fdc, p);
4426 return -EBUSY; 4407 return -EBUSY;
4427 } 4408 }
@@ -4512,11 +4493,9 @@ cleanup:
4512static void floppy_release_irq_and_dma(void) 4493static void floppy_release_irq_and_dma(void)
4513{ 4494{
4514 int old_fdc; 4495 int old_fdc;
4515#ifdef FLOPPY_SANITY_CHECK
4516#ifndef __sparc__ 4496#ifndef __sparc__
4517 int drive; 4497 int drive;
4518#endif 4498#endif
4519#endif
4520 long tmpsize; 4499 long tmpsize;
4521 unsigned long tmpaddr; 4500 unsigned long tmpaddr;
4522 unsigned long flags; 4501 unsigned long flags;
@@ -4547,20 +4526,18 @@ static void floppy_release_irq_and_dma(void)
4547 buffer_min = buffer_max = -1; 4526 buffer_min = buffer_max = -1;
4548 fd_dma_mem_free(tmpaddr, tmpsize); 4527 fd_dma_mem_free(tmpaddr, tmpsize);
4549 } 4528 }
4550#ifdef FLOPPY_SANITY_CHECK
4551#ifndef __sparc__ 4529#ifndef __sparc__
4552 for (drive = 0; drive < N_FDC * 4; drive++) 4530 for (drive = 0; drive < N_FDC * 4; drive++)
4553 if (timer_pending(motor_off_timer + drive)) 4531 if (timer_pending(motor_off_timer + drive))
4554 printk("motor off timer %d still active\n", drive); 4532 pr_info("motor off timer %d still active\n", drive);
4555#endif 4533#endif
4556 4534
4557 if (timer_pending(&fd_timeout)) 4535 if (timer_pending(&fd_timeout))
4558 printk("floppy timer still active:%s\n", timeout_message); 4536 pr_info("floppy timer still active:%s\n", timeout_message);
4559 if (timer_pending(&fd_timer)) 4537 if (timer_pending(&fd_timer))
4560 printk("auxiliary floppy timer still active\n"); 4538 pr_info("auxiliary floppy timer still active\n");
4561 if (work_pending(&floppy_work)) 4539 if (work_pending(&floppy_work))
4562 printk("work still pending\n"); 4540 pr_info("work still pending\n");
4563#endif
4564 old_fdc = fdc; 4541 old_fdc = fdc;
4565 for (fdc = 0; fdc < N_FDC; fdc++) 4542 for (fdc = 0; fdc < N_FDC; fdc++)
4566 if (FDCS->address != -1) 4543 if (FDCS->address != -1)
@@ -4577,7 +4554,9 @@ static void __init parse_floppy_cfg_string(char *cfg)
4577 char *ptr; 4554 char *ptr;
4578 4555
4579 while (*cfg) { 4556 while (*cfg) {
4580 for (ptr = cfg; *cfg && *cfg != ' ' && *cfg != '\t'; cfg++) ; 4557 ptr = cfg;
4558 while (*cfg && *cfg != ' ' && *cfg != '\t')
4559 cfg++;
4581 if (*cfg) { 4560 if (*cfg) {
4582 *cfg = '\0'; 4561 *cfg = '\0';
4583 cfg++; 4562 cfg++;
@@ -4625,6 +4604,7 @@ static void __exit floppy_module_exit(void)
4625 /* eject disk, if any */ 4604 /* eject disk, if any */
4626 fd_eject(0); 4605 fd_eject(0);
4627} 4606}
4607
4628module_exit(floppy_module_exit); 4608module_exit(floppy_module_exit);
4629 4609
4630module_param(floppy, charp, 0); 4610module_param(floppy, charp, 0);
@@ -4636,9 +4616,10 @@ MODULE_LICENSE("GPL");
4636 4616
4637/* This doesn't actually get used other than for module information */ 4617/* This doesn't actually get used other than for module information */
4638static const struct pnp_device_id floppy_pnpids[] = { 4618static const struct pnp_device_id floppy_pnpids[] = {
4639 { "PNP0700", 0 }, 4619 {"PNP0700", 0},
4640 { } 4620 {}
4641}; 4621};
4622
4642MODULE_DEVICE_TABLE(pnp, floppy_pnpids); 4623MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
4643 4624
4644#else 4625#else
diff --git a/drivers/char/ChangeLog b/drivers/char/ChangeLog
deleted file mode 100644
index 56b8a2e76ab1..000000000000
--- a/drivers/char/ChangeLog
+++ /dev/null
@@ -1,775 +0,0 @@
12001-08-11 Tim Waugh <twaugh@redhat.com>
2
3 * serial.c (get_pci_port): Deal with awkward Titan cards.
4
51998-08-26 Theodore Ts'o <tytso@rsts-11.mit.edu>
6
7 * serial.c (rs_open): Correctly decrement the module in-use count
8 on errors.
9
10Thu Feb 19 14:24:08 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
11
12 * tty_io.c (tty_name): Remove the non-reentrant (and non-SMP safe)
13 version of tty_name, and rename the reentrant _tty_name
14 function to be tty_name.
15 (tty_open): Add a warning message stating callout devices
16 are deprecated.
17
18Mon Dec 1 08:24:15 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
19
20 * tty_io.c (tty_get_baud_rate): Print a warning syslog if the
21 tty->alt_speed kludge is used; this means the system is
22 using the deprecated SPD_HI ioctls.
23
24Mon Nov 24 10:37:49 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
25
26 * serial.c, esp.c, rocket.c: Change drivers to take advantage of
27 tty_get_baud_rate().
28
29 * tty_io.c (tty_get_baud_rate): New function which computes the
30 correct baud rate for the tty. More factoring out of
31 common code out of the serial driver to the high-level tty
32 functions....
33
34Sat Nov 22 07:53:36 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
35
36 * serial.c, esp.c, rocket.c: Add tty->driver.break() routine, and
37 allow high-level tty code to handle the break and soft
38 carrier ioctls.
39
40 * tty_ioctl.c (n_tty_ioctl): Support TIOCGSOFTCAR and
41 TIOCSSOFTCAR, so that device drivers don't have to support
42 it.
43
44 * serial.c (autoconfig): Change 16750 test to hopefully eliminate
45 false results by people with strange 16550As being
46 detected as 16750s. Hopefully 16750s will still be
47 detected as 16750, and other weird UARTs won't get poorly
48 autodetected. If this doesn't work, I'll have to disable
49 the auto identification for the 16750.
50
51 * tty_io.c (tty_hangup): Now actually do the tty hangup
52 processing during the timer processing, and disable
53 interrupts while doing the hangup processing. This avoids
54 several nasty race conditions which happened when the
55 hangup processing was done asynchronously.
56 (tty_ioctl): Do break handling in the tty driver if
57 driver's break function is supported.
58 (tty_flip_buffer_push): New exported function which should
59 be used by drivers to push characters in the flip buffer
60 to the tty handler. This may either be done using a task
61 queue function for better CPU efficiency, or directly for
62 low latency operation.
63
64 * serial.c (rs_set_termios): Fix bug rs_set_termios when
65 transitioning away from B0, submitted by Stanislav
66 Voronyi.
67
68Thu Jun 19 20:05:58 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
69
70 * serial.c (begin_break, end_break, rs_ioctl): Applied patch
71 to support BSD ioctls to set and clear the break
72 condition explicitly.
73
74 * console.c (scrup, scrdown, insert_line, delete_line): Applied
75 fix suggested by Aaron Tiensivu to speed up block scrolls
76 up and down.
77
78 * n_tty.c (opost_block, write_chan): Added a modified "fast
79 console" patch which processes a block of text via
80 "cooking" efficiently.
81
82Wed Jun 18 15:25:50 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
83
84 * tty_io.c (init_dev, release_dev): Applied fix suggested by Bill
85 Hawes to prevent race conditions in the tty code.
86
87 * n_tty.c (n_tty_chars_in_buffer): Applied fix suggested by Bill
88 Hawes so that n_tty_chars_in_buffer returns the correct
89 value in the case when the tty is in cannonical mode. (To
90 avoid a pty deadlock with telnetd.)
91
92Thu Feb 27 01:53:08 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
93
94 * serial.c (change_speed): Add support for the termios flag
95 CMSPAR, which allows the user to select stick parity.
96 (i.e, if PARODD is set, the parity bit is always 1; if
97 PARRODD is not set, then the parity bit is always 0).
98
99Wed Feb 26 19:03:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
100
101 * serial.c (cleanup_module): Fix memory leak when using the serial
102 driver as a module; make sure tmp_buf gets freed!
103
104Tue Feb 25 11:01:59 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
105
106 * serial.c (set_modem_info): Add support for setting and clearing
107 the OUT1 and OUT2 bits. (For special case UART's, usually
108 for half-duplex.)
109 (autoconfig, change_speed): Fix TI 16750 support.
110
111Sun Feb 16 00:14:43 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
112
113 * tty_io.c (release_dev): Add sanity check to make sure there are
114 no waiters on tty->read_wait or tty->write_wait.
115
116 * serial.c (rs_init): Don't autoconfig a device if the I/O region
117 is already reserved.
118
119 * serial.c (serial_proc_info): Add support for /proc/serial.
120
121Thu Feb 13 00:49:10 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
122
123 * serial.c (receive_chars): When the UART repotrs an overrun
124 condition, it does so with a valid character. Changed to
125 not throw away the valid character, but instead report the
126 overrun after the valid character.
127
128 * serial.c: Added new #ifdef's for some of the advanced serial
129 driver features. A minimal driver that only supports COM
130 1/2/3/4 without sharing serial interrupts only takes 17k;
131 the full driver takes 32k.
132
133Wed Feb 12 14:50:44 1997 Theodore Ts'o <tytso@rsts-11.mit.edu>
134
135 * vt.c:
136 * pty.c:
137 * tty_ioctl.c:
138 * serial.c: Update routines to use the new 2.1 memory access
139 routines.
140
141Wed Dec 4 07:51:52 1996 Theodore Ts'o <tytso@localhost.mit.edu>
142
143 * serial.c (change_speed): Use save_flags(); cli() and
144 restore_flags() in order to ensure we don't accidentally
145 turn on interrupts when starting up the port.
146 (startup): Move the insertion of serial structure into the
147 IRQ chain earlier into the startup processing. Interrupts
148 should be off this whole time, but we eventually will want
149 to reduce this window.
150
151Thu Nov 21 10:05:22 1996 Theodore Ts'o <tytso@localhost.mit.edu>
152
153 * tty_ioctl.c (tty_wait_until_sent): Always check the driver
154 wait_until_ready routine, even if there are no characters
155 in the xmit buffer. (There may be charactes in the device
156 FIFO.)
157 (n_tty_ioctl): Add new flag tty->flow_stopped which
158 indicates whether the tty is stopped due to a request by
159 the TCXONC ioctl (used by tcflow). If so, don't let an
160 incoming XOFF character restart the tty. The tty can only
161 be restarted by another TCXONC request.
162
163 * tty_io.c (start_tty): Don't allow the tty to be restarted if
164 tty->flow_stopped is true.
165
166 * n_tty.c (n_tty_receive_char): If tty->flow_stopped is true, and
167 IXANY is set, don't eat a character trying to restart the
168 tty.
169
170 * serial.c (startup): Remove need for MCR_noint from the
171 async_struct structure. Only turn on DTR and RTS if the
172 baud rate is not zero.
173 (change_speed): More accurately calculate the timeout
174 value based on the word size. Move responsibility of
175 hangup when speed becomes B0 to rs_set_termios()
176 (set_serial_info): When changing the UART type set the
177 current xmit_fifo_size as well as the permanent
178 xmit_fifo_size.
179 (rs_ioctl): Fix TCSBRK (used by tcdrain) and TCSBRKP
180 ioctls to return EINTR if interrupted by a signal.
181 (rs_set_termios): If the baud rate changes to or from B0,
182 this function is now responsible for setting or clearing
183 DTR and RTS. DTR and RTS are only be changed on the
184 transition to or from the B0 state.
185 (rs_close): Wait for the characters to drain based on
186 info->timeout. At low baud rates (50 bps), it may take a
187 long time for the FIFO to completely drain out!
188 (rs_wait_until_sent): Fixed timeout handling. Now
189 releases control to the scheduler, but checks frequently
190 enough so that the function is sensitive enough to pass
191 the timing requirements of the NIST-PCTS.
192 (block_til_ready): When opening the device, don't turn on
193 DTR and RTS if the baud rate is B0.
194
195Thu Nov 14 00:06:09 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
196
197 * serial.c (autoconfig): Fix autoconfiguration problems;
198 info->flags wasn't getting initialized from the state
199 structure. Put in more paranoid test for the 16750.
200
201Fri Nov 8 20:19:50 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
202
203 * n_tty.c (n_tty_flush_buffer): Only call driver->unthrottle() if
204 the tty was previous throttled.
205 (n_tty_set_termios, write_chan): Add changes suggested by
206 Simon P. Allen to allow hardware cooking.
207
208 * tty_ioctl.c (set_termios): If we get a signal while waiting for
209 the tty to drain, return -EINTR.
210
211 * serial.c (change_speed): Add support for CREAD, as required by
212 POSIX.
213
214Sat Nov 2 20:43:10 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
215
216 * serial.c: Wholesale changes. Added support for the Startech
217 16650 and 16650V2 chips. (WARNING: the new startech
218 16650A may or may not work!) Added support for the
219 TI16750 (not yet tested). Split async_struct into a
220 transient part (async_struct) and a permanent part
221 (serial_state) which contains the configuration
222 information for the ports. Added new driver routines
223 wait_until_sent() and send_xchar() to help with POSIX
224 compliance. Added support for radio clocks which waggle
225 the carrier detect line (CONFIG_HARD_PPS).
226
227 * tty_ioctl.c (tty_wait_until_sent): Added call to new driver
228 function tty->driver.wait_until_sent(), which returns when
229 the tty's device xmit buffers are drained. Needed for
230 full POSIX compliance.
231
232 (send_prio_char): New function, called by the ioctl's
233 TCIOFF and TCION; uses the new driver call send_xchar(),
234 which will send the XON or XOFF character at high priority
235 (and even if tty output is stopped).
236
237Wed Jun 5 18:52:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
238
239 * pty.c (pty_close): When closing a pty, make sure packet mode is
240 cleared.
241
242Sun May 26 09:33:52 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
243
244 * vesa_blank.c (set_vesa_blanking): Add missing verify_area() call.
245
246 * selection.c (set_selection): Add missing verify_area() call.
247
248 * tty_io.c (tty_ioctl): Add missing verify_area() calls.
249
250 * serial.c (rs_ioctl): Add missing verify_area() calls.
251 (rs_init): Allow initialization of serial driver
252 configuration from a module.
253
254 * random.c (extract_entropy): Add missing verify_area call.
255 Don't limit number of characters returned to
256 32,768. Extract entropy is now no longer a inlined
257 function.
258
259 (random_read): Check return value in case extract_entropy
260 returns an error.
261
262 (secure_tcp_sequence_number): New function which returns a
263 secure TCP sequence number. This is needed to prevent some
264 nasty TCP hijacking attacks.
265
266 (init_std_data): Initialize using gettimeofday() instead of
267 struct timeval xtime.
268
269 (fast_add_entropy_word, add_entropy_word): Rename the
270 inline function add_entropy_word() to
271 fast_add_entropy_word(). Make add_entropy_word() be the
272 non-inlined function which is used in non-timing critical
273 places, in order to save space.
274
275 (initialize_benchmark, begin_benchmark, end_benchmark): New
276 functions defined when RANDOM_BENCHMARK is defined. They
277 allow us to benchmark the speed of the
278 add_timer_randomness() call.
279
280 (int_ln, rotate_left): Add two new inline functions with
281 i386 optimized asm instructions. This speeds up the
282 critical add_entropy_word() and add_timer_randomness()
283 functions, which are called from interrupt handlers.
284
285Tue May 7 22:51:11 1996 <tytso@rsts-11.mit.edu>
286
287 * random.c (add_timer_randomness): Limit the amount randomness
288 that we estimate to 12 bits. (An arbitrary amount).
289
290 (extract_entropy): To make it harder to analyze the hash
291 function, fold the hash function in half using XOR, and
292 use the folded result as the value to emit to the user.
293 Also, add timer randomness each pass through the
294 exact_entropy call, to increase the amount of unknown
295 values during the extraction process.
296
297 (random_ioctl): Use IOR/IOW definitions to define the
298 ioctl values used by the /dev/random driver. Allow the
299 old ioctl values to be used for backwards compatibility
300 (for a limited amount of time).
301
302Wed Apr 24 14:02:04 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
303
304 * random.c (add_timer_randomness): Use 2nd derivative as well to
305 better estimate entropy.
306
307 (rand_initialize): Explicitly initialize all the pointers
308 to NULL. (Clearing pointers using memset isn't portable.)
309 Initialize the random pool with OS-dependent data.
310
311 (random_write): Add sanity checking to the arguments to
312 random_write(), so that bad arguments won't cause a kernel
313 SEGV.
314
315 (random_read): Update the access time of the device inode
316 when you return data to the user.
317
318 (random_ioctl): Wake up the random_wait channel when there
319 are only WAIT_INPUT_BITS available. Add more paranoia
320 checks to make sure entropy_count doesn't go beyond the
321 bounds of (0, POOLSIZE). Add a few missing verify_area
322 checks. Add support for the RNDCLEARPOOL ioctl, which
323 zaps the random pool.
324
325 (add_timer_randomness): Wake up the random_wait
326 channel only when there are WAIT_INPUT_BITS available.
327
328 (random_select): Allow a random refresh daemon process to
329 select on /dev/random for writing; wake up the daemon when
330 there are less than WAIT_OUTPUT_BITS bits of randomness
331 available.
332
333Tue Apr 23 22:56:07 1996 <tytso@rsts-11.mit.edu>
334
335 * tty_io.c (init_dev): Change return code when user attempts to
336 open master pty which is already open from EAGAIN to EIO,
337 to match with BSD expectations. EIO is more correct
338 anyway, since EAGAIN implies that retrying will be
339 successful --- which it might be.... Eventually!!
340
341 * pty.c (pty_open, pty_close): Fix wait loop so that we don't
342 busy loop while waiting for the master side to open.
343 Fix tty opening/closing logic. TTY_SLAVE_CLOSED was
344 renamed to TTY_OTHER_CLOSED, so that the name is more
345 descriptive. Also fixed code so that the tty flag
346 actually works correctly now....
347
348Mon Apr 1 10:22:01 1996 <tytso@rsts-11.mit.edu>
349
350 * serial.c (rs_close): Cleaned up modularization changes.
351 Remove code which forced line discipline back to N_TTY
352 this is done in the tty upper layers, and there's no
353 reason to do it here. (Making this change also
354 removed the requirement that the serial module access
355 the internal kernel symbol "ldiscs".)
356
357 * tty_io.c (tty_init): Formally register a tty_driver entry for
358 /dev/tty (device 4, 0) and /dev/console (device 5, 0).
359 This guarantees that major device numbers 4 and 5 will be
360 reserved for the tty subsystem (as they have to be because
361 of /dev/tty and /dev/console). Removed tty_regdev, as
362 this interface is no longer necessary.
363
364Sun Mar 17 20:42:47 GMT 1996 <ah@doc.ic.ac.uk>
365
366 * serial.c : modularisation (changes in linux/fs/device.c allow
367 kerneld to automatically load the serial module).
368
369 * Makefile, Config.in : serial modularisation adds.
370
371 * tty_io.c : tty_init_ctty used by to register "cua" driver just
372 for the /dev/tty device (5,0). Added tty_regdev.
373
374 * serial.c (shutdown, rs_ioctl) : when port shuts down wakeup processes
375 waiting on delta_msr_wait. The TIOCMIWAIT ioctl returns EIO
376 if no change was done since the time of call.
377
378Sat Mar 16 14:33:13 1996 <aeb@cwi.nl>
379
380 * tty_io.c (disassociate_ctty): If disassociate_ctty is called by
381 exit, do not perform an implicit vhangup on a pty.
382
383Fri Feb 9 14:15:47 1996 <tytso@rsts-11.mit.edu>
384
385 * serial.c (block_til_ready): Fixed another race condition which
386 happens if a hangup happens during the open.
387
388Wed Jan 10 10:08:00 1996 <tytso@rsts-11.mit.edu>
389
390 * serial.c (block_til_ready): Remove race condition which happened
391 if a hangup condition happened during the setup of the
392 UART, before rs_open() called block_til_ready(). This
393 caused the info->count counter to be erroneously
394 decremented.
395
396 * serial.c (startup, rs_open): Remove race condition that could
397 cause a memory leak of one page. (Fortunately, both race
398 conditions were relatively rare in practice.)
399
400Tue Dec 5 13:21:27 1995 <tytso@rsts-11.mit.edu>
401
402 * serial.c (check_modem_status, rs_ioctl): Support the new
403 ioctl()'s TIOCGICOUNT, TIOCMIWAIT. These allow an
404 application program to wait on a modem serial register
405 status bit change, and to find out how many changes have
406 taken place for the MSR bits.
407
408 (rs_write): Eliminate a race condition which is introduced
409 if it is necessary to wait for the semaphore.
410
411Sat Nov 4 17:14:45 1995 <tytso@rsts-11.mit.edu>
412
413 * tty_io.c (tty_init): Move registration of TTY_MAJOR and
414 TTY_AUX_MAJOR to the end, so that /proc/devices looks
415 prettier.
416
417 * pty.c (pty_init): Use new major numbers for PTY master and slave
418 devices. This allow us to have more than 64 pty's. We
419 register the old pty devices for backwards compatibility.
420 Note that a system should either be using the old pty
421 devices or the new pty devices --- in general, it should
422 try to use both, since they map into the same pty table.
423 The old pty devices are strictly for backwards compatibility.
424
425Wed Oct 11 12:45:24 1995 <tytso@rsts-11.mit.edu>
426
427 * tty_io.c (disassociate_ctty): If disassociate_ctty is called by
428 exit, perform an implicit vhangup on the tty.
429
430 * pty.c (pty_close): When the master pty is closed, send a hangup
431 to the slave pty.
432 (pty_open): Use the flag TTY_SLAVE_CLOSED to test to see
433 if there are any open slave ptys, instead of using
434 tty->link->count. The old method got confused if there
435 were processes that had hung-up file descriptors on the
436 slave tty.
437
438Tue May 2 00:53:25 1995 <tytso@rsx-11.mit.edu>
439
440 * tty_io.c (tty_set_ldisc): Wait until the output buffer is
441 drained before closing the old line discipline --- needed
442 in only one case: XON/XOFF processing.
443
444 * n_tty.c (n_tty_close): Don't bother waiting until the output
445 driver is closed; in general, the line discipline
446 shouldn't care if the hardware is finished
447 transmitting before the line discipline terminates.
448
449 * tty_io.c (release_dev): Shutdown the line discipline after
450 decrementing the tty count variable; but set the
451 TTY_CLOSING flag so that we know that this tty structure
452 isn't long for this world.
453
454 * tty_io.c (init_dev): Add sanity code to check to see if
455 TTY_CLOSING is set on a tty structure; if so, something
456 bad has happened (probably a line discipline close blocked
457 when it shouldn't have; so do a kernel printk and then
458 return an error).
459
460Wed Apr 26 10:23:44 1995 Theodore Y. Ts'o <tytso@localhost>
461
462 * tty_io.c (release_dev): Try to shutdown the line discipline
463 *before* decrementing the tty count variable; this removes
464 a potential race condition which occurs when the line
465 discipline close blocks, and another process then tries
466 open the same serial port.
467
468 * serial.c (rs_hangup): When hanging up, flush the output buffer
469 before shutting down the UART. Otherwise the line
470 discipline close blocks waiting for the characters to get
471 flushed, which never happens until the serial port gets reused.
472
473Wed Apr 12 08:06:16 1995 Theodore Y. Ts'o <tytso@localhost>
474
475 * serial.c (do_serial_hangup, do_softint, check_modem_status,
476 rs_init): Hangups are now scheduled via a separate tqueue
477 structure in the async_struct structure, tqueue_hangup.
478 This task is pushed on to the tq_schedule queue, so that
479 it is processed synchronously by the scheduler.
480
481Sat Feb 18 12:13:51 1995 Theodore Y. Ts'o (tytso@rt-11)
482
483 * tty_io.c (disassociate_ctty, tty_open, tty_ioctl): Clear
484 current->tty_old_pgrp field when a session leader
485 acquires a controlling tty, and after a session leader
486 has disassociated from a controlling tty.
487
488Fri Feb 17 09:34:09 1995 Theodore Y. Ts'o (tytso@rt-11)
489
490 * serial.c (rs_interrupt_single, rs_interrupt, rs_interrupt_multi):
491 Change the number of passes made from 64 to be 256,
492 configurable with the #define RS_ISR_PASS_LIMIT.
493
494 * serial.c (rs_init, set_serial_info, get_serial_info, rs_close):
495 Remove support for closing_wait2. Instead, set
496 tty->closing and rely on the line discipline to prevent
497 echo wars.
498
499 * n_tty.c (n_tty_receive_char): IEXTEN does not need to be
500 enabled in order for IXANY to be active.
501
502 If tty->closing is set, then only process XON and XOFF
503 characters.
504
505Sun Feb 12 23:57:48 1995 Theodore Y. Ts'o (tytso@rt-11)
506
507 * serial.c (rs_timer): Change the interrupt poll time from 60
508 seconds to 10 seconds, configurable with the #define
509 RS_STROBE_TIME.
510
511 * serial.c (rs_interrupt_multi, startup, shutdown, rs_ioctl,
512 set_multiport_struct, get_multiport_struct): Add
513 provisions for a new type of interrupt service routine,
514 which better supports multiple serial ports on a single
515 IRQ.
516
517Sun Feb 5 19:35:11 1995 Theodore Y. Ts'o (tytso@rt-11)
518
519 * tty_ioctl.c (n_tty_ioctl, set_termios, tty_wait_until_sent):
520 * serial.c (rs_ioctl, rs_close):
521 * cyclades.c (cy_ioctl, cy_close):
522 * n_tty.c (n_tty_close): Rename wait_until_sent to
523 tty_wait_until_sent, so that it's a better name to export
524 in ksyms.c.
525
526Sat Feb 4 23:36:20 1995 Theodore Y. Ts'o (tytso@rt-11)
527
528 * serial.c (rs_close): Added missing check for closing_wait2 being
529 ASYNC_CLOSING_WAIT_NONE.
530
531Thu Jan 26 09:02:49 1995 Theodore Y. Ts'o (tytso@rt-11)
532
533 * serial.c (rs_init, set_serial_info, get_serial_info,
534 rs_close): Support close_wait in the serial driver.
535 This is helpful for slow devices (like serial
536 plotters) so that their outputs don't get flushed upon
537 device close. This has to be configurable because
538 normally we don't want ports to be hung up for long
539 periods of time during a close when they are not
540 connected to a device, or the device is powered off.
541
542 The default is to wait 30 seconds; in the case of a
543 very slow device, the close_wait timeout should be
544 lengthened. If it is set to 0, the kernel will wait
545 forever for all of the data to be transmitted.
546
547Thu Jan 17 01:17:20 1995 Theodore Y. Ts'o (tytso@rt-11)
548
549 * serial.c (startup, change_speed, rs_init): Add support to detect
550 the StarTech 16650 chip. Treat it as a 16450 for now,
551 because of its FIFO bugs.
552
553Thu Jan 5 21:21:57 1995 <dahinds@users.sourceforge.net>
554
555 * serial.c: (receive_char): Added counter to prevent infinite loop
556 when a PCMCIA serial device is ejected.
557
558Thu Dec 29 17:53:48 1994 <tytso@rsx-11.mit.edu>
559
560 * tty_io.c (check_tty_count): New procedure which checks
561 tty->count to make sure that it matches with the number of
562 open file descriptors which point at the structure. If
563 the number doesn't match, it prints a warning message.
564
565Wed Dec 28 15:41:51 1994 <tytso@rsx-11.mit.edu>
566
567 * tty_io.c (do_tty_hangup, disassociate_ctty): At hangup time,
568 save the tty's current foreground process group in the
569 session leader's task structure. When the session leader
570 terminates, send a SIGHUP, SIGCONT to that process group.
571 This is not required by POSIX, but it's not prohibited
572 either, and it appears to be the least intrusive way
573 to fix a problem that dialup servers have with
574 orphaned process groups caused by modem hangups.
575
576Thu Dec 8 14:52:11 1994 <tytso@rsx-11.mit.edu>
577
578 * serial.c (rs_ioctl): Don't allow most ioctl's if the serial port
579 isn't initialized.
580
581 * serial.c (rs_close): Don't clear the IER if the serial port
582 isn't initialized.
583
584 * serial.c (block_til_ready): Don't try to block on the dialin
585 port if the serial port isn't initialized.
586
587Wed Dec 7 10:48:30 1994 Si Park (si@wimpol.demon.co.uk)
588 * tty_io.c (tty_register_driver): Fix bug when linking onto
589 the tty_drivers list. We now test that there are elements
590 already on the list before setting the back link from the
591 first element to the new driver.
592
593 * tty_io.c (tty_unregister_driver): Fix bug in unlinking the
594 specified driver from the tty_drivers list. We were not
595 setting the back link correctly. This used to result in
596 a dangling back link pointer and cause panics on the next
597 call to get_tty_driver().
598
599Tue Nov 29 10:21:09 1994 Theodore Y. Ts'o (tytso@rt-11)
600
601 * tty_io.c (tty_unregister_driver): Fix bug in
602 tty_unregister_driver where the pointer to the refcount is
603 tested, instead of the refcount itself. This caused
604 tty_unregister_driver to always return EBUSY.
605
606Sat Nov 26 11:59:24 1994 Theodore Y. Ts'o (tytso@rt-11)
607
608 * tty_io.c (tty_ioctl): Add support for the new ioctl
609 TIOCTTYGSTRUCT, which allow a kernel debugging program
610 direct read access to the tty and tty_driver structures.
611
612Fri Nov 25 17:26:22 1994 Theodore Y. Ts'o (tytso@rt-11)
613
614 * serial.c (rs_set_termios): Don't wake up processes blocked in
615 open when the CLOCAL flag changes, since a blocking
616 open only samples the CLOCAL flag once when it blocks,
617 and doesn't check it again. (n.b. FreeBSD has a
618 different behavior for blocking opens; it's not clear
619 whether Linux or FreeBSD's interpretation is correct.
620 POSIX doesn't give clear guidance on this issue, so
621 this may change in the future....)
622
623 * serial.c (block_til_ready): Use the correct termios structure to
624 check the CLOCAL flag. If the cuaXX device is active,
625 then check the saved termios for the ttySXX device.
626 Otherwise, use the currently active termios structure.
627
628Sun Nov 6 21:05:44 1994 Theodore Y. Ts'o (tytso@rt-11)
629
630 * serial.c (change_speed): Add support for direct access of
631 57,600 and 115,200 bps.
632
633Wed Nov 2 10:32:36 1994 Theodore Y. Ts'o (tytso@rt-11)
634
635 * n_tty.c (n_tty_receive_room): Only allow excess characters
636 through if we are in ICANON mode *and* there are other no
637 pending lines in the buffer. Otherwise cut and paste over
638 4k breaks.
639
640Sat Oct 29 18:17:34 1994 Theodore Y. Ts'o (tytso@rt-11)
641
642 * serial.c (rs_ioctl, get_lsr_info): Added patch suggested by Arne
643 Riiber so that user mode programs can tell when the
644 transmitter shift register is empty.
645
646Thu Oct 27 23:14:29 1994 Theodore Y. Ts'o (tytso@rt-11)
647
648 * tty_ioctl.c (wait_until_sent): Added debugging printk statements
649 (under the #ifdef TTY_DEBUG_WAIT_UNTIL_SENT)
650
651 * serial.c (rs_interrupt, rs_interrupt_single, receive_chars,
652 change_speed, rs_close): rs_close now disables receiver
653 interrupts when closing the serial port. This allows the
654 serial port to close quickly when Linux and a modem (or a
655 mouse) are engaged in an echo war; when closing the serial
656 port, we now first stop listening to incoming characters,
657 and *then* wait for the transmit buffer to drain.
658
659 In order to make this change, the info->read_status_mask
660 is now used to control what bits of the line status
661 register are looked at in the interrupt routine in all
662 cases; previously it was only used in receive_chars to
663 select a few of the status bits.
664
665Mon Oct 24 23:36:21 1994 Theodore Y. Ts'o (tytso@rt-11)
666
667 * serial.c (rs_close): Add a timeout to the transmitter flush
668 loop; this is just a sanity check in case we have flaky
669 (or non-existent-but-configured-by-the-user) hardware.
670
671Fri Oct 21 09:37:23 1994 Theodore Y. Ts'o (tytso@rt-11)
672
673 * tty_io.c (tty_fasync): When asynchronous I/O is enabled, if the
674 process or process group has not be specified yet, set it
675 to be the tty's process group, or if that is not yet set,
676 to the current process's pid.
677
678Thu Oct 20 23:17:28 1994 Theodore Y. Ts'o (tytso@rt-11)
679
680 * n_tty.c (n_tty_receive_room): If we are doing input
681 canonicalization, let as many characters through as
682 possible, so that the excess characters can be "beeped".
683
684Tue Oct 18 10:02:43 1994 Theodore Y. Ts'o (tytso@rt-11)
685
686 * serial.c (rs_start): Removed an incorrect '!' that was
687 preventing transmit interrupts from being re-enabled in
688 rs_start(). Fortunately in most cases it would be
689 re-enabled elsewhere, but this still should be fixed
690 correctly.
691
692Sun Oct 9 23:46:03 1994 Theodore Y. Ts'o (tytso@rt-11)
693
694 * tty_io.c (do_tty_hangup): If the tty driver flags
695 TTY_DRIVER_RESET_TERMIOS is set, then reset the termios
696 settings back to the driver's initial configuration. This
697 allows the termios settings to be reset even if a process
698 has hung up file descriptors keeping a pty's termios from
699 being freed and reset.
700
701 * tty_io.c (release_dev): Fix memory leak. The pty's other
702 termios structure should also be freed.
703
704 * serial.c (rs_close, shutdown): Change how we wait for the
705 transmitter to completely drain before shutting down the
706 serial port. We now do it by scheduling in another
707 process instead of busy looping with the interrupts turned
708 on. This may eliminate some race condition problems that
709 some people seem to be reporting.
710
711Sun Sep 25 14:18:14 1994 Theodore Y. Ts'o (tytso@rt-11)
712
713 * tty_io.c (release_dev): When freeing a tty make sure that both
714 the tty and the o_tty (if present) aren't a process's
715 controlling tty. (Previously, we only checked the tty.)
716
717 * serial.c (change_speed): Only enable the Modem Status
718 Interrupt for a port if CLOCAL is not set or CRTSCTS
719 is set. If we're not checking the carrier detect and
720 CTS line, there's no point in enabling the modem
721 status interrupt. This will save spurious interrupts
722 from slowing down systems who have terminals that
723 don't support either line. (Of course, if you want
724 only one of CD and CTS support, you will need a
725 properly wired serial cable.)
726
727Thu Sep 22 08:32:48 1994 Theodore Y. Ts'o (tytso@rt-11)
728
729 * tty_io.c (do_SAK): Return if tty is null.
730
731 * tty_io.c (_tty_name): Return "NULL tty" if the passed in tty is
732 NULL.
733
734Sat Sep 17 13:19:25 1994 Theodore Y. Ts'o (tytso@rt-11)
735
736 * tty_ioctl.c (n_tty_ioctl): Fix TIOCGLCKTRMIOS and
737 TIOCSLCKTRMIOS, which were totally broken. Remove
738 extra indirection from argument; it should be a struct
739 termios *, not a struct termios **.
740 &real_tty->termios_locked should have been
741 real_tty->termios_locked. This caused us to be
742 reading and writing the termios_locked structure to
743 random places in kernel memory.
744
745 * tty_io.c (release_dev): Oops! Forgot to delete a critical kfree
746 of the locked_termios. This leaves the locked_termios
747 structure pointed at a freed object.
748
749Fri Sep 16 08:13:25 1994 Theodore Y. Ts'o (tytso@rt-11)
750
751 * tty_io.c (tty_open): Don't check for an exclusive open until
752 after the device specific open routine has been called.
753 Otherwise, the serial device ref counting will be screwed
754 up.
755
756 * serial.c (rs_open, block_til_ready): Don't set termios structure
757 until after block_til_ready has returned successfully.
758 Modify block_til_ready to check the normal_termios
759 structure directly, so it doesn't rely on termios being
760 set before it's called.
761
762Thu Sep 15 23:34:01 1994 Theodore Y. Ts'o (tytso@rt-11)
763
764 * serial.c (rs_close): Turn off interrupts during rs_close() to
765 prevent a race condition with the hangup code (which
766 runs during a software interrupt).
767
768 * tty_io.c (release_dev): Don't free the locked_termios structure;
769 its state must be retained across device opens.
770
771
772 * tty_io.c (tty_unregister_driver): Added function to unregister a
773 tty driver. (For loadable device drivers.)
774
775
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 919a28558d36..a3e10dc7cc25 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -298,7 +298,7 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem,
298 j++; 298 j++;
299 } 299 }
300 } else { 300 } else {
301 /* sg may merge pages, but we have to seperate 301 /* sg may merge pages, but we have to separate
302 * per-page addr for GTT */ 302 * per-page addr for GTT */
303 unsigned int len, m; 303 unsigned int len, m;
304 304
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index fe2cb2f5db17..a7424bf7eacf 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -14,7 +14,7 @@
14/* et passe en argument a acinit, mais est scrute sur le bus pour s'adapter */ 14/* et passe en argument a acinit, mais est scrute sur le bus pour s'adapter */
15/* au nombre de cartes presentes sur le bus. IOCL code 6 affichait V2.4.3 */ 15/* au nombre de cartes presentes sur le bus. IOCL code 6 affichait V2.4.3 */
16/* F.LAFORSE 28/11/95 creation de fichiers acXX.o avec les differentes */ 16/* F.LAFORSE 28/11/95 creation de fichiers acXX.o avec les differentes */
17/* adresses de base des cartes, IOCTL 6 plus complet */ 17/* addresses de base des cartes, IOCTL 6 plus complet */
18/* J.PAGET le 19/08/96 copie de la version V2.6 en V2.8.0 sans modification */ 18/* J.PAGET le 19/08/96 copie de la version V2.6 en V2.8.0 sans modification */
19/* de code autre que le texte V2.6.1 en V2.8.0 */ 19/* de code autre que le texte V2.6.1 en V2.8.0 */
20/*****************************************************************************/ 20/*****************************************************************************/
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c
index fd0242676a2a..21c54955084e 100644
--- a/drivers/char/hvc_iseries.c
+++ b/drivers/char/hvc_iseries.c
@@ -353,7 +353,7 @@ static void hvc_close_event(struct HvLpEvent *event)
353 353
354 if (!hvlpevent_is_int(event)) { 354 if (!hvlpevent_is_int(event)) {
355 printk(KERN_WARNING 355 printk(KERN_WARNING
356 "hvc: got unexpected close acknowlegement\n"); 356 "hvc: got unexpected close acknowledgement\n");
357 return; 357 return;
358 } 358 }
359 359
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index 9b3e09cd41f9..10f868eefaa6 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -71,7 +71,7 @@ MODULE_VERSION(DRV_MODULE_VERSION);
71 * x22 + x21 + x17 + x15 + x13 + x12 + x11 + x7 + x5 + x + 1 71 * x22 + x21 + x17 + x15 + x13 + x12 + x11 + x7 + x5 + x + 1
72 * 72 *
73 * The RNG_CTL_VCO value of each noise cell must be programmed 73 * The RNG_CTL_VCO value of each noise cell must be programmed
74 * seperately. This is why 4 control register values must be provided 74 * separately. This is why 4 control register values must be provided
75 * to the hypervisor. During a write, the hypervisor writes them all, 75 * to the hypervisor. During a write, the hypervisor writes them all,
76 * one at a time, to the actual RNG_CTL register. The first three 76 * one at a time, to the actual RNG_CTL register. The first three
77 * values are used to setup the desired RNG_CTL_VCO for each entropy 77 * values are used to setup the desired RNG_CTL_VCO for each entropy
diff --git a/drivers/char/ip2/i2hw.h b/drivers/char/ip2/i2hw.h
index 8aa6e7ab8d5b..c0ba6c05f0cd 100644
--- a/drivers/char/ip2/i2hw.h
+++ b/drivers/char/ip2/i2hw.h
@@ -559,7 +559,7 @@ Loadware may be sent to the board in two ways:
559 559
5602) It may be hard-coded into your source by including a .h file (typically 5602) It may be hard-coded into your source by including a .h file (typically
561 supplied by Computone), which declares a data array and initializes every 561 supplied by Computone), which declares a data array and initializes every
562 element. This acheives the same result as if an entire loadware file had 562 element. This achieves the same result as if an entire loadware file had
563 been read into the array. 563 been read into the array.
564 564
565 This requires more data space in your program, but access to the file system 565 This requires more data space in your program, but access to the file system
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 176f1751237f..4462b113ba3f 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -295,6 +295,9 @@ struct smi_info {
295static int force_kipmid[SI_MAX_PARMS]; 295static int force_kipmid[SI_MAX_PARMS];
296static int num_force_kipmid; 296static int num_force_kipmid;
297 297
298static unsigned int kipmid_max_busy_us[SI_MAX_PARMS];
299static int num_max_busy_us;
300
298static int unload_when_empty = 1; 301static int unload_when_empty = 1;
299 302
300static int try_smi_init(struct smi_info *smi); 303static int try_smi_init(struct smi_info *smi);
@@ -925,23 +928,77 @@ static void set_run_to_completion(void *send_info, int i_run_to_completion)
925 } 928 }
926} 929}
927 930
931/*
932 * Use -1 in the nsec value of the busy waiting timespec to tell that
933 * we are spinning in kipmid looking for something and not delaying
934 * between checks
935 */
936static inline void ipmi_si_set_not_busy(struct timespec *ts)
937{
938 ts->tv_nsec = -1;
939}
940static inline int ipmi_si_is_busy(struct timespec *ts)
941{
942 return ts->tv_nsec != -1;
943}
944
945static int ipmi_thread_busy_wait(enum si_sm_result smi_result,
946 const struct smi_info *smi_info,
947 struct timespec *busy_until)
948{
949 unsigned int max_busy_us = 0;
950
951 if (smi_info->intf_num < num_max_busy_us)
952 max_busy_us = kipmid_max_busy_us[smi_info->intf_num];
953 if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY)
954 ipmi_si_set_not_busy(busy_until);
955 else if (!ipmi_si_is_busy(busy_until)) {
956 getnstimeofday(busy_until);
957 timespec_add_ns(busy_until, max_busy_us*NSEC_PER_USEC);
958 } else {
959 struct timespec now;
960 getnstimeofday(&now);
961 if (unlikely(timespec_compare(&now, busy_until) > 0)) {
962 ipmi_si_set_not_busy(busy_until);
963 return 0;
964 }
965 }
966 return 1;
967}
968
969
970/*
971 * A busy-waiting loop for speeding up IPMI operation.
972 *
973 * Lousy hardware makes this hard. This is only enabled for systems
974 * that are not BT and do not have interrupts. It starts spinning
975 * when an operation is complete or until max_busy tells it to stop
976 * (if that is enabled). See the paragraph on kimid_max_busy_us in
977 * Documentation/IPMI.txt for details.
978 */
928static int ipmi_thread(void *data) 979static int ipmi_thread(void *data)
929{ 980{
930 struct smi_info *smi_info = data; 981 struct smi_info *smi_info = data;
931 unsigned long flags; 982 unsigned long flags;
932 enum si_sm_result smi_result; 983 enum si_sm_result smi_result;
984 struct timespec busy_until;
933 985
986 ipmi_si_set_not_busy(&busy_until);
934 set_user_nice(current, 19); 987 set_user_nice(current, 19);
935 while (!kthread_should_stop()) { 988 while (!kthread_should_stop()) {
989 int busy_wait;
990
936 spin_lock_irqsave(&(smi_info->si_lock), flags); 991 spin_lock_irqsave(&(smi_info->si_lock), flags);
937 smi_result = smi_event_handler(smi_info, 0); 992 smi_result = smi_event_handler(smi_info, 0);
938 spin_unlock_irqrestore(&(smi_info->si_lock), flags); 993 spin_unlock_irqrestore(&(smi_info->si_lock), flags);
994 busy_wait = ipmi_thread_busy_wait(smi_result, smi_info,
995 &busy_until);
939 if (smi_result == SI_SM_CALL_WITHOUT_DELAY) 996 if (smi_result == SI_SM_CALL_WITHOUT_DELAY)
940 ; /* do nothing */ 997 ; /* do nothing */
941 else if (smi_result == SI_SM_CALL_WITH_DELAY) 998 else if (smi_result == SI_SM_CALL_WITH_DELAY && busy_wait)
942 schedule(); 999 schedule();
943 else 1000 else
944 schedule_timeout_interruptible(1); 1001 schedule_timeout_interruptible(0);
945 } 1002 }
946 return 0; 1003 return 0;
947} 1004}
@@ -1144,7 +1201,7 @@ static int regsizes[SI_MAX_PARMS];
1144static unsigned int num_regsizes; 1201static unsigned int num_regsizes;
1145static int regshifts[SI_MAX_PARMS]; 1202static int regshifts[SI_MAX_PARMS];
1146static unsigned int num_regshifts; 1203static unsigned int num_regshifts;
1147static int slave_addrs[SI_MAX_PARMS]; 1204static int slave_addrs[SI_MAX_PARMS]; /* Leaving 0 chooses the default value */
1148static unsigned int num_slave_addrs; 1205static unsigned int num_slave_addrs;
1149 1206
1150#define IPMI_IO_ADDR_SPACE 0 1207#define IPMI_IO_ADDR_SPACE 0
@@ -1212,6 +1269,11 @@ module_param(unload_when_empty, int, 0);
1212MODULE_PARM_DESC(unload_when_empty, "Unload the module if no interfaces are" 1269MODULE_PARM_DESC(unload_when_empty, "Unload the module if no interfaces are"
1213 " specified or found, default is 1. Setting to 0" 1270 " specified or found, default is 1. Setting to 0"
1214 " is useful for hot add of devices using hotmod."); 1271 " is useful for hot add of devices using hotmod.");
1272module_param_array(kipmid_max_busy_us, uint, &num_max_busy_us, 0644);
1273MODULE_PARM_DESC(kipmid_max_busy_us,
1274 "Max time (in microseconds) to busy-wait for IPMI data before"
1275 " sleeping. 0 (default) means to wait forever. Set to 100-500"
1276 " if kipmid is using up a lot of CPU time.");
1215 1277
1216 1278
1217static void std_irq_cleanup(struct smi_info *info) 1279static void std_irq_cleanup(struct smi_info *info)
@@ -1607,7 +1669,7 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
1607 regsize = 1; 1669 regsize = 1;
1608 regshift = 0; 1670 regshift = 0;
1609 irq = 0; 1671 irq = 0;
1610 ipmb = 0x20; 1672 ipmb = 0; /* Choose the default if not specified */
1611 1673
1612 next = strchr(curr, ':'); 1674 next = strchr(curr, ':');
1613 if (next) { 1675 if (next) {
@@ -1799,6 +1861,7 @@ static __devinit void hardcode_find_bmc(void)
1799 info->irq = irqs[i]; 1861 info->irq = irqs[i];
1800 if (info->irq) 1862 if (info->irq)
1801 info->irq_setup = std_irq_setup; 1863 info->irq_setup = std_irq_setup;
1864 info->slave_addr = slave_addrs[i];
1802 1865
1803 try_smi_init(info); 1866 try_smi_init(info);
1804 } 1867 }
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 48788db4e280..1f3215ac085b 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds 4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * 5 *
6 * Added devfs support. 6 * Added devfs support.
7 * Jan-11-1998, C. Scott Ananian <cananian@alumni.princeton.edu> 7 * Jan-11-1998, C. Scott Ananian <cananian@alumni.princeton.edu>
8 * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com> 8 * Shared /dev/zero mmapping support, Feb 2000, Kanoj Sarcar <kanoj@sgi.com>
9 */ 9 */
@@ -44,36 +44,6 @@ static inline unsigned long size_inside_page(unsigned long start,
44 return min(sz, size); 44 return min(sz, size);
45} 45}
46 46
47/*
48 * Architectures vary in how they handle caching for addresses
49 * outside of main memory.
50 *
51 */
52static inline int uncached_access(struct file *file, unsigned long addr)
53{
54#if defined(CONFIG_IA64)
55 /*
56 * On ia64, we ignore O_DSYNC because we cannot tolerate memory attribute aliases.
57 */
58 return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
59#elif defined(CONFIG_MIPS)
60 {
61 extern int __uncached_access(struct file *file,
62 unsigned long addr);
63
64 return __uncached_access(file, addr);
65 }
66#else
67 /*
68 * Accessing memory above the top the kernel knows about or through a file pointer
69 * that was marked O_DSYNC will be done non-cached.
70 */
71 if (file->f_flags & O_DSYNC)
72 return 1;
73 return addr >= __pa(high_memory);
74#endif
75}
76
77#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE 47#ifndef ARCH_HAS_VALID_PHYS_ADDR_RANGE
78static inline int valid_phys_addr_range(unsigned long addr, size_t count) 48static inline int valid_phys_addr_range(unsigned long addr, size_t count)
79{ 49{
@@ -115,15 +85,15 @@ static inline int range_is_allowed(unsigned long pfn, unsigned long size)
115} 85}
116#endif 86#endif
117 87
118void __attribute__((weak)) unxlate_dev_mem_ptr(unsigned long phys, void *addr) 88void __weak unxlate_dev_mem_ptr(unsigned long phys, void *addr)
119{ 89{
120} 90}
121 91
122/* 92/*
123 * This funcion reads the *physical* memory. The f_pos points directly to the 93 * This funcion reads the *physical* memory. The f_pos points directly to the
124 * memory location. 94 * memory location.
125 */ 95 */
126static ssize_t read_mem(struct file * file, char __user * buf, 96static ssize_t read_mem(struct file *file, char __user *buf,
127 size_t count, loff_t *ppos) 97 size_t count, loff_t *ppos)
128{ 98{
129 unsigned long p = *ppos; 99 unsigned long p = *ppos;
@@ -140,10 +110,10 @@ static ssize_t read_mem(struct file * file, char __user * buf,
140 if (sz > 0) { 110 if (sz > 0) {
141 if (clear_user(buf, sz)) 111 if (clear_user(buf, sz))
142 return -EFAULT; 112 return -EFAULT;
143 buf += sz; 113 buf += sz;
144 p += sz; 114 p += sz;
145 count -= sz; 115 count -= sz;
146 read += sz; 116 read += sz;
147 } 117 }
148 } 118 }
149#endif 119#endif
@@ -157,9 +127,9 @@ static ssize_t read_mem(struct file * file, char __user * buf,
157 return -EPERM; 127 return -EPERM;
158 128
159 /* 129 /*
160 * On ia64 if a page has been mapped somewhere as 130 * On ia64 if a page has been mapped somewhere as uncached, then
161 * uncached, then it must also be accessed uncached 131 * it must also be accessed uncached by the kernel or data
162 * by the kernel or data corruption may occur 132 * corruption may occur.
163 */ 133 */
164 ptr = xlate_dev_mem_ptr(p); 134 ptr = xlate_dev_mem_ptr(p);
165 if (!ptr) 135 if (!ptr)
@@ -180,7 +150,7 @@ static ssize_t read_mem(struct file * file, char __user * buf,
180 return read; 150 return read;
181} 151}
182 152
183static ssize_t write_mem(struct file * file, const char __user * buf, 153static ssize_t write_mem(struct file *file, const char __user *buf,
184 size_t count, loff_t *ppos) 154 size_t count, loff_t *ppos)
185{ 155{
186 unsigned long p = *ppos; 156 unsigned long p = *ppos;
@@ -212,9 +182,9 @@ static ssize_t write_mem(struct file * file, const char __user * buf,
212 return -EPERM; 182 return -EPERM;
213 183
214 /* 184 /*
215 * On ia64 if a page has been mapped somewhere as 185 * On ia64 if a page has been mapped somewhere as uncached, then
216 * uncached, then it must also be accessed uncached 186 * it must also be accessed uncached by the kernel or data
217 * by the kernel or data corruption may occur 187 * corruption may occur.
218 */ 188 */
219 ptr = xlate_dev_mem_ptr(p); 189 ptr = xlate_dev_mem_ptr(p);
220 if (!ptr) { 190 if (!ptr) {
@@ -242,13 +212,46 @@ static ssize_t write_mem(struct file * file, const char __user * buf,
242 return written; 212 return written;
243} 213}
244 214
245int __attribute__((weak)) phys_mem_access_prot_allowed(struct file *file, 215int __weak phys_mem_access_prot_allowed(struct file *file,
246 unsigned long pfn, unsigned long size, pgprot_t *vma_prot) 216 unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
247{ 217{
248 return 1; 218 return 1;
249} 219}
250 220
251#ifndef __HAVE_PHYS_MEM_ACCESS_PROT 221#ifndef __HAVE_PHYS_MEM_ACCESS_PROT
222
223/*
224 * Architectures vary in how they handle caching for addresses
225 * outside of main memory.
226 *
227 */
228static int uncached_access(struct file *file, unsigned long addr)
229{
230#if defined(CONFIG_IA64)
231 /*
232 * On ia64, we ignore O_DSYNC because we cannot tolerate memory
233 * attribute aliases.
234 */
235 return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
236#elif defined(CONFIG_MIPS)
237 {
238 extern int __uncached_access(struct file *file,
239 unsigned long addr);
240
241 return __uncached_access(file, addr);
242 }
243#else
244 /*
245 * Accessing memory above the top the kernel knows about or through a
246 * file pointer
247 * that was marked O_DSYNC will be done non-cached.
248 */
249 if (file->f_flags & O_DSYNC)
250 return 1;
251 return addr >= __pa(high_memory);
252#endif
253}
254
252static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, 255static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
253 unsigned long size, pgprot_t vma_prot) 256 unsigned long size, pgprot_t vma_prot)
254{ 257{
@@ -294,7 +297,7 @@ static const struct vm_operations_struct mmap_mem_ops = {
294#endif 297#endif
295}; 298};
296 299
297static int mmap_mem(struct file * file, struct vm_area_struct * vma) 300static int mmap_mem(struct file *file, struct vm_area_struct *vma)
298{ 301{
299 size_t size = vma->vm_end - vma->vm_start; 302 size_t size = vma->vm_end - vma->vm_start;
300 303
@@ -329,7 +332,7 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma)
329} 332}
330 333
331#ifdef CONFIG_DEVKMEM 334#ifdef CONFIG_DEVKMEM
332static int mmap_kmem(struct file * file, struct vm_area_struct * vma) 335static int mmap_kmem(struct file *file, struct vm_area_struct *vma)
333{ 336{
334 unsigned long pfn; 337 unsigned long pfn;
335 338
@@ -337,9 +340,9 @@ static int mmap_kmem(struct file * file, struct vm_area_struct * vma)
337 pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; 340 pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT;
338 341
339 /* 342 /*
340 * RED-PEN: on some architectures there is more mapped memory 343 * RED-PEN: on some architectures there is more mapped memory than
341 * than available in mem_map which pfn_valid checks 344 * available in mem_map which pfn_valid checks for. Perhaps should add a
342 * for. Perhaps should add a new macro here. 345 * new macro here.
343 * 346 *
344 * RED-PEN: vmalloc is not supported right now. 347 * RED-PEN: vmalloc is not supported right now.
345 */ 348 */
@@ -389,7 +392,7 @@ static ssize_t read_oldmem(struct file *file, char __user *buf,
389/* 392/*
390 * This function reads the *virtual* memory as seen by the kernel. 393 * This function reads the *virtual* memory as seen by the kernel.
391 */ 394 */
392static ssize_t read_kmem(struct file *file, char __user *buf, 395static ssize_t read_kmem(struct file *file, char __user *buf,
393 size_t count, loff_t *ppos) 396 size_t count, loff_t *ppos)
394{ 397{
395 unsigned long p = *ppos; 398 unsigned long p = *ppos;
@@ -400,8 +403,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
400 read = 0; 403 read = 0;
401 if (p < (unsigned long) high_memory) { 404 if (p < (unsigned long) high_memory) {
402 low_count = count; 405 low_count = count;
403 if (count > (unsigned long) high_memory - p) 406 if (count > (unsigned long)high_memory - p)
404 low_count = (unsigned long) high_memory - p; 407 low_count = (unsigned long)high_memory - p;
405 408
406#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED 409#ifdef __ARCH_HAS_NO_PAGE_ZERO_MAPPED
407 /* we don't have page 0 mapped on sparc and m68k.. */ 410 /* we don't have page 0 mapped on sparc and m68k.. */
@@ -465,9 +468,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf,
465} 468}
466 469
467 470
468static inline ssize_t 471static ssize_t do_write_kmem(unsigned long p, const char __user *buf,
469do_write_kmem(unsigned long p, const char __user *buf, 472 size_t count, loff_t *ppos)
470 size_t count, loff_t *ppos)
471{ 473{
472 ssize_t written, sz; 474 ssize_t written, sz;
473 unsigned long copied; 475 unsigned long copied;
@@ -491,9 +493,9 @@ do_write_kmem(unsigned long p, const char __user *buf,
491 sz = size_inside_page(p, count); 493 sz = size_inside_page(p, count);
492 494
493 /* 495 /*
494 * On ia64 if a page has been mapped somewhere as 496 * On ia64 if a page has been mapped somewhere as uncached, then
495 * uncached, then it must also be accessed uncached 497 * it must also be accessed uncached by the kernel or data
496 * by the kernel or data corruption may occur 498 * corruption may occur.
497 */ 499 */
498 ptr = xlate_dev_kmem_ptr((char *)p); 500 ptr = xlate_dev_kmem_ptr((char *)p);
499 501
@@ -514,11 +516,10 @@ do_write_kmem(unsigned long p, const char __user *buf,
514 return written; 516 return written;
515} 517}
516 518
517
518/* 519/*
519 * This function writes to the *virtual* memory as seen by the kernel. 520 * This function writes to the *virtual* memory as seen by the kernel.
520 */ 521 */
521static ssize_t write_kmem(struct file * file, const char __user * buf, 522static ssize_t write_kmem(struct file *file, const char __user *buf,
522 size_t count, loff_t *ppos) 523 size_t count, loff_t *ppos)
523{ 524{
524 unsigned long p = *ppos; 525 unsigned long p = *ppos;
@@ -570,17 +571,17 @@ static ssize_t write_kmem(struct file * file, const char __user * buf,
570#endif 571#endif
571 572
572#ifdef CONFIG_DEVPORT 573#ifdef CONFIG_DEVPORT
573static ssize_t read_port(struct file * file, char __user * buf, 574static ssize_t read_port(struct file *file, char __user *buf,
574 size_t count, loff_t *ppos) 575 size_t count, loff_t *ppos)
575{ 576{
576 unsigned long i = *ppos; 577 unsigned long i = *ppos;
577 char __user *tmp = buf; 578 char __user *tmp = buf;
578 579
579 if (!access_ok(VERIFY_WRITE, buf, count)) 580 if (!access_ok(VERIFY_WRITE, buf, count))
580 return -EFAULT; 581 return -EFAULT;
581 while (count-- > 0 && i < 65536) { 582 while (count-- > 0 && i < 65536) {
582 if (__put_user(inb(i),tmp) < 0) 583 if (__put_user(inb(i), tmp) < 0)
583 return -EFAULT; 584 return -EFAULT;
584 i++; 585 i++;
585 tmp++; 586 tmp++;
586 } 587 }
@@ -588,22 +589,22 @@ static ssize_t read_port(struct file * file, char __user * buf,
588 return tmp-buf; 589 return tmp-buf;
589} 590}
590 591
591static ssize_t write_port(struct file * file, const char __user * buf, 592static ssize_t write_port(struct file *file, const char __user *buf,
592 size_t count, loff_t *ppos) 593 size_t count, loff_t *ppos)
593{ 594{
594 unsigned long i = *ppos; 595 unsigned long i = *ppos;
595 const char __user * tmp = buf; 596 const char __user * tmp = buf;
596 597
597 if (!access_ok(VERIFY_READ,buf,count)) 598 if (!access_ok(VERIFY_READ, buf, count))
598 return -EFAULT; 599 return -EFAULT;
599 while (count-- > 0 && i < 65536) { 600 while (count-- > 0 && i < 65536) {
600 char c; 601 char c;
601 if (__get_user(c, tmp)) { 602 if (__get_user(c, tmp)) {
602 if (tmp > buf) 603 if (tmp > buf)
603 break; 604 break;
604 return -EFAULT; 605 return -EFAULT;
605 } 606 }
606 outb(c,i); 607 outb(c, i);
607 i++; 608 i++;
608 tmp++; 609 tmp++;
609 } 610 }
@@ -612,13 +613,13 @@ static ssize_t write_port(struct file * file, const char __user * buf,
612} 613}
613#endif 614#endif
614 615
615static ssize_t read_null(struct file * file, char __user * buf, 616static ssize_t read_null(struct file *file, char __user *buf,
616 size_t count, loff_t *ppos) 617 size_t count, loff_t *ppos)
617{ 618{
618 return 0; 619 return 0;
619} 620}
620 621
621static ssize_t write_null(struct file * file, const char __user * buf, 622static ssize_t write_null(struct file *file, const char __user *buf,
622 size_t count, loff_t *ppos) 623 size_t count, loff_t *ppos)
623{ 624{
624 return count; 625 return count;
@@ -630,13 +631,13 @@ static int pipe_to_null(struct pipe_inode_info *info, struct pipe_buffer *buf,
630 return sd->len; 631 return sd->len;
631} 632}
632 633
633static ssize_t splice_write_null(struct pipe_inode_info *pipe,struct file *out, 634static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out,
634 loff_t *ppos, size_t len, unsigned int flags) 635 loff_t *ppos, size_t len, unsigned int flags)
635{ 636{
636 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null); 637 return splice_from_pipe(pipe, out, ppos, len, flags, pipe_to_null);
637} 638}
638 639
639static ssize_t read_zero(struct file * file, char __user * buf, 640static ssize_t read_zero(struct file *file, char __user *buf,
640 size_t count, loff_t *ppos) 641 size_t count, loff_t *ppos)
641{ 642{
642 size_t written; 643 size_t written;
@@ -667,7 +668,7 @@ static ssize_t read_zero(struct file * file, char __user * buf,
667 return written ? written : -EFAULT; 668 return written ? written : -EFAULT;
668} 669}
669 670
670static int mmap_zero(struct file * file, struct vm_area_struct * vma) 671static int mmap_zero(struct file *file, struct vm_area_struct *vma)
671{ 672{
672#ifndef CONFIG_MMU 673#ifndef CONFIG_MMU
673 return -ENOSYS; 674 return -ENOSYS;
@@ -677,7 +678,7 @@ static int mmap_zero(struct file * file, struct vm_area_struct * vma)
677 return 0; 678 return 0;
678} 679}
679 680
680static ssize_t write_full(struct file * file, const char __user * buf, 681static ssize_t write_full(struct file *file, const char __user *buf,
681 size_t count, loff_t *ppos) 682 size_t count, loff_t *ppos)
682{ 683{
683 return -ENOSPC; 684 return -ENOSPC;
@@ -688,8 +689,7 @@ static ssize_t write_full(struct file * file, const char __user * buf,
688 * can fopen() both devices with "a" now. This was previously impossible. 689 * can fopen() both devices with "a" now. This was previously impossible.
689 * -- SRB. 690 * -- SRB.
690 */ 691 */
691 692static loff_t null_lseek(struct file *file, loff_t offset, int orig)
692static loff_t null_lseek(struct file * file, loff_t offset, int orig)
693{ 693{
694 return file->f_pos = 0; 694 return file->f_pos = 0;
695} 695}
@@ -702,24 +702,31 @@ static loff_t null_lseek(struct file * file, loff_t offset, int orig)
702 * also note that seeking relative to the "end of file" isn't supported: 702 * also note that seeking relative to the "end of file" isn't supported:
703 * it has no meaning, so it returns -EINVAL. 703 * it has no meaning, so it returns -EINVAL.
704 */ 704 */
705static loff_t memory_lseek(struct file * file, loff_t offset, int orig) 705static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
706{ 706{
707 loff_t ret; 707 loff_t ret;
708 708
709 mutex_lock(&file->f_path.dentry->d_inode->i_mutex); 709 mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
710 switch (orig) { 710 switch (orig) {
711 case 0: 711 case SEEK_CUR:
712 file->f_pos = offset; 712 offset += file->f_pos;
713 ret = file->f_pos; 713 if ((unsigned long long)offset <
714 force_successful_syscall_return(); 714 (unsigned long long)file->f_pos) {
715 ret = -EOVERFLOW;
715 break; 716 break;
716 case 1: 717 }
717 file->f_pos += offset; 718 case SEEK_SET:
718 ret = file->f_pos; 719 /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
719 force_successful_syscall_return(); 720 if ((unsigned long long)offset >= ~0xFFFULL) {
721 ret = -EOVERFLOW;
720 break; 722 break;
721 default: 723 }
722 ret = -EINVAL; 724 file->f_pos = offset;
725 ret = file->f_pos;
726 force_successful_syscall_return();
727 break;
728 default:
729 ret = -EINVAL;
723 } 730 }
724 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 731 mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
725 return ret; 732 return ret;
@@ -803,7 +810,7 @@ static const struct file_operations oldmem_fops = {
803}; 810};
804#endif 811#endif
805 812
806static ssize_t kmsg_write(struct file * file, const char __user * buf, 813static ssize_t kmsg_write(struct file *file, const char __user *buf,
807 size_t count, loff_t *ppos) 814 size_t count, loff_t *ppos)
808{ 815{
809 char *tmp; 816 char *tmp;
@@ -825,7 +832,7 @@ static ssize_t kmsg_write(struct file * file, const char __user * buf,
825} 832}
826 833
827static const struct file_operations kmsg_fops = { 834static const struct file_operations kmsg_fops = {
828 .write = kmsg_write, 835 .write = kmsg_write,
829}; 836};
830 837
831static const struct memdev { 838static const struct memdev {
@@ -876,7 +883,7 @@ static int memory_open(struct inode *inode, struct file *filp)
876} 883}
877 884
878static const struct file_operations memory_fops = { 885static const struct file_operations memory_fops = {
879 .open = memory_open, 886 .open = memory_open,
880}; 887};
881 888
882static char *mem_devnode(struct device *dev, mode_t *mode) 889static char *mem_devnode(struct device *dev, mode_t *mode)
@@ -897,7 +904,7 @@ static int __init chr_dev_init(void)
897 if (err) 904 if (err)
898 return err; 905 return err;
899 906
900 if (register_chrdev(MEM_MAJOR,"mem",&memory_fops)) 907 if (register_chrdev(MEM_MAJOR, "mem", &memory_fops))
901 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 908 printk("unable to get major %d for memory devs\n", MEM_MAJOR);
902 909
903 mem_class = class_create(THIS_MODULE, "mem"); 910 mem_class = class_create(THIS_MODULE, "mem");
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index 918711aa56f3..04fd0d843b3b 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -546,7 +546,7 @@ static void mmtimer_tasklet(unsigned long data)
546{ 546{
547 int nodeid = data; 547 int nodeid = data;
548 struct mmtimer_node *mn = &timers[nodeid]; 548 struct mmtimer_node *mn = &timers[nodeid];
549 struct mmtimer *x = rb_entry(mn->next, struct mmtimer, list); 549 struct mmtimer *x;
550 struct k_itimer *t; 550 struct k_itimer *t;
551 unsigned long flags; 551 unsigned long flags;
552 552
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index 2e50f4dfc79c..bdae8327143c 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -48,6 +48,7 @@
48#include <linux/audit.h> 48#include <linux/audit.h>
49#include <linux/file.h> 49#include <linux/file.h>
50#include <linux/uaccess.h> 50#include <linux/uaccess.h>
51#include <linux/module.h>
51 52
52#include <asm/system.h> 53#include <asm/system.h>
53 54
@@ -2091,3 +2092,19 @@ struct tty_ldisc_ops tty_ldisc_N_TTY = {
2091 .receive_buf = n_tty_receive_buf, 2092 .receive_buf = n_tty_receive_buf,
2092 .write_wakeup = n_tty_write_wakeup 2093 .write_wakeup = n_tty_write_wakeup
2093}; 2094};
2095
2096/**
2097 * n_tty_inherit_ops - inherit N_TTY methods
2098 * @ops: struct tty_ldisc_ops where to save N_TTY methods
2099 *
2100 * Used by a generic struct tty_ldisc_ops to easily inherit N_TTY
2101 * methods.
2102 */
2103
2104void n_tty_inherit_ops(struct tty_ldisc_ops *ops)
2105{
2106 *ops = tty_ldisc_N_TTY;
2107 ops->owner = NULL;
2108 ops->refcount = ops->flags = 0;
2109}
2110EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 385c44b3034f..5ee424817263 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -220,7 +220,7 @@ static void pty_set_termios(struct tty_struct *tty,
220 * @tty: tty being resized 220 * @tty: tty being resized
221 * @ws: window size being set. 221 * @ws: window size being set.
222 * 222 *
223 * Update the termios variables and send the neccessary signals to 223 * Update the termios variables and send the necessary signals to
224 * peform a terminal resize correctly 224 * peform a terminal resize correctly
225 */ 225 */
226 226
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 2849713d2231..2fd3d39995d5 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1191,7 +1191,7 @@ const struct file_operations urandom_fops = {
1191void generate_random_uuid(unsigned char uuid_out[16]) 1191void generate_random_uuid(unsigned char uuid_out[16])
1192{ 1192{
1193 get_random_bytes(uuid_out, 16); 1193 get_random_bytes(uuid_out, 16);
1194 /* Set UUID version to 4 --- truely random generation */ 1194 /* Set UUID version to 4 --- truly random generation */
1195 uuid_out[6] = (uuid_out[6] & 0x0F) | 0x40; 1195 uuid_out[6] = (uuid_out[6] & 0x0F) | 0x40;
1196 /* Set the UUID variant to DCE */ 1196 /* Set the UUID variant to DCE */
1197 uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80; 1197 uuid_out[8] = (uuid_out[8] & 0x3F) | 0x80;
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 986aa606a6b6..1ec3d5cd748f 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -1989,7 +1989,7 @@ void mvme167_serial_console_setup(int cflag)
1989 /* 1989 /*
1990 * Attempt to set up all channels to something reasonable, and 1990 * Attempt to set up all channels to something reasonable, and
1991 * bang out a INIT_CHAN command. We should then be able to limit 1991 * bang out a INIT_CHAN command. We should then be able to limit
1992 * the ammount of fiddling we have to do in normal running. 1992 * the amount of fiddling we have to do in normal running.
1993 */ 1993 */
1994 1994
1995 for (ch = 3; ch >= 0; ch--) { 1995 for (ch = 3; ch >= 0; ch--) {
diff --git a/drivers/char/tty_audit.c b/drivers/char/tty_audit.c
index ac16fbec72d0..283a15bc84e3 100644
--- a/drivers/char/tty_audit.c
+++ b/drivers/char/tty_audit.c
@@ -148,7 +148,6 @@ void tty_audit_fork(struct signal_struct *sig)
148 spin_lock_irq(&current->sighand->siglock); 148 spin_lock_irq(&current->sighand->siglock);
149 sig->audit_tty = current->signal->audit_tty; 149 sig->audit_tty = current->signal->audit_tty;
150 spin_unlock_irq(&current->sighand->siglock); 150 spin_unlock_irq(&current->sighand->siglock);
151 sig->tty_audit_buf = NULL;
152} 151}
153 152
154/** 153/**
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index dcb9083ecde0..a42c466f7092 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2028,7 +2028,7 @@ static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg)
2028 * @rows: rows (character) 2028 * @rows: rows (character)
2029 * @cols: cols (character) 2029 * @cols: cols (character)
2030 * 2030 *
2031 * Update the termios variables and send the neccessary signals to 2031 * Update the termios variables and send the necessary signals to
2032 * peform a terminal resize correctly 2032 * peform a terminal resize correctly
2033 */ 2033 */
2034 2034
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 50faa1fb0f06..bd1d1164fec5 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -821,7 +821,7 @@ static inline int resize_screen(struct vc_data *vc, int width, int height,
821 * 821 *
822 * Resize a virtual console, clipping according to the actual constraints. 822 * Resize a virtual console, clipping according to the actual constraints.
823 * If the caller passes a tty structure then update the termios winsize 823 * If the caller passes a tty structure then update the termios winsize
824 * information and perform any neccessary signal handling. 824 * information and perform any necessary signal handling.
825 * 825 *
826 * Caller must hold the console semaphore. Takes the termios mutex and 826 * Caller must hold the console semaphore. Takes the termios mutex and
827 * ctrl_lock of the tty IFF a tty is passed. 827 * ctrl_lock of the tty IFF a tty is passed.
@@ -2119,8 +2119,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
2119 uint8_t inverse; 2119 uint8_t inverse;
2120 uint8_t width; 2120 uint8_t width;
2121 u16 himask, charmask; 2121 u16 himask, charmask;
2122 const unsigned char *orig_buf = NULL;
2123 int orig_count;
2124 2122
2125 if (in_interrupt()) 2123 if (in_interrupt())
2126 return count; 2124 return count;
@@ -2142,8 +2140,6 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co
2142 release_console_sem(); 2140 release_console_sem();
2143 return 0; 2141 return 0;
2144 } 2142 }
2145 orig_buf = buf;
2146 orig_count = count;
2147 2143
2148 himask = vc->vc_hi_font_mask; 2144 himask = vc->vc_hi_font_mask;
2149 charmask = himask ? 0x1ff : 0xff; 2145 charmask = himask ? 0x1ff : 0xff;
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index 09ad9154d86c..73e8b1713b54 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -321,7 +321,7 @@ static atomic_t hifn_dev_number;
321#define HIFN_PUBOPLEN_MOD_M 0x0000007f /* modulus length mask */ 321#define HIFN_PUBOPLEN_MOD_M 0x0000007f /* modulus length mask */
322#define HIFN_PUBOPLEN_MOD_S 0 /* modulus length shift */ 322#define HIFN_PUBOPLEN_MOD_S 0 /* modulus length shift */
323#define HIFN_PUBOPLEN_EXP_M 0x0003ff80 /* exponent length mask */ 323#define HIFN_PUBOPLEN_EXP_M 0x0003ff80 /* exponent length mask */
324#define HIFN_PUBOPLEN_EXP_S 7 /* exponent lenght shift */ 324#define HIFN_PUBOPLEN_EXP_S 7 /* exponent length shift */
325#define HIFN_PUBOPLEN_RED_M 0x003c0000 /* reducend length mask */ 325#define HIFN_PUBOPLEN_RED_M 0x003c0000 /* reducend length mask */
326#define HIFN_PUBOPLEN_RED_S 18 /* reducend length shift */ 326#define HIFN_PUBOPLEN_RED_S 18 /* reducend length shift */
327 327
diff --git a/drivers/dma/coh901318_lli.h b/drivers/dma/coh901318_lli.h
index 7bf713b79c6b..7a5c80990e9e 100644
--- a/drivers/dma/coh901318_lli.h
+++ b/drivers/dma/coh901318_lli.h
@@ -30,7 +30,7 @@ struct device;
30 * @pool: pool handle 30 * @pool: pool handle
31 * @dev: dma device 31 * @dev: dma device
32 * @lli_nbr: number of lli:s in the pool 32 * @lli_nbr: number of lli:s in the pool
33 * @algin: adress alignemtn of lli:s 33 * @algin: address alignemtn of lli:s
34 * returns 0 on success otherwise none zero 34 * returns 0 on success otherwise none zero
35 */ 35 */
36int coh901318_pool_create(struct coh901318_pool *pool, 36int coh901318_pool_create(struct coh901318_pool *pool,
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index d205d493a68a..243e9aacad69 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -75,6 +75,14 @@ static struct edac_pci_ctl_info *e752x_pci;
75#define E752X_NR_CSROWS 8 /* number of csrows */ 75#define E752X_NR_CSROWS 8 /* number of csrows */
76 76
77/* E752X register addresses - device 0 function 0 */ 77/* E752X register addresses - device 0 function 0 */
78#define E752X_MCHSCRB 0x52 /* Memory Scrub register (16b) */
79 /*
80 * 6:5 Scrub Completion Count
81 * 3:2 Scrub Rate (i3100 only)
82 * 01=fast 10=normal
83 * 1:0 Scrub Mode enable
84 * 00=off 10=on
85 */
78#define E752X_DRB 0x60 /* DRAM row boundary register (8b) */ 86#define E752X_DRB 0x60 /* DRAM row boundary register (8b) */
79#define E752X_DRA 0x70 /* DRAM row attribute register (8b) */ 87#define E752X_DRA 0x70 /* DRAM row attribute register (8b) */
80 /* 88 /*
@@ -240,6 +248,41 @@ static const struct e752x_dev_info e752x_devs[] = {
240 .ctl_name = "3100"}, 248 .ctl_name = "3100"},
241}; 249};
242 250
251/* Valid scrub rates for the e752x/3100 hardware memory scrubber. We
252 * map the scrubbing bandwidth to a hardware register value. The 'set'
253 * operation finds the 'matching or higher value'. Note that scrubbing
254 * on the e752x can only be enabled/disabled. The 3100 supports
255 * a normal and fast mode.
256 */
257
258#define SDRATE_EOT 0xFFFFFFFF
259
260struct scrubrate {
261 u32 bandwidth; /* bandwidth consumed by scrubbing in bytes/sec */
262 u16 scrubval; /* register value for scrub rate */
263};
264
265/* Rate below assumes same performance as i3100 using PC3200 DDR2 in
266 * normal mode. e752x bridges don't support choosing normal or fast mode,
267 * so the scrubbing bandwidth value isn't all that important - scrubbing is
268 * either on or off.
269 */
270static const struct scrubrate scrubrates_e752x[] = {
271 {0, 0x00}, /* Scrubbing Off */
272 {500000, 0x02}, /* Scrubbing On */
273 {SDRATE_EOT, 0x00} /* End of Table */
274};
275
276/* Fast mode: 2 GByte PC3200 DDR2 scrubbed in 33s = 63161283 bytes/s
277 * Normal mode: 125 (32000 / 256) times slower than fast mode.
278 */
279static const struct scrubrate scrubrates_i3100[] = {
280 {0, 0x00}, /* Scrubbing Off */
281 {500000, 0x0a}, /* Normal mode - 32k clocks */
282 {62500000, 0x06}, /* Fast mode - 256 clocks */
283 {SDRATE_EOT, 0x00} /* End of Table */
284};
285
243static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci, 286static unsigned long ctl_page_to_phys(struct mem_ctl_info *mci,
244 unsigned long page) 287 unsigned long page)
245{ 288{
@@ -915,6 +958,68 @@ static void e752x_check(struct mem_ctl_info *mci)
915 e752x_process_error_info(mci, &info, 1); 958 e752x_process_error_info(mci, &info, 1);
916} 959}
917 960
961/* Program byte/sec bandwidth scrub rate to hardware */
962static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *new_bw)
963{
964 const struct scrubrate *scrubrates;
965 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;
966 struct pci_dev *pdev = pvt->dev_d0f0;
967 int i;
968
969 if (pvt->dev_info->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
970 scrubrates = scrubrates_i3100;
971 else
972 scrubrates = scrubrates_e752x;
973
974 /* Translate the desired scrub rate to a e752x/3100 register value.
975 * Search for the bandwidth that is equal or greater than the
976 * desired rate and program the cooresponding register value.
977 */
978 for (i = 0; scrubrates[i].bandwidth != SDRATE_EOT; i++)
979 if (scrubrates[i].bandwidth >= *new_bw)
980 break;
981
982 if (scrubrates[i].bandwidth == SDRATE_EOT)
983 return -1;
984
985 pci_write_config_word(pdev, E752X_MCHSCRB, scrubrates[i].scrubval);
986
987 return 0;
988}
989
990/* Convert current scrub rate value into byte/sec bandwidth */
991static int get_sdram_scrub_rate(struct mem_ctl_info *mci, u32 *bw)
992{
993 const struct scrubrate *scrubrates;
994 struct e752x_pvt *pvt = (struct e752x_pvt *) mci->pvt_info;
995 struct pci_dev *pdev = pvt->dev_d0f0;
996 u16 scrubval;
997 int i;
998
999 if (pvt->dev_info->ctl_dev == PCI_DEVICE_ID_INTEL_3100_0)
1000 scrubrates = scrubrates_i3100;
1001 else
1002 scrubrates = scrubrates_e752x;
1003
1004 /* Find the bandwidth matching the memory scrubber configuration */
1005 pci_read_config_word(pdev, E752X_MCHSCRB, &scrubval);
1006 scrubval = scrubval & 0x0f;
1007
1008 for (i = 0; scrubrates[i].bandwidth != SDRATE_EOT; i++)
1009 if (scrubrates[i].scrubval == scrubval)
1010 break;
1011
1012 if (scrubrates[i].bandwidth == SDRATE_EOT) {
1013 e752x_printk(KERN_WARNING,
1014 "Invalid sdram scrub control value: 0x%x\n", scrubval);
1015 return -1;
1016 }
1017
1018 *bw = scrubrates[i].bandwidth;
1019
1020 return 0;
1021}
1022
918/* Return 1 if dual channel mode is active. Else return 0. */ 1023/* Return 1 if dual channel mode is active. Else return 0. */
919static inline int dual_channel_active(u16 ddrcsr) 1024static inline int dual_channel_active(u16 ddrcsr)
920{ 1025{
@@ -1073,10 +1178,7 @@ fail:
1073 1178
1074/* Setup system bus parity mask register. 1179/* Setup system bus parity mask register.
1075 * Sysbus parity supported on: 1180 * Sysbus parity supported on:
1076 * e7320/e7520/e7525 + Xeon 1181 * e7320/e7520/e7525 + Xeon
1077 * i3100 + Xeon/Celeron
1078 * Sysbus parity not supported on:
1079 * i3100 + Pentium M/Celeron M/Core Duo/Core2 Duo
1080 */ 1182 */
1081static void e752x_init_sysbus_parity_mask(struct e752x_pvt *pvt) 1183static void e752x_init_sysbus_parity_mask(struct e752x_pvt *pvt)
1082{ 1184{
@@ -1087,10 +1189,7 @@ static void e752x_init_sysbus_parity_mask(struct e752x_pvt *pvt)
1087 /* Allow module parameter override, else see if CPU supports parity */ 1189 /* Allow module parameter override, else see if CPU supports parity */
1088 if (sysbus_parity != -1) { 1190 if (sysbus_parity != -1) {
1089 enable = sysbus_parity; 1191 enable = sysbus_parity;
1090 } else if (cpu_id[0] && 1192 } else if (cpu_id[0] && !strstr(cpu_id, "Xeon")) {
1091 ((strstr(cpu_id, "Pentium") && strstr(cpu_id, " M ")) ||
1092 (strstr(cpu_id, "Celeron") && strstr(cpu_id, " M ")) ||
1093 (strstr(cpu_id, "Core") && strstr(cpu_id, "Duo")))) {
1094 e752x_printk(KERN_INFO, "System Bus Parity not " 1193 e752x_printk(KERN_INFO, "System Bus Parity not "
1095 "supported by CPU, disabling\n"); 1194 "supported by CPU, disabling\n");
1096 enable = 0; 1195 enable = 0;
@@ -1187,6 +1286,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
1187 mci->dev_name = pci_name(pdev); 1286 mci->dev_name = pci_name(pdev);
1188 mci->edac_check = e752x_check; 1287 mci->edac_check = e752x_check;
1189 mci->ctl_page_to_phys = ctl_page_to_phys; 1288 mci->ctl_page_to_phys = ctl_page_to_phys;
1289 mci->set_sdram_scrub_rate = set_sdram_scrub_rate;
1290 mci->get_sdram_scrub_rate = get_sdram_scrub_rate;
1190 1291
1191 /* set the map type. 1 = normal, 0 = reversed 1292 /* set the map type. 1 = normal, 0 = reversed
1192 * Must be set before e752x_init_csrows in case csrow mapping 1293 * Must be set before e752x_init_csrows in case csrow mapping
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index ecd5928d7110..94cac0aacea3 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -239,16 +239,15 @@ static int __devinit mpc85xx_pci_err_probe(struct of_device *op,
239 /* we only need the error registers */ 239 /* we only need the error registers */
240 r.start += 0xe00; 240 r.start += 0xe00;
241 241
242 if (!devm_request_mem_region(&op->dev, r.start, 242 if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
243 r.end - r.start + 1, pdata->name)) { 243 pdata->name)) {
244 printk(KERN_ERR "%s: Error while requesting mem region\n", 244 printk(KERN_ERR "%s: Error while requesting mem region\n",
245 __func__); 245 __func__);
246 res = -EBUSY; 246 res = -EBUSY;
247 goto err; 247 goto err;
248 } 248 }
249 249
250 pdata->pci_vbase = devm_ioremap(&op->dev, r.start, 250 pdata->pci_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
251 r.end - r.start + 1);
252 if (!pdata->pci_vbase) { 251 if (!pdata->pci_vbase) {
253 printk(KERN_ERR "%s: Unable to setup PCI err regs\n", __func__); 252 printk(KERN_ERR "%s: Unable to setup PCI err regs\n", __func__);
254 res = -ENOMEM; 253 res = -ENOMEM;
@@ -668,15 +667,125 @@ static struct of_platform_driver mpc85xx_l2_err_driver = {
668 667
669/**************************** MC Err device ***************************/ 668/**************************** MC Err device ***************************/
670 669
670/*
671 * Taken from table 8-55 in the MPC8641 User's Manual and/or 9-61 in the
672 * MPC8572 User's Manual. Each line represents a syndrome bit column as a
673 * 64-bit value, but split into an upper and lower 32-bit chunk. The labels
674 * below correspond to Freescale's manuals.
675 */
676static unsigned int ecc_table[16] = {
677 /* MSB LSB */
678 /* [0:31] [32:63] */
679 0xf00fe11e, 0xc33c0ff7, /* Syndrome bit 7 */
680 0x00ff00ff, 0x00fff0ff,
681 0x0f0f0f0f, 0x0f0fff00,
682 0x11113333, 0x7777000f,
683 0x22224444, 0x8888222f,
684 0x44448888, 0xffff4441,
685 0x8888ffff, 0x11118882,
686 0xffff1111, 0x22221114, /* Syndrome bit 0 */
687};
688
689/*
690 * Calculate the correct ECC value for a 64-bit value specified by high:low
691 */
692static u8 calculate_ecc(u32 high, u32 low)
693{
694 u32 mask_low;
695 u32 mask_high;
696 int bit_cnt;
697 u8 ecc = 0;
698 int i;
699 int j;
700
701 for (i = 0; i < 8; i++) {
702 mask_high = ecc_table[i * 2];
703 mask_low = ecc_table[i * 2 + 1];
704 bit_cnt = 0;
705
706 for (j = 0; j < 32; j++) {
707 if ((mask_high >> j) & 1)
708 bit_cnt ^= (high >> j) & 1;
709 if ((mask_low >> j) & 1)
710 bit_cnt ^= (low >> j) & 1;
711 }
712
713 ecc |= bit_cnt << i;
714 }
715
716 return ecc;
717}
718
719/*
720 * Create the syndrome code which is generated if the data line specified by
721 * 'bit' failed. Eg generate an 8-bit codes seen in Table 8-55 in the MPC8641
722 * User's Manual and 9-61 in the MPC8572 User's Manual.
723 */
724static u8 syndrome_from_bit(unsigned int bit) {
725 int i;
726 u8 syndrome = 0;
727
728 /*
729 * Cycle through the upper or lower 32-bit portion of each value in
730 * ecc_table depending on if 'bit' is in the upper or lower half of
731 * 64-bit data.
732 */
733 for (i = bit < 32; i < 16; i += 2)
734 syndrome |= ((ecc_table[i] >> (bit % 32)) & 1) << (i / 2);
735
736 return syndrome;
737}
738
739/*
740 * Decode data and ecc syndrome to determine what went wrong
741 * Note: This can only decode single-bit errors
742 */
743static void sbe_ecc_decode(u32 cap_high, u32 cap_low, u32 cap_ecc,
744 int *bad_data_bit, int *bad_ecc_bit)
745{
746 int i;
747 u8 syndrome;
748
749 *bad_data_bit = -1;
750 *bad_ecc_bit = -1;
751
752 /*
753 * Calculate the ECC of the captured data and XOR it with the captured
754 * ECC to find an ECC syndrome value we can search for
755 */
756 syndrome = calculate_ecc(cap_high, cap_low) ^ cap_ecc;
757
758 /* Check if a data line is stuck... */
759 for (i = 0; i < 64; i++) {
760 if (syndrome == syndrome_from_bit(i)) {
761 *bad_data_bit = i;
762 return;
763 }
764 }
765
766 /* If data is correct, check ECC bits for errors... */
767 for (i = 0; i < 8; i++) {
768 if ((syndrome >> i) & 0x1) {
769 *bad_ecc_bit = i;
770 return;
771 }
772 }
773}
774
671static void mpc85xx_mc_check(struct mem_ctl_info *mci) 775static void mpc85xx_mc_check(struct mem_ctl_info *mci)
672{ 776{
673 struct mpc85xx_mc_pdata *pdata = mci->pvt_info; 777 struct mpc85xx_mc_pdata *pdata = mci->pvt_info;
674 struct csrow_info *csrow; 778 struct csrow_info *csrow;
779 u32 bus_width;
675 u32 err_detect; 780 u32 err_detect;
676 u32 syndrome; 781 u32 syndrome;
677 u32 err_addr; 782 u32 err_addr;
678 u32 pfn; 783 u32 pfn;
679 int row_index; 784 int row_index;
785 u32 cap_high;
786 u32 cap_low;
787 int bad_data_bit;
788 int bad_ecc_bit;
680 789
681 err_detect = in_be32(pdata->mc_vbase + MPC85XX_MC_ERR_DETECT); 790 err_detect = in_be32(pdata->mc_vbase + MPC85XX_MC_ERR_DETECT);
682 if (!err_detect) 791 if (!err_detect)
@@ -692,6 +801,15 @@ static void mpc85xx_mc_check(struct mem_ctl_info *mci)
692 } 801 }
693 802
694 syndrome = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_ECC); 803 syndrome = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_ECC);
804
805 /* Mask off appropriate bits of syndrome based on bus width */
806 bus_width = (in_be32(pdata->mc_vbase + MPC85XX_MC_DDR_SDRAM_CFG) &
807 DSC_DBW_MASK) ? 32 : 64;
808 if (bus_width == 64)
809 syndrome &= 0xff;
810 else
811 syndrome &= 0xffff;
812
695 err_addr = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_ADDRESS); 813 err_addr = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_ADDRESS);
696 pfn = err_addr >> PAGE_SHIFT; 814 pfn = err_addr >> PAGE_SHIFT;
697 815
@@ -701,14 +819,35 @@ static void mpc85xx_mc_check(struct mem_ctl_info *mci)
701 break; 819 break;
702 } 820 }
703 821
704 mpc85xx_mc_printk(mci, KERN_ERR, "Capture Data High: %#8.8x\n", 822 cap_high = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_DATA_HI);
705 in_be32(pdata->mc_vbase + 823 cap_low = in_be32(pdata->mc_vbase + MPC85XX_MC_CAPTURE_DATA_LO);
706 MPC85XX_MC_CAPTURE_DATA_HI)); 824
707 mpc85xx_mc_printk(mci, KERN_ERR, "Capture Data Low: %#8.8x\n", 825 /*
708 in_be32(pdata->mc_vbase + 826 * Analyze single-bit errors on 64-bit wide buses
709 MPC85XX_MC_CAPTURE_DATA_LO)); 827 * TODO: Add support for 32-bit wide buses
710 mpc85xx_mc_printk(mci, KERN_ERR, "syndrome: %#8.8x\n", syndrome); 828 */
711 mpc85xx_mc_printk(mci, KERN_ERR, "err addr: %#8.8x\n", err_addr); 829 if ((err_detect & DDR_EDE_SBE) && (bus_width == 64)) {
830 sbe_ecc_decode(cap_high, cap_low, syndrome,
831 &bad_data_bit, &bad_ecc_bit);
832
833 if (bad_data_bit != -1)
834 mpc85xx_mc_printk(mci, KERN_ERR,
835 "Faulty Data bit: %d\n", bad_data_bit);
836 if (bad_ecc_bit != -1)
837 mpc85xx_mc_printk(mci, KERN_ERR,
838 "Faulty ECC bit: %d\n", bad_ecc_bit);
839
840 mpc85xx_mc_printk(mci, KERN_ERR,
841 "Expected Data / ECC:\t%#8.8x_%08x / %#2.2x\n",
842 cap_high ^ (1 << (bad_data_bit - 32)),
843 cap_low ^ (1 << bad_data_bit),
844 syndrome ^ (1 << bad_ecc_bit));
845 }
846
847 mpc85xx_mc_printk(mci, KERN_ERR,
848 "Captured Data / ECC:\t%#8.8x_%08x / %#2.2x\n",
849 cap_high, cap_low, syndrome);
850 mpc85xx_mc_printk(mci, KERN_ERR, "Err addr: %#8.8x\n", err_addr);
712 mpc85xx_mc_printk(mci, KERN_ERR, "PFN: %#8.8x\n", pfn); 851 mpc85xx_mc_printk(mci, KERN_ERR, "PFN: %#8.8x\n", pfn);
713 852
714 /* we are out of range */ 853 /* we are out of range */
diff --git a/drivers/edac/mpc85xx_edac.h b/drivers/edac/mpc85xx_edac.h
index 52432ee7c4b9..cb24df839460 100644
--- a/drivers/edac/mpc85xx_edac.h
+++ b/drivers/edac/mpc85xx_edac.h
@@ -48,6 +48,9 @@
48#define DSC_MEM_EN 0x80000000 48#define DSC_MEM_EN 0x80000000
49#define DSC_ECC_EN 0x20000000 49#define DSC_ECC_EN 0x20000000
50#define DSC_RD_EN 0x10000000 50#define DSC_RD_EN 0x10000000
51#define DSC_DBW_MASK 0x00180000
52#define DSC_DBW_32 0x00080000
53#define DSC_DBW_64 0x00000000
51 54
52#define DSC_SDTYPE_MASK 0x07000000 55#define DSC_SDTYPE_MASK 0x07000000
53 56
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 71247da17da5..75bceee76044 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -3545,7 +3545,7 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b
3545 * at which modes should be set up in the dual link style. 3545 * at which modes should be set up in the dual link style.
3546 * 3546 *
3547 * Following the header, the BMP (ver 0xa) table has several records, 3547 * Following the header, the BMP (ver 0xa) table has several records,
3548 * indexed by a seperate xlat table, indexed in turn by the fp strap in 3548 * indexed by a separate xlat table, indexed in turn by the fp strap in
3549 * EXTDEV_BOOT. Each record had a config byte, followed by 6 script 3549 * EXTDEV_BOOT. Each record had a config byte, followed by 6 script
3550 * numbers for use by INIT_SUB which controlled panel init and power, 3550 * numbers for use by INIT_SUB which controlled panel init and power,
3551 * and finally a dword of ms to sleep between power off and on 3551 * and finally a dword of ms to sleep between power off and on
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 5f8d987af363..4b9aaf2a8d0f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -553,7 +553,7 @@ struct drm_nouveau_private {
553 uint32_t ramro_offset; 553 uint32_t ramro_offset;
554 uint32_t ramro_size; 554 uint32_t ramro_size;
555 555
556 /* base physical adresses */ 556 /* base physical addresses */
557 uint64_t fb_phys; 557 uint64_t fb_phys;
558 uint64_t fb_available_size; 558 uint64_t fb_available_size;
559 uint64_t fb_mappable_pages; 559 uint64_t fb_mappable_pages;
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c
index 3c32f840dcd2..40ab6d9c3736 100644
--- a/drivers/gpu/drm/radeon/radeon_state.c
+++ b/drivers/gpu/drm/radeon/radeon_state.c
@@ -1093,7 +1093,7 @@ static void radeon_cp_dispatch_clear(struct drm_device * dev,
1093 /* judging by the first tile offset needed, could possibly 1093 /* judging by the first tile offset needed, could possibly
1094 directly address/clear 4x4 tiles instead of 8x2 * 4x4 1094 directly address/clear 4x4 tiles instead of 8x2 * 4x4
1095 macro tiles, though would still need clear mask for 1095 macro tiles, though would still need clear mask for
1096 right/bottom if truely 4x4 granularity is desired ? */ 1096 right/bottom if truly 4x4 granularity is desired ? */
1097 OUT_RING(tileoffset * 16); 1097 OUT_RING(tileoffset * 16);
1098 /* the number of tiles to clear */ 1098 /* the number of tiles to clear */
1099 OUT_RING(nrtilesx + 1); 1099 OUT_RING(nrtilesx + 1);
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index 5935b8842e86..34079f251cd4 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -150,7 +150,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS)
150 cur_irq++; 150 cur_irq++;
151 } 151 }
152 152
153 /* Acknowlege interrupts */ 153 /* Acknowledge interrupts */
154 VIA_WRITE(VIA_REG_INTERRUPT, status); 154 VIA_WRITE(VIA_REG_INTERRUPT, status);
155 155
156 156
@@ -165,7 +165,7 @@ static __inline__ void viadrv_acknowledge_irqs(drm_via_private_t * dev_priv)
165 u32 status; 165 u32 status;
166 166
167 if (dev_priv) { 167 if (dev_priv) {
168 /* Acknowlege interrupts */ 168 /* Acknowledge interrupts */
169 status = VIA_READ(VIA_REG_INTERRUPT); 169 status = VIA_READ(VIA_REG_INTERRUPT);
170 VIA_WRITE(VIA_REG_INTERRUPT, status | 170 VIA_WRITE(VIA_REG_INTERRUPT, status |
171 dev_priv->irq_pending_mask); 171 dev_priv->irq_pending_mask);
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 7ce75775ec73..6b6bd06202b2 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -176,7 +176,7 @@ static int pcf_init_8584 (struct i2c_algo_pcf_data *adap)
176 */ 176 */
177 if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) { 177 if (((temp = get_pcf(adap, 1)) & 0x7f) != (0)) {
178 DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp)); 178 DEB2(printk(KERN_ERR "i2c-algo-pcf.o: PCF detection failed -- can't select S0 (0x%02x).\n", temp));
179 return -ENXIO; /* definetly not PCF8584 */ 179 return -ENXIO; /* definitely not PCF8584 */
180 } 180 }
181 181
182 /* load own address in S0, effective address is (own << 1) */ 182 /* load own address in S0, effective address is (own << 1) */
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 7647a20523a0..90ffbf6f9d4f 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -12,7 +12,7 @@
12 * 12 *
13 * History: 13 * History:
14 * Apr 2002: Initial version [CS] 14 * Apr 2002: Initial version [CS]
15 * Jun 2002: Properly seperated algo/adap [FB] 15 * Jun 2002: Properly separated algo/adap [FB]
16 * Jan 2003: Fixed several bugs concerning interrupt handling [Kai-Uwe Bloem] 16 * Jan 2003: Fixed several bugs concerning interrupt handling [Kai-Uwe Bloem]
17 * Jan 2003: added limited signal handling [Kai-Uwe Bloem] 17 * Jan 2003: added limited signal handling [Kai-Uwe Bloem]
18 * Sep 2004: Major rework to ensure efficient bus handling [RMK] 18 * Sep 2004: Major rework to ensure efficient bus handling [RMK]
diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
index 9555fd253865..bf47fee79808 100644
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -1452,7 +1452,7 @@ static int __devinit add_card(struct pci_dev *dev,
1452 PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c"); 1452 PRINT(KERN_ERR, lynx->id, "unable to read bus info block from i2c");
1453 } else { 1453 } else {
1454 PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom"); 1454 PRINT(KERN_INFO, lynx->id, "got bus info block from serial eeprom");
1455 /* FIXME: probably we shoud rewrite the max_rec, max_ROM(1394a), 1455 /* FIXME: probably we should rewrite the max_rec, max_ROM(1394a),
1456 * generation(1394a) and link_spd(1394a) field and recalculate 1456 * generation(1394a) and link_spd(1394a) field and recalculate
1457 * the CRC */ 1457 * the CRC */
1458 1458
diff --git a/drivers/infiniband/hw/ehca/ehca_qes.h b/drivers/infiniband/hw/ehca/ehca_qes.h
index 5d28e3e98a20..90c4efa67586 100644
--- a/drivers/infiniband/hw/ehca/ehca_qes.h
+++ b/drivers/infiniband/hw/ehca/ehca_qes.h
@@ -46,7 +46,7 @@
46 46
47#include "ehca_tools.h" 47#include "ehca_tools.h"
48 48
49/* virtual scatter gather entry to specify remote adresses with length */ 49/* virtual scatter gather entry to specify remote addresses with length */
50struct ehca_vsgentry { 50struct ehca_vsgentry {
51 u64 vaddr; 51 u64 vaddr;
52 u32 lkey; 52 u32 lkey;
@@ -148,7 +148,7 @@ struct ehca_wqe {
148 u32 immediate_data; 148 u32 immediate_data;
149 union { 149 union {
150 struct { 150 struct {
151 u64 remote_virtual_adress; 151 u64 remote_virtual_address;
152 u32 rkey; 152 u32 rkey;
153 u32 reserved; 153 u32 reserved;
154 u64 atomic_1st_op_dma_len; 154 u64 atomic_1st_op_dma_len;
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/infiniband/hw/ehca/ehca_reqs.c
index e3ec7fdd67bd..9a3fbfca9b41 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -269,7 +269,7 @@ static inline int ehca_write_swqe(struct ehca_qp *qp,
269 /* no break is intentional here */ 269 /* no break is intentional here */
270 case IB_QPT_RC: 270 case IB_QPT_RC:
271 /* TODO: atomic not implemented */ 271 /* TODO: atomic not implemented */
272 wqe_p->u.nud.remote_virtual_adress = 272 wqe_p->u.nud.remote_virtual_address =
273 send_wr->wr.rdma.remote_addr; 273 send_wr->wr.rdma.remote_addr;
274 wqe_p->u.nud.rkey = send_wr->wr.rdma.rkey; 274 wqe_p->u.nud.rkey = send_wr->wr.rdma.rkey;
275 275
diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c
index 9caed30f3bbb..b1ab29861e1c 100644
--- a/drivers/input/keyboard/locomokbd.c
+++ b/drivers/input/keyboard/locomokbd.c
@@ -192,11 +192,18 @@ static void locomokbd_scankeyboard(struct locomokbd *locomokbd)
192static irqreturn_t locomokbd_interrupt(int irq, void *dev_id) 192static irqreturn_t locomokbd_interrupt(int irq, void *dev_id)
193{ 193{
194 struct locomokbd *locomokbd = dev_id; 194 struct locomokbd *locomokbd = dev_id;
195 u16 r;
196
197 r = locomo_readl(locomokbd->base + LOCOMO_KIC);
198 if ((r & 0x0001) == 0)
199 return IRQ_HANDLED;
200
201 locomo_writel(r & ~0x0100, locomokbd->base + LOCOMO_KIC); /* Ack */
202
195 /** wait chattering delay **/ 203 /** wait chattering delay **/
196 udelay(100); 204 udelay(100);
197 205
198 locomokbd_scankeyboard(locomokbd); 206 locomokbd_scankeyboard(locomokbd);
199
200 return IRQ_HANDLED; 207 return IRQ_HANDLED;
201} 208}
202 209
@@ -210,6 +217,25 @@ static void locomokbd_timer_callback(unsigned long data)
210 locomokbd_scankeyboard(locomokbd); 217 locomokbd_scankeyboard(locomokbd);
211} 218}
212 219
220static int locomokbd_open(struct input_dev *dev)
221{
222 struct locomokbd *locomokbd = input_get_drvdata(dev);
223 u16 r;
224
225 r = locomo_readl(locomokbd->base + LOCOMO_KIC) | 0x0010;
226 locomo_writel(r, locomokbd->base + LOCOMO_KIC);
227 return 0;
228}
229
230static void locomokbd_close(struct input_dev *dev)
231{
232 struct locomokbd *locomokbd = input_get_drvdata(dev);
233 u16 r;
234
235 r = locomo_readl(locomokbd->base + LOCOMO_KIC) & ~0x0010;
236 locomo_writel(r, locomokbd->base + LOCOMO_KIC);
237}
238
213static int __devinit locomokbd_probe(struct locomo_dev *dev) 239static int __devinit locomokbd_probe(struct locomo_dev *dev)
214{ 240{
215 struct locomokbd *locomokbd; 241 struct locomokbd *locomokbd;
@@ -253,6 +279,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
253 input_dev->id.vendor = 0x0001; 279 input_dev->id.vendor = 0x0001;
254 input_dev->id.product = 0x0001; 280 input_dev->id.product = 0x0001;
255 input_dev->id.version = 0x0100; 281 input_dev->id.version = 0x0100;
282 input_dev->open = locomokbd_open;
283 input_dev->close = locomokbd_close;
256 input_dev->dev.parent = &dev->dev; 284 input_dev->dev.parent = &dev->dev;
257 285
258 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | 286 input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
@@ -261,6 +289,8 @@ static int __devinit locomokbd_probe(struct locomo_dev *dev)
261 input_dev->keycodesize = sizeof(locomokbd_keycode[0]); 289 input_dev->keycodesize = sizeof(locomokbd_keycode[0]);
262 input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode); 290 input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);
263 291
292 input_set_drvdata(input_dev, locomokbd);
293
264 memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode)); 294 memcpy(locomokbd->keycode, locomokbd_keycode, sizeof(locomokbd->keycode));
265 for (i = 0; i < LOCOMOKBD_NUMKEYS; i++) 295 for (i = 0; i < LOCOMOKBD_NUMKEYS; i++)
266 set_bit(locomokbd->keycode[i], input_dev->keybit); 296 set_bit(locomokbd->keycode[i], input_dev->keybit);
diff --git a/drivers/input/misc/yealink.h b/drivers/input/misc/yealink.h
index 48af0be9cbdf..1e0f52397010 100644
--- a/drivers/input/misc/yealink.h
+++ b/drivers/input/misc/yealink.h
@@ -127,7 +127,7 @@ struct yld_ctl_packet {
127 * yld_status struct. 127 * yld_status struct.
128 */ 128 */
129 129
130/* LCD, each segment must be driven seperately. 130/* LCD, each segment must be driven separately.
131 * 131 *
132 * Layout: 132 * Layout:
133 * 133 *
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index b54aee7cd9e3..ff4d77c4de11 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -430,7 +430,7 @@ static bool i8042_filter(unsigned char data, unsigned char str,
430 } 430 }
431 431
432 if (i8042_platform_filter && i8042_platform_filter(data, str, serio)) { 432 if (i8042_platform_filter && i8042_platform_filter(data, str, serio)) {
433 dbg("Filtered out by platfrom filter\n"); 433 dbg("Filtered out by platform filter\n");
434 return true; 434 return true;
435 } 435 }
436 436
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 7d005a3616d7..4be039d7dcad 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -362,7 +362,7 @@ static const int macroKeyEvents[] = {
362}; 362};
363 363
364/*********************************************************************** 364/***********************************************************************
365 * Map values to strings and back. Every map shoudl have the following 365 * Map values to strings and back. Every map should have the following
366 * as its last element: { NULL, AIPTEK_INVALID_VALUE }. 366 * as its last element: { NULL, AIPTEK_INVALID_VALUE }.
367 */ 367 */
368#define AIPTEK_INVALID_VALUE -1 368#define AIPTEK_INVALID_VALUE -1
diff --git a/drivers/isdn/hardware/mISDN/mISDNisar.c b/drivers/isdn/hardware/mISDN/mISDNisar.c
index 09095c747110..f0bc6fa95809 100644
--- a/drivers/isdn/hardware/mISDN/mISDNisar.c
+++ b/drivers/isdn/hardware/mISDN/mISDNisar.c
@@ -1712,13 +1712,13 @@ mISDNisar_init(struct isar_hw *isar, void *hw)
1712} 1712}
1713EXPORT_SYMBOL(mISDNisar_init); 1713EXPORT_SYMBOL(mISDNisar_init);
1714 1714
1715static int isar_mod_init(void) 1715static int __init isar_mod_init(void)
1716{ 1716{
1717 pr_notice("mISDN: ISAR driver Rev. %s\n", ISAR_REV); 1717 pr_notice("mISDN: ISAR driver Rev. %s\n", ISAR_REV);
1718 return 0; 1718 return 0;
1719} 1719}
1720 1720
1721static void isar_mod_cleanup(void) 1721static void __exit isar_mod_cleanup(void)
1722{ 1722{
1723 pr_notice("mISDN: ISAR module unloaded\n"); 1723 pr_notice("mISDN: ISAR module unloaded\n");
1724} 1724}
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index adb1e8c36b46..00c60e2e0ff7 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1347,7 +1347,7 @@ isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
1347/* 1347/*
1348 * isdn net devices manage lots of configuration variables as linked lists. 1348 * isdn net devices manage lots of configuration variables as linked lists.
1349 * Those lists must only be manipulated from user space. Some of the ioctl's 1349 * Those lists must only be manipulated from user space. Some of the ioctl's
1350 * service routines access user space and are not atomic. Therefor, ioctl's 1350 * service routines access user space and are not atomic. Therefore, ioctl's
1351 * manipulating the lists and ioctl's sleeping while accessing the lists 1351 * manipulating the lists and ioctl's sleeping while accessing the lists
1352 * are serialized by means of a semaphore. 1352 * are serialized by means of a semaphore.
1353 */ 1353 */
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c
index 43ff4d3b046e..6eac588e0a37 100644
--- a/drivers/isdn/mISDN/dsp_core.c
+++ b/drivers/isdn/mISDN/dsp_core.c
@@ -1114,7 +1114,7 @@ static struct Bprotocol DSP = {
1114 .create = dspcreate 1114 .create = dspcreate
1115}; 1115};
1116 1116
1117static int dsp_init(void) 1117static int __init dsp_init(void)
1118{ 1118{
1119 int err; 1119 int err;
1120 int tics; 1120 int tics;
@@ -1212,7 +1212,7 @@ static int dsp_init(void)
1212} 1212}
1213 1213
1214 1214
1215static void dsp_cleanup(void) 1215static void __exit dsp_cleanup(void)
1216{ 1216{
1217 mISDN_unregister_Bprotocol(&DSP); 1217 mISDN_unregister_Bprotocol(&DSP);
1218 1218
diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index f1e8af54dff0..325b1ad7d4b8 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -477,7 +477,7 @@ l1oip_socket_parse(struct l1oip *hc, struct sockaddr_in *sin, u8 *buf, int len)
477 printk(KERN_DEBUG "%s: received frame, parsing... (%d)\n", 477 printk(KERN_DEBUG "%s: received frame, parsing... (%d)\n",
478 __func__, len); 478 __func__, len);
479 479
480 /* check lenght */ 480 /* check length */
481 if (len < 1+1+2) { 481 if (len < 1+1+2) {
482 printk(KERN_WARNING "%s: packet error - length %d below " 482 printk(KERN_WARNING "%s: packet error - length %d below "
483 "4 bytes\n", __func__, len); 483 "4 bytes\n", __func__, len);
@@ -1509,7 +1509,7 @@ l1oip_init(void)
1509 printk(KERN_DEBUG "%s: interface %d is %s with %s.\n", 1509 printk(KERN_DEBUG "%s: interface %d is %s with %s.\n",
1510 __func__, l1oip_cnt, pri ? "PRI" : "BRI", 1510 __func__, l1oip_cnt, pri ? "PRI" : "BRI",
1511 bundle ? "bundled IP packet for all B-channels" : 1511 bundle ? "bundled IP packet for all B-channels" :
1512 "seperate IP packets for every B-channel"); 1512 "separate IP packets for every B-channel");
1513 1513
1514 hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC); 1514 hc = kzalloc(sizeof(struct l1oip), GFP_ATOMIC);
1515 if (!hc) { 1515 if (!hc) {
diff --git a/drivers/isdn/sc/hardware.h b/drivers/isdn/sc/hardware.h
index 9e6d5302bf8e..627324856ead 100644
--- a/drivers/isdn/sc/hardware.h
+++ b/drivers/isdn/sc/hardware.h
@@ -87,7 +87,7 @@
87#define BRI_CHANNELS 2 /* Number of B channels */ 87#define BRI_CHANNELS 2 /* Number of B channels */
88#define BRI_BASEPG_VAL 0x98 88#define BRI_BASEPG_VAL 0x98
89#define BRI_MAGIC 0x60000 /* Magic Number */ 89#define BRI_MAGIC 0x60000 /* Magic Number */
90#define BRI_MEMSIZE 0x10000 /* Ammount of RAM (64K) */ 90#define BRI_MEMSIZE 0x10000 /* Amount of RAM (64K) */
91#define BRI_PARTNO "72-029" 91#define BRI_PARTNO "72-029"
92#define BRI_FEATURES ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L3_TRANS; 92#define BRI_FEATURES ISDN_FEATURE_L2_HDLC | ISDN_FEATURE_L3_TRANS;
93/* 93/*
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 5738d8bf2d97..921373e4e3af 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -948,10 +948,16 @@ static void do_monitor_cpu_combined(void)
948 printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n", 948 printk(KERN_WARNING "Warning ! Temperature way above maximum (%d) !\n",
949 temp_combi >> 16); 949 temp_combi >> 16);
950 state0->overtemp += CPU_MAX_OVERTEMP / 4; 950 state0->overtemp += CPU_MAX_OVERTEMP / 4;
951 } else if (temp_combi > (state0->mpu.tmax << 16)) 951 } else if (temp_combi > (state0->mpu.tmax << 16)) {
952 state0->overtemp++; 952 state0->overtemp++;
953 else 953 printk(KERN_WARNING "Temperature %d above max %d. overtemp %d\n",
954 temp_combi >> 16, state0->mpu.tmax, state0->overtemp);
955 } else {
956 if (state0->overtemp)
957 printk(KERN_WARNING "Temperature back down to %d\n",
958 temp_combi >> 16);
954 state0->overtemp = 0; 959 state0->overtemp = 0;
960 }
955 if (state0->overtemp >= CPU_MAX_OVERTEMP) 961 if (state0->overtemp >= CPU_MAX_OVERTEMP)
956 critical_state = 1; 962 critical_state = 1;
957 if (state0->overtemp > 0) { 963 if (state0->overtemp > 0) {
@@ -1023,10 +1029,16 @@ static void do_monitor_cpu_split(struct cpu_pid_state *state)
1023 " (%d) !\n", 1029 " (%d) !\n",
1024 state->index, temp >> 16); 1030 state->index, temp >> 16);
1025 state->overtemp += CPU_MAX_OVERTEMP / 4; 1031 state->overtemp += CPU_MAX_OVERTEMP / 4;
1026 } else if (temp > (state->mpu.tmax << 16)) 1032 } else if (temp > (state->mpu.tmax << 16)) {
1027 state->overtemp++; 1033 state->overtemp++;
1028 else 1034 printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
1035 state->index, temp >> 16, state->mpu.tmax, state->overtemp);
1036 } else {
1037 if (state->overtemp)
1038 printk(KERN_WARNING "CPU %d temperature back down to %d\n",
1039 state->index, temp >> 16);
1029 state->overtemp = 0; 1040 state->overtemp = 0;
1041 }
1030 if (state->overtemp >= CPU_MAX_OVERTEMP) 1042 if (state->overtemp >= CPU_MAX_OVERTEMP)
1031 critical_state = 1; 1043 critical_state = 1;
1032 if (state->overtemp > 0) { 1044 if (state->overtemp > 0) {
@@ -1085,10 +1097,16 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state)
1085 " (%d) !\n", 1097 " (%d) !\n",
1086 state->index, temp >> 16); 1098 state->index, temp >> 16);
1087 state->overtemp = CPU_MAX_OVERTEMP / 4; 1099 state->overtemp = CPU_MAX_OVERTEMP / 4;
1088 } else if (temp > (state->mpu.tmax << 16)) 1100 } else if (temp > (state->mpu.tmax << 16)) {
1089 state->overtemp++; 1101 state->overtemp++;
1090 else 1102 printk(KERN_WARNING "CPU %d temperature %d above max %d. overtemp %d\n",
1103 state->index, temp >> 16, state->mpu.tmax, state->overtemp);
1104 } else {
1105 if (state->overtemp)
1106 printk(KERN_WARNING "CPU %d temperature back down to %d\n",
1107 state->index, temp >> 16);
1091 state->overtemp = 0; 1108 state->overtemp = 0;
1109 }
1092 if (state->overtemp >= CPU_MAX_OVERTEMP) 1110 if (state->overtemp >= CPU_MAX_OVERTEMP)
1093 critical_state = 1; 1111 critical_state = 1;
1094 if (state->overtemp > 0) { 1112 if (state->overtemp > 0) {
diff --git a/drivers/macintosh/therm_pm72.h b/drivers/macintosh/therm_pm72.h
index 393cc9df94e1..df3680e2a22f 100644
--- a/drivers/macintosh/therm_pm72.h
+++ b/drivers/macintosh/therm_pm72.h
@@ -269,7 +269,7 @@ struct slots_pid_state
269#define CPU_TEMP_HISTORY_SIZE 2 269#define CPU_TEMP_HISTORY_SIZE 2
270#define CPU_POWER_HISTORY_SIZE 10 270#define CPU_POWER_HISTORY_SIZE 10
271#define CPU_PID_INTERVAL 1 271#define CPU_PID_INTERVAL 1
272#define CPU_MAX_OVERTEMP 30 272#define CPU_MAX_OVERTEMP 90
273 273
274#define CPUA_PUMP_RPM_INDEX 7 274#define CPUA_PUMP_RPM_INDEX 7
275#define CPUB_PUMP_RPM_INDEX 8 275#define CPUB_PUMP_RPM_INDEX 8
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h
index 52e4ce4304ee..80dda308ff74 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.h
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.h
@@ -214,14 +214,14 @@ struct dvb_tuner_ops {
214 int (*get_status)(struct dvb_frontend *fe, u32 *status); 214 int (*get_status)(struct dvb_frontend *fe, u32 *status);
215 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength); 215 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
216 216
217 /** These are provided seperately from set_params in order to facilitate silicon 217 /** These are provided separately from set_params in order to facilitate silicon
218 * tuners which require sophisticated tuning loops, controlling each parameter seperately. */ 218 * tuners which require sophisticated tuning loops, controlling each parameter separately. */
219 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency); 219 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
220 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth); 220 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
221 221
222 /* 222 /*
223 * These are provided seperately from set_params in order to facilitate silicon 223 * These are provided separately from set_params in order to facilitate silicon
224 * tuners which require sophisticated tuning loops, controlling each parameter seperately. 224 * tuners which require sophisticated tuning loops, controlling each parameter separately.
225 */ 225 */
226 int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state); 226 int (*set_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
227 int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state); 227 int (*get_state)(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *state);
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 12279f6d9bc4..716870ae85d5 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -4404,7 +4404,7 @@ static void rv605_muxsel(struct bttv *btv, unsigned int input)
4404/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning] 4404/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4405 * 4405 *
4406 * The CS16 (available on eBay cheap) is a PCI board with four Fusion 4406 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4407 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator 4407 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
4408 * chips, ten eight input analog multiplexors, a not chip and a few 4408 * chips, ten eight input analog multiplexors, a not chip and a few
4409 * other components. 4409 * other components.
4410 * 4410 *
@@ -4426,7 +4426,7 @@ static void rv605_muxsel(struct bttv *btv, unsigned int input)
4426 * 4426 *
4427 * There is an ATMEL microcontroller with an 8031 core on board. I have not 4427 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4428 * determined what function (if any) it provides. With the microcontroller 4428 * determined what function (if any) it provides. With the microcontroller
4429 * and sync seperator chips a guess is that it might have to do with video 4429 * and sync separator chips a guess is that it might have to do with video
4430 * switching and maybe some digital I/O. 4430 * switching and maybe some digital I/O.
4431 */ 4431 */
4432static void tibetCS16_muxsel(struct bttv *btv, unsigned int input) 4432static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c
index bc4ced6c013b..f36e11a0458d 100644
--- a/drivers/media/video/gspca/ov519.c
+++ b/drivers/media/video/gspca/ov519.c
@@ -512,7 +512,7 @@ static const struct v4l2_pix_format ovfx2_ov3610_mode[] = {
512/* 512/*
513 * The FX2 chip does not give us a zero length read at end of frame. 513 * The FX2 chip does not give us a zero length read at end of frame.
514 * It does, however, give a short read at the end of a frame, if 514 * It does, however, give a short read at the end of a frame, if
515 * neccessary, rather than run two frames together. 515 * necessary, rather than run two frames together.
516 * 516 *
517 * By choosing the right bulk transfer size, we are guaranteed to always 517 * By choosing the right bulk transfer size, we are guaranteed to always
518 * get a short read for the last read of each frame. Frame sizes are 518 * get a short read for the last read of each frame. Frame sizes are
diff --git a/drivers/media/video/pwc/philips.txt b/drivers/media/video/pwc/philips.txt
index f9f3584281d8..d38dd791511e 100644
--- a/drivers/media/video/pwc/philips.txt
+++ b/drivers/media/video/pwc/philips.txt
@@ -33,7 +33,7 @@ a lot of extra information, a FAQ, and the binary plugin 'PWCX'. This plugin
33contains decompression routines that allow you to use higher image sizes and 33contains decompression routines that allow you to use higher image sizes and
34framerates; in addition the webcam uses less bandwidth on the USB bus (handy 34framerates; in addition the webcam uses less bandwidth on the USB bus (handy
35if you want to run more than 1 camera simultaneously). These routines fall 35if you want to run more than 1 camera simultaneously). These routines fall
36under a NDA, and may therefor not be distributed as source; however, its use 36under a NDA, and may therefore not be distributed as source; however, its use
37is completely optional. 37is completely optional.
38 38
39You can build this code either into your kernel, or as a module. I recommend 39You can build this code either into your kernel, or as a module. I recommend
diff --git a/drivers/media/video/sn9c102/sn9c102_sensor.h b/drivers/media/video/sn9c102/sn9c102_sensor.h
index 4af7382da5c5..494957b10bac 100644
--- a/drivers/media/video/sn9c102/sn9c102_sensor.h
+++ b/drivers/media/video/sn9c102/sn9c102_sensor.h
@@ -120,7 +120,7 @@ extern int sn9c102_write_regs(struct sn9c102_device*, const u8 valreg[][2],
120/* 120/*
121 Write multiple registers with constant values. For example: 121 Write multiple registers with constant values. For example:
122 sn9c102_write_const_regs(cam, {0x00, 0x14}, {0x60, 0x17}, {0x0f, 0x18}); 122 sn9c102_write_const_regs(cam, {0x00, 0x14}, {0x60, 0x17}, {0x0f, 0x18});
123 Register adresses must be < 256. 123 Register addresses must be < 256.
124*/ 124*/
125#define sn9c102_write_const_regs(sn9c102_device, data...) \ 125#define sn9c102_write_const_regs(sn9c102_device, data...) \
126 ({ static const u8 _valreg[][2] = {data}; \ 126 ({ static const u8 _valreg[][2] = {data}; \
diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c
index 0446524d3543..6bf6bc7dbc7f 100644
--- a/drivers/media/video/tea6420.c
+++ b/drivers/media/video/tea6420.c
@@ -6,7 +6,7 @@
6 6
7 The tea6420 is a bus controlled audio-matrix with 5 stereo inputs, 7 The tea6420 is a bus controlled audio-matrix with 5 stereo inputs,
8 4 stereo outputs and gain control for each output. 8 4 stereo outputs and gain control for each output.
9 It is cascadable, i.e. it can be found at the adresses 0x98 9 It is cascadable, i.e. it can be found at the addresses 0x98
10 and 0x9a on the i2c-bus. 10 and 0x9a on the i2c-bus.
11 11
12 For detailed informations download the specifications directly 12 For detailed informations download the specifications directly
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c
index e5ab62141503..ef5ce2676f05 100644
--- a/drivers/message/i2o/iop.c
+++ b/drivers/message/i2o/iop.c
@@ -539,7 +539,7 @@ static int i2o_iop_reset(struct i2o_controller *c)
539 * which is indeterminate. We need to wait until the IOP has 539 * which is indeterminate. We need to wait until the IOP has
540 * rebooted before we can let the system talk to it. We read 540 * rebooted before we can let the system talk to it. We read
541 * the inbound Free_List until a message is available. If we 541 * the inbound Free_List until a message is available. If we
542 * can't read one in the given ammount of time, we assume the 542 * can't read one in the given amount of time, we assume the
543 * IOP could not reboot properly. 543 * IOP could not reboot properly.
544 */ 544 */
545 osm_debug("%s: Reset in progress, waiting for reboot...\n", 545 osm_debug("%s: Reset in progress, waiting for reboot...\n",
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index dc9ea95c0561..ff0718efb0ae 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -523,7 +523,7 @@ unsigned long sm501_set_clock(struct device *dev,
523 unsigned long clock = readl(sm->regs + SM501_CURRENT_CLOCK); 523 unsigned long clock = readl(sm->regs + SM501_CURRENT_CLOCK);
524 unsigned char reg; 524 unsigned char reg;
525 unsigned int pll_reg = 0; 525 unsigned int pll_reg = 0;
526 unsigned long sm501_freq; /* the actual frequency acheived */ 526 unsigned long sm501_freq; /* the actual frequency achieved */
527 527
528 struct sm501_clock to; 528 struct sm501_clock to;
529 529
@@ -533,7 +533,7 @@ unsigned long sm501_set_clock(struct device *dev,
533 533
534 switch (clksrc) { 534 switch (clksrc) {
535 case SM501_CLOCK_P2XCLK: 535 case SM501_CLOCK_P2XCLK:
536 /* This clock is divided in half so to achive the 536 /* This clock is divided in half so to achieve the
537 * requested frequency the value must be multiplied by 537 * requested frequency the value must be multiplied by
538 * 2. This clock also has an additional pre divisor */ 538 * 2. This clock also has an additional pre divisor */
539 539
@@ -562,7 +562,7 @@ unsigned long sm501_set_clock(struct device *dev,
562 break; 562 break;
563 563
564 case SM501_CLOCK_V2XCLK: 564 case SM501_CLOCK_V2XCLK:
565 /* This clock is divided in half so to achive the 565 /* This clock is divided in half so to achieve the
566 * requested frequency the value must be multiplied by 2. */ 566 * requested frequency the value must be multiplied by 2. */
567 567
568 sm501_freq = (sm501_select_clock(2 * req_freq, &to, 3) / 2); 568 sm501_freq = (sm501_select_clock(2 * req_freq, &to, 3) / 2);
@@ -648,7 +648,7 @@ unsigned long sm501_find_clock(struct device *dev,
648 unsigned long req_freq) 648 unsigned long req_freq)
649{ 649{
650 struct sm501_devdata *sm = dev_get_drvdata(dev); 650 struct sm501_devdata *sm = dev_get_drvdata(dev);
651 unsigned long sm501_freq; /* the frequency achiveable by the 501 */ 651 unsigned long sm501_freq; /* the frequency achieveable by the 501 */
652 struct sm501_clock to; 652 struct sm501_clock to;
653 653
654 switch (clksrc) { 654 switch (clksrc) {
diff --git a/drivers/misc/sgi-gru/grutables.h b/drivers/misc/sgi-gru/grutables.h
index 02a77b8b8eef..7a8b9068ea03 100644
--- a/drivers/misc/sgi-gru/grutables.h
+++ b/drivers/misc/sgi-gru/grutables.h
@@ -516,8 +516,7 @@ struct gru_blade_state {
516 516
517/* Scan all active GRUs in a GRU bitmap */ 517/* Scan all active GRUs in a GRU bitmap */
518#define for_each_gru_in_bitmap(gid, map) \ 518#define for_each_gru_in_bitmap(gid, map) \
519 for ((gid) = find_first_bit((map), GRU_MAX_GRUS); (gid) < GRU_MAX_GRUS;\ 519 for_each_set_bit((gid), (map), GRU_MAX_GRUS)
520 (gid)++, (gid) = find_next_bit((map), GRU_MAX_GRUS, (gid)))
521 520
522/* Scan all active GRUs on a specific blade */ 521/* Scan all active GRUs on a specific blade */
523#define for_each_gru_on_blade(gru, nid, i) \ 522#define for_each_gru_on_blade(gru, nid, i) \
@@ -536,23 +535,17 @@ struct gru_blade_state {
536 535
537/* Scan each CBR whose bit is set in a TFM (or copy of) */ 536/* Scan each CBR whose bit is set in a TFM (or copy of) */
538#define for_each_cbr_in_tfm(i, map) \ 537#define for_each_cbr_in_tfm(i, map) \
539 for ((i) = find_first_bit(map, GRU_NUM_CBE); \ 538 for_each_set_bit((i), (map), GRU_NUM_CBE)
540 (i) < GRU_NUM_CBE; \
541 (i)++, (i) = find_next_bit(map, GRU_NUM_CBE, i))
542 539
543/* Scan each CBR in a CBR bitmap. Note: multiple CBRs in an allocation unit */ 540/* Scan each CBR in a CBR bitmap. Note: multiple CBRs in an allocation unit */
544#define for_each_cbr_in_allocation_map(i, map, k) \ 541#define for_each_cbr_in_allocation_map(i, map, k) \
545 for ((k) = find_first_bit(map, GRU_CBR_AU); (k) < GRU_CBR_AU; \ 542 for_each_set_bit((k), (map), GRU_CBR_AU) \
546 (k) = find_next_bit(map, GRU_CBR_AU, (k) + 1)) \
547 for ((i) = (k)*GRU_CBR_AU_SIZE; \ 543 for ((i) = (k)*GRU_CBR_AU_SIZE; \
548 (i) < ((k) + 1) * GRU_CBR_AU_SIZE; (i)++) 544 (i) < ((k) + 1) * GRU_CBR_AU_SIZE; (i)++)
549 545
550/* Scan each DSR in a DSR bitmap. Note: multiple DSRs in an allocation unit */ 546/* Scan each DSR in a DSR bitmap. Note: multiple DSRs in an allocation unit */
551#define for_each_dsr_in_allocation_map(i, map, k) \ 547#define for_each_dsr_in_allocation_map(i, map, k) \
552 for ((k) = find_first_bit((const unsigned long *)map, GRU_DSR_AU);\ 548 for_each_set_bit((k), (const unsigned long *)(map), GRU_DSR_AU) \
553 (k) < GRU_DSR_AU; \
554 (k) = find_next_bit((const unsigned long *)map, \
555 GRU_DSR_AU, (k) + 1)) \
556 for ((i) = (k) * GRU_DSR_AU_CL; \ 549 for ((i) = (k) * GRU_DSR_AU_CL; \
557 (i) < ((k) + 1) * GRU_DSR_AU_CL; (i)++) 550 (i) < ((k) + 1) * GRU_DSR_AU_CL; (i)++)
558 551
diff --git a/drivers/mmc/card/sdio_uart.c b/drivers/mmc/card/sdio_uart.c
index 3fab78ba8952..723e50894db9 100644
--- a/drivers/mmc/card/sdio_uart.c
+++ b/drivers/mmc/card/sdio_uart.c
@@ -575,7 +575,7 @@ static int uart_carrier_raised(struct tty_port *tport)
575 struct sdio_uart_port *port = 575 struct sdio_uart_port *port =
576 container_of(tport, struct sdio_uart_port, port); 576 container_of(tport, struct sdio_uart_port, port);
577 unsigned int ret = sdio_uart_claim_func(port); 577 unsigned int ret = sdio_uart_claim_func(port);
578 if (ret) /* Missing hardware shoudn't block for carrier */ 578 if (ret) /* Missing hardware shouldn't block for carrier */
579 return 1; 579 return 1;
580 ret = sdio_uart_get_mctrl(port); 580 ret = sdio_uart_get_mctrl(port);
581 sdio_uart_release_func(port); 581 sdio_uart_release_func(port);
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index f4b97d3c3d0f..3168ebd616b2 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1089,6 +1089,7 @@ void mmc_rescan(struct work_struct *work)
1089 mmc_claim_host(host); 1089 mmc_claim_host(host);
1090 1090
1091 mmc_power_up(host); 1091 mmc_power_up(host);
1092 sdio_reset(host);
1092 mmc_go_idle(host); 1093 mmc_go_idle(host);
1093 1094
1094 mmc_send_if_cond(host, host->ocr_avail); 1095 mmc_send_if_cond(host, host->ocr_avail);
diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c
index 4eb7825fd1a7..dea36d9c22e6 100644
--- a/drivers/mmc/core/sdio_ops.c
+++ b/drivers/mmc/core/sdio_ops.c
@@ -67,13 +67,13 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
67 return err; 67 return err;
68} 68}
69 69
70int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, 70static int mmc_io_rw_direct_host(struct mmc_host *host, int write, unsigned fn,
71 unsigned addr, u8 in, u8* out) 71 unsigned addr, u8 in, u8 *out)
72{ 72{
73 struct mmc_command cmd; 73 struct mmc_command cmd;
74 int err; 74 int err;
75 75
76 BUG_ON(!card); 76 BUG_ON(!host);
77 BUG_ON(fn > 7); 77 BUG_ON(fn > 7);
78 78
79 /* sanity check */ 79 /* sanity check */
@@ -90,11 +90,11 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
90 cmd.arg |= in; 90 cmd.arg |= in;
91 cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_AC; 91 cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_AC;
92 92
93 err = mmc_wait_for_cmd(card->host, &cmd, 0); 93 err = mmc_wait_for_cmd(host, &cmd, 0);
94 if (err) 94 if (err)
95 return err; 95 return err;
96 96
97 if (mmc_host_is_spi(card->host)) { 97 if (mmc_host_is_spi(host)) {
98 /* host driver already reported errors */ 98 /* host driver already reported errors */
99 } else { 99 } else {
100 if (cmd.resp[0] & R5_ERROR) 100 if (cmd.resp[0] & R5_ERROR)
@@ -106,7 +106,7 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
106 } 106 }
107 107
108 if (out) { 108 if (out) {
109 if (mmc_host_is_spi(card->host)) 109 if (mmc_host_is_spi(host))
110 *out = (cmd.resp[0] >> 8) & 0xFF; 110 *out = (cmd.resp[0] >> 8) & 0xFF;
111 else 111 else
112 *out = cmd.resp[0] & 0xFF; 112 *out = cmd.resp[0] & 0xFF;
@@ -115,6 +115,13 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
115 return 0; 115 return 0;
116} 116}
117 117
118int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
119 unsigned addr, u8 in, u8 *out)
120{
121 BUG_ON(!card);
122 return mmc_io_rw_direct_host(card->host, write, fn, addr, in, out);
123}
124
118int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, 125int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
119 unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz) 126 unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz)
120{ 127{
@@ -182,3 +189,20 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
182 return 0; 189 return 0;
183} 190}
184 191
192int sdio_reset(struct mmc_host *host)
193{
194 int ret;
195 u8 abort;
196
197 /* SDIO Simplified Specification V2.0, 4.4 Reset for SDIO */
198
199 ret = mmc_io_rw_direct_host(host, 0, 0, SDIO_CCCR_ABORT, 0, &abort);
200 if (ret)
201 abort = 0x08;
202 else
203 abort |= 0x08;
204
205 ret = mmc_io_rw_direct_host(host, 1, 0, SDIO_CCCR_ABORT, abort, NULL);
206 return ret;
207}
208
diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
index e2e74b0d17d8..12a4d3ab174c 100644
--- a/drivers/mmc/core/sdio_ops.h
+++ b/drivers/mmc/core/sdio_ops.h
@@ -17,6 +17,7 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
17 unsigned addr, u8 in, u8* out); 17 unsigned addr, u8 in, u8* out);
18int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, 18int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
19 unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz); 19 unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz);
20int sdio_reset(struct mmc_host *host);
20 21
21#endif 22#endif
22 23
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index b31946e0b4ca..4c068e5fe6b2 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1250,9 +1250,7 @@ msmsdcc_resume(struct platform_device *dev)
1250 1250
1251 if (mmc->card && mmc->card->type != MMC_TYPE_SDIO) 1251 if (mmc->card && mmc->card->type != MMC_TYPE_SDIO)
1252 mmc_resume_host(mmc); 1252 mmc_resume_host(mmc);
1253 if (host->stat_irq) 1253 if (host->stat_irq)
1254 enable_irq(host->stat_irq);
1255 else if (host->stat_irq)
1256 enable_irq(host->stat_irq); 1254 enable_irq(host->stat_irq);
1257 } 1255 }
1258 return 0; 1256 return 0;
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 60a2b69e54f5..2df90412abb5 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -4,7 +4,7 @@
4 * This is a driver for the SDHC controller found in Freescale MX2/MX3 4 * This is a driver for the SDHC controller found in Freescale MX2/MX3
5 * SoCs. It is basically the same hardware as found on MX1 (imxmmc.c). 5 * SoCs. It is basically the same hardware as found on MX1 (imxmmc.c).
6 * Unlike the hardware found on MX1, this hardware just works and does 6 * Unlike the hardware found on MX1, this hardware just works and does
7 * not need all the quirks found in imxmmc.c, hence the seperate driver. 7 * not need all the quirks found in imxmmc.c, hence the separate driver.
8 * 8 *
9 * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de> 9 * Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
10 * Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com> 10 * Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
@@ -708,7 +708,7 @@ static int mxcmci_probe(struct platform_device *pdev)
708 mmc->max_blk_size = 2048; 708 mmc->max_blk_size = 2048;
709 mmc->max_blk_count = 65535; 709 mmc->max_blk_count = 65535;
710 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; 710 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
711 mmc->max_seg_size = mmc->max_seg_size; 711 mmc->max_seg_size = mmc->max_req_size;
712 712
713 host = mmc_priv(mmc); 713 host = mmc_priv(mmc);
714 host->base = ioremap(r->start, resource_size(r)); 714 host->base = ioremap(r->start, resource_size(r));
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c
index ca584d0380b4..ca584d0380b4 100755..100644
--- a/drivers/mtd/chips/cfi_util.c
+++ b/drivers/mtd/chips/cfi_util.c
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 1bec5e1ce6ac..8db1148dfa47 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -226,7 +226,7 @@ struct unlock_addr {
226 * exists, but is for MTD_UADDR_NOT_SUPPORTED - and, therefore, 226 * exists, but is for MTD_UADDR_NOT_SUPPORTED - and, therefore,
227 * should not be used. The problem is that structures with 227 * should not be used. The problem is that structures with
228 * initializers have extra fields initialized to 0. It is _very_ 228 * initializers have extra fields initialized to 0. It is _very_
229 * desireable to have the unlock address entries for unsupported 229 * desirable to have the unlock address entries for unsupported
230 * data widths automatically initialized - that means that 230 * data widths automatically initialized - that means that
231 * MTD_UADDR_NOT_SUPPORTED must be 0 and the first entry here 231 * MTD_UADDR_NOT_SUPPORTED must be 0 and the first entry here
232 * must go unused. 232 * must go unused.
diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c
index 8aca5523a337..8aca5523a337 100755..100644
--- a/drivers/mtd/inftlcore.c
+++ b/drivers/mtd/inftlcore.c
diff --git a/drivers/mtd/maps/pismo.c b/drivers/mtd/maps/pismo.c
index c48cad271f5d..30e12c88d1da 100644
--- a/drivers/mtd/maps/pismo.c
+++ b/drivers/mtd/maps/pismo.c
@@ -118,7 +118,7 @@ static int __devinit pismo_add_device(struct pismo_data *pismo, int i,
118{ 118{
119 struct platform_device *dev; 119 struct platform_device *dev;
120 struct resource res = { }; 120 struct resource res = { };
121 phys_addr_t base = region.base; 121 phys_addr_t base = region->base;
122 int ret; 122 int ret;
123 123
124 if (base == ~0) 124 if (base == ~0)
diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index dafb91944e70..76a76be5a7bd 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -4,7 +4,7 @@
4 * http://www.simtec.co.uk/products/SWLINUX/ 4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
7 * Generic platfrom device based RAM map 7 * Generic platform device based RAM map
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 10 * it under the terms of the GNU General Public License as published by
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index bb6465604235..1157d5679e66 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -444,7 +444,7 @@ config MTD_NAND_FSL_UPM
444 444
445config MTD_NAND_MXC 445config MTD_NAND_MXC
446 tristate "MXC NAND support" 446 tristate "MXC NAND support"
447 depends on ARCH_MX2 || ARCH_MX3 447 depends on ARCH_MX2 || ARCH_MX25 || ARCH_MX3
448 help 448 help
449 This enables the driver for the NAND flash controller on the 449 This enables the driver for the NAND flash controller on the
450 MXC processors. 450 MXC processors.
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c
index 087bcd745bb7..7d1cca7a31a9 100644
--- a/drivers/mtd/nand/bcm_umi_nand.c
+++ b/drivers/mtd/nand/bcm_umi_nand.c
@@ -381,7 +381,7 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev)
381 if (!r) 381 if (!r)
382 return -ENXIO; 382 return -ENXIO;
383 383
384 /* map physical adress */ 384 /* map physical address */
385 bcm_umi_io_base = ioremap(r->start, r->end - r->start + 1); 385 bcm_umi_io_base = ioremap(r->start, r->end - r->start + 1);
386 386
387 if (!bcm_umi_io_base) { 387 if (!bcm_umi_io_base) {
@@ -525,7 +525,7 @@ static int bcm_umi_nand_remove(struct platform_device *pdev)
525 /* Release resources, unregister device */ 525 /* Release resources, unregister device */
526 nand_release(board_mtd); 526 nand_release(board_mtd);
527 527
528 /* unmap physical adress */ 528 /* unmap physical address */
529 iounmap(bcm_umi_io_base); 529 iounmap(bcm_umi_io_base);
530 530
531 /* Free the MTD device structure */ 531 /* Free the MTD device structure */
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 45dec5770da0..b2900d8406d3 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -507,7 +507,7 @@ static void mxc_do_addr_cycle(struct mtd_info *mtd, int column, int page_addr)
507 * MXC NANDFC can only perform full page+spare or 507 * MXC NANDFC can only perform full page+spare or
508 * spare-only read/write. When the upper layers 508 * spare-only read/write. When the upper layers
509 * layers perform a read/write buf operation, 509 * layers perform a read/write buf operation,
510 * we will used the saved column adress to index into 510 * we will used the saved column address to index into
511 * the full page. 511 * the full page.
512 */ 512 */
513 send_addr(host, 0, page_addr == -1); 513 send_addr(host, 0, page_addr == -1);
diff --git a/drivers/net/atlx/atl2.h b/drivers/net/atlx/atl2.h
index d918bbe621ea..927e4de6474d 100644
--- a/drivers/net/atlx/atl2.h
+++ b/drivers/net/atlx/atl2.h
@@ -442,7 +442,7 @@ struct atl2_hw {
442struct atl2_ring_header { 442struct atl2_ring_header {
443 /* pointer to the descriptor ring memory */ 443 /* pointer to the descriptor ring memory */
444 void *desc; 444 void *desc;
445 /* physical adress of the descriptor ring */ 445 /* physical address of the descriptor ring */
446 dma_addr_t dma; 446 dma_addr_t dma;
447 /* length of descriptor ring in bytes */ 447 /* length of descriptor ring in bytes */
448 unsigned int size; 448 unsigned int size;
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index 71384114a4ed..55d99ca82f8a 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -248,7 +248,7 @@ static void restart_sched(unsigned long);
248 * 248 *
249 * Interrupts are handled by a single CPU and it is likely that on a MP system 249 * Interrupts are handled by a single CPU and it is likely that on a MP system
250 * the application is migrated to another CPU. In that scenario, we try to 250 * the application is migrated to another CPU. In that scenario, we try to
251 * seperate the RX(in irq context) and TX state in order to decrease memory 251 * separate the RX(in irq context) and TX state in order to decrease memory
252 * contention. 252 * contention.
253 */ 253 */
254struct sge { 254struct sge {
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 14624019ce71..b0208e474f7e 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -580,7 +580,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
580 } 580 }
581 581
582#ifdef CONFIG_SH_HICOSH4 582#ifdef CONFIG_SH_HICOSH4
583 /* truely reset the chip */ 583 /* truly reset the chip */
584 writeword(ioaddr, ADD_PORT, 0x0114); 584 writeword(ioaddr, ADD_PORT, 0x0114);
585 writeword(ioaddr, DATA_PORT, 0x0040); 585 writeword(ioaddr, DATA_PORT, 0x0040);
586#endif 586#endif
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 78e265b484b6..67e61b2a8c42 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -197,13 +197,13 @@ static inline void refill_rspq(struct adapter *adapter,
197/** 197/**
198 * need_skb_unmap - does the platform need unmapping of sk_buffs? 198 * need_skb_unmap - does the platform need unmapping of sk_buffs?
199 * 199 *
200 * Returns true if the platfrom needs sk_buff unmapping. The compiler 200 * Returns true if the platform needs sk_buff unmapping. The compiler
201 * optimizes away unecessary code if this returns true. 201 * optimizes away unecessary code if this returns true.
202 */ 202 */
203static inline int need_skb_unmap(void) 203static inline int need_skb_unmap(void)
204{ 204{
205 /* 205 /*
206 * This structure is used to tell if the platfrom needs buffer 206 * This structure is used to tell if the platform needs buffer
207 * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything. 207 * unmapping by checking if DECLARE_PCI_UNMAP_ADDR defines anything.
208 */ 208 */
209 struct dummy { 209 struct dummy {
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 1ac9440eb3fb..13f9869927e3 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -2658,7 +2658,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
2658 2658
2659 pdata = pdev->dev.platform_data; 2659 pdata = pdev->dev.platform_data;
2660 if (!pdata) { 2660 if (!pdata) {
2661 printk(KERN_ERR "DaVinci EMAC: No platfrom data\n"); 2661 printk(KERN_ERR "DaVinci EMAC: No platform data\n");
2662 return -ENODEV; 2662 return -ENODEV;
2663 } 2663 }
2664 2664
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index 3c95acb3a87d..712ccc66ba25 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -1346,7 +1346,7 @@ static s32 e1000_setup_fiber_serdes_link_82571(struct e1000_hw *hw)
1346 * 1346 *
1347 * 1) down 1347 * 1) down
1348 * 2) autoneg_progress 1348 * 2) autoneg_progress
1349 * 3) autoneg_complete (the link sucessfully autonegotiated) 1349 * 3) autoneg_complete (the link successfully autonegotiated)
1350 * 4) forced_up (the link has been forced up, it did not autonegotiate) 1350 * 4) forced_up (the link has been forced up, it did not autonegotiate)
1351 * 1351 *
1352 **/ 1352 **/
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 2425ed11d5cc..a8b2c0de27c4 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -647,7 +647,7 @@ s32 e1000e_check_for_serdes_link(struct e1000_hw *hw)
647 if (!(rxcw & E1000_RXCW_IV)) { 647 if (!(rxcw & E1000_RXCW_IV)) {
648 mac->serdes_has_link = true; 648 mac->serdes_has_link = true;
649 e_dbg("SERDES: Link up - autoneg " 649 e_dbg("SERDES: Link up - autoneg "
650 "completed sucessfully.\n"); 650 "completed successfully.\n");
651 } else { 651 } else {
652 mac->serdes_has_link = false; 652 mac->serdes_has_link = false;
653 e_dbg("SERDES: Link down - invalid" 653 e_dbg("SERDES: Link down - invalid"
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 583a21c1def3..0ed25f059a00 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -688,7 +688,7 @@ static void igb_set_interrupt_capability(struct igb_adapter *adapter)
688 /* start with one vector for every rx queue */ 688 /* start with one vector for every rx queue */
689 numvecs = adapter->num_rx_queues; 689 numvecs = adapter->num_rx_queues;
690 690
691 /* if tx handler is seperate add 1 for every tx queue */ 691 /* if tx handler is separate add 1 for every tx queue */
692 if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS)) 692 if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
693 numvecs += adapter->num_tx_queues; 693 numvecs += adapter->num_tx_queues;
694 694
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index c412e8026173..1dcdce0631aa 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -331,7 +331,7 @@ static int sa1100_irda_resume(struct platform_device *pdev)
331 * If we missed a speed change, initialise at the new speed 331 * If we missed a speed change, initialise at the new speed
332 * directly. It is debatable whether this is actually 332 * directly. It is debatable whether this is actually
333 * required, but in the interests of continuing from where 333 * required, but in the interests of continuing from where
334 * we left off it is desireable. The converse argument is 334 * we left off it is desirable. The converse argument is
335 * that we should re-negotiate at 9600 baud again. 335 * that we should re-negotiate at 9600 baud again.
336 */ 336 */
337 if (si->newspeed) { 337 if (si->newspeed) {
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index b5219cce12ed..0573e0bb4444 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -407,7 +407,7 @@ static irqreturn_t ks8851_irq(int irq, void *pw)
407 * @buff: The buffer address 407 * @buff: The buffer address
408 * @len: The length of the data to read 408 * @len: The length of the data to read
409 * 409 *
410 * Issue an RXQ FIFO read command and read the @len ammount of data from 410 * Issue an RXQ FIFO read command and read the @len amount of data from
411 * the FIFO into the buffer specified by @buff. 411 * the FIFO into the buffer specified by @buff.
412 */ 412 */
413static void ks8851_rdfifo(struct ks8851_net *ks, u8 *buff, unsigned len) 413static void ks8851_rdfifo(struct ks8851_net *ks, u8 *buff, unsigned len)
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c
index 05b8bde9980d..7dbff87480dc 100644
--- a/drivers/net/qlge/qlge_ethtool.c
+++ b/drivers/net/qlge/qlge_ethtool.c
@@ -405,7 +405,7 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
405 u32 wol = 0; 405 u32 wol = 0;
406 status = ql_mb_wol_mode(qdev, wol); 406 status = ql_mb_wol_mode(qdev, wol);
407 netif_err(qdev, drv, qdev->ndev, "WOL %s (wol code 0x%x)\n", 407 netif_err(qdev, drv, qdev->ndev, "WOL %s (wol code 0x%x)\n",
408 status == 0 ? "cleared sucessfully" : "clear failed", 408 status == 0 ? "cleared successfully" : "clear failed",
409 wol); 409 wol);
410 } 410 }
411 411
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index c26ec5d740f6..fd34f266c0a8 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -3855,7 +3855,7 @@ int ql_wol(struct ql_adapter *qdev)
3855 status = ql_mb_wol_mode(qdev, wol); 3855 status = ql_mb_wol_mode(qdev, wol);
3856 netif_err(qdev, drv, qdev->ndev, 3856 netif_err(qdev, drv, qdev->ndev,
3857 "WOL %s (wol code 0x%x) on %s\n", 3857 "WOL %s (wol code 0x%x) on %s\n",
3858 (status == 0) ? "Sucessfully set" : "Failed", 3858 (status == 0) ? "Successfully set" : "Failed",
3859 wol, qdev->ndev->name); 3859 wol, qdev->ndev->name);
3860 } 3860 }
3861 3861
diff --git a/drivers/net/sfc/regs.h b/drivers/net/sfc/regs.h
index 89d606fe9248..18a3be428348 100644
--- a/drivers/net/sfc/regs.h
+++ b/drivers/net/sfc/regs.h
@@ -95,7 +95,7 @@
95#define FRF_AA_INT_ACK_KER_FIELD_LBN 0 95#define FRF_AA_INT_ACK_KER_FIELD_LBN 0
96#define FRF_AA_INT_ACK_KER_FIELD_WIDTH 32 96#define FRF_AA_INT_ACK_KER_FIELD_WIDTH 32
97 97
98/* INT_ISR0_REG: Function 0 Interrupt Acknowlege Status register */ 98/* INT_ISR0_REG: Function 0 Interrupt Acknowledge Status register */
99#define FR_BZ_INT_ISR0 0x00000090 99#define FR_BZ_INT_ISR0 0x00000090
100#define FRF_BZ_INT_ISR_REG_LBN 0 100#define FRF_BZ_INT_ISR_REG_LBN 0
101#define FRF_BZ_INT_ISR_REG_WIDTH 64 101#define FRF_BZ_INT_ISR_REG_WIDTH 64
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index a85efcfd9d0e..e8387d25f24a 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -557,7 +557,7 @@ static void ess_send_alc_req(struct s_smc *smc)
557 557
558 /* 558 /*
559 * send never allocation request where the requested payload and 559 * send never allocation request where the requested payload and
560 * overhead is zero or deallocate bandwidht when no bandwidth is 560 * overhead is zero or deallocate bandwidth when no bandwidth is
561 * parsed 561 * parsed
562 */ 562 */
563 if (!smc->mib.fddiESSPayload) { 563 if (!smc->mib.fddiESSPayload) {
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index 30110a11d737..34fa10d8ad40 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -1347,7 +1347,7 @@ static int smsc9420_open(struct net_device *dev)
1347 1347
1348 netif_carrier_off(dev); 1348 netif_carrier_off(dev);
1349 1349
1350 /* disable, mask and acknowlege all interrupts */ 1350 /* disable, mask and acknowledge all interrupts */
1351 spin_lock_irqsave(&pd->int_lock, flags); 1351 spin_lock_irqsave(&pd->int_lock, flags);
1352 int_cfg = smsc9420_reg_read(pd, INT_CFG) & (~INT_CFG_IRQ_EN_); 1352 int_cfg = smsc9420_reg_read(pd, INT_CFG) & (~INT_CFG_IRQ_EN_);
1353 smsc9420_reg_write(pd, INT_CFG, int_cfg); 1353 smsc9420_reg_write(pd, INT_CFG, int_cfg);
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 2f8a8c32021e..5ba9d989f8fc 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -474,7 +474,7 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
474 * spider_net_enable_rxchtails - sets RX dmac chain tail addresses 474 * spider_net_enable_rxchtails - sets RX dmac chain tail addresses
475 * @card: card structure 475 * @card: card structure
476 * 476 *
477 * spider_net_enable_rxchtails sets the RX DMAC chain tail adresses in the 477 * spider_net_enable_rxchtails sets the RX DMAC chain tail addresses in the
478 * chip by writing to the appropriate register. DMA is enabled in 478 * chip by writing to the appropriate register. DMA is enabled in
479 * spider_net_enable_rxdmac. 479 * spider_net_enable_rxdmac.
480 */ 480 */
@@ -1820,7 +1820,7 @@ spider_net_enable_card(struct spider_net_card *card)
1820 1820
1821 spider_net_write_reg(card, SPIDER_NET_ECMODE, SPIDER_NET_ECMODE_VALUE); 1821 spider_net_write_reg(card, SPIDER_NET_ECMODE, SPIDER_NET_ECMODE_VALUE);
1822 1822
1823 /* set chain tail adress for RX chains and 1823 /* set chain tail address for RX chains and
1824 * enable DMA */ 1824 * enable DMA */
1825 spider_net_enable_rxchtails(card); 1825 spider_net_enable_rxchtails(card);
1826 spider_net_enable_rxdmac(card); 1826 spider_net_enable_rxdmac(card);
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4344017bfaef..70196bc5fe61 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -782,7 +782,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
782 break; 782 break;
783 783
784 /* When writing back RX descriptor, GEM writes status 784 /* When writing back RX descriptor, GEM writes status
785 * then buffer address, possibly in seperate transactions. 785 * then buffer address, possibly in separate transactions.
786 * If we don't wait for the chip to write both, we could 786 * If we don't wait for the chip to write both, we could
787 * post a new buffer to this descriptor then have GEM spam 787 * post a new buffer to this descriptor then have GEM spam
788 * on the buffer address. We sync on the RX completion 788 * on the buffer address. We sync on the RX completion
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 0c9780217c87..f5493092521a 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -1851,7 +1851,7 @@ static void bdx_tx_push_desc(struct bdx_priv *priv, void *data, int size)
1851 * @data - desc's data 1851 * @data - desc's data
1852 * @size - desc's size 1852 * @size - desc's size
1853 * 1853 *
1854 * NOTE: this func does check for available space and, if neccessary, waits for 1854 * NOTE: this func does check for available space and, if necessary, waits for
1855 * NIC to read existing data before writing new one. 1855 * NIC to read existing data before writing new one.
1856 */ 1856 */
1857static void bdx_tx_push_desc_safe(struct bdx_priv *priv, void *data, int size) 1857static void bdx_tx_push_desc_safe(struct bdx_priv *priv, void *data, int size)
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index 21a01753312a..ee71bcfb3753 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -693,7 +693,7 @@ static netdev_tx_t tms380tr_hardware_send_packet(struct sk_buff *skb,
693 * NOTE: This function should be used whenever the status of any TPL must be 693 * NOTE: This function should be used whenever the status of any TPL must be
694 * modified by the driver, because the compiler may otherwise change the 694 * modified by the driver, because the compiler may otherwise change the
695 * order of instructions such that writing the TPL status may be executed at 695 * order of instructions such that writing the TPL status may be executed at
696 * an undesireable time. When this function is used, the status is always 696 * an undesirable time. When this function is used, the status is always
697 * written when the function is called. 697 * written when the function is called.
698 */ 698 */
699static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status) 699static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status)
@@ -2264,7 +2264,7 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
2264 * This function should be used whenever the status of any RPL must be 2264 * This function should be used whenever the status of any RPL must be
2265 * modified by the driver, because the compiler may otherwise change the 2265 * modified by the driver, because the compiler may otherwise change the
2266 * order of instructions such that writing the RPL status may be executed 2266 * order of instructions such that writing the RPL status may be executed
2267 * at an undesireable time. When this function is used, the status is 2267 * at an undesirable time. When this function is used, the status is
2268 * always written when the function is called. 2268 * always written when the function is called.
2269 */ 2269 */
2270static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status) 2270static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ce1efa4c0b0d..96c39bddc78c 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1437,7 +1437,7 @@ static int tun_chr_close(struct inode *inode, struct file *file)
1437 1437
1438 __tun_detach(tun); 1438 __tun_detach(tun);
1439 1439
1440 /* If desireable, unregister the netdevice. */ 1440 /* If desirable, unregister the netdevice. */
1441 if (!(tun->flags & TUN_PERSIST)) { 1441 if (!(tun->flags & TUN_PERSIST)) {
1442 rtnl_lock(); 1442 rtnl_lock();
1443 if (dev->reg_state == NETREG_REGISTERED) 1443 if (dev->reg_state == NETREG_REGISTERED)
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index e3ddcb8f29df..2fbf15235c05 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -2096,7 +2096,7 @@ typhoon_tx_timeout(struct net_device *dev)
2096 2096
2097 if(typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) { 2097 if(typhoon_reset(tp->ioaddr, WaitNoSleep) < 0) {
2098 netdev_warn(dev, "could not reset in tx timeout\n"); 2098 netdev_warn(dev, "could not reset in tx timeout\n");
2099 goto truely_dead; 2099 goto truly_dead;
2100 } 2100 }
2101 2101
2102 /* If we ever start using the Hi ring, it will need cleaning too */ 2102 /* If we ever start using the Hi ring, it will need cleaning too */
@@ -2105,13 +2105,13 @@ typhoon_tx_timeout(struct net_device *dev)
2105 2105
2106 if(typhoon_start_runtime(tp) < 0) { 2106 if(typhoon_start_runtime(tp) < 0) {
2107 netdev_err(dev, "could not start runtime in tx timeout\n"); 2107 netdev_err(dev, "could not start runtime in tx timeout\n");
2108 goto truely_dead; 2108 goto truly_dead;
2109 } 2109 }
2110 2110
2111 netif_wake_queue(dev); 2111 netif_wake_queue(dev);
2112 return; 2112 return;
2113 2113
2114truely_dead: 2114truly_dead:
2115 /* Reset the hardware, and turn off carrier to avoid more timeouts */ 2115 /* Reset the hardware, and turn off carrier to avoid more timeouts */
2116 typhoon_reset(tp->ioaddr, NoWait); 2116 typhoon_reset(tp->ioaddr, NoWait);
2117 netif_carrier_off(dev); 2117 netif_carrier_off(dev);
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 23a97518bc1f..1b0aef37e495 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -430,7 +430,7 @@ static void hw_add_addr_in_hash(struct ucc_geth_private *ugeth,
430 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num); 430 ucc_fast_get_qe_cr_subblock(ugeth->ug_info->uf_info.ucc_num);
431 431
432 /* Ethernet frames are defined in Little Endian mode, 432 /* Ethernet frames are defined in Little Endian mode,
433 therefor to insert */ 433 therefore to insert */
434 /* the address to the hash (Big Endian mode), we reverse the bytes.*/ 434 /* the address to the hash (Big Endian mode), we reverse the bytes.*/
435 435
436 set_mac_addr(&p_82xx_addr_filt->taddr.h, p_enet_addr); 436 set_mac_addr(&p_82xx_addr_filt->taddr.h, p_enet_addr);
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index b36bf96eb502..f0bd70fb650c 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -811,7 +811,7 @@ static ssize_t cosa_read(struct file *file,
811 cosa_enable_rx(chan); 811 cosa_enable_rx(chan);
812 spin_lock_irqsave(&cosa->lock, flags); 812 spin_lock_irqsave(&cosa->lock, flags);
813 add_wait_queue(&chan->rxwaitq, &wait); 813 add_wait_queue(&chan->rxwaitq, &wait);
814 while(!chan->rx_status) { 814 while (!chan->rx_status) {
815 current->state = TASK_INTERRUPTIBLE; 815 current->state = TASK_INTERRUPTIBLE;
816 spin_unlock_irqrestore(&cosa->lock, flags); 816 spin_unlock_irqrestore(&cosa->lock, flags);
817 schedule(); 817 schedule();
@@ -896,7 +896,7 @@ static ssize_t cosa_write(struct file *file,
896 896
897 spin_lock_irqsave(&cosa->lock, flags); 897 spin_lock_irqsave(&cosa->lock, flags);
898 add_wait_queue(&chan->txwaitq, &wait); 898 add_wait_queue(&chan->txwaitq, &wait);
899 while(!chan->tx_status) { 899 while (!chan->tx_status) {
900 current->state = TASK_INTERRUPTIBLE; 900 current->state = TASK_INTERRUPTIBLE;
901 spin_unlock_irqrestore(&cosa->lock, flags); 901 spin_unlock_irqrestore(&cosa->lock, flags);
902 schedule(); 902 schedule();
@@ -1153,7 +1153,7 @@ static int cosa_ioctl_common(struct cosa_data *cosa,
1153 struct channel_data *channel, unsigned int cmd, unsigned long arg) 1153 struct channel_data *channel, unsigned int cmd, unsigned long arg)
1154{ 1154{
1155 void __user *argp = (void __user *)arg; 1155 void __user *argp = (void __user *)arg;
1156 switch(cmd) { 1156 switch (cmd) {
1157 case COSAIORSET: /* Reset the device */ 1157 case COSAIORSET: /* Reset the device */
1158 if (!capable(CAP_NET_ADMIN)) 1158 if (!capable(CAP_NET_ADMIN))
1159 return -EACCES; 1159 return -EACCES;
@@ -1704,7 +1704,7 @@ static inline void tx_interrupt(struct cosa_data *cosa, int status)
1704 spin_unlock_irqrestore(&cosa->lock, flags); 1704 spin_unlock_irqrestore(&cosa->lock, flags);
1705 return; 1705 return;
1706 } 1706 }
1707 while(1) { 1707 while (1) {
1708 cosa->txchan++; 1708 cosa->txchan++;
1709 i++; 1709 i++;
1710 if (cosa->txchan >= cosa->nchannels) 1710 if (cosa->txchan >= cosa->nchannels)
@@ -2010,7 +2010,7 @@ again:
2010static void debug_status_in(struct cosa_data *cosa, int status) 2010static void debug_status_in(struct cosa_data *cosa, int status)
2011{ 2011{
2012 char *s; 2012 char *s;
2013 switch(status & SR_CMD_FROM_SRP_MASK) { 2013 switch (status & SR_CMD_FROM_SRP_MASK) {
2014 case SR_UP_REQUEST: 2014 case SR_UP_REQUEST:
2015 s = "RX_REQ"; 2015 s = "RX_REQ";
2016 break; 2016 break;
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index f1bff98acd1f..1ceccf1ca6c7 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -141,7 +141,7 @@ static __be16 cisco_type_trans(struct sk_buff *skb, struct net_device *dev)
141 data->address != CISCO_UNICAST) 141 data->address != CISCO_UNICAST)
142 return cpu_to_be16(ETH_P_HDLC); 142 return cpu_to_be16(ETH_P_HDLC);
143 143
144 switch(data->protocol) { 144 switch (data->protocol) {
145 case cpu_to_be16(ETH_P_IP): 145 case cpu_to_be16(ETH_P_IP):
146 case cpu_to_be16(ETH_P_IPX): 146 case cpu_to_be16(ETH_P_IPX):
147 case cpu_to_be16(ETH_P_IPV6): 147 case cpu_to_be16(ETH_P_IPV6):
@@ -190,7 +190,7 @@ static int cisco_rx(struct sk_buff *skb)
190 cisco_data = (struct cisco_packet*)(skb->data + sizeof 190 cisco_data = (struct cisco_packet*)(skb->data + sizeof
191 (struct hdlc_header)); 191 (struct hdlc_header));
192 192
193 switch(ntohl (cisco_data->type)) { 193 switch (ntohl (cisco_data->type)) {
194 case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */ 194 case CISCO_ADDR_REQ: /* Stolen from syncppp.c :-) */
195 in_dev = dev->ip_ptr; 195 in_dev = dev->ip_ptr;
196 addr = 0; 196 addr = 0;
@@ -245,8 +245,8 @@ static int cisco_rx(struct sk_buff *skb)
245 245
246 dev_kfree_skb_any(skb); 246 dev_kfree_skb_any(skb);
247 return NET_RX_SUCCESS; 247 return NET_RX_SUCCESS;
248 } /* switch(keepalive type) */ 248 } /* switch (keepalive type) */
249 } /* switch(protocol) */ 249 } /* switch (protocol) */
250 250
251 printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name, 251 printk(KERN_INFO "%s: Unsupported protocol %x\n", dev->name,
252 ntohs(data->protocol)); 252 ntohs(data->protocol));
diff --git a/drivers/net/wan/hdlc_x25.c b/drivers/net/wan/hdlc_x25.c
index aa9248f8eb1a..6e1ca256effd 100644
--- a/drivers/net/wan/hdlc_x25.c
+++ b/drivers/net/wan/hdlc_x25.c
@@ -202,10 +202,10 @@ static int x25_ioctl(struct net_device *dev, struct ifreq *ifr)
202 return 0; /* return protocol only, no settable parameters */ 202 return 0; /* return protocol only, no settable parameters */
203 203
204 case IF_PROTO_X25: 204 case IF_PROTO_X25:
205 if(!capable(CAP_NET_ADMIN)) 205 if (!capable(CAP_NET_ADMIN))
206 return -EPERM; 206 return -EPERM;
207 207
208 if(dev->flags & IFF_UP) 208 if (dev->flags & IFF_UP)
209 return -EBUSY; 209 return -EBUSY;
210 210
211 result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT); 211 result=hdlc->attach(dev, ENCODING_NRZ,PARITY_CRC16_PR1_CCITT);
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index e803a7dc6502..25c24f0368d8 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -612,7 +612,7 @@ ssize_t i2400m_bm_cmd(struct i2400m *i2400m,
612 goto error_wait_for_ack; 612 goto error_wait_for_ack;
613 } 613 }
614 rx_bytes = result; 614 rx_bytes = result;
615 /* verify the ack and read more if neccessary [result is the 615 /* verify the ack and read more if necessary [result is the
616 * final amount of bytes we get in the ack] */ 616 * final amount of bytes we get in the ack] */
617 result = __i2400m_bm_ack_verify(i2400m, opcode, ack, ack_size, flags); 617 result = __i2400m_bm_ack_verify(i2400m, opcode, ack, ack_size, flags);
618 if (result < 0) 618 if (result < 0)
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h
index 04df9bbe340f..820b128705ec 100644
--- a/drivers/net/wimax/i2400m/i2400m.h
+++ b/drivers/net/wimax/i2400m/i2400m.h
@@ -627,7 +627,7 @@ enum i2400m_bm_cmd_flags {
627 * @I2400M_BRI_NO_REBOOT: Do not reboot the device and proceed 627 * @I2400M_BRI_NO_REBOOT: Do not reboot the device and proceed
628 * directly to wait for a reboot barker from the device. 628 * directly to wait for a reboot barker from the device.
629 * @I2400M_BRI_MAC_REINIT: We need to reinitialize the boot 629 * @I2400M_BRI_MAC_REINIT: We need to reinitialize the boot
630 * rom after reading the MAC adress. This is quite a dirty hack, 630 * rom after reading the MAC address. This is quite a dirty hack,
631 * if you ask me -- the device requires the bootrom to be 631 * if you ask me -- the device requires the bootrom to be
632 * intialized after reading the MAC address. 632 * intialized after reading the MAC address.
633 */ 633 */
diff --git a/drivers/net/wimax/i2400m/sdio.c b/drivers/net/wimax/i2400m/sdio.c
index 76a50ac02ebb..14f876b1358b 100644
--- a/drivers/net/wimax/i2400m/sdio.c
+++ b/drivers/net/wimax/i2400m/sdio.c
@@ -304,7 +304,7 @@ error_kzalloc:
304 * 304 *
305 * The device will be fully reset internally, but won't be 305 * The device will be fully reset internally, but won't be
306 * disconnected from the bus (so no reenumeration will 306 * disconnected from the bus (so no reenumeration will
307 * happen). Firmware upload will be neccessary. 307 * happen). Firmware upload will be necessary.
308 * 308 *
309 * The device will send a reboot barker that will trigger the driver 309 * The device will send a reboot barker that will trigger the driver
310 * to reinitialize the state via __i2400m_dev_reset_handle. 310 * to reinitialize the state via __i2400m_dev_reset_handle.
@@ -314,7 +314,7 @@ error_kzalloc:
314 * 314 *
315 * The device will be fully reset internally, disconnected from the 315 * The device will be fully reset internally, disconnected from the
316 * bus an a reenumeration will happen. Firmware upload will be 316 * bus an a reenumeration will happen. Firmware upload will be
317 * neccessary. Thus, we don't do any locking or struct 317 * necessary. Thus, we don't do any locking or struct
318 * reinitialization, as we are going to be fully disconnected and 318 * reinitialization, as we are going to be fully disconnected and
319 * reenumerated. 319 * reenumerated.
320 * 320 *
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
index 98f4f8c5fb68..99f04c475898 100644
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -246,7 +246,7 @@ error_kzalloc:
246 * 246 *
247 * The device will be fully reset internally, but won't be 247 * The device will be fully reset internally, but won't be
248 * disconnected from the USB bus (so no reenumeration will 248 * disconnected from the USB bus (so no reenumeration will
249 * happen). Firmware upload will be neccessary. 249 * happen). Firmware upload will be necessary.
250 * 250 *
251 * The device will send a reboot barker in the notification endpoint 251 * The device will send a reboot barker in the notification endpoint
252 * that will trigger the driver to reinitialize the state 252 * that will trigger the driver to reinitialize the state
@@ -257,7 +257,7 @@ error_kzalloc:
257 * 257 *
258 * The device will be fully reset internally, disconnected from the 258 * The device will be fully reset internally, disconnected from the
259 * USB bus an a reenumeration will happen. Firmware upload will be 259 * USB bus an a reenumeration will happen. Firmware upload will be
260 * neccessary. Thus, we don't do any locking or struct 260 * necessary. Thus, we don't do any locking or struct
261 * reinitialization, as we are going to be fully disconnected and 261 * reinitialization, as we are going to be fully disconnected and
262 * reenumerated. 262 * reenumerated.
263 * 263 *
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index a6452af9c6c5..08dc42da0f63 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2512,7 +2512,7 @@ void *ar9170_alloc(size_t priv_size)
2512 /* 2512 /*
2513 * this buffer is used for rx stream reconstruction. 2513 * this buffer is used for rx stream reconstruction.
2514 * Under heavy load this device (or the transport layer?) 2514 * Under heavy load this device (or the transport layer?)
2515 * tends to split the streams into seperate rx descriptors. 2515 * tends to split the streams into separate rx descriptors.
2516 */ 2516 */
2517 2517
2518 skb = __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE, GFP_KERNEL); 2518 skb = __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE, GFP_KERNEL);
diff --git a/drivers/net/wireless/iwmc3200wifi/lmac.h b/drivers/net/wireless/iwmc3200wifi/lmac.h
index a3a79b5e2898..a855a99e49b8 100644
--- a/drivers/net/wireless/iwmc3200wifi/lmac.h
+++ b/drivers/net/wireless/iwmc3200wifi/lmac.h
@@ -262,7 +262,7 @@ struct iwm_ct_kill_cfg_cmd {
262 262
263/* Power Management */ 263/* Power Management */
264#define POWER_TABLE_CMD 0x77 264#define POWER_TABLE_CMD 0x77
265#define SAVE_RESTORE_ADRESS_CMD 0x78 265#define SAVE_RESTORE_ADDRESS_CMD 0x78
266#define REPLY_WATERMARK_CMD 0x79 266#define REPLY_WATERMARK_CMD 0x79
267#define PM_DEBUG_STATISTIC_NOTIFIC 0x7B 267#define PM_DEBUG_STATISTIC_NOTIFIC 0x7B
268#define PD_FLUSH_N_NOTIFICATION 0x7C 268#define PD_FLUSH_N_NOTIFICATION 0x7C
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index ee34c137e7cd..9b04964deced 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -368,7 +368,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
368 368
369 /* 369 /*
370 * The encryption key doesn't fit within the CSR cache, 370 * The encryption key doesn't fit within the CSR cache,
371 * this means we should allocate it seperately and use 371 * this means we should allocate it separately and use
372 * rt2x00usb_vendor_request() to send the key to the hardware. 372 * rt2x00usb_vendor_request() to send the key to the hardware.
373 */ 373 */
374 reg = KEY_ENTRY(key->hw_key_idx); 374 reg = KEY_ENTRY(key->hw_key_idx);
@@ -382,7 +382,7 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev,
382 /* 382 /*
383 * The driver does not support the IV/EIV generation 383 * The driver does not support the IV/EIV generation
384 * in hardware. However it demands the data to be provided 384 * in hardware. However it demands the data to be provided
385 * both seperately as well as inside the frame. 385 * both separately as well as inside the frame.
386 * We already provided the CONFIG_CRYPTO_COPY_IV to rt2x00lib 386 * We already provided the CONFIG_CRYPTO_COPY_IV to rt2x00lib
387 * to ensure rt2x00lib will not strip the data from the 387 * to ensure rt2x00lib will not strip the data from the
388 * frame after the copy, now we must tell mac80211 388 * frame after the copy, now we must tell mac80211
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 5e4ee2023fcf..d27d7d5d850c 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -99,7 +99,7 @@ static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev,
99 * There are 2 variations of the rt2870 firmware. 99 * There are 2 variations of the rt2870 firmware.
100 * a) size: 4kb 100 * a) size: 4kb
101 * b) size: 8kb 101 * b) size: 8kb
102 * Note that (b) contains 2 seperate firmware blobs of 4k 102 * Note that (b) contains 2 separate firmware blobs of 4k
103 * within the file. The first blob is the same firmware as (a), 103 * within the file. The first blob is the same firmware as (a),
104 * but the second blob is for the additional chipsets. 104 * but the second blob is for the additional chipsets.
105 */ 105 */
@@ -117,7 +117,7 @@ static int rt2800usb_check_firmware(struct rt2x00_dev *rt2x00dev,
117 117
118 /* 118 /*
119 * 8kb firmware files must be checked as if it were 119 * 8kb firmware files must be checked as if it were
120 * 2 seperate firmware files. 120 * 2 separate firmware files.
121 */ 121 */
122 while (offset < len) { 122 while (offset < len) {
123 if (!rt2800usb_check_crc(data + offset, 4096)) 123 if (!rt2800usb_check_crc(data + offset, 4096))
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 70c04c282efc..28a1c46ec4eb 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -109,7 +109,7 @@ struct rt2x00debug_intf {
109 109
110 /* 110 /*
111 * HW crypto statistics. 111 * HW crypto statistics.
112 * All statistics are stored seperately per cipher type. 112 * All statistics are stored separately per cipher type.
113 */ 113 */
114 struct rt2x00debug_crypto crypto_stats[CIPHER_MAX]; 114 struct rt2x00debug_crypto crypto_stats[CIPHER_MAX];
115 115
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index b93731b79903..dd5ab8fe2321 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -394,7 +394,7 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,
394 /* 394 /*
395 * Hardware might have stripped the IV/EIV/ICV data, 395 * Hardware might have stripped the IV/EIV/ICV data,
396 * in that case it is possible that the data was 396 * in that case it is possible that the data was
397 * provided seperately (through hardware descriptor) 397 * provided separately (through hardware descriptor)
398 * in which case we should reinsert the data into the frame. 398 * in which case we should reinsert the data into the frame.
399 */ 399 */
400 if ((rxdesc.dev_flags & RXDONE_CRYPTO_IV) && 400 if ((rxdesc.dev_flags & RXDONE_CRYPTO_IV) &&
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 0b4801a14601..5b6b789cad3d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -497,7 +497,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
497 /* 497 /*
498 * When hardware encryption is supported, and this frame 498 * When hardware encryption is supported, and this frame
499 * is to be encrypted, we should strip the IV/EIV data from 499 * is to be encrypted, we should strip the IV/EIV data from
500 * the frame so we can provide it to the driver seperately. 500 * the frame so we can provide it to the driver separately.
501 */ 501 */
502 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) && 502 if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc.flags) &&
503 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags)) { 503 !test_bit(ENTRY_TXD_ENCRYPT_IV, &txdesc.flags)) {
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index e2da928dd9f0..177472742172 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -476,7 +476,7 @@ static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
476 * The driver does not support the IV/EIV generation 476 * The driver does not support the IV/EIV generation
477 * in hardware. However it doesn't support the IV/EIV 477 * in hardware. However it doesn't support the IV/EIV
478 * inside the ieee80211 frame either, but requires it 478 * inside the ieee80211 frame either, but requires it
479 * to be provided seperately for the descriptor. 479 * to be provided separately for the descriptor.
480 * rt2x00lib will cut the IV/EIV data out of all frames 480 * rt2x00lib will cut the IV/EIV data out of all frames
481 * given to us by mac80211, but we must tell mac80211 481 * given to us by mac80211, but we must tell mac80211
482 * to generate the IV/EIV data. 482 * to generate the IV/EIV data.
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index f39a8ed17841..e77aec8d0a84 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -339,7 +339,7 @@ static int rt73usb_config_shared_key(struct rt2x00_dev *rt2x00dev,
339 * The driver does not support the IV/EIV generation 339 * The driver does not support the IV/EIV generation
340 * in hardware. However it doesn't support the IV/EIV 340 * in hardware. However it doesn't support the IV/EIV
341 * inside the ieee80211 frame either, but requires it 341 * inside the ieee80211 frame either, but requires it
342 * to be provided seperately for the descriptor. 342 * to be provided separately for the descriptor.
343 * rt2x00lib will cut the IV/EIV data out of all frames 343 * rt2x00lib will cut the IV/EIV data out of all frames
344 * given to us by mac80211, but we must tell mac80211 344 * given to us by mac80211, but we must tell mac80211
345 * to generate the IV/EIV data. 345 * to generate the IV/EIV data.
@@ -439,7 +439,7 @@ static int rt73usb_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
439 * The driver does not support the IV/EIV generation 439 * The driver does not support the IV/EIV generation
440 * in hardware. However it doesn't support the IV/EIV 440 * in hardware. However it doesn't support the IV/EIV
441 * inside the ieee80211 frame either, but requires it 441 * inside the ieee80211 frame either, but requires it
442 * to be provided seperately for the descriptor. 442 * to be provided separately for the descriptor.
443 * rt2x00lib will cut the IV/EIV data out of all frames 443 * rt2x00lib will cut the IV/EIV data out of all frames
444 * given to us by mac80211, but we must tell mac80211 444 * given to us by mac80211, but we must tell mac80211
445 * to generate the IV/EIV data. 445 * to generate the IV/EIV data.
@@ -1661,7 +1661,7 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,
1661 1661
1662 /* 1662 /*
1663 * Hardware has stripped IV/EIV data from 802.11 frame during 1663 * Hardware has stripped IV/EIV data from 802.11 frame during
1664 * decryption. It has provided the data seperately but rt2x00lib 1664 * decryption. It has provided the data separately but rt2x00lib
1665 * should decide if it should be reinserted. 1665 * should decide if it should be reinserted.
1666 */ 1666 */
1667 rxdesc->flags |= RX_FLAG_IV_STRIPPED; 1667 rxdesc->flags |= RX_FLAG_IV_STRIPPED;
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 2d555cc30508..a22a19203120 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -374,7 +374,7 @@ static void zd_mac_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb,
374 * zd_mac_tx_failed - callback for failed frames 374 * zd_mac_tx_failed - callback for failed frames
375 * @dev: the mac80211 wireless device 375 * @dev: the mac80211 wireless device
376 * 376 *
377 * This function is called if a frame couldn't be successfully be 377 * This function is called if a frame couldn't be successfully
378 * transferred. The first frame from the tx queue, will be selected and 378 * transferred. The first frame from the tx queue, will be selected and
379 * reported as error to the upper layers. 379 * reported as error to the upper layers.
380 */ 380 */
diff --git a/drivers/parport/ChangeLog b/drivers/parport/ChangeLog
deleted file mode 100644
index 8565bbbeb6ec..000000000000
--- a/drivers/parport/ChangeLog
+++ /dev/null
@@ -1,583 +0,0 @@
12001-10-11 Tim Waugh <twaugh@redhat.com>
2 * parport_pc.c, parport_serial.c: Support for NetMos cards.
3 + Patch originally from Michael Reinelt <reinelt@eunet.at>.
4
52002-04-25 Tim Waugh <twaugh@redhat.com>
6
7 * parport_serial.c, parport_pc.c: Move some SIIG cards around.
8 Patch from Andrey Panin.
9
102002-01-20 Tim Waugh <twaugh@redhat.com>
11
12 * parport_pc.c (parport_pc_compat_write_block_pio,
13 parport_pc_ecp_write_block_pio, parport_pc_ecp_read_block_pio):
14 Use the default implementations if the caller wants to use
15 O_NONBLOCK.
16
172002-02-25 Tim Waugh <twaugh@redhat.com>
18
19 * parport_pc.c: Make sure that priv->ctr_writable includes IntEn
20 even if IRQ is given as a parameter.
21
222002-01-21 Tim Waugh <twaugh@redhat.com>
23
24 * daisy.c: Apply patch from Max Vorobiev to make parport_daisy_select
25 work for ECP/EPP modes.
26
272002-01-13 Niels Kristian Bech Jensen <nkbj@image.dk>
28
29 * parport_pc.c: Change some occurrences of frob_set_mode to
30 ECR_WRITE. This fixes PLIP.
31
322002-01-04 Tim Waugh <twaugh@redhat.com>
33
34 * share.c (parport_claim_or_block): Sleep interruptibly to prevent
35 a possible deadlock.
36
372001-12-07 Damian Gruszka <damian.gruszka@VisionSystems.de>
38
39 * parport_pc.c (ECR_WRITE): Define. If there are forbidden bits
40 in the ECR register for some chips, this will be a useful place to
41 put that knowledge.
42 (change_mode): Use ECR_WRITE.
43 (parport_pc_restore_state): Likewise.
44 (parport_ECPPS2_supported): Likewise.
45 (parport_ECPEPP_supported): Likewise.
46 (irq_probe_EPP): Likewise.
47 (programmable_irq_support): Likewise.
48 (programmable_dma_support): Likewise.
49 (parport_pc_probe_port): Likewise.
50
51 (frob_set_mode): New function. Set the mode bits of the ECR.
52 (get_fifo_residue): Use frob_set_mode.
53 (parport_pc_ecpepp_read_data): Likewise.
54 (parport_pc_ecpepp_write_data): Likewise.
55 (parport_pc_ecpepp_read_addr): Likewise.
56 (parport_pc_ecpepp_write_addr): Likewise.
57 (parport_pc_compat_write_block_pio): Likewise.
58 (parport_pc_ecp_write_block_pio): Likewise.
59 (parport_ECR_present): Likewise.
60 (parport_ECP_supported): Likewise.
61 (parport_EPP_supported): Likewise.
62 (parport_ECPEPP_supported): Likewise.
63 (programmable_irq_support): Likewise.
64 (irq_probe_ECP): Likewise.
65 (programmable_dma_support): Likewise.
66
67 (parport_pc_enable_irq): Only enable interrupts if we know which
68 IRQ line they will come from.
69 (parport_pc_init_state): Set nErrIntrEn at initialisation.
70 (parport_pc_restore_state): Only write writable bits of CTR.
71 (parport_irq_probe): If no IRQ is found, take ackIntEn out of the
72 writable bit set.
73
742001-12-07 Tim Waugh <twaugh@redhat.com>
75
76 * parport_pc.c (parport_pc_fifo_write_block_pio): Correct typo.
77 (parport_pc_init_state): Only set ackIntEn if we know which IRQ
78 line the interrupts will come from.
79
802001-12-07 Tim Waugh <twaugh@redhat.com>
81
82 * ieee1284_ops.c (parport_ieee1284_epp_write_addr,
83 parport_ieee1284_epp_read_addr): Actually do something useful.
84
852001-12-07 Tim Waugh <twaugh@redhat.com>
86
87 * parport_pc.c (dmaval): Don't use DMA by default. It seems to be
88 too buggy at the moment. Use 'dma=auto' to restore the previous
89 behaviour.
90
912001-12-07 Tim Waugh <twaugh@redhat.com>
92
93 * daisy.c (DEBUG): Undefine.
94
952001-12-06 Tim Waugh <twaugh@redhat.com>
96
97 * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Mask off
98 PARPORT_CONTROL_AUTOFD as well. Bug spotted by Joe
99 <joeja@mindspring.com>.
100
1012001-12-03 Rich Liu <Rich.Liu@ite.com.tw>
102
103 * parport_pc.c (sio_ite_8872_probe): ITE8873 is a single-port
104 serial board, not a serial+parallel.
105
1062001-11-30 Niels Kristian Bech Jensen <nkbj@image.dk>
107
108 * parport_pc.c: Fix compiler warning.
109
1102001-11-14 Tim Waugh <twaugh@redhat.com>
111
112 * parport_pc.c (parport_pc_pci_probe): Hooks for PCI cards before
113 and after probing for ports.
114 * parport_serial.c (parport_register): Likewise.
115
1162001-11-12 Tim Waugh <twaugh@redhat.com>
117
118 * parport_pc.c (init_module): Warn when parameters are ignored.
119
1202001-11-01 Damian Gruszka <damian.gruszka@VisionSystems.de>
121
122 * parport_serial.c (serial_register): Set base_baud before
123 calling register_serial.
124
1252001-10-26 Tim Waugh <twaugh@redhat.com>
126
127 * parport_pc.c (parport_irq_probe): When ECR programmable IRQ
128 support fails, generate interrupts using the FIFO even if we don't
129 want to use the FIFO for real data transfers.
130 (parport_pc_probe_port): Display the ECR address if we have an
131 ECR, not just if we will use the FIFO.
132
1332001-10-24 Dave Strauss <D.Strauss@motorola.com>
134
135 * parport_pc.c (parport_pc_compat_write_block_pio,
136 parport_pc_ecp_write_block_pio): Allow a few seconds for an ECP
137 transfer to finish up.
138
1392001-10-11 Tim Waugh <twaugh@redhat.com>
140
141 * parport_pc (sio_ite_8872_probe): New function, submitted by Rich
142 Liu from ITE. Cleaned up, removed bogus phys_to_virt calls.
143
1442001-10-24 Tim Waugh <twaugh@redhat.com>
145
146 * parport_pc.c: Support for AKS AladdinCARD. Patch from
147 Aladdin Knowledge Systems (Christian Groessler).
148
1492001-10-24 Tim Waugh <twaugh@redhat.com>
150
151 * ieee1284_ops.c (parport_ieee1284_ecp_read_data): Try to minimise
152 turnaround time.
153
154 * ieee1284.c (parport_poll_peripheral): Try a couple of times
155 first without delaying.
156
1572001-10-10 Tim Waugh <twaugh@redhat.com>
158
159 * parport_pc.c: Support for OX16PCI954 PCI card.
160
1612001-10-10 Tim Waugh <twaugh@redhat.com>
162
163 * parport_pc.c: Support for OX12PCI840 PCI card (reported by
164 mk@daveg.com). Lock-ups diagnosed by Ronnie Arosa (and now we
165 just don't trust its ECR).
166
1672001-10-10 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
168
169 * parport_pc.c: Support for AVLAB cards.
170
1712001-10-10 Tim Waugh <twaugh@redhat.com>
172
173 * ieee1284_ops.c (ecp_forward_to_reverse, ecp_reverse_to_forward):
174 Remember to retry direction switch if it fails. Patch from David
175 Lambert.
176
1772001-10-08 David C. Hansen <haveblue@us.ibm.com>
178
179 * share.c: Make driverlist_lock and parportlist_lock static.
180
1812001-10-08 Philip Blundell <philb@gnu.org>
182
183 * parport_pc.c: New modular parameter verbose_logging.
184 Make port->modes indicate the modes that we are prepared to use,
185 rather than the modes that are available.
186
1872001-10-07 Tim Waugh <twaugh@redhat.com>
188
189 * parport_pc.c (parport_pc_probe_port): Fix memory leak spotted by
190 Kipp Cannon.
191
1922001-10-07 Tim Waugh <twaugh@redhat.com>
193
194 * parport_serial.c: Remove NetMos support, since it causes problems
195 for some people.
196
1972001-08-30 Tim Waugh <twaugh@redhat.com>
198
199 * parport_serial.c (parport_serial_pci_probe): Clean-up on partial
200 registration failure.
201
2022001-08-14 Tim Waugh <twaugh@redhat.com>
203
204 * parport_pc.c (parport_pc_init_superio): Allow for more than one
205 SuperIO device. Patch from Rich Lio (ITE).
206
2072001-08-11 Tim Waugh <twaugh@redhat.com>
208
209 * parport_pc.c: Support for Titan Electronics cards.
210
2112001-08-08 Tim Waugh <twaugh@redhat.com>
212
213 * share.c (parport_unregister_device): Remove device from wait list
214 too.
215
2162001-06-20 Tim Waugh <twaugh@redhat.com>
217
218 * parport_pc.c: Make 'io_hi=0' work.
219
2202001-05-31 Tim Waugh <twaugh@redhat.com>
221
222 * parport_serial.c: New file.
223
2242001-06-05 Tim Waugh <twaugh@redhat.com>
225
226 * parport_pc.c (parport_pc_unregister_port): New exported function.
227 Do the opposite of parport_pc_probe_port.
228 (cleanup_module): Use it.
229
2302001-05-22 Juan Quintela <quintela@mandrakesoft.com>
231
232 * parport_amiga.c: Set printk levels.
233 * parport_gsc.c: Likewise.
234 * parport_mfc3.c: Likewise.
235 * parport_pc.c: Likewise.
236 * parport_sunbpp.c: Likewise.
237 * probe.c: Likewise.
238 * share.c: Likewise.
239
2402001-05-10 Fred Barnes <frmb2@ukc.ac.uk>
241
242 * parport_pc.c (parport_pc_epp_read_data): added support for
243 reading from a w91284pic peripheral, flag is PARPORT_W91284PIC.
244
2452001-05-07 Fred Barnes <frmb2@ukc.ac.uk>
246
247 * parport_pc.c (parport_pc_epp_read_data,
248 parport_pc_epp_write_data, parport_pc_epp_read_addr,
249 parport_pc_epp_write_addr): support for fast reads/writes using
250 the PARPORT_EPP_FAST flag.
251
252 * ieee1284.c (parport_read, parport_write): added code to handle
253 software EPP mode (IEEE1284_MODE_EPPSWE). Added code to allow
254 BYTE mode reverse transfers (previously always went for NIBBLE
255 mode).
256
257 * ieee1284_ops.c (parport_ieee1284_epp_read_data,
258 parport_ieee1284_epp_write_data): fixed various polarity problems.
259 Also (theoretically) fixed address versions (.._addr), but no
260 hardware to test this on.
261
262 * parport_pc.h: added parport_dump_state() function for debugging.
263 Needs to have DEBUG_PARPORT to be defined for it to be included.
264
2652001-05-03 Tim Waugh <twaugh@redhat.com>
266
267 * parport_pc.c: Fix the compile problem I introduce from the last
268 change.
269
2702001-04-20 Paul Gortmaker <p_gortmaker@yahoo.com>
271
272 * parport_pc.c: Cut down the size quite a bit (more than 4k off
273 the object, about 1k off the zImage) for the older non-PCI
274 machines which are typically resource starved anyway...
275
2762001-03-26 R Horn <rjh@world.std.com>
277
278 * parport_pc.c: Some commentary changes.
279
2802001-04-19 Tim Waugh <twaugh@redhat.com>
281
282 * parport_pc.c (parport_pc_probe_port): Remove __devinit
283 attribute. Export unconditionally.
284
2852001-04-14 Jeff Garzik <jgarzik@pobox.com>
286
287 Merged: 2001-03-30 Tim Waugh <twaugh@redhat.com>
288
289 * drivers/parport/parport_pc.c: Make Via SuperIO chipsets behave
290 like everything else with respect to irq= and dma= parameters.
291
2922001-04-08 Tim Waugh <twaugh@redhat.com>
293
294 * parport_pc.c (parport_pc_save_state): Read from the soft copy of
295 the control port.
296 (parport_pc_restore_state): Update the soft copy of the control
297 port.
298
2992001-03-26 Tim Waugh <twaugh@redhat.com>
300
301 * share.c (parport_find_number, parport_find_base): Trigger
302 a lowlevel driver load if there are no ports yet.
303
3042001-03-26 Tim Waugh <twaugh@redhat.com>
305
306 * parport_pc.c (parport_ECP_supported): Remove the IRQ conflict
307 check since it seems totally unreliable.
308
3092001-03-02 Tim Waugh <twaugh@redhat.com>
310
311 * ieee1284_ops.c (parport_ieee1284_read_nibble): Reset nAutoFd
312 on timeout. Matches 2.2.x behaviour.
313
3142001-03-02 Andrew Morton
315
316 * parport_pc.c (registered_parport): New static variable.
317 (parport_pc_find_ports): Set it when we register PCI driver.
318 (init_module): Unregister PCI driver if necessary when we
319 fail.
320
3212001-03-02 Tim Waugh <twaugh@redhat.com>
322
323 * ieee1284_ops.c (parport_ieee1284_write_compat): Don't use
324 down_trylock to reset the IRQ count. Don't even use sema_init,
325 because it's not even necessary to reset the count. I can't
326 remember why we ever did.
327
3282001-01-04 Peter Osterlund <peter.osterlund@mailbox.swipnet.se>
329
330 * ieee1284.c (parport_negotiate): Fix missing printk argument.
331
3322001-01-03 Paul Schleger <Paul.Schleger@t-online.de>
333
334 * probe.c (parse_data): Get rid of trailing blanks in values.
335 Needed for XEROX XJ8C printer.
336
3372001-01-03 Tim Waugh <twaugh@redhat.com>
338
339 * parport_pc.c (parport_pc_probe_port): Say something when probes
340 are omitted.
341
3422001-01-03 Tim Waugh <twaugh@redhat.com>
343
344 * parport_pc.c (sio_via_686a_probe): Correct dma=255 fix.
345
3462000-11-21 Tim Waugh <twaugh@redhat.com>
347
348 * parport_pc.c (parport_pc_ecp_write_block_pio): Fix
349 reverse-to-forward logic. Spotted by Roland Kuck
350 <rci@cityweb.de>.
351
3522000-09-16 Cesar Eduardo Barros <cesarb@nitnet.com.br>
353
354 * parport_pc.c (sio_via_686a_probe): Handle case
355 where hardware returns 255 for IRQ or DMA.
356
3572000-07-20 Eddie C. Dost <ecd@skynet.be>
358
359 * share.c (attach_driver_chain): attach[i](port) needs to be
360 replaced by attach[count](port).
361
3622000-07-20 Eddie C. Dost <ecd@skynet.be>
363
364 * daisy.c (add_dev): kmalloc args are in wrong order.
365
3662000-07-12 Tim Waugh <twaugh@redhat.com>
367
368 * share.c: Documentation for parport_{get,port}_port,
369 parport_find_{number,base}.
370
3712000-07-12 Tim Waugh <twaugh@redhat.com>
372
373 * share.c (parport_unregister_device): Remove unneeded locking
374 (test cad==dev).
375 (parport_claim): Likewise.
376 (parport_find_number): New function.
377
3782000-07-12 Tim Waugh <twaugh@redhat.com>
379
380 * share.c (parport_register_port): Hold the parportlist_lock while
381 looking for a free parport number.
382 (parport_register_driver): Make sure that attach can block.
383 (attach_driver_chain): Likewise.
384
3852000-07-12 Tim Waugh <twaugh@redhat.com>
386
387 * share.c (call_driver_chain): Do reference counting things.
388 (parport_get_port): New function.
389 (parport_put_port): New function.
390 (parport_register_port): Initialise reference count to zero.
391 (parport_unregister_port): Check reference count rather than
392 driver list to see if we can free the port.
393
3942000-07-12 Tim Waugh <twaugh@redhat.com>
395
396 * share.c: Clarifications in doc comments.
397
3982000-07-12 Tim Waugh <twaugh@redhat.com>
399
400 * share.c (parport_unregister_port): Fix typo in comment.
401
4022000-07-11 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
403
404 * parport_pc.c: Support for the full range of Timedia cards.
405
4062000-07-08 Tim Waugh <twaugh@redhat.com>
407
408 * daisy.c: License block comments as part of parportbook.
409 * ieee1284.c: Likewise.
410 * share.c: Likewise.
411
4122000-06-30 Petr Vandrovec <vandrove@vc.cvut.cz>
413
414 * procfs.c (do_hardware_modes): Generated string can be up to 34
415 chars long.
416
4172000-06-20 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
418
419 * parport_pc.c (parport_pc_compat_write_block_pio): Warn about
420 change_mode failures.
421 (parport_pc_ecp_write_block_pio): Likewise.
422 (parport_pc_ecp_read_block_pio): Likewise.
423
4242000-06-20 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
425
426 * parport_pc.c (parport_SPP_supported): Warn more about possibly
427 incorrect parameters.
428
4292000-06-15 Tim Waugh <twaugh@redhat.com>
430
431 * parport_pc.c (parport_ECP_supported): Set PARPORT_MODE_COMPAT
432 for ECP ports, since they can all do hardware accelerated
433 compatibility mode (I assume).
434
4352000-06-13 Tim Waugh <twaugh@redhat.com>
436
437 * parport_pc.c (cleanup_module): Remark about possible bugs.
438
4392000-06-13 Tim Waugh <twaugh@redhat.com>
440
441 * procfs.c: Break 'hardware' out into separate files.
442
4432000-05-28 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
444
445 * Fix PCI ID printk for non-superio PCI cards.
446
4472000-05-28 Tim Waugh <twaugh@redhat.com>
448
449 * share.c (call_driver_chain): Get the driverlist_lock.
450 (parport_register_device): Make sure that port->devices always
451 looks consistent.
452 (parport_register_driver): Ensure that parport drivers are given
453 parameters that are valid for the duration of the callback by
454 locking the portlist against changes.
455 (parport_unregister_driver): Likewise.
456 (parport_claim): Don't overwrite flags.
457
4582000-05-28 Tim Waugh <twaugh@redhat.com>
459
460 * daisy.c (assign_addrs): Avoid double-probing daisy-chain devices
461 if the first probe succeeds.
462
4632000-05-16 Tim Waugh <twaugh@redhat.com>
464
465 * share.c (parport_claim): Fix SMP race.
466
4672000-05-15 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
468
469 * parport_pc.c (parport_pc_compat_write_block_pio): Check for
470 timeouts.
471 (parport_pc_ecp_write_block_pio): Likewise.
472 (parport_pc_ecp_read_block_pio): Likewise.
473
4742000-05-02 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
475
476 * parport_pc.c: PCI SYBA patch and verbose PCI detection.
477
4782000-05-02 Gunther Mayer <gunther.mayer@braunschweig.okersurf.de>
479
480 * parport_pc.c (decode_smsc): Fix SMSC 665/666 identification.
481
4822000-04-28 Tim Waugh <twaugh@redhat.com>
483
484 * ieee1284.c: Short function descriptions can't be multiline.
485
486 * daisy.c: Short function descriptions can't be multiline.
487
4882000-04-19 Tim Waugh <twaugh@redhat.com>
489
490 * parport_pc.c (parport_pc_fifo_write_block_dma): Make maxlen
491 calculation a bit clearer.
492
493 * ieee1284.c (parport_negotiate): Turn on data line drivers.
494
495 * ieee1284_ops.c (parport_ieee1284_read_byte): Turn off data line
496 drivers.
497 (parport_ieee1284_write_compat): Turn on data line drivers.
498
499 * daisy.c (assign_addrs): Turn on data line drivers.
500 (cpp_mux): Likewise.
501 (cpp_daisy): Likewise.
502
5032000-04-04 Tim Waugh <twaugh@redhat.com>
504
505 * parport_pc.c: Add support for another PCI card.
506
5072000-04-04 Tim Waugh <twaugh@redhat.com>
508
509 * daisy.c: Documentation in kernel-doc format.
510
511 * ieee1284.c: Likewise.
512
513 * share.c: Likewise.
514
5152000-04-01 Tim Waugh <twaugh@redhat.com>
516
517 * share.c (parport_register_device): Need to hold the module
518 reference counts before sleeping.
519
5202000-03-27 Tim Waugh <twaugh@redhat.com>
521
522 * parport_pc.c (parport_pc_ecp_read_block_pio): Correct operation
523 when peripheral is trying to send data when we stop listening.
524
5252000-03-22 Tim Waugh <twaugh@redhat.com>
526
527 * init.c (parport_setup): Fix return value.
528
5292000-03-21 Tim Waugh <twaugh@redhat.com>
530
531 * parport_pc.c (parport_pc_pci_probe): Fix return value; call
532 pci_enable_device.
533
5342000-03-16 Tim Waugh <twaugh@redhat.com>
535
536 * parport_pc.c (parport_ECP_supported): This seems to trigger on
537 machines that don't have an IRQ conflict; toned down the warning
538 message accordingly.
539
5402000-03-16 Gunther Mayer <gunther.mayer@braunschweig.netsurf.de>
541
542 * parport_pc.c (show_parconfig_smsc37c669): Fix typo.
543 (decode_winbond): More IDs.
544 (winbond_check): Protect against false positives.
545 (winbond_check2): Likewise.
546 (smsc_check): Likewise.
547
5482000-03-15 Tim Waugh <twaugh@redhat.com>
549
550 * parport_pc.c (cleanup_module): Don't call pci_unregister_driver
551 if we didn't call pci_register_driver first.
552
5532000-03-13 Tim Waugh <twaugh@redhat.com>
554
555 * parport_pc.c (parport_pc_init): Moved from asm/parport.h.
556
557 * Config.in: CONFIG_PARPORT_PC_SUPERIO: new option.
558
559 * parport_pc.c (show_parconfig_smsc37c669): Make __devinit.
560 (show_parconfig_winbond): Likewise.
561 (decode_winbond): Likewise.
562 (decode_smsc): Likewise.
563 (winbond_check): Likewise.
564 (winbond_check2): Likewise.
565 (smsc_check): Likewise.
566 (detect_and_report_winbond): Likewise.
567 (detect_and_report_smsc): Likewise.
568 (get_superio_dma): Likewise.
569 (get_superio_irq): Likewise.
570 (parport_pc_find_isa_ports): New function.
571 (parport_pc_find_ports): New function.
572 (init_module): Make superio a config option, not a parameter.
573
5742000-03-10 Tim Waugh <twaugh@redhat.com>
575
576 * parport_pc.c (decode_winbond): Use correct 83877ATF chip ID.
577 (decode_winbond): Fix typo.
578
5792000-03-09 Tim Waugh <twaugh@redhat.com>
580
581 * parport_pc.c: Integrate SuperIO PCI probe with normal PCI card
582 probe, so that the MODULE_DEVICE_TABLE is complete.
583
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 897fa5ccdb78..cb1dd5f4988c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1583,8 +1583,10 @@ void pci_pm_init(struct pci_dev *dev)
1583 int pm; 1583 int pm;
1584 u16 pmc; 1584 u16 pmc;
1585 1585
1586 pm_runtime_forbid(&dev->dev);
1586 device_enable_async_suspend(&dev->dev); 1587 device_enable_async_suspend(&dev->dev);
1587 dev->wakeup_prepared = false; 1588 dev->wakeup_prepared = false;
1589
1588 dev->pm_cap = 0; 1590 dev->pm_cap = 0;
1589 1591
1590 /* find PCI PM capability in list */ 1592 /* find PCI PM capability in list */
@@ -2296,35 +2298,6 @@ void pci_msi_off(struct pci_dev *dev)
2296 } 2298 }
2297} 2299}
2298 2300
2299#ifndef HAVE_ARCH_PCI_SET_DMA_MASK
2300/*
2301 * These can be overridden by arch-specific implementations
2302 */
2303int
2304pci_set_dma_mask(struct pci_dev *dev, u64 mask)
2305{
2306 if (!pci_dma_supported(dev, mask))
2307 return -EIO;
2308
2309 dev->dma_mask = mask;
2310 dev_dbg(&dev->dev, "using %dbit DMA mask\n", fls64(mask));
2311
2312 return 0;
2313}
2314
2315int
2316pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
2317{
2318 if (!pci_dma_supported(dev, mask))
2319 return -EIO;
2320
2321 dev->dev.coherent_dma_mask = mask;
2322 dev_dbg(&dev->dev, "using %dbit consistent DMA mask\n", fls64(mask));
2323
2324 return 0;
2325}
2326#endif
2327
2328#ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE 2301#ifndef HAVE_ARCH_PCI_SET_DMA_MAX_SEGMENT_SIZE
2329int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size) 2302int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size)
2330{ 2303{
@@ -3066,8 +3039,6 @@ EXPORT_SYMBOL(pci_set_mwi);
3066EXPORT_SYMBOL(pci_try_set_mwi); 3039EXPORT_SYMBOL(pci_try_set_mwi);
3067EXPORT_SYMBOL(pci_clear_mwi); 3040EXPORT_SYMBOL(pci_clear_mwi);
3068EXPORT_SYMBOL_GPL(pci_intx); 3041EXPORT_SYMBOL_GPL(pci_intx);
3069EXPORT_SYMBOL(pci_set_dma_mask);
3070EXPORT_SYMBOL(pci_set_consistent_dma_mask);
3071EXPORT_SYMBOL(pci_assign_resource); 3042EXPORT_SYMBOL(pci_assign_resource);
3072EXPORT_SYMBOL(pci_find_parent_resource); 3043EXPORT_SYMBOL(pci_find_parent_resource);
3073EXPORT_SYMBOL(pci_select_bars); 3044EXPORT_SYMBOL(pci_select_bars);
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index de6bc333d299..db79ca61cf96 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -21,11 +21,18 @@
21 21
22#include "sa1111_generic.h" 22#include "sa1111_generic.h"
23 23
24#define IDX_IRQ_S0_READY_NINT (0)
25#define IDX_IRQ_S0_CD_VALID (1)
26#define IDX_IRQ_S0_BVD1_STSCHG (2)
27#define IDX_IRQ_S1_READY_NINT (3)
28#define IDX_IRQ_S1_CD_VALID (4)
29#define IDX_IRQ_S1_BVD1_STSCHG (5)
30
24static struct pcmcia_irqs irqs[] = { 31static struct pcmcia_irqs irqs[] = {
25 { 0, IRQ_S0_CD_VALID, "SA1111 PCMCIA card detect" }, 32 { 0, NO_IRQ, "SA1111 PCMCIA card detect" },
26 { 0, IRQ_S0_BVD1_STSCHG, "SA1111 PCMCIA BVD1" }, 33 { 0, NO_IRQ, "SA1111 PCMCIA BVD1" },
27 { 1, IRQ_S1_CD_VALID, "SA1111 CF card detect" }, 34 { 1, NO_IRQ, "SA1111 CF card detect" },
28 { 1, IRQ_S1_BVD1_STSCHG, "SA1111 CF BVD1" }, 35 { 1, NO_IRQ, "SA1111 CF BVD1" },
29}; 36};
30 37
31static int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt) 38static int sa1111_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
@@ -136,7 +143,9 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
136 s->soc.ops = ops; 143 s->soc.ops = ops;
137 s->soc.socket.owner = ops->owner; 144 s->soc.socket.owner = ops->owner;
138 s->soc.socket.dev.parent = &dev->dev; 145 s->soc.socket.dev.parent = &dev->dev;
139 s->soc.socket.pci_irq = s->soc.nr ? IRQ_S1_READY_NINT : IRQ_S0_READY_NINT; 146 s->soc.socket.pci_irq = s->soc.nr ?
147 dev->irq[IDX_IRQ_S0_READY_NINT] :
148 dev->irq[IDX_IRQ_S1_READY_NINT];
140 s->dev = dev; 149 s->dev = dev;
141 150
142 ret = add(&s->soc); 151 ret = add(&s->soc);
@@ -162,6 +171,12 @@ static int pcmcia_probe(struct sa1111_dev *dev)
162 171
163 base = dev->mapbase; 172 base = dev->mapbase;
164 173
174 /* Initialize PCMCIA IRQs */
175 irqs[0].irq = dev->irq[IDX_IRQ_S0_CD_VALID];
176 irqs[1].irq = dev->irq[IDX_IRQ_S0_BVD1_STSCHG];
177 irqs[2].irq = dev->irq[IDX_IRQ_S1_CD_VALID];
178 irqs[3].irq = dev->irq[IDX_IRQ_S1_BVD1_STSCHG];
179
165 /* 180 /*
166 * Initialise the suspend state. 181 * Initialise the suspend state.
167 */ 182 */
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e7b0c3bcef89..c64e3528889b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1668,7 +1668,7 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv)
1668 * Table of recommended minimum BIOS versions 1668 * Table of recommended minimum BIOS versions
1669 * 1669 *
1670 * Reasons for listing: 1670 * Reasons for listing:
1671 * 1. Stable BIOS, listed because the unknown ammount of 1671 * 1. Stable BIOS, listed because the unknown amount of
1672 * bugs and bad ACPI behaviour on older versions 1672 * bugs and bad ACPI behaviour on older versions
1673 * 1673 *
1674 * 2. BIOS or EC fw with known bugs that trigger on Linux 1674 * 2. BIOS or EC fw with known bugs that trigger on Linux
@@ -7108,7 +7108,7 @@ static struct ibm_struct volume_driver_data = {
7108 * 7108 *
7109 * Fan speed changes of any sort (including those caused by the 7109 * Fan speed changes of any sort (including those caused by the
7110 * disengaged mode) are usually done slowly by the firmware as the 7110 * disengaged mode) are usually done slowly by the firmware as the
7111 * maximum ammount of fan duty cycle change per second seems to be 7111 * maximum amount of fan duty cycle change per second seems to be
7112 * limited. 7112 * limited.
7113 * 7113 *
7114 * Reading is not available if GFAN exists. 7114 * Reading is not available if GFAN exists.
diff --git a/drivers/pps/Kconfig b/drivers/pps/Kconfig
index cc2eb8edb514..1afe4e03440f 100644
--- a/drivers/pps/Kconfig
+++ b/drivers/pps/Kconfig
@@ -30,4 +30,6 @@ config PPS_DEBUG
30 messages to the system log. Select this if you are having a 30 messages to the system log. Select this if you are having a
31 problem with PPS support and want to see more of what is going on. 31 problem with PPS support and want to see more of what is going on.
32 32
33source drivers/pps/clients/Kconfig
34
33endmenu 35endmenu
diff --git a/drivers/pps/Makefile b/drivers/pps/Makefile
index 19ea582f431d..98960ddd3188 100644
--- a/drivers/pps/Makefile
+++ b/drivers/pps/Makefile
@@ -4,5 +4,6 @@
4 4
5pps_core-y := pps.o kapi.o sysfs.o 5pps_core-y := pps.o kapi.o sysfs.o
6obj-$(CONFIG_PPS) := pps_core.o 6obj-$(CONFIG_PPS) := pps_core.o
7obj-y += clients/
7 8
8ccflags-$(CONFIG_PPS_DEBUG) := -DDEBUG 9ccflags-$(CONFIG_PPS_DEBUG) := -DDEBUG
diff --git a/drivers/pps/clients/Kconfig b/drivers/pps/clients/Kconfig
new file mode 100644
index 000000000000..4e801bd7254f
--- /dev/null
+++ b/drivers/pps/clients/Kconfig
@@ -0,0 +1,25 @@
1#
2# PPS clients configuration
3#
4
5if PPS
6
7comment "PPS clients support"
8
9config PPS_CLIENT_KTIMER
10 tristate "Kernel timer client (Testing client, use for debug)"
11 help
12 If you say yes here you get support for a PPS debugging client
13 which uses a kernel timer to generate the PPS signal.
14
15 This driver can also be built as a module. If so, the module
16 will be called pps-ktimer.
17
18config PPS_CLIENT_LDISC
19 tristate "PPS line discipline"
20 depends on PPS
21 help
22 If you say yes here you get support for a PPS source connected
23 with the CD (Carrier Detect) pin of your serial port.
24
25endif
diff --git a/drivers/pps/clients/Makefile b/drivers/pps/clients/Makefile
new file mode 100644
index 000000000000..812c9b19b430
--- /dev/null
+++ b/drivers/pps/clients/Makefile
@@ -0,0 +1,10 @@
1#
2# Makefile for PPS clients.
3#
4
5obj-$(CONFIG_PPS_CLIENT_KTIMER) += pps-ktimer.o
6obj-$(CONFIG_PPS_CLIENT_LDISC) += pps-ldisc.o
7
8ifeq ($(CONFIG_PPS_DEBUG),y)
9EXTRA_CFLAGS += -DDEBUG
10endif
diff --git a/drivers/pps/clients/pps-ktimer.c b/drivers/pps/clients/pps-ktimer.c
new file mode 100644
index 000000000000..e7ef5b8186d0
--- /dev/null
+++ b/drivers/pps/clients/pps-ktimer.c
@@ -0,0 +1,123 @@
1/*
2 * pps-ktimer.c -- kernel timer test client
3 *
4 *
5 * Copyright (C) 2005-2006 Rodolfo Giometti <giometti@linux.it>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22
23#include <linux/kernel.h>
24#include <linux/module.h>
25#include <linux/init.h>
26#include <linux/time.h>
27#include <linux/timer.h>
28#include <linux/pps_kernel.h>
29
30/*
31 * Global variables
32 */
33
34static int source;
35static struct timer_list ktimer;
36
37/*
38 * The kernel timer
39 */
40
41static void pps_ktimer_event(unsigned long ptr)
42{
43 struct timespec __ts;
44 struct pps_ktime ts;
45
46 /* First of all we get the time stamp... */
47 getnstimeofday(&__ts);
48
49 pr_info("PPS event at %lu\n", jiffies);
50
51 /* ... and translate it to PPS time data struct */
52 ts.sec = __ts.tv_sec;
53 ts.nsec = __ts.tv_nsec;
54
55 pps_event(source, &ts, PPS_CAPTUREASSERT, NULL);
56
57 mod_timer(&ktimer, jiffies + HZ);
58}
59
60/*
61 * The echo function
62 */
63
64static void pps_ktimer_echo(int source, int event, void *data)
65{
66 pr_info("echo %s %s for source %d\n",
67 event & PPS_CAPTUREASSERT ? "assert" : "",
68 event & PPS_CAPTURECLEAR ? "clear" : "",
69 source);
70}
71
72/*
73 * The PPS info struct
74 */
75
76static struct pps_source_info pps_ktimer_info = {
77 .name = "ktimer",
78 .path = "",
79 .mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT |
80 PPS_ECHOASSERT |
81 PPS_CANWAIT | PPS_TSFMT_TSPEC,
82 .echo = pps_ktimer_echo,
83 .owner = THIS_MODULE,
84};
85
86/*
87 * Module staff
88 */
89
90static void __exit pps_ktimer_exit(void)
91{
92 del_timer_sync(&ktimer);
93 pps_unregister_source(source);
94
95 pr_info("ktimer PPS source unregistered\n");
96}
97
98static int __init pps_ktimer_init(void)
99{
100 int ret;
101
102 ret = pps_register_source(&pps_ktimer_info,
103 PPS_CAPTUREASSERT | PPS_OFFSETASSERT);
104 if (ret < 0) {
105 printk(KERN_ERR "cannot register ktimer source\n");
106 return ret;
107 }
108 source = ret;
109
110 setup_timer(&ktimer, pps_ktimer_event, 0);
111 mod_timer(&ktimer, jiffies + HZ);
112
113 pr_info("ktimer PPS source registered at %d\n", source);
114
115 return 0;
116}
117
118module_init(pps_ktimer_init);
119module_exit(pps_ktimer_exit);
120
121MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
122MODULE_DESCRIPTION("dummy PPS source by using a kernel timer (just for debug)");
123MODULE_LICENSE("GPL");
diff --git a/drivers/pps/clients/pps-ldisc.c b/drivers/pps/clients/pps-ldisc.c
new file mode 100644
index 000000000000..8e1932d29fd4
--- /dev/null
+++ b/drivers/pps/clients/pps-ldisc.c
@@ -0,0 +1,154 @@
1/*
2 * pps-ldisc.c -- PPS line discipline
3 *
4 *
5 * Copyright (C) 2008 Rodolfo Giometti <giometti@linux.it>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#include <linux/module.h>
23#include <linux/serial_core.h>
24#include <linux/tty.h>
25#include <linux/pps_kernel.h>
26
27#define PPS_TTY_MAGIC 0x0001
28
29static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status,
30 struct timespec *ts)
31{
32 int id = (long)tty->disc_data;
33 struct timespec __ts;
34 struct pps_ktime pps_ts;
35
36 /* First of all we get the time stamp... */
37 getnstimeofday(&__ts);
38
39 /* Does caller give us a timestamp? */
40 if (ts) { /* Yes. Let's use it! */
41 pps_ts.sec = ts->tv_sec;
42 pps_ts.nsec = ts->tv_nsec;
43 } else { /* No. Do it ourself! */
44 pps_ts.sec = __ts.tv_sec;
45 pps_ts.nsec = __ts.tv_nsec;
46 }
47
48 /* Now do the PPS event report */
49 pps_event(id, &pps_ts, status ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR,
50 NULL);
51
52 pr_debug("PPS %s at %lu on source #%d\n",
53 status ? "assert" : "clear", jiffies, id);
54}
55
56static int (*alias_n_tty_open)(struct tty_struct *tty);
57
58static int pps_tty_open(struct tty_struct *tty)
59{
60 struct pps_source_info info;
61 struct tty_driver *drv = tty->driver;
62 int index = tty->index + drv->name_base;
63 int ret;
64
65 info.owner = THIS_MODULE;
66 info.dev = NULL;
67 snprintf(info.name, PPS_MAX_NAME_LEN, "%s%d", drv->driver_name, index);
68 snprintf(info.path, PPS_MAX_NAME_LEN, "/dev/%s%d", drv->name, index);
69 info.mode = PPS_CAPTUREBOTH | \
70 PPS_OFFSETASSERT | PPS_OFFSETCLEAR | \
71 PPS_CANWAIT | PPS_TSFMT_TSPEC;
72
73 ret = pps_register_source(&info, PPS_CAPTUREBOTH | \
74 PPS_OFFSETASSERT | PPS_OFFSETCLEAR);
75 if (ret < 0) {
76 pr_err("cannot register PPS source \"%s\"\n", info.path);
77 return ret;
78 }
79 tty->disc_data = (void *)(long)ret;
80
81 /* Should open N_TTY ldisc too */
82 ret = alias_n_tty_open(tty);
83 if (ret < 0)
84 pps_unregister_source((long)tty->disc_data);
85
86 pr_info("PPS source #%d \"%s\" added\n", ret, info.path);
87
88 return 0;
89}
90
91static void (*alias_n_tty_close)(struct tty_struct *tty);
92
93static void pps_tty_close(struct tty_struct *tty)
94{
95 int id = (long)tty->disc_data;
96
97 pps_unregister_source(id);
98 alias_n_tty_close(tty);
99
100 pr_info("PPS source #%d removed\n", id);
101}
102
103static struct tty_ldisc_ops pps_ldisc_ops;
104
105/*
106 * Module stuff
107 */
108
109static int __init pps_tty_init(void)
110{
111 int err;
112
113 /* Inherit the N_TTY's ops */
114 n_tty_inherit_ops(&pps_ldisc_ops);
115
116 /* Save N_TTY's open()/close() methods */
117 alias_n_tty_open = pps_ldisc_ops.open;
118 alias_n_tty_close = pps_ldisc_ops.close;
119
120 /* Init PPS_TTY data */
121 pps_ldisc_ops.owner = THIS_MODULE;
122 pps_ldisc_ops.magic = PPS_TTY_MAGIC;
123 pps_ldisc_ops.name = "pps_tty";
124 pps_ldisc_ops.dcd_change = pps_tty_dcd_change;
125 pps_ldisc_ops.open = pps_tty_open;
126 pps_ldisc_ops.close = pps_tty_close;
127
128 err = tty_register_ldisc(N_PPS, &pps_ldisc_ops);
129 if (err)
130 pr_err("can't register PPS line discipline\n");
131 else
132 pr_info("PPS line discipline registered\n");
133
134 return err;
135}
136
137static void __exit pps_tty_cleanup(void)
138{
139 int err;
140
141 err = tty_unregister_ldisc(N_PPS);
142 if (err)
143 pr_err("can't unregister PPS line discipline\n");
144 else
145 pr_info("PPS line discipline removed\n");
146}
147
148module_init(pps_tty_init);
149module_exit(pps_tty_cleanup);
150
151MODULE_ALIAS_LDISC(N_PPS);
152MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
153MODULE_DESCRIPTION("PPS TTY device driver");
154MODULE_LICENSE("GPL");
diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index 33c0e98243ee..bc90b091f195 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -22,48 +22,57 @@
22 * the best guess is to add 0.5s. 22 * the best guess is to add 0.5s.
23 */ 23 */
24 24
25int rtc_hctosys_ret = -ENODEV;
26
25static int __init rtc_hctosys(void) 27static int __init rtc_hctosys(void)
26{ 28{
27 int err; 29 int err = -ENODEV;
28 struct rtc_time tm; 30 struct rtc_time tm;
31 struct timespec tv = {
32 .tv_nsec = NSEC_PER_SEC >> 1,
33 };
29 struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); 34 struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
30 35
31 if (rtc == NULL) { 36 if (rtc == NULL) {
32 printk("%s: unable to open rtc device (%s)\n", 37 pr_err("%s: unable to open rtc device (%s)\n",
33 __FILE__, CONFIG_RTC_HCTOSYS_DEVICE); 38 __FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
34 return -ENODEV; 39 goto err_open;
35 } 40 }
36 41
37 err = rtc_read_time(rtc, &tm); 42 err = rtc_read_time(rtc, &tm);
38 if (err == 0) { 43 if (err) {
39 err = rtc_valid_tm(&tm); 44 dev_err(rtc->dev.parent,
40 if (err == 0) { 45 "hctosys: unable to read the hardware clock\n");
41 struct timespec tv; 46 goto err_read;
42 47
43 tv.tv_nsec = NSEC_PER_SEC >> 1; 48 }
44 49
45 rtc_tm_to_time(&tm, &tv.tv_sec); 50 err = rtc_valid_tm(&tm);
51 if (err) {
52 dev_err(rtc->dev.parent,
53 "hctosys: invalid date/time\n");
54 goto err_invalid;
55 }
46 56
47 do_settimeofday(&tv); 57 rtc_tm_to_time(&tm, &tv.tv_sec);
48 58
49 dev_info(rtc->dev.parent, 59 do_settimeofday(&tv);
50 "setting system clock to "
51 "%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
52 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
53 tm.tm_hour, tm.tm_min, tm.tm_sec,
54 (unsigned int) tv.tv_sec);
55 }
56 else
57 dev_err(rtc->dev.parent,
58 "hctosys: invalid date/time\n");
59 }
60 else
61 dev_err(rtc->dev.parent,
62 "hctosys: unable to read the hardware clock\n");
63 60
61 dev_info(rtc->dev.parent,
62 "setting system clock to "
63 "%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
64 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
65 tm.tm_hour, tm.tm_min, tm.tm_sec,
66 (unsigned int) tv.tv_sec);
67
68err_invalid:
69err_read:
64 rtc_class_close(rtc); 70 rtc_class_close(rtc);
65 71
66 return 0; 72err_open:
73 rtc_hctosys_ret = err;
74
75 return err;
67} 76}
68 77
69late_initcall(rtc_hctosys); 78late_initcall(rtc_hctosys);
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 7dd23a6fc825..380083ca572f 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -107,8 +107,9 @@ rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
107 char *buf) 107 char *buf)
108{ 108{
109#ifdef CONFIG_RTC_HCTOSYS_DEVICE 109#ifdef CONFIG_RTC_HCTOSYS_DEVICE
110 if (strcmp(dev_name(&to_rtc_device(dev)->dev), 110 if (rtc_hctosys_ret == 0 &&
111 CONFIG_RTC_HCTOSYS_DEVICE) == 0) 111 strcmp(dev_name(&to_rtc_device(dev)->dev),
112 CONFIG_RTC_HCTOSYS_DEVICE) == 0)
112 return sprintf(buf, "1\n"); 113 return sprintf(buf, "1\n");
113 else 114 else
114#endif 115#endif
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 62ddf5202b79..2a4c566456e7 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -373,7 +373,7 @@ raw3270_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
373 rq->rc = ccw_device_start(rp->cdev, &rq->ccw, 373 rq->rc = ccw_device_start(rp->cdev, &rq->ccw,
374 (unsigned long) rq, 0, 0); 374 (unsigned long) rq, 0, 0);
375 if (rq->rc == 0) 375 if (rq->rc == 0)
376 return; /* Sucessfully restarted. */ 376 return; /* Successfully restarted. */
377 break; 377 break;
378 case RAW3270_IO_STOP: 378 case RAW3270_IO_STOP:
379 if (!rq) 379 if (!rq)
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index ec88c59842e3..f6d72e1f2a38 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -196,7 +196,7 @@ __sclp_start_request(struct sclp_req *req)
196 req->start_count++; 196 req->start_count++;
197 197
198 if (rc == 0) { 198 if (rc == 0) {
199 /* Sucessfully started request */ 199 /* Successfully started request */
200 req->status = SCLP_REQ_RUNNING; 200 req->status = SCLP_REQ_RUNNING;
201 sclp_running_state = sclp_running_state_running; 201 sclp_running_state = sclp_running_state_running;
202 __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ, 202 __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ,
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 208d6df9ed59..ff5716d5f044 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -492,7 +492,7 @@ static void init_alloc_map(struct orc_host * host)
492 * init_orchid - initialise the host adapter 492 * init_orchid - initialise the host adapter
493 * @host:host adapter to initialise 493 * @host:host adapter to initialise
494 * 494 *
495 * Initialise the controller and if neccessary load the firmware. 495 * Initialise the controller and if necessary load the firmware.
496 * 496 *
497 * Returns -1 if the initialisation fails. 497 * Returns -1 if the initialisation fails.
498 */ 498 */
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 89a59484be02..a7714160fbc3 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -531,7 +531,7 @@ static void initio_read_eeprom(unsigned long base)
531 * initio_stop_bm - stop bus master 531 * initio_stop_bm - stop bus master
532 * @host: InitIO we are stopping 532 * @host: InitIO we are stopping
533 * 533 *
534 * Stop any pending DMA operation, aborting the DMA if neccessary 534 * Stop any pending DMA operation, aborting the DMA if necessary
535 */ 535 */
536 536
537static void initio_stop_bm(struct initio_host * host) 537static void initio_stop_bm(struct initio_host * host)
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index 6fde2fabfd9b..774e7ac837a5 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -48,7 +48,7 @@ struct kmem_cache *scsi_pkt_cachep;
48#define FC_SRB_CMD_SENT (1 << 0) /* cmd has been sent */ 48#define FC_SRB_CMD_SENT (1 << 0) /* cmd has been sent */
49#define FC_SRB_RCV_STATUS (1 << 1) /* response has arrived */ 49#define FC_SRB_RCV_STATUS (1 << 1) /* response has arrived */
50#define FC_SRB_ABORT_PENDING (1 << 2) /* cmd abort sent to device */ 50#define FC_SRB_ABORT_PENDING (1 << 2) /* cmd abort sent to device */
51#define FC_SRB_ABORTED (1 << 3) /* abort acknowleged */ 51#define FC_SRB_ABORTED (1 << 3) /* abort acknowledged */
52#define FC_SRB_DISCONTIG (1 << 4) /* non-sequential data recvd */ 52#define FC_SRB_DISCONTIG (1 << 4) /* non-sequential data recvd */
53#define FC_SRB_COMPL (1 << 5) /* fc_io_compl has been run */ 53#define FC_SRB_COMPL (1 << 5) /* fc_io_compl has been run */
54#define FC_SRB_FCP_PROCESSING_TMO (1 << 6) /* timer function processing */ 54#define FC_SRB_FCP_PROCESSING_TMO (1 << 6) /* timer function processing */
@@ -519,7 +519,7 @@ crc_err:
519 * 519 *
520 * Called after receiving a Transfer Ready data descriptor. 520 * Called after receiving a Transfer Ready data descriptor.
521 * If the LLD is capable of sequence offload then send down the 521 * If the LLD is capable of sequence offload then send down the
522 * seq_blen ammount of data in single frame, otherwise send 522 * seq_blen amount of data in single frame, otherwise send
523 * multiple frames of the maximum frame payload supported by 523 * multiple frames of the maximum frame payload supported by
524 * the target port. 524 * the target port.
525 */ 525 */
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 08b6634cb994..2a40a6eabf4d 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -981,7 +981,7 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
981 * function returns, it does not guarantee all the IOCBs are actually aborted. 981 * function returns, it does not guarantee all the IOCBs are actually aborted.
982 * 982 *
983 * Return code 983 * Return code
984 * 0 - Sucessfully issued abort iocb on all outstanding flogis (Always 0) 984 * 0 - Successfully issued abort iocb on all outstanding flogis (Always 0)
985 **/ 985 **/
986int 986int
987lpfc_els_abort_flogi(struct lpfc_hba *phba) 987lpfc_els_abort_flogi(struct lpfc_hba *phba)
@@ -3129,7 +3129,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3129 if (ndlp && NLP_CHK_NODE_ACT(ndlp) && 3129 if (ndlp && NLP_CHK_NODE_ACT(ndlp) &&
3130 (*((uint32_t *) (pcmd)) == ELS_CMD_LS_RJT)) { 3130 (*((uint32_t *) (pcmd)) == ELS_CMD_LS_RJT)) {
3131 /* A LS_RJT associated with Default RPI cleanup has its own 3131 /* A LS_RJT associated with Default RPI cleanup has its own
3132 * seperate code path. 3132 * separate code path.
3133 */ 3133 */
3134 if (!(ndlp->nlp_flag & NLP_RM_DFLT_RPI)) 3134 if (!(ndlp->nlp_flag & NLP_RM_DFLT_RPI))
3135 ls_rjt = 1; 3135 ls_rjt = 1;
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 7f21b47db791..483fb74bc592 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -1575,7 +1575,7 @@ lpfc_bg_scsi_prep_dma_buf(struct lpfc_hba *phba,
1575 case LPFC_PG_TYPE_NO_DIF: 1575 case LPFC_PG_TYPE_NO_DIF:
1576 num_bde = lpfc_bg_setup_bpl(phba, scsi_cmnd, bpl, 1576 num_bde = lpfc_bg_setup_bpl(phba, scsi_cmnd, bpl,
1577 datasegcnt); 1577 datasegcnt);
1578 /* we shoud have 2 or more entries in buffer list */ 1578 /* we should have 2 or more entries in buffer list */
1579 if (num_bde < 2) 1579 if (num_bde < 2)
1580 goto err; 1580 goto err;
1581 break; 1581 break;
@@ -1612,7 +1612,7 @@ lpfc_bg_scsi_prep_dma_buf(struct lpfc_hba *phba,
1612 1612
1613 num_bde = lpfc_bg_setup_bpl_prot(phba, scsi_cmnd, bpl, 1613 num_bde = lpfc_bg_setup_bpl_prot(phba, scsi_cmnd, bpl,
1614 datasegcnt, protsegcnt); 1614 datasegcnt, protsegcnt);
1615 /* we shoud have 3 or more entries in buffer list */ 1615 /* we should have 3 or more entries in buffer list */
1616 if (num_bde < 3) 1616 if (num_bde < 3)
1617 goto err; 1617 goto err;
1618 break; 1618 break;
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 7db28cd49446..8c61a4fe1db9 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -187,7 +187,7 @@
187#define S_IO BIT(1) /* Input/Output line from SCSI bus */ 187#define S_IO BIT(1) /* Input/Output line from SCSI bus */
188#define S_CD BIT(2) /* Command/Data line from SCSI bus */ 188#define S_CD BIT(2) /* Command/Data line from SCSI bus */
189#define S_BUSY BIT(3) /* Busy line from SCSI bus */ 189#define S_BUSY BIT(3) /* Busy line from SCSI bus */
190#define S_ACK BIT(4) /* Acknowlege line from SCSI bus */ 190#define S_ACK BIT(4) /* Acknowledge line from SCSI bus */
191#define S_REQUEST BIT(5) /* Request line from SCSI bus */ 191#define S_REQUEST BIT(5) /* Request line from SCSI bus */
192#define S_SELECT BIT(6) /* */ 192#define S_SELECT BIT(6) /* */
193#define S_ATN BIT(7) /* */ 193#define S_ATN BIT(7) /* */
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 9b44c6f1b10e..7985ae45d688 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -2924,7 +2924,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb)
2924 break; 2924 break;
2925 default: 2925 default:
2926 PM8001_MSG_DBG(pm8001_ha, 2926 PM8001_MSG_DBG(pm8001_ha,
2927 pm8001_printk("unkown device type(%x)\n", deviceType)); 2927 pm8001_printk("unknown device type(%x)\n", deviceType));
2928 break; 2928 break;
2929 } 2929 }
2930 phy->phy_type |= PORT_TYPE_SAS; 2930 phy->phy_type |= PORT_TYPE_SAS;
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 7f9c83a76390..3b2c98fba834 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -600,7 +600,7 @@ static void pm8001_free_dev(struct pm8001_device *pm8001_dev)
600 * by the command "OPC_INB_REG_DEV", after that the HBA will assign a 600 * by the command "OPC_INB_REG_DEV", after that the HBA will assign a
601 * device ID(according to device's sas address) and returned it to LLDD. From 601 * device ID(according to device's sas address) and returned it to LLDD. From
602 * now on, we communicate with HBA FW with the device ID which HBA assigned 602 * now on, we communicate with HBA FW with the device ID which HBA assigned
603 * rather than sas address. it is the neccessary step for our HBA but it is 603 * rather than sas address. it is the necessary step for our HBA but it is
604 * the optional for other HBA driver. 604 * the optional for other HBA driver.
605 */ 605 */
606static int pm8001_dev_found_notify(struct domain_device *dev) 606static int pm8001_dev_found_notify(struct domain_device *dev)
diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h
index 92f89d50850c..b8ad07c3449e 100644
--- a/drivers/scsi/pmcraid.h
+++ b/drivers/scsi/pmcraid.h
@@ -938,7 +938,7 @@ static struct pmcraid_ioasc_error pmcraid_ioasc_error_table[] = {
938 938
939/* 939/*
940 * pmcraid_ioctl_header - definition of header structure that preceeds all the 940 * pmcraid_ioctl_header - definition of header structure that preceeds all the
941 * buffers given as ioctl arguements. 941 * buffers given as ioctl arguments.
942 * 942 *
943 * .signature : always ASCII string, "PMCRAID" 943 * .signature : always ASCII string, "PMCRAID"
944 * .reserved : not used 944 * .reserved : not used
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 1dd4d8407694..83881dfb33c0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2111,7 +2111,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
2111 * which is followed by sdaaa. 2111 * which is followed by sdaaa.
2112 * 2112 *
2113 * This is basically 26 base counting with one extra 'nil' entry 2113 * This is basically 26 base counting with one extra 'nil' entry
2114 * at the beggining from the second digit on and can be 2114 * at the beginning from the second digit on and can be
2115 * determined using similar method as 26 base conversion with the 2115 * determined using similar method as 26 base conversion with the
2116 * index shifted -1 after each digit is computed. 2116 * index shifted -1 after each digit is computed.
2117 * 2117 *
diff --git a/drivers/scsi/ses.c b/drivers/scsi/ses.c
index 1d7a8780e00c..0d9d6f7567f5 100644
--- a/drivers/scsi/ses.c
+++ b/drivers/scsi/ses.c
@@ -595,8 +595,6 @@ static int ses_intf_add(struct device *cdev,
595 ses_dev->page10_len = len; 595 ses_dev->page10_len = len;
596 buf = NULL; 596 buf = NULL;
597 } 597 }
598 kfree(hdr_buf);
599
600 scomp = kzalloc(sizeof(struct ses_component) * components, GFP_KERNEL); 598 scomp = kzalloc(sizeof(struct ses_component) * components, GFP_KERNEL);
601 if (!scomp) 599 if (!scomp)
602 goto err_free; 600 goto err_free;
@@ -608,6 +606,8 @@ static int ses_intf_add(struct device *cdev,
608 goto err_free; 606 goto err_free;
609 } 607 }
610 608
609 kfree(hdr_buf);
610
611 edev->scratch = ses_dev; 611 edev->scratch = ses_dev;
612 for (i = 0; i < components; i++) 612 for (i = 0; i < components; i++)
613 edev->component[i].scratch = scomp + i; 613 edev->component[i].scratch = scomp + i;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 7c4ebe6ee18b..c3db16b7afa1 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2408,6 +2408,21 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
2408} 2408}
2409 2409
2410static void 2410static void
2411serial8250_set_ldisc(struct uart_port *port)
2412{
2413 int line = port->line;
2414
2415 if (line >= port->state->port.tty->driver->num)
2416 return;
2417
2418 if (port->state->port.tty->ldisc->ops->num == N_PPS) {
2419 port->flags |= UPF_HARDPPS_CD;
2420 serial8250_enable_ms(port);
2421 } else
2422 port->flags &= ~UPF_HARDPPS_CD;
2423}
2424
2425static void
2411serial8250_pm(struct uart_port *port, unsigned int state, 2426serial8250_pm(struct uart_port *port, unsigned int state,
2412 unsigned int oldstate) 2427 unsigned int oldstate)
2413{ 2428{
@@ -2628,6 +2643,7 @@ static struct uart_ops serial8250_pops = {
2628 .startup = serial8250_startup, 2643 .startup = serial8250_startup,
2629 .shutdown = serial8250_shutdown, 2644 .shutdown = serial8250_shutdown,
2630 .set_termios = serial8250_set_termios, 2645 .set_termios = serial8250_set_termios,
2646 .set_ldisc = serial8250_set_ldisc,
2631 .pm = serial8250_pm, 2647 .pm = serial8250_pm,
2632 .type = serial8250_type, 2648 .type = serial8250_type,
2633 .release_port = serial8250_release_port, 2649 .release_port = serial8250_release_port,
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index d6ff73395623..f55c49475a8c 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -447,7 +447,7 @@ config SERIAL_CLPS711X_CONSOLE
447 447
448config SERIAL_SAMSUNG 448config SERIAL_SAMSUNG
449 tristate "Samsung SoC serial support" 449 tristate "Samsung SoC serial support"
450 depends on ARM && PLAT_S3C 450 depends on ARM && PLAT_SAMSUNG
451 select SERIAL_CORE 451 select SERIAL_CORE
452 help 452 help
453 Support for the on-chip UARTs on the Samsung S3C24XX series CPUs, 453 Support for the on-chip UARTs on the Samsung S3C24XX series CPUs,
@@ -455,11 +455,18 @@ config SERIAL_SAMSUNG
455 provide all of these ports, depending on how the serial port 455 provide all of these ports, depending on how the serial port
456 pins are configured. 456 pins are configured.
457 457
458config SERIAL_SAMSUNG_UARTS_4
459 bool
460 depends on ARM && PLAT_SAMSUNG
461 default y if CPU_S3C2443
462 help
463 Internal node for the common case of 4 Samsung compatible UARTs
464
458config SERIAL_SAMSUNG_UARTS 465config SERIAL_SAMSUNG_UARTS
459 int 466 int
460 depends on ARM && PLAT_S3C 467 depends on ARM && PLAT_SAMSUNG
461 default 2 if ARCH_S3C2400 468 default 2 if ARCH_S3C2400
462 default 4 if ARCH_S5PC1XX || ARCH_S3C64XX || CPU_S3C2443 469 default 4 if SERIAL_SAMSUNG_UARTS_4
463 default 3 470 default 3
464 help 471 help
465 Select the number of available UART ports for the Samsung S3C 472 Select the number of available UART ports for the Samsung S3C
@@ -526,20 +533,30 @@ config SERIAL_S3C24A0
526 Serial port support for the Samsung S3C24A0 SoC 533 Serial port support for the Samsung S3C24A0 SoC
527 534
528config SERIAL_S3C6400 535config SERIAL_S3C6400
529 tristate "Samsung S3C6400/S3C6410 Serial port support" 536 tristate "Samsung S3C6400/S3C6410/S5P6440 Seria port support"
530 depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410) 537 depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440)
538 select SERIAL_SAMSUNG_UARTS_4
531 default y 539 default y
532 help 540 help
533 Serial port support for the Samsung S3C6400 and S3C6410 541 Serial port support for the Samsung S3C6400, S3C6410 and S5P6440
534 SoCs 542 SoCs
535 543
536config SERIAL_S5PC100 544config SERIAL_S5PC100
537 tristate "Samsung S5PC100 Serial port support" 545 tristate "Samsung S5PC100 Serial port support"
538 depends on SERIAL_SAMSUNG && CPU_S5PC100 546 depends on SERIAL_SAMSUNG && CPU_S5PC100
547 select SERIAL_SAMSUNG_UARTS_4
539 default y 548 default y
540 help 549 help
541 Serial port support for the Samsung S5PC100 SoCs 550 Serial port support for the Samsung S5PC100 SoCs
542 551
552config SERIAL_S5PV210
553 tristate "Samsung S5PV210 Serial port support"
554 depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_S5P6442)
555 select SERIAL_SAMSUNG_UARTS_4 if CPU_S5PV210
556 default y
557 help
558 Serial port support for Samsung's S5P Family of SoC's
559
543config SERIAL_MAX3100 560config SERIAL_MAX3100
544 tristate "MAX3100 support" 561 tristate "MAX3100 support"
545 depends on SPI 562 depends on SPI
@@ -996,7 +1013,7 @@ config SERIAL_IP22_ZILOG_CONSOLE
996 1013
997config SERIAL_SH_SCI 1014config SERIAL_SH_SCI
998 tristate "SuperH SCI(F) serial port support" 1015 tristate "SuperH SCI(F) serial port support"
999 depends on HAVE_CLK && (SUPERH || H8300) 1016 depends on HAVE_CLK && (SUPERH || H8300 || ARCH_SHMOBILE)
1000 select SERIAL_CORE 1017 select SERIAL_CORE
1001 1018
1002config SERIAL_SH_SCI_NR_UARTS 1019config SERIAL_SH_SCI_NR_UARTS
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 5548fe7df61d..6aa4723b74ee 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o
45obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o 45obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
46obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o 46obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
47obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o 47obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
48obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o
48obj-$(CONFIG_SERIAL_MAX3100) += max3100.o 49obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
49obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o 50obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
50obj-$(CONFIG_SERIAL_MUX) += mux.o 51obj-$(CONFIG_SERIAL_MUX) += mux.o
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 429a8ae86933..e4b3c2c88bb6 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -471,6 +471,20 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios,
471 spin_unlock_irqrestore(&uap->port.lock, flags); 471 spin_unlock_irqrestore(&uap->port.lock, flags);
472} 472}
473 473
474static void pl010_set_ldisc(struct uart_port *port)
475{
476 int line = port->line;
477
478 if (line >= port->state->port.tty->driver->num)
479 return;
480
481 if (port->state->port.tty->ldisc->ops->num == N_PPS) {
482 port->flags |= UPF_HARDPPS_CD;
483 pl010_enable_ms(port);
484 } else
485 port->flags &= ~UPF_HARDPPS_CD;
486}
487
474static const char *pl010_type(struct uart_port *port) 488static const char *pl010_type(struct uart_port *port)
475{ 489{
476 return port->type == PORT_AMBA ? "AMBA" : NULL; 490 return port->type == PORT_AMBA ? "AMBA" : NULL;
@@ -531,6 +545,7 @@ static struct uart_ops amba_pl010_pops = {
531 .startup = pl010_startup, 545 .startup = pl010_startup,
532 .shutdown = pl010_shutdown, 546 .shutdown = pl010_shutdown,
533 .set_termios = pl010_set_termios, 547 .set_termios = pl010_set_termios,
548 .set_ldisc = pl010_set_ldisc,
534 .type = pl010_type, 549 .type = pl010_type,
535 .release_port = pl010_release_port, 550 .release_port = pl010_release_port,
536 .request_port = pl010_request_port, 551 .request_port = pl010_request_port,
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index d00fcf8e6c70..e579d7a1807a 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -440,7 +440,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
440 440
441 temp = readl(sport->port.membase + USR2); 441 temp = readl(sport->port.membase + USR2);
442 if (temp & USR2_BRCD) { 442 if (temp & USR2_BRCD) {
443 writel(temp | USR2_BRCD, sport->port.membase + USR2); 443 writel(USR2_BRCD, sport->port.membase + USR2);
444 if (uart_handle_break(&sport->port)) 444 if (uart_handle_break(&sport->port))
445 continue; 445 continue;
446 } 446 }
diff --git a/drivers/serial/s3c2412.c b/drivers/serial/s3c2412.c
index ce75e28e36ef..1700b1a2fb7e 100644
--- a/drivers/serial/s3c2412.c
+++ b/drivers/serial/s3c2412.c
@@ -102,6 +102,7 @@ static struct s3c24xx_uart_info s3c2412_uart_inf = {
102 .name = "Samsung S3C2412 UART", 102 .name = "Samsung S3C2412 UART",
103 .type = PORT_S3C2412, 103 .type = PORT_S3C2412,
104 .fifosize = 64, 104 .fifosize = 64,
105 .has_divslot = 1,
105 .rx_fifomask = S3C2440_UFSTAT_RXMASK, 106 .rx_fifomask = S3C2440_UFSTAT_RXMASK,
106 .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 107 .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT,
107 .rx_fifofull = S3C2440_UFSTAT_RXFULL, 108 .rx_fifofull = S3C2440_UFSTAT_RXFULL,
diff --git a/drivers/serial/s5pv210.c b/drivers/serial/s5pv210.c
new file mode 100644
index 000000000000..8dc03837617b
--- /dev/null
+++ b/drivers/serial/s5pv210.c
@@ -0,0 +1,154 @@
1/* linux/drivers/serial/s5pv210.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
5 *
6 * Based on drivers/serial/s3c6400.c
7 *
8 * Driver for Samsung S5PV210 SoC UARTs.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15#include <linux/module.h>
16#include <linux/ioport.h>
17#include <linux/io.h>
18#include <linux/platform_device.h>
19#include <linux/init.h>
20#include <linux/serial_core.h>
21#include <linux/serial.h>
22
23#include <asm/irq.h>
24#include <mach/hardware.h>
25#include <plat/regs-serial.h>
26#include "samsung.h"
27
28static int s5pv210_serial_setsource(struct uart_port *port,
29 struct s3c24xx_uart_clksrc *clk)
30{
31 unsigned long ucon = rd_regl(port, S3C2410_UCON);
32
33 if (strcmp(clk->name, "pclk") == 0)
34 ucon &= ~S5PV210_UCON_CLKMASK;
35 else if (strcmp(clk->name, "uclk1") == 0)
36 ucon |= S5PV210_UCON_CLKMASK;
37 else {
38 printk(KERN_ERR "unknown clock source %s\n", clk->name);
39 return -EINVAL;
40 }
41
42 wr_regl(port, S3C2410_UCON, ucon);
43 return 0;
44}
45
46
47static int s5pv210_serial_getsource(struct uart_port *port,
48 struct s3c24xx_uart_clksrc *clk)
49{
50 u32 ucon = rd_regl(port, S3C2410_UCON);
51
52 clk->divisor = 1;
53
54 switch (ucon & S5PV210_UCON_CLKMASK) {
55 case S5PV210_UCON_PCLK:
56 clk->name = "pclk";
57 break;
58 case S5PV210_UCON_UCLK:
59 clk->name = "uclk1";
60 break;
61 }
62
63 return 0;
64}
65
66static int s5pv210_serial_resetport(struct uart_port *port,
67 struct s3c2410_uartcfg *cfg)
68{
69 unsigned long ucon = rd_regl(port, S3C2410_UCON);
70
71 ucon &= S5PV210_UCON_CLKMASK;
72 wr_regl(port, S3C2410_UCON, ucon | cfg->ucon);
73 wr_regl(port, S3C2410_ULCON, cfg->ulcon);
74
75 /* reset both fifos */
76 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
77 wr_regl(port, S3C2410_UFCON, cfg->ufcon);
78
79 return 0;
80}
81
82#define S5PV210_UART_DEFAULT_INFO(fifo_size) \
83 .name = "Samsung S5PV210 UART0", \
84 .type = PORT_S3C6400, \
85 .fifosize = fifo_size, \
86 .has_divslot = 1, \
87 .rx_fifomask = S5PV210_UFSTAT_RXMASK, \
88 .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \
89 .rx_fifofull = S5PV210_UFSTAT_RXFULL, \
90 .tx_fifofull = S5PV210_UFSTAT_TXFULL, \
91 .tx_fifomask = S5PV210_UFSTAT_TXMASK, \
92 .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \
93 .get_clksrc = s5pv210_serial_getsource, \
94 .set_clksrc = s5pv210_serial_setsource, \
95 .reset_port = s5pv210_serial_resetport
96
97static struct s3c24xx_uart_info s5p_port_fifo256 = {
98 S5PV210_UART_DEFAULT_INFO(256),
99};
100
101static struct s3c24xx_uart_info s5p_port_fifo64 = {
102 S5PV210_UART_DEFAULT_INFO(64),
103};
104
105static struct s3c24xx_uart_info s5p_port_fifo16 = {
106 S5PV210_UART_DEFAULT_INFO(16),
107};
108
109static struct s3c24xx_uart_info *s5p_uart_inf[] = {
110 [0] = &s5p_port_fifo256,
111 [1] = &s5p_port_fifo64,
112 [2] = &s5p_port_fifo16,
113 [3] = &s5p_port_fifo16,
114};
115
116/* device management */
117static int s5p_serial_probe(struct platform_device *pdev)
118{
119 return s3c24xx_serial_probe(pdev, s5p_uart_inf[pdev->id]);
120}
121
122static struct platform_driver s5p_serial_drv = {
123 .probe = s5p_serial_probe,
124 .remove = __devexit_p(s3c24xx_serial_remove),
125 .driver = {
126 .name = "s5pv210-uart",
127 .owner = THIS_MODULE,
128 },
129};
130
131static int __init s5pv210_serial_console_init(void)
132{
133 return s3c24xx_serial_initconsole(&s5p_serial_drv, s5p_uart_inf);
134}
135
136console_initcall(s5pv210_serial_console_init);
137
138static int __init s5p_serial_init(void)
139{
140 return s3c24xx_serial_init(&s5p_serial_drv, *s5p_uart_inf);
141}
142
143static void __exit s5p_serial_exit(void)
144{
145 platform_driver_unregister(&s5p_serial_drv);
146}
147
148module_init(s5p_serial_init);
149module_exit(s5p_serial_exit);
150
151MODULE_LICENSE("GPL");
152MODULE_ALIAS("platform:s5pv210-uart");
153MODULE_DESCRIPTION("Samsung S5PV210 UART Driver support");
154MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>");
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index 52e3df113ec0..a9d6c5626a0a 100644
--- a/drivers/serial/samsung.c
+++ b/drivers/serial/samsung.c
@@ -1271,7 +1271,7 @@ s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon)
1271 unsigned long ufstat, utrstat; 1271 unsigned long ufstat, utrstat;
1272 1272
1273 if (ufcon & S3C2410_UFCON_FIFOMODE) { 1273 if (ufcon & S3C2410_UFCON_FIFOMODE) {
1274 /* fifo mode - check ammount of data in fifo registers... */ 1274 /* fifo mode - check amount of data in fifo registers... */
1275 1275
1276 ufstat = rd_regl(port, S3C2410_UFSTAT); 1276 ufstat = rd_regl(port, S3C2410_UFSTAT);
1277 return (ufstat & info->tx_fifofull) ? 0 : 1; 1277 return (ufstat & info->tx_fifofull) ? 0 : 1;
@@ -1374,7 +1374,7 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud,
1374 * data. 1374 * data.
1375*/ 1375*/
1376 1376
1377static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info) 1377static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info)
1378{ 1378{
1379 struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports; 1379 struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports;
1380 struct platform_device **platdev_ptr; 1380 struct platform_device **platdev_ptr;
@@ -1385,7 +1385,7 @@ static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info *info)
1385 platdev_ptr = s3c24xx_uart_devs; 1385 platdev_ptr = s3c24xx_uart_devs;
1386 1386
1387 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) { 1387 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) {
1388 s3c24xx_serial_init_port(ptr, info, *platdev_ptr); 1388 s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr);
1389 } 1389 }
1390 1390
1391 return 0; 1391 return 0;
@@ -1451,7 +1451,7 @@ static struct console s3c24xx_serial_console = {
1451}; 1451};
1452 1452
1453int s3c24xx_serial_initconsole(struct platform_driver *drv, 1453int s3c24xx_serial_initconsole(struct platform_driver *drv,
1454 struct s3c24xx_uart_info *info) 1454 struct s3c24xx_uart_info **info)
1455 1455
1456{ 1456{
1457 struct platform_device *dev = s3c24xx_uart_devs[0]; 1457 struct platform_device *dev = s3c24xx_uart_devs[0];
diff --git a/drivers/serial/samsung.h b/drivers/serial/samsung.h
index 1fb22343df42..0ac06a07d25f 100644
--- a/drivers/serial/samsung.h
+++ b/drivers/serial/samsung.h
@@ -75,19 +75,24 @@ extern int s3c24xx_serial_probe(struct platform_device *dev,
75extern int __devexit s3c24xx_serial_remove(struct platform_device *dev); 75extern int __devexit s3c24xx_serial_remove(struct platform_device *dev);
76 76
77extern int s3c24xx_serial_initconsole(struct platform_driver *drv, 77extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
78 struct s3c24xx_uart_info *uart); 78 struct s3c24xx_uart_info **uart);
79 79
80extern int s3c24xx_serial_init(struct platform_driver *drv, 80extern int s3c24xx_serial_init(struct platform_driver *drv,
81 struct s3c24xx_uart_info *info); 81 struct s3c24xx_uart_info *info);
82 82
83#ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE 83#ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
84 84
85#define s3c24xx_console_init(__drv, __inf) \ 85#define s3c24xx_console_init(__drv, __inf) \
86static int __init s3c_serial_console_init(void) \ 86static int __init s3c_serial_console_init(void) \
87{ \ 87{ \
88 return s3c24xx_serial_initconsole(__drv, __inf); \ 88 struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS]; \
89} \ 89 int i; \
90 \ 90 \
91 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) \
92 uinfo[i] = __inf; \
93 return s3c24xx_serial_initconsole(__drv, uinfo); \
94} \
95 \
91console_initcall(s3c_serial_console_init) 96console_initcall(s3c_serial_console_init)
92 97
93#else 98#else
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index f7d2589926d2..fad67d33b0bd 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -30,7 +30,8 @@
30 */ 30 */
31# define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 31# define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0
32#elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 32#elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \
33 defined(CONFIG_CPU_SUBTYPE_SH7721) 33 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
34 defined(CONFIG_ARCH_SHMOBILE)
34# define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ 35# define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */
35# define PORT_PTCR 0xA405011EUL 36# define PORT_PTCR 0xA405011EUL
36# define PORT_PVCR 0xA4050122UL 37# define PORT_PVCR 0xA4050122UL
@@ -228,7 +229,8 @@
228 229
229#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 230#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
230 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 231 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
231 defined(CONFIG_CPU_SUBTYPE_SH7721) 232 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
233 defined(CONFIG_ARCH_SHMOBILE)
232# define SCIF_ORER 0x0200 234# define SCIF_ORER 0x0200
233# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) 235# define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER)
234# define SCIF_RFDC_MASK 0x007f 236# define SCIF_RFDC_MASK 0x007f
@@ -261,7 +263,8 @@
261 263
262#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 264#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
263 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 265 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
264 defined(CONFIG_CPU_SUBTYPE_SH7721) 266 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
267 defined(CONFIG_ARCH_SHMOBILE)
265# define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) 268# define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc)
266# define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) 269# define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73)
267# define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) 270# define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf)
@@ -356,7 +359,7 @@
356 SCI_OUT(sci_size, sci_offset, value); \ 359 SCI_OUT(sci_size, sci_offset, value); \
357 } 360 }
358 361
359#ifdef CONFIG_CPU_SH3 362#if defined(CONFIG_CPU_SH3) || defined(CONFIG_ARCH_SHMOBILE)
360#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) 363#if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
361#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \ 364#define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \
362 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \ 365 sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \
@@ -366,7 +369,8 @@
366 CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size) 369 CPU_SCIF_FNS(name, sh4_scif_offset, sh4_scif_size)
367#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 370#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
368 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 371 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
369 defined(CONFIG_CPU_SUBTYPE_SH7721) 372 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
373 defined(CONFIG_ARCH_SHMOBILE)
370#define SCIF_FNS(name, scif_offset, scif_size) \ 374#define SCIF_FNS(name, scif_offset, scif_size) \
371 CPU_SCIF_FNS(name, scif_offset, scif_size) 375 CPU_SCIF_FNS(name, scif_offset, scif_size)
372#else 376#else
@@ -401,7 +405,8 @@
401 405
402#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 406#if defined(CONFIG_CPU_SUBTYPE_SH7705) || \
403 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 407 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
404 defined(CONFIG_CPU_SUBTYPE_SH7721) 408 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
409 defined(CONFIG_ARCH_SHMOBILE)
405 410
406SCIF_FNS(SCSMR, 0x00, 16) 411SCIF_FNS(SCSMR, 0x00, 16)
407SCIF_FNS(SCBRR, 0x04, 8) 412SCIF_FNS(SCBRR, 0x04, 8)
@@ -413,7 +418,7 @@ SCIF_FNS(SCFCR, 0x18, 16)
413SCIF_FNS(SCFDR, 0x1c, 16) 418SCIF_FNS(SCFDR, 0x1c, 16)
414SCIF_FNS(SCxTDR, 0x20, 8) 419SCIF_FNS(SCxTDR, 0x20, 8)
415SCIF_FNS(SCxRDR, 0x24, 8) 420SCIF_FNS(SCxRDR, 0x24, 8)
416SCIF_FNS(SCLSR, 0x24, 16) 421SCIF_FNS(SCLSR, 0x00, 0)
417#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\ 422#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
418 defined(CONFIG_CPU_SUBTYPE_SH7724) 423 defined(CONFIG_CPU_SUBTYPE_SH7724)
419SCIx_FNS(SCSMR, 0x00, 16, 0x00, 16) 424SCIx_FNS(SCSMR, 0x00, 16, 0x00, 16)
@@ -583,7 +588,8 @@ static inline int sci_rxd_in(struct uart_port *port)
583#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1) 588#define SCBRR_VALUE(bps, clk) ((clk+16*bps)/(16*bps)-1)
584#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ 589#elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \
585 defined(CONFIG_CPU_SUBTYPE_SH7720) || \ 590 defined(CONFIG_CPU_SUBTYPE_SH7720) || \
586 defined(CONFIG_CPU_SUBTYPE_SH7721) 591 defined(CONFIG_CPU_SUBTYPE_SH7721) || \
592 defined(CONFIG_ARCH_SHMOBILE)
587#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) 593#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1)
588#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\ 594#elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\
589 defined(CONFIG_CPU_SUBTYPE_SH7724) 595 defined(CONFIG_CPU_SUBTYPE_SH7724)
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c
index 3a5a17db9474..c2750391fd34 100644
--- a/drivers/sh/intc.c
+++ b/drivers/sh/intc.c
@@ -762,6 +762,10 @@ static void __init intc_register_irq(struct intc_desc *desc,
762 762
763 if (desc->hw.ack_regs) 763 if (desc->hw.ack_regs)
764 ack_handle[irq] = intc_ack_data(desc, d, enum_id); 764 ack_handle[irq] = intc_ack_data(desc, d, enum_id);
765
766#ifdef CONFIG_ARM
767 set_irq_flags(irq, IRQF_VALID); /* Enable IRQ on ARM systems */
768#endif
765} 769}
766 770
767static unsigned int __init save_reg(struct intc_desc_int *d, 771static unsigned int __init save_reg(struct intc_desc_int *d,
@@ -1024,8 +1028,12 @@ unsigned int create_irq_nr(unsigned int irq_want, int node)
1024out_unlock: 1028out_unlock:
1025 spin_unlock_irqrestore(&vector_lock, flags); 1029 spin_unlock_irqrestore(&vector_lock, flags);
1026 1030
1027 if (irq > 0) 1031 if (irq > 0) {
1028 dynamic_irq_init(irq); 1032 dynamic_irq_init(irq);
1033#ifdef CONFIG_ARM
1034 set_irq_flags(irq, IRQF_VALID); /* Enable IRQ on ARM systems */
1035#endif
1036 }
1029 1037
1030 return irq; 1038 return irq;
1031} 1039}
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c
index c010733877ae..1fabede9e061 100644
--- a/drivers/spi/spi_s3c24xx.c
+++ b/drivers/spi/spi_s3c24xx.c
@@ -275,7 +275,7 @@ static inline u32 ack_bit(unsigned int irq)
275 * Claim the FIQ handler (only one can be active at any one time) and 275 * Claim the FIQ handler (only one can be active at any one time) and
276 * then setup the correct transfer code for this transfer. 276 * then setup the correct transfer code for this transfer.
277 * 277 *
278 * This call updates all the necessary state information if sucessful, 278 * This call updates all the necessary state information if successful,
279 * so the caller does not need to do anything more than start the transfer 279 * so the caller does not need to do anything more than start the transfer
280 * as normal, since the IRQ will have been re-routed to the FIQ handler. 280 * as normal, since the IRQ will have been re-routed to the FIQ handler.
281*/ 281*/
diff --git a/drivers/usb/gadget/fsl_mx3_udc.c b/drivers/usb/gadget/fsl_mx3_udc.c
index 4bc2bf3d602e..20a802ecaa15 100644
--- a/drivers/usb/gadget/fsl_mx3_udc.c
+++ b/drivers/usb/gadget/fsl_mx3_udc.c
@@ -17,6 +17,8 @@
17#include <linux/fsl_devices.h> 17#include <linux/fsl_devices.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/hardware.h>
21
20static struct clk *mxc_ahb_clk; 22static struct clk *mxc_ahb_clk;
21static struct clk *mxc_usb_clk; 23static struct clk *mxc_usb_clk;
22 24
@@ -28,14 +30,16 @@ int fsl_udc_clk_init(struct platform_device *pdev)
28 30
29 pdata = pdev->dev.platform_data; 31 pdata = pdev->dev.platform_data;
30 32
31 mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); 33 if (!cpu_is_mx35()) {
32 if (IS_ERR(mxc_ahb_clk)) 34 mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb");
33 return PTR_ERR(mxc_ahb_clk); 35 if (IS_ERR(mxc_ahb_clk))
36 return PTR_ERR(mxc_ahb_clk);
34 37
35 ret = clk_enable(mxc_ahb_clk); 38 ret = clk_enable(mxc_ahb_clk);
36 if (ret < 0) { 39 if (ret < 0) {
37 dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); 40 dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n");
38 goto eenahb; 41 goto eenahb;
42 }
39 } 43 }
40 44
41 /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ 45 /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */
@@ -50,6 +54,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
50 if (pdata->phy_mode != FSL_USB2_PHY_ULPI && 54 if (pdata->phy_mode != FSL_USB2_PHY_ULPI &&
51 (freq < 59999000 || freq > 60001000)) { 55 (freq < 59999000 || freq > 60001000)) {
52 dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); 56 dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq);
57 ret = -EINVAL;
53 goto eclkrate; 58 goto eclkrate;
54 } 59 }
55 60
@@ -66,9 +71,11 @@ eclkrate:
66 clk_put(mxc_usb_clk); 71 clk_put(mxc_usb_clk);
67 mxc_usb_clk = NULL; 72 mxc_usb_clk = NULL;
68egusb: 73egusb:
69 clk_disable(mxc_ahb_clk); 74 if (!cpu_is_mx35())
75 clk_disable(mxc_ahb_clk);
70eenahb: 76eenahb:
71 clk_put(mxc_ahb_clk); 77 if (!cpu_is_mx35())
78 clk_put(mxc_ahb_clk);
72 return ret; 79 return ret;
73} 80}
74 81
@@ -90,6 +97,8 @@ void fsl_udc_clk_release(void)
90 clk_disable(mxc_usb_clk); 97 clk_disable(mxc_usb_clk);
91 clk_put(mxc_usb_clk); 98 clk_put(mxc_usb_clk);
92 } 99 }
93 clk_disable(mxc_ahb_clk); 100 if (!cpu_is_mx35()) {
94 clk_put(mxc_ahb_clk); 101 clk_disable(mxc_ahb_clk);
102 clk_put(mxc_ahb_clk);
103 }
95} 104}
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index e6fedbd5a654..be5fb34d9602 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -65,6 +65,10 @@
65#include <mach/pxa25x-udc.h> 65#include <mach/pxa25x-udc.h>
66#endif 66#endif
67 67
68#ifdef CONFIG_ARCH_LUBBOCK
69#include <mach/lubbock.h>
70#endif
71
68#include <asm/mach/udc_pxa2xx.h> 72#include <asm/mach/udc_pxa2xx.h>
69 73
70 74
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 7e5bf593d386..f742c8e7397c 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -30,7 +30,7 @@
30 30
31#include <plat/regs-usb-hsotg-phy.h> 31#include <plat/regs-usb-hsotg-phy.h>
32#include <plat/regs-usb-hsotg.h> 32#include <plat/regs-usb-hsotg.h>
33#include <plat/regs-sys.h> 33#include <mach/regs-sys.h>
34#include <plat/udc-hs.h> 34#include <plat/udc-hs.h>
35 35
36#define DMA_ADDR_INVALID (~((dma_addr_t)0)) 36#define DMA_ADDR_INVALID (~((dma_addr_t)0))
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index 66913811af5e..a883f9dd3f8a 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -274,7 +274,7 @@ static irqreturn_t davinci_interrupt(int irq, void *__hci)
274 /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through 274 /* NOTE: DaVinci shadows the Mentor IRQs. Don't manage them through
275 * the Mentor registers (except for setup), use the TI ones and EOI. 275 * the Mentor registers (except for setup), use the TI ones and EOI.
276 * 276 *
277 * Docs describe irq "vector" registers asociated with the CPPI and 277 * Docs describe irq "vector" registers associated with the CPPI and
278 * USB EOI registers. These hold a bitmask corresponding to the 278 * USB EOI registers. These hold a bitmask corresponding to the
279 * current IRQ, not an irq handler address. Would using those bits 279 * current IRQ, not an irq handler address. Would using those bits
280 * resolve some of the races observed in this dispatch code?? 280 * resolve some of the races observed in this dispatch code??
diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h
index 292894a2c247..8d8062b10e2f 100644
--- a/drivers/usb/musb/musb_regs.h
+++ b/drivers/usb/musb/musb_regs.h
@@ -491,7 +491,7 @@ static inline u8 musb_read_txhubport(void __iomem *mbase, u8 epnum)
491#define MUSB_FLAT_OFFSET(_epnum, _offset) \ 491#define MUSB_FLAT_OFFSET(_epnum, _offset) \
492 (USB_OFFSET(USB_EP_NI0_TXMAXP) + (0x40 * (_epnum)) + (_offset)) 492 (USB_OFFSET(USB_EP_NI0_TXMAXP) + (0x40 * (_epnum)) + (_offset))
493 493
494/* Not implemented - HW has seperate Tx/Rx FIFO */ 494/* Not implemented - HW has separate Tx/Rx FIFO */
495#define MUSB_TXCSR_MODE 0x0000 495#define MUSB_TXCSR_MODE 0x0000
496 496
497static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size) 497static inline void musb_write_txfifosz(void __iomem *mbase, u8 c_size)
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index baf74b44e6ed..e23c77925e7a 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -152,7 +152,7 @@ struct cypress_private {
152 int isthrottled; /* if throttled, discard reads */ 152 int isthrottled; /* if throttled, discard reads */
153 wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */ 153 wait_queue_head_t delta_msr_wait; /* used for TIOCMIWAIT */
154 char prev_status, diff_status; /* used for TIOCMIWAIT */ 154 char prev_status, diff_status; /* used for TIOCMIWAIT */
155 /* we pass a pointer to this as the arguement sent to 155 /* we pass a pointer to this as the argument sent to
156 cypress_set_termios old_termios */ 156 cypress_set_termios old_termios */
157 struct ktermios tmp_termios; /* stores the old termios settings */ 157 struct ktermios tmp_termios; /* stores the old termios settings */
158}; 158};
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index f37476e22684..701452ae9197 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -115,7 +115,7 @@ static void opticon_bulk_callback(struct urb *urb)
115 } 115 }
116 } else { 116 } else {
117 dev_dbg(&priv->udev->dev, 117 dev_dbg(&priv->udev->dev,
118 "Improper ammount of data received from the device, " 118 "Improper amount of data received from the device, "
119 "%d bytes", urb->actual_length); 119 "%d bytes", urb->actual_length);
120 } 120 }
121 121
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c
index 72398888858f..ee190cc1757c 100644
--- a/drivers/usb/serial/symbolserial.c
+++ b/drivers/usb/serial/symbolserial.c
@@ -94,7 +94,7 @@ static void symbol_int_callback(struct urb *urb)
94 } 94 }
95 } else { 95 } else {
96 dev_dbg(&priv->udev->dev, 96 dev_dbg(&priv->udev->dev,
97 "Improper ammount of data received from the device, " 97 "Improper amount of data received from the device, "
98 "%d bytes", urb->actual_length); 98 "%d bytes", urb->actual_length);
99 } 99 }
100 100
diff --git a/drivers/usb/wusbcore/wusbhc.h b/drivers/usb/wusbcore/wusbhc.h
index fd2fd4e277e1..759cda55f7c3 100644
--- a/drivers/usb/wusbcore/wusbhc.h
+++ b/drivers/usb/wusbcore/wusbhc.h
@@ -198,7 +198,7 @@ struct wusb_port {
198 * ports) this HC will take. Read-only. 198 * ports) this HC will take. Read-only.
199 * 199 *
200 * @port Array of port status for each fake root port. Guaranteed to 200 * @port Array of port status for each fake root port. Guaranteed to
201 * always be the same lenght during device existence 201 * always be the same length during device existence
202 * [this allows for some unlocked but referenced reading]. 202 * [this allows for some unlocked but referenced reading].
203 * 203 *
204 * @mmcies_max Max number of Information Elements this HC can send 204 * @mmcies_max Max number of Information Elements this HC can send
diff --git a/drivers/uwb/i1480/i1480-est.c b/drivers/uwb/i1480/i1480-est.c
index 7bf8c6febae7..f2eb4d8b76c9 100644
--- a/drivers/uwb/i1480/i1480-est.c
+++ b/drivers/uwb/i1480/i1480-est.c
@@ -54,7 +54,7 @@ static struct uwb_est_entry i1480_est_fd01[] = {
54 .size = sizeof(struct i1480_rceb) + 2 }, 54 .size = sizeof(struct i1480_rceb) + 2 },
55}; 55};
56 56
57static int i1480_est_init(void) 57static int __init i1480_est_init(void)
58{ 58{
59 int result = uwb_est_register(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b, 59 int result = uwb_est_register(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
60 i1480_est_fd00, 60 i1480_est_fd00,
@@ -73,7 +73,7 @@ static int i1480_est_init(void)
73} 73}
74module_init(i1480_est_init); 74module_init(i1480_est_init);
75 75
76static void i1480_est_exit(void) 76static void __exit i1480_est_exit(void)
77{ 77{
78 uwb_est_unregister(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b, 78 uwb_est_unregister(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
79 i1480_est_fd00, ARRAY_SIZE(i1480_est_fd00)); 79 i1480_est_fd00, ARRAY_SIZE(i1480_est_fd00));
diff --git a/drivers/uwb/uwbd.c b/drivers/uwb/uwbd.c
index 5a777d8624da..6210fe1fd1bb 100644
--- a/drivers/uwb/uwbd.c
+++ b/drivers/uwb/uwbd.c
@@ -43,7 +43,7 @@
43 * 43 *
44 * EVENTS 44 * EVENTS
45 * 45 *
46 * Events have a type, a subtype, a lenght, some other stuff and the 46 * Events have a type, a subtype, a length, some other stuff and the
47 * data blob, which depends on the event. The header is 'struct 47 * data blob, which depends on the event. The header is 'struct
48 * uwb_event'; for payloads, see 'struct uwbd_evt_*'. 48 * uwb_event'; for payloads, see 'struct uwbd_evt_*'.
49 * 49 *
diff --git a/drivers/video/68328fb.c b/drivers/video/68328fb.c
index 0b17824b0eb5..2110556f76b3 100644
--- a/drivers/video/68328fb.c
+++ b/drivers/video/68328fb.c
@@ -308,7 +308,7 @@ static int mc68x328fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
308 * Pseudocolor: 308 * Pseudocolor:
309 * uses offset = 0 && length = RAMDAC register width. 309 * uses offset = 0 && length = RAMDAC register width.
310 * var->{color}.offset is 0 310 * var->{color}.offset is 0
311 * var->{color}.length contains widht of DAC 311 * var->{color}.length contains width of DAC
312 * cmap is not used 312 * cmap is not used
313 * RAMDAC[X] is programmed to (red, green, blue) 313 * RAMDAC[X] is programmed to (red, green, blue)
314 * Truecolor: 314 * Truecolor:
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 5a5c303a6373..1c60053439a9 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -400,9 +400,12 @@ config FB_SA1100
400 If you plan to use the LCD display with your SA-1100 system, say 400 If you plan to use the LCD display with your SA-1100 system, say
401 Y here. 401 Y here.
402 402
403config HAVE_FB_IMX
404 bool
405
403config FB_IMX 406config FB_IMX
404 tristate "Motorola i.MX LCD support" 407 tristate "Motorola i.MX LCD support"
405 depends on FB && (ARCH_MX1 || ARCH_MX2) 408 depends on FB && (HAVE_FB_IMX || ARCH_MX1 || ARCH_MX2)
406 select FB_CFB_FILLRECT 409 select FB_CFB_FILLRECT
407 select FB_CFB_COPYAREA 410 select FB_CFB_COPYAREA
408 select FB_CFB_IMAGEBLIT 411 select FB_CFB_IMAGEBLIT
@@ -1494,7 +1497,6 @@ config FB_VIA
1494 select FB_CFB_FILLRECT 1497 select FB_CFB_FILLRECT
1495 select FB_CFB_COPYAREA 1498 select FB_CFB_COPYAREA
1496 select FB_CFB_IMAGEBLIT 1499 select FB_CFB_IMAGEBLIT
1497 select FB_SOFT_CURSOR
1498 select I2C_ALGOBIT 1500 select I2C_ALGOBIT
1499 select I2C 1501 select I2C
1500 help 1502 help
@@ -1945,6 +1947,27 @@ config FB_S3C2410_DEBUG
1945 Turn on debugging messages. Note that you can set/unset at run time 1947 Turn on debugging messages. Note that you can set/unset at run time
1946 through sysfs 1948 through sysfs
1947 1949
1950config FB_NUC900
1951 bool "NUC900 LCD framebuffer support"
1952 depends on FB && ARCH_W90X900
1953 select FB_CFB_FILLRECT
1954 select FB_CFB_COPYAREA
1955 select FB_CFB_IMAGEBLIT
1956 ---help---
1957 Frame buffer driver for the built-in LCD controller in the Nuvoton
1958 NUC900 processor
1959
1960config GPM1040A0_320X240
1961 bool "Giantplus Technology GPM1040A0 320x240 Color TFT LCD"
1962 depends on FB_NUC900
1963
1964config FB_NUC900_DEBUG
1965 bool "NUC900 lcd debug messages"
1966 depends on FB_NUC900
1967 help
1968 Turn on debugging messages. Note that you can set/unset at run time
1969 through sysfs
1970
1948config FB_SM501 1971config FB_SM501
1949 tristate "Silicon Motion SM501 framebuffer support" 1972 tristate "Silicon Motion SM501 framebuffer support"
1950 depends on FB && MFD_SM501 1973 depends on FB && MFD_SM501
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 4ecb30c4f3f2..a42ad55e3a15 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -129,6 +129,7 @@ obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o
129obj-$(CONFIG_FB_CARMINE) += carminefb.o 129obj-$(CONFIG_FB_CARMINE) += carminefb.o
130obj-$(CONFIG_FB_MB862XX) += mb862xx/ 130obj-$(CONFIG_FB_MB862XX) += mb862xx/
131obj-$(CONFIG_FB_MSM) += msm/ 131obj-$(CONFIG_FB_MSM) += msm/
132obj-$(CONFIG_FB_NUC900) += nuc900fb.o
132 133
133# Platform or fallback drivers go here 134# Platform or fallback drivers go here
134obj-$(CONFIG_FB_UVESA) += uvesafb.o 135obj-$(CONFIG_FB_UVESA) += uvesafb.o
diff --git a/drivers/video/asiliantfb.c b/drivers/video/asiliantfb.c
index 9fe90ce928fb..e70bc225fe31 100644
--- a/drivers/video/asiliantfb.c
+++ b/drivers/video/asiliantfb.c
@@ -140,7 +140,7 @@ static void asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dc
140 140
141 /* 3 <= m <= 257 */ 141 /* 3 <= m <= 257 */
142 if (m >= 3 && m <= 257) { 142 if (m >= 3 && m <= 257) {
143 unsigned new_error = ((Ftarget * n) - (Fref * m)) >= 0 ? 143 unsigned new_error = Ftarget * n >= Fref * m ?
144 ((Ftarget * n) - (Fref * m)) : ((Fref * m) - (Ftarget * n)); 144 ((Ftarget * n) - (Fref * m)) : ((Fref * m) - (Ftarget * n));
145 if (new_error < best_error) { 145 if (new_error < best_error) {
146 best_n = n; 146 best_n = n;
@@ -152,7 +152,7 @@ static void asiliant_calc_dclk2(u32 *ppixclock, u8 *dclk2_m, u8 *dclk2_n, u8 *dc
152 else if (m <= 1028) { 152 else if (m <= 1028) {
153 /* remember there are still only 8-bits of precision in m, so 153 /* remember there are still only 8-bits of precision in m, so
154 * avoid over-optimistic error calculations */ 154 * avoid over-optimistic error calculations */
155 unsigned new_error = ((Ftarget * n) - (Fref * (m & ~3))) >= 0 ? 155 unsigned new_error = Ftarget * n >= Fref * (m & ~3) ?
156 ((Ftarget * n) - (Fref * (m & ~3))) : ((Fref * (m & ~3)) - (Ftarget * n)); 156 ((Ftarget * n) - (Fref * (m & ~3))) : ((Fref * (m & ~3)) - (Ftarget * n));
157 if (new_error < best_error) { 157 if (new_error < best_error) {
158 best_n = n; 158 best_n = n;
diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c
index e49ae5edcc00..814312a7452f 100644
--- a/drivers/video/bf54x-lq043fb.c
+++ b/drivers/video/bf54x-lq043fb.c
@@ -82,7 +82,6 @@ struct bfin_bf54xfb_info {
82 unsigned char *fb_buffer; /* RGB Buffer */ 82 unsigned char *fb_buffer; /* RGB Buffer */
83 83
84 dma_addr_t dma_handle; 84 dma_addr_t dma_handle;
85 int lq043_mmap;
86 int lq043_open_cnt; 85 int lq043_open_cnt;
87 int irq; 86 int irq;
88 spinlock_t lock; /* lock */ 87 spinlock_t lock; /* lock */
@@ -316,7 +315,6 @@ static int bfin_bf54x_fb_release(struct fb_info *info, int user)
316 spin_lock(&fbi->lock); 315 spin_lock(&fbi->lock);
317 316
318 fbi->lq043_open_cnt--; 317 fbi->lq043_open_cnt--;
319 fbi->lq043_mmap = 0;
320 318
321 if (fbi->lq043_open_cnt <= 0) { 319 if (fbi->lq043_open_cnt <= 0) {
322 320
@@ -374,33 +372,6 @@ static int bfin_bf54x_fb_check_var(struct fb_var_screeninfo *var,
374 return 0; 372 return 0;
375} 373}
376 374
377static int bfin_bf54x_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
378{
379
380 struct bfin_bf54xfb_info *fbi = info->par;
381
382 if (fbi->lq043_mmap)
383 return -1;
384
385 spin_lock(&fbi->lock);
386 fbi->lq043_mmap = 1;
387 spin_unlock(&fbi->lock);
388
389 vma->vm_start = (unsigned long)(fbi->fb_buffer);
390
391 vma->vm_end = vma->vm_start + info->fix.smem_len;
392 /* For those who don't understand how mmap works, go read
393 * Documentation/nommu-mmap.txt.
394 * For those that do, you will know that the VM_MAYSHARE flag
395 * must be set in the vma->vm_flags structure on noMMU
396 * Other flags can be set, and are documented in
397 * include/linux/mm.h
398 */
399 vma->vm_flags |= VM_MAYSHARE | VM_SHARED;
400
401 return 0;
402}
403
404int bfin_bf54x_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) 375int bfin_bf54x_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
405{ 376{
406 if (nocursor) 377 if (nocursor)
@@ -452,7 +423,6 @@ static struct fb_ops bfin_bf54x_fb_ops = {
452 .fb_fillrect = cfb_fillrect, 423 .fb_fillrect = cfb_fillrect,
453 .fb_copyarea = cfb_copyarea, 424 .fb_copyarea = cfb_copyarea,
454 .fb_imageblit = cfb_imageblit, 425 .fb_imageblit = cfb_imageblit,
455 .fb_mmap = bfin_bf54x_fb_mmap,
456 .fb_cursor = bfin_bf54x_fb_cursor, 426 .fb_cursor = bfin_bf54x_fb_cursor,
457 .fb_setcolreg = bfin_bf54x_fb_setcolreg, 427 .fb_setcolreg = bfin_bf54x_fb_setcolreg,
458}; 428};
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index b690c269784a..03872365a36d 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -22,7 +22,6 @@
22#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/spi/spi.h> 24#include <linux/spi/spi.h>
25#include <linux/dma-mapping.h>
26 25
27#include <asm/blackfin.h> 26#include <asm/blackfin.h>
28#include <asm/irq.h> 27#include <asm/irq.h>
diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c
index 2549c53b26a0..5653d083a983 100644
--- a/drivers/video/bfin-t350mcqb-fb.c
+++ b/drivers/video/bfin-t350mcqb-fb.c
@@ -87,7 +87,6 @@ struct bfin_t350mcqbfb_info {
87 struct device *dev; 87 struct device *dev;
88 unsigned char *fb_buffer; /* RGB Buffer */ 88 unsigned char *fb_buffer; /* RGB Buffer */
89 dma_addr_t dma_handle; 89 dma_addr_t dma_handle;
90 int lq043_mmap;
91 int lq043_open_cnt; 90 int lq043_open_cnt;
92 int irq; 91 int irq;
93 spinlock_t lock; /* lock */ 92 spinlock_t lock; /* lock */
@@ -235,7 +234,6 @@ static int bfin_t350mcqb_fb_release(struct fb_info *info, int user)
235 spin_lock(&fbi->lock); 234 spin_lock(&fbi->lock);
236 235
237 fbi->lq043_open_cnt--; 236 fbi->lq043_open_cnt--;
238 fbi->lq043_mmap = 0;
239 237
240 if (fbi->lq043_open_cnt <= 0) { 238 if (fbi->lq043_open_cnt <= 0) {
241 bfin_t350mcqb_disable_ppi(); 239 bfin_t350mcqb_disable_ppi();
@@ -293,32 +291,6 @@ static int bfin_t350mcqb_fb_check_var(struct fb_var_screeninfo *var,
293 return 0; 291 return 0;
294} 292}
295 293
296static int bfin_t350mcqb_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
297{
298 struct bfin_t350mcqbfb_info *fbi = info->par;
299
300 if (fbi->lq043_mmap)
301 return -1;
302
303 spin_lock(&fbi->lock);
304 fbi->lq043_mmap = 1;
305 spin_unlock(&fbi->lock);
306
307 vma->vm_start = (unsigned long)(fbi->fb_buffer + ACTIVE_VIDEO_MEM_OFFSET);
308
309 vma->vm_end = vma->vm_start + info->fix.smem_len;
310 /* For those who don't understand how mmap works, go read
311 * Documentation/nommu-mmap.txt.
312 * For those that do, you will know that the VM_MAYSHARE flag
313 * must be set in the vma->vm_flags structure on noMMU
314 * Other flags can be set, and are documented in
315 * include/linux/mm.h
316 */
317 vma->vm_flags |= VM_MAYSHARE | VM_SHARED;
318
319 return 0;
320}
321
322int bfin_t350mcqb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor) 294int bfin_t350mcqb_fb_cursor(struct fb_info *info, struct fb_cursor *cursor)
323{ 295{
324 if (nocursor) 296 if (nocursor)
@@ -370,7 +342,6 @@ static struct fb_ops bfin_t350mcqb_fb_ops = {
370 .fb_fillrect = cfb_fillrect, 342 .fb_fillrect = cfb_fillrect,
371 .fb_copyarea = cfb_copyarea, 343 .fb_copyarea = cfb_copyarea,
372 .fb_imageblit = cfb_imageblit, 344 .fb_imageblit = cfb_imageblit,
373 .fb_mmap = bfin_t350mcqb_fb_mmap,
374 .fb_cursor = bfin_t350mcqb_fb_cursor, 345 .fb_cursor = bfin_t350mcqb_fb_cursor,
375 .fb_setcolreg = bfin_t350mcqb_fb_setcolreg, 346 .fb_setcolreg = bfin_t350mcqb_fb_setcolreg,
376}; 347};
diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c
index df9ccb901d86..ebda6876d3a9 100644
--- a/drivers/video/broadsheetfb.c
+++ b/drivers/video/broadsheetfb.c
@@ -29,11 +29,65 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/list.h> 31#include <linux/list.h>
32#include <linux/firmware.h>
32#include <linux/uaccess.h> 33#include <linux/uaccess.h>
33 34
34#include <video/broadsheetfb.h> 35#include <video/broadsheetfb.h>
35 36
36/* Display specific information */ 37/* track panel specific parameters */
38struct panel_info {
39 int w;
40 int h;
41 u16 sdcfg;
42 u16 gdcfg;
43 u16 lutfmt;
44 u16 fsynclen;
45 u16 fendfbegin;
46 u16 lsynclen;
47 u16 lendlbegin;
48 u16 pixclk;
49};
50
51/* table of panel specific parameters to be indexed into by the board drivers */
52static struct panel_info panel_table[] = {
53 { /* standard 6" on TFT backplane */
54 .w = 800,
55 .h = 600,
56 .sdcfg = (100 | (1 << 8) | (1 << 9)),
57 .gdcfg = 2,
58 .lutfmt = (4 | (1 << 7)),
59 .fsynclen = 4,
60 .fendfbegin = (10 << 8) | 4,
61 .lsynclen = 10,
62 .lendlbegin = (100 << 8) | 4,
63 .pixclk = 6,
64 },
65 { /* custom 3.7" flexible on PET or steel */
66 .w = 320,
67 .h = 240,
68 .sdcfg = (67 | (0 << 8) | (0 << 9) | (0 << 10) | (0 << 12)),
69 .gdcfg = 3,
70 .lutfmt = (4 | (1 << 7)),
71 .fsynclen = 0,
72 .fendfbegin = (80 << 8) | 4,
73 .lsynclen = 10,
74 .lendlbegin = (80 << 8) | 20,
75 .pixclk = 14,
76 },
77 { /* standard 9.7" on TFT backplane */
78 .w = 1200,
79 .h = 825,
80 .sdcfg = (100 | (1 << 8) | (1 << 9) | (0 << 10) | (0 << 12)),
81 .gdcfg = 2,
82 .lutfmt = (4 | (1 << 7)),
83 .fsynclen = 0,
84 .fendfbegin = (4 << 8) | 4,
85 .lsynclen = 4,
86 .lendlbegin = (60 << 8) | 10,
87 .pixclk = 3,
88 },
89};
90
37#define DPY_W 800 91#define DPY_W 800
38#define DPY_H 600 92#define DPY_H 600
39 93
@@ -62,30 +116,30 @@ static struct fb_var_screeninfo broadsheetfb_var __devinitdata = {
62}; 116};
63 117
64/* main broadsheetfb functions */ 118/* main broadsheetfb functions */
65static void broadsheet_issue_data(struct broadsheetfb_par *par, u16 data) 119static void broadsheet_gpio_issue_data(struct broadsheetfb_par *par, u16 data)
66{ 120{
67 par->board->set_ctl(par, BS_WR, 0); 121 par->board->set_ctl(par, BS_WR, 0);
68 par->board->set_hdb(par, data); 122 par->board->set_hdb(par, data);
69 par->board->set_ctl(par, BS_WR, 1); 123 par->board->set_ctl(par, BS_WR, 1);
70} 124}
71 125
72static void broadsheet_issue_cmd(struct broadsheetfb_par *par, u16 data) 126static void broadsheet_gpio_issue_cmd(struct broadsheetfb_par *par, u16 data)
73{ 127{
74 par->board->set_ctl(par, BS_DC, 0); 128 par->board->set_ctl(par, BS_DC, 0);
75 broadsheet_issue_data(par, data); 129 broadsheet_gpio_issue_data(par, data);
76} 130}
77 131
78static void broadsheet_send_command(struct broadsheetfb_par *par, u16 data) 132static void broadsheet_gpio_send_command(struct broadsheetfb_par *par, u16 data)
79{ 133{
80 par->board->wait_for_rdy(par); 134 par->board->wait_for_rdy(par);
81 135
82 par->board->set_ctl(par, BS_CS, 0); 136 par->board->set_ctl(par, BS_CS, 0);
83 broadsheet_issue_cmd(par, data); 137 broadsheet_gpio_issue_cmd(par, data);
84 par->board->set_ctl(par, BS_DC, 1); 138 par->board->set_ctl(par, BS_DC, 1);
85 par->board->set_ctl(par, BS_CS, 1); 139 par->board->set_ctl(par, BS_CS, 1);
86} 140}
87 141
88static void broadsheet_send_cmdargs(struct broadsheetfb_par *par, u16 cmd, 142static void broadsheet_gpio_send_cmdargs(struct broadsheetfb_par *par, u16 cmd,
89 int argc, u16 *argv) 143 int argc, u16 *argv)
90{ 144{
91 int i; 145 int i;
@@ -93,15 +147,43 @@ static void broadsheet_send_cmdargs(struct broadsheetfb_par *par, u16 cmd,
93 par->board->wait_for_rdy(par); 147 par->board->wait_for_rdy(par);
94 148
95 par->board->set_ctl(par, BS_CS, 0); 149 par->board->set_ctl(par, BS_CS, 0);
96 broadsheet_issue_cmd(par, cmd); 150 broadsheet_gpio_issue_cmd(par, cmd);
97 par->board->set_ctl(par, BS_DC, 1); 151 par->board->set_ctl(par, BS_DC, 1);
98 152
99 for (i = 0; i < argc; i++) 153 for (i = 0; i < argc; i++)
100 broadsheet_issue_data(par, argv[i]); 154 broadsheet_gpio_issue_data(par, argv[i]);
101 par->board->set_ctl(par, BS_CS, 1); 155 par->board->set_ctl(par, BS_CS, 1);
102} 156}
103 157
104static void broadsheet_burst_write(struct broadsheetfb_par *par, int size, 158static void broadsheet_mmio_send_cmdargs(struct broadsheetfb_par *par, u16 cmd,
159 int argc, u16 *argv)
160{
161 int i;
162
163 par->board->mmio_write(par, BS_MMIO_CMD, cmd);
164
165 for (i = 0; i < argc; i++)
166 par->board->mmio_write(par, BS_MMIO_DATA, argv[i]);
167}
168
169static void broadsheet_send_command(struct broadsheetfb_par *par, u16 data)
170{
171 if (par->board->mmio_write)
172 par->board->mmio_write(par, BS_MMIO_CMD, data);
173 else
174 broadsheet_gpio_send_command(par, data);
175}
176
177static void broadsheet_send_cmdargs(struct broadsheetfb_par *par, u16 cmd,
178 int argc, u16 *argv)
179{
180 if (par->board->mmio_write)
181 broadsheet_mmio_send_cmdargs(par, cmd, argc, argv);
182 else
183 broadsheet_gpio_send_cmdargs(par, cmd, argc, argv);
184}
185
186static void broadsheet_gpio_burst_write(struct broadsheetfb_par *par, int size,
105 u16 *data) 187 u16 *data)
106{ 188{
107 int i; 189 int i;
@@ -121,7 +203,30 @@ static void broadsheet_burst_write(struct broadsheetfb_par *par, int size,
121 par->board->set_ctl(par, BS_CS, 1); 203 par->board->set_ctl(par, BS_CS, 1);
122} 204}
123 205
124static u16 broadsheet_get_data(struct broadsheetfb_par *par) 206static void broadsheet_mmio_burst_write(struct broadsheetfb_par *par, int size,
207 u16 *data)
208{
209 int i;
210 u16 tmp;
211
212 for (i = 0; i < size; i++) {
213 tmp = (data[i] & 0x0F) << 4;
214 tmp |= (data[i] & 0x0F00) << 4;
215 par->board->mmio_write(par, BS_MMIO_DATA, tmp);
216 }
217
218}
219
220static void broadsheet_burst_write(struct broadsheetfb_par *par, int size,
221 u16 *data)
222{
223 if (par->board->mmio_write)
224 broadsheet_mmio_burst_write(par, size, data);
225 else
226 broadsheet_gpio_burst_write(par, size, data);
227}
228
229static u16 broadsheet_gpio_get_data(struct broadsheetfb_par *par)
125{ 230{
126 u16 res; 231 u16 res;
127 /* wait for ready to go hi. (lo is busy) */ 232 /* wait for ready to go hi. (lo is busy) */
@@ -141,7 +246,16 @@ static u16 broadsheet_get_data(struct broadsheetfb_par *par)
141 return res; 246 return res;
142} 247}
143 248
144static void broadsheet_write_reg(struct broadsheetfb_par *par, u16 reg, 249
250static u16 broadsheet_get_data(struct broadsheetfb_par *par)
251{
252 if (par->board->mmio_read)
253 return par->board->mmio_read(par);
254 else
255 return broadsheet_gpio_get_data(par);
256}
257
258static void broadsheet_gpio_write_reg(struct broadsheetfb_par *par, u16 reg,
145 u16 data) 259 u16 data)
146{ 260{
147 /* wait for ready to go hi. (lo is busy) */ 261 /* wait for ready to go hi. (lo is busy) */
@@ -150,44 +264,541 @@ static void broadsheet_write_reg(struct broadsheetfb_par *par, u16 reg,
150 /* cs lo, dc lo for cmd, we lo for each data, db as usual */ 264 /* cs lo, dc lo for cmd, we lo for each data, db as usual */
151 par->board->set_ctl(par, BS_CS, 0); 265 par->board->set_ctl(par, BS_CS, 0);
152 266
153 broadsheet_issue_cmd(par, BS_CMD_WR_REG); 267 broadsheet_gpio_issue_cmd(par, BS_CMD_WR_REG);
154 268
155 par->board->set_ctl(par, BS_DC, 1); 269 par->board->set_ctl(par, BS_DC, 1);
156 270
157 broadsheet_issue_data(par, reg); 271 broadsheet_gpio_issue_data(par, reg);
158 broadsheet_issue_data(par, data); 272 broadsheet_gpio_issue_data(par, data);
159 273
160 par->board->set_ctl(par, BS_CS, 1); 274 par->board->set_ctl(par, BS_CS, 1);
161} 275}
162 276
277static void broadsheet_mmio_write_reg(struct broadsheetfb_par *par, u16 reg,
278 u16 data)
279{
280 par->board->mmio_write(par, BS_MMIO_CMD, BS_CMD_WR_REG);
281 par->board->mmio_write(par, BS_MMIO_DATA, reg);
282 par->board->mmio_write(par, BS_MMIO_DATA, data);
283
284}
285
286static void broadsheet_write_reg(struct broadsheetfb_par *par, u16 reg,
287 u16 data)
288{
289 if (par->board->mmio_write)
290 broadsheet_mmio_write_reg(par, reg, data);
291 else
292 broadsheet_gpio_write_reg(par, reg, data);
293}
294
295static void broadsheet_write_reg32(struct broadsheetfb_par *par, u16 reg,
296 u32 data)
297{
298 broadsheet_write_reg(par, reg, cpu_to_le32(data) & 0xFFFF);
299 broadsheet_write_reg(par, reg + 2, (cpu_to_le32(data) >> 16) & 0xFFFF);
300}
301
302
163static u16 broadsheet_read_reg(struct broadsheetfb_par *par, u16 reg) 303static u16 broadsheet_read_reg(struct broadsheetfb_par *par, u16 reg)
164{ 304{
165 broadsheet_send_command(par, reg); 305 broadsheet_send_cmdargs(par, BS_CMD_RD_REG, 1, &reg);
166 msleep(100); 306 par->board->wait_for_rdy(par);
167 return broadsheet_get_data(par); 307 return broadsheet_get_data(par);
168} 308}
169 309
310/* functions for waveform manipulation */
311static int is_broadsheet_pll_locked(struct broadsheetfb_par *par)
312{
313 return broadsheet_read_reg(par, 0x000A) & 0x0001;
314}
315
316static int broadsheet_setup_plls(struct broadsheetfb_par *par)
317{
318 int retry_count = 0;
319 u16 tmp;
320
321 /* disable arral saemipu mode */
322 broadsheet_write_reg(par, 0x0006, 0x0000);
323
324 broadsheet_write_reg(par, 0x0010, 0x0004);
325 broadsheet_write_reg(par, 0x0012, 0x5949);
326 broadsheet_write_reg(par, 0x0014, 0x0040);
327 broadsheet_write_reg(par, 0x0016, 0x0000);
328
329 do {
330 if (retry_count++ > 100)
331 return -ETIMEDOUT;
332 mdelay(1);
333 } while (!is_broadsheet_pll_locked(par));
334
335 tmp = broadsheet_read_reg(par, 0x0006);
336 tmp &= ~0x1;
337 broadsheet_write_reg(par, 0x0006, tmp);
338
339 return 0;
340}
341
342static int broadsheet_setup_spi(struct broadsheetfb_par *par)
343{
344
345 broadsheet_write_reg(par, 0x0204, ((3 << 3) | 1));
346 broadsheet_write_reg(par, 0x0208, 0x0001);
347
348 return 0;
349}
350
351static int broadsheet_setup_spiflash(struct broadsheetfb_par *par,
352 u16 *orig_sfmcd)
353{
354
355 *orig_sfmcd = broadsheet_read_reg(par, 0x0204);
356 broadsheet_write_reg(par, 0x0208, 0);
357 broadsheet_write_reg(par, 0x0204, 0);
358 broadsheet_write_reg(par, 0x0204, ((3 << 3) | 1));
359
360 return 0;
361}
362
363static int broadsheet_spiflash_wait_for_bit(struct broadsheetfb_par *par,
364 u16 reg, int bitnum, int val,
365 int timeout)
366{
367 u16 tmp;
368
369 do {
370 tmp = broadsheet_read_reg(par, reg);
371 if (((tmp >> bitnum) & 1) == val)
372 return 0;
373 mdelay(1);
374 } while (timeout--);
375
376 return -ETIMEDOUT;
377}
378
379static int broadsheet_spiflash_write_byte(struct broadsheetfb_par *par, u8 data)
380{
381 broadsheet_write_reg(par, 0x0202, (data | 0x100));
382
383 return broadsheet_spiflash_wait_for_bit(par, 0x0206, 3, 0, 100);
384}
385
386static int broadsheet_spiflash_read_byte(struct broadsheetfb_par *par, u8 *data)
387{
388 int err;
389 u16 tmp;
390
391 broadsheet_write_reg(par, 0x0202, 0);
392
393 err = broadsheet_spiflash_wait_for_bit(par, 0x0206, 3, 0, 100);
394 if (err)
395 return err;
396
397 tmp = broadsheet_read_reg(par, 0x200);
398
399 *data = tmp & 0xFF;
400
401 return 0;
402}
403
404static int broadsheet_spiflash_wait_for_status(struct broadsheetfb_par *par,
405 int timeout)
406{
407 u8 tmp;
408 int err;
409
410 do {
411 broadsheet_write_reg(par, 0x0208, 1);
412
413 err = broadsheet_spiflash_write_byte(par, 0x05);
414 if (err)
415 goto failout;
416
417 err = broadsheet_spiflash_read_byte(par, &tmp);
418 if (err)
419 goto failout;
420
421 broadsheet_write_reg(par, 0x0208, 0);
422
423 if (!(tmp & 0x1))
424 return 0;
425
426 mdelay(5);
427 } while (timeout--);
428
429 dev_err(par->info->device, "Timed out waiting for spiflash status\n");
430 return -ETIMEDOUT;
431
432failout:
433 broadsheet_write_reg(par, 0x0208, 0);
434 return err;
435}
436
437static int broadsheet_spiflash_op_on_address(struct broadsheetfb_par *par,
438 u8 op, u32 addr)
439{
440 int i;
441 u8 tmp;
442 int err;
443
444 broadsheet_write_reg(par, 0x0208, 1);
445
446 err = broadsheet_spiflash_write_byte(par, op);
447 if (err)
448 return err;
449
450 for (i = 2; i >= 0; i--) {
451 tmp = ((addr >> (i * 8)) & 0xFF);
452 err = broadsheet_spiflash_write_byte(par, tmp);
453 if (err)
454 return err;
455 }
456
457 return err;
458}
459
460static int broadsheet_verify_spiflash(struct broadsheetfb_par *par,
461 int *flash_type)
462{
463 int err = 0;
464 u8 sig;
465
466 err = broadsheet_spiflash_op_on_address(par, 0xAB, 0x00000000);
467 if (err)
468 goto failout;
469
470 err = broadsheet_spiflash_read_byte(par, &sig);
471 if (err)
472 goto failout;
473
474 if ((sig != 0x10) && (sig != 0x11)) {
475 dev_err(par->info->device, "Unexpected flash type\n");
476 err = -EINVAL;
477 goto failout;
478 }
479
480 *flash_type = sig;
481
482failout:
483 broadsheet_write_reg(par, 0x0208, 0);
484 return err;
485}
486
487static int broadsheet_setup_for_wfm_write(struct broadsheetfb_par *par,
488 u16 *initial_sfmcd, int *flash_type)
489
490{
491 int err;
492
493 err = broadsheet_setup_plls(par);
494 if (err)
495 return err;
496
497 broadsheet_write_reg(par, 0x0106, 0x0203);
498
499 err = broadsheet_setup_spi(par);
500 if (err)
501 return err;
502
503 err = broadsheet_setup_spiflash(par, initial_sfmcd);
504 if (err)
505 return err;
506
507 return broadsheet_verify_spiflash(par, flash_type);
508}
509
510static int broadsheet_spiflash_write_control(struct broadsheetfb_par *par,
511 int mode)
512{
513 int err;
514
515 broadsheet_write_reg(par, 0x0208, 1);
516 if (mode)
517 err = broadsheet_spiflash_write_byte(par, 0x06);
518 else
519 err = broadsheet_spiflash_write_byte(par, 0x04);
520
521 broadsheet_write_reg(par, 0x0208, 0);
522 return err;
523}
524
525static int broadsheet_spiflash_erase_sector(struct broadsheetfb_par *par,
526 int addr)
527{
528 int err;
529
530 broadsheet_spiflash_write_control(par, 1);
531
532 err = broadsheet_spiflash_op_on_address(par, 0xD8, addr);
533
534 broadsheet_write_reg(par, 0x0208, 0);
535
536 if (err)
537 return err;
538
539 err = broadsheet_spiflash_wait_for_status(par, 1000);
540
541 return err;
542}
543
544static int broadsheet_spiflash_read_range(struct broadsheetfb_par *par,
545 int addr, int size, char *data)
546{
547 int err;
548 int i;
549
550 err = broadsheet_spiflash_op_on_address(par, 0x03, addr);
551 if (err)
552 goto failout;
553
554 for (i = 0; i < size; i++) {
555 err = broadsheet_spiflash_read_byte(par, &data[i]);
556 if (err)
557 goto failout;
558 }
559
560failout:
561 broadsheet_write_reg(par, 0x0208, 0);
562 return err;
563}
564
565#define BS_SPIFLASH_PAGE_SIZE 256
566static int broadsheet_spiflash_write_page(struct broadsheetfb_par *par,
567 int addr, const char *data)
568{
569 int err;
570 int i;
571
572 broadsheet_spiflash_write_control(par, 1);
573
574 err = broadsheet_spiflash_op_on_address(par, 0x02, addr);
575 if (err)
576 goto failout;
577
578 for (i = 0; i < BS_SPIFLASH_PAGE_SIZE; i++) {
579 err = broadsheet_spiflash_write_byte(par, data[i]);
580 if (err)
581 goto failout;
582 }
583
584 broadsheet_write_reg(par, 0x0208, 0);
585
586 err = broadsheet_spiflash_wait_for_status(par, 100);
587
588failout:
589 return err;
590}
591
592static int broadsheet_spiflash_write_sector(struct broadsheetfb_par *par,
593 int addr, const char *data, int sector_size)
594{
595 int i;
596 int err;
597
598 for (i = 0; i < sector_size; i += BS_SPIFLASH_PAGE_SIZE) {
599 err = broadsheet_spiflash_write_page(par, addr + i, &data[i]);
600 if (err)
601 return err;
602 }
603 return 0;
604}
605
606/*
607 * The caller must guarantee that the data to be rewritten is entirely
608 * contained within this sector. That is, data_start_addr + data_len
609 * must be less than sector_start_addr + sector_size.
610 */
611static int broadsheet_spiflash_rewrite_sector(struct broadsheetfb_par *par,
612 int sector_size, int data_start_addr,
613 int data_len, const char *data)
614{
615 int err;
616 char *sector_buffer;
617 int tail_start_addr;
618 int start_sector_addr;
619
620 sector_buffer = kzalloc(sizeof(char)*sector_size, GFP_KERNEL);
621 if (!sector_buffer)
622 return -ENOMEM;
623
624 /* the start address of the sector is the 0th byte of that sector */
625 start_sector_addr = (data_start_addr / sector_size) * sector_size;
626
627 /*
628 * check if there is head data that we need to readback into our sector
629 * buffer first
630 */
631 if (data_start_addr != start_sector_addr) {
632 /*
633 * we need to read every byte up till the start address of our
634 * data and we put it into our sector buffer.
635 */
636 err = broadsheet_spiflash_read_range(par, start_sector_addr,
637 data_start_addr, sector_buffer);
638 if (err)
639 return err;
640 }
641
642 /* now we copy our data into the right place in the sector buffer */
643 memcpy(sector_buffer + data_start_addr, data, data_len);
644
645 /*
646 * now we check if there is a tail section of the sector that we need to
647 * readback.
648 */
649 tail_start_addr = (data_start_addr + data_len) % sector_size;
650
651 if (tail_start_addr) {
652 int tail_len;
653
654 tail_len = sector_size - tail_start_addr;
655
656 /* now we read this tail into our sector buffer */
657 err = broadsheet_spiflash_read_range(par, tail_start_addr,
658 tail_len, sector_buffer + tail_start_addr);
659 if (err)
660 return err;
661 }
662
663 /* if we got here we have the full sector that we want to rewrite. */
664
665 /* first erase the sector */
666 err = broadsheet_spiflash_erase_sector(par, start_sector_addr);
667 if (err)
668 return err;
669
670 /* now write it */
671 err = broadsheet_spiflash_write_sector(par, start_sector_addr,
672 sector_buffer, sector_size);
673 return err;
674}
675
676static int broadsheet_write_spiflash(struct broadsheetfb_par *par, u32 wfm_addr,
677 const u8 *wfm, int bytecount, int flash_type)
678{
679 int sector_size;
680 int err;
681 int cur_addr;
682 int writecount;
683 int maxlen;
684 int offset = 0;
685
686 switch (flash_type) {
687 case 0x10:
688 sector_size = 32*1024;
689 break;
690 case 0x11:
691 default:
692 sector_size = 64*1024;
693 break;
694 }
695
696 while (bytecount) {
697 cur_addr = wfm_addr + offset;
698 maxlen = roundup(cur_addr, sector_size) - cur_addr;
699 writecount = min(bytecount, maxlen);
700
701 err = broadsheet_spiflash_rewrite_sector(par, sector_size,
702 cur_addr, writecount, wfm + offset);
703 if (err)
704 return err;
705
706 offset += writecount;
707 bytecount -= writecount;
708 }
709
710 return 0;
711}
712
713static int broadsheet_store_waveform_to_spiflash(struct broadsheetfb_par *par,
714 const u8 *wfm, size_t wfm_size)
715{
716 int err = 0;
717 u16 initial_sfmcd = 0;
718 int flash_type = 0;
719
720 err = broadsheet_setup_for_wfm_write(par, &initial_sfmcd, &flash_type);
721 if (err)
722 goto failout;
723
724 err = broadsheet_write_spiflash(par, 0x886, wfm, wfm_size, flash_type);
725
726failout:
727 broadsheet_write_reg(par, 0x0204, initial_sfmcd);
728 return err;
729}
730
731static ssize_t broadsheet_loadstore_waveform(struct device *dev,
732 struct device_attribute *attr,
733 const char *buf, size_t len)
734{
735 int err;
736 struct fb_info *info = dev_get_drvdata(dev);
737 struct broadsheetfb_par *par = info->par;
738 const struct firmware *fw_entry;
739
740 if (len < 1)
741 return -EINVAL;
742
743 err = request_firmware(&fw_entry, "broadsheet.wbf", dev);
744 if (err < 0) {
745 dev_err(dev, "Failed to get broadsheet waveform\n");
746 goto err_failed;
747 }
748
749 /* try to enforce reasonable min max on waveform */
750 if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
751 dev_err(dev, "Invalid waveform\n");
752 err = -EINVAL;
753 goto err_failed;
754 }
755
756 mutex_lock(&(par->io_lock));
757 err = broadsheet_store_waveform_to_spiflash(par, fw_entry->data,
758 fw_entry->size);
759
760 mutex_unlock(&(par->io_lock));
761 if (err < 0) {
762 dev_err(dev, "Failed to store broadsheet waveform\n");
763 goto err_failed;
764 }
765
766 dev_info(dev, "Stored broadsheet waveform, size %zd\n", fw_entry->size);
767
768 return len;
769
770err_failed:
771 return err;
772}
773static DEVICE_ATTR(loadstore_waveform, S_IWUSR, NULL,
774 broadsheet_loadstore_waveform);
775
776/* upper level functions that manipulate the display and other stuff */
170static void __devinit broadsheet_init_display(struct broadsheetfb_par *par) 777static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
171{ 778{
172 u16 args[5]; 779 u16 args[5];
173 780 int xres = par->info->var.xres;
174 args[0] = DPY_W; 781 int yres = par->info->var.yres;
175 args[1] = DPY_H; 782
176 args[2] = (100 | (1 << 8) | (1 << 9)); /* sdcfg */ 783 args[0] = panel_table[par->panel_index].w;
177 args[3] = 2; /* gdrv cfg */ 784 args[1] = panel_table[par->panel_index].h;
178 args[4] = (4 | (1 << 7)); /* lut index format */ 785 args[2] = panel_table[par->panel_index].sdcfg;
786 args[3] = panel_table[par->panel_index].gdcfg;
787 args[4] = panel_table[par->panel_index].lutfmt;
179 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_CFG, 5, args); 788 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_CFG, 5, args);
180 789
181 /* did the controller really set it? */ 790 /* did the controller really set it? */
182 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_CFG, 5, args); 791 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_CFG, 5, args);
183 792
184 args[0] = 4; /* fsync len */ 793 args[0] = panel_table[par->panel_index].fsynclen;
185 args[1] = (10 << 8) | 4; /* fend/fbegin len */ 794 args[1] = panel_table[par->panel_index].fendfbegin;
186 args[2] = 10; /* line sync len */ 795 args[2] = panel_table[par->panel_index].lsynclen;
187 args[3] = (100 << 8) | 4; /* line end/begin len */ 796 args[3] = panel_table[par->panel_index].lendlbegin;
188 args[4] = 6; /* pixel clock cfg */ 797 args[4] = panel_table[par->panel_index].pixclk;
189 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_TMG, 5, args); 798 broadsheet_send_cmdargs(par, BS_CMD_INIT_DSPE_TMG, 5, args);
190 799
800 broadsheet_write_reg32(par, 0x310, xres*yres*2);
801
191 /* setup waveform */ 802 /* setup waveform */
192 args[0] = 0x886; 803 args[0] = 0x886;
193 args[1] = 0; 804 args[1] = 0;
@@ -207,8 +818,9 @@ static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
207 args[0] = 0x154; 818 args[0] = 0x154;
208 broadsheet_send_cmdargs(par, BS_CMD_WR_REG, 1, args); 819 broadsheet_send_cmdargs(par, BS_CMD_WR_REG, 1, args);
209 820
210 broadsheet_burst_write(par, DPY_W*DPY_H/2, 821 broadsheet_burst_write(par, (panel_table[par->panel_index].w *
211 (u16 *) par->info->screen_base); 822 panel_table[par->panel_index].h)/2,
823 (u16 *) par->info->screen_base);
212 824
213 broadsheet_send_command(par, BS_CMD_LD_IMG_END); 825 broadsheet_send_command(par, BS_CMD_LD_IMG_END);
214 826
@@ -222,6 +834,21 @@ static void __devinit broadsheet_init_display(struct broadsheetfb_par *par)
222 par->board->wait_for_rdy(par); 834 par->board->wait_for_rdy(par);
223} 835}
224 836
837static void __devinit broadsheet_identify(struct broadsheetfb_par *par)
838{
839 u16 rev, prc;
840 struct device *dev = par->info->device;
841
842 rev = broadsheet_read_reg(par, BS_REG_REV);
843 prc = broadsheet_read_reg(par, BS_REG_PRC);
844 dev_info(dev, "Broadsheet Rev 0x%x, Product Code 0x%x\n", rev, prc);
845
846 if (prc != 0x0047)
847 dev_warn(dev, "Unrecognized Broadsheet Product Code\n");
848 if (rev != 0x0100)
849 dev_warn(dev, "Unrecognized Broadsheet Revision\n");
850}
851
225static void __devinit broadsheet_init(struct broadsheetfb_par *par) 852static void __devinit broadsheet_init(struct broadsheetfb_par *par)
226{ 853{
227 broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN); 854 broadsheet_send_command(par, BS_CMD_INIT_SYS_RUN);
@@ -236,6 +863,7 @@ static void broadsheetfb_dpy_update_pages(struct broadsheetfb_par *par,
236 u16 args[5]; 863 u16 args[5];
237 unsigned char *buf = (unsigned char *)par->info->screen_base; 864 unsigned char *buf = (unsigned char *)par->info->screen_base;
238 865
866 mutex_lock(&(par->io_lock));
239 /* y1 must be a multiple of 4 so drop the lower bits */ 867 /* y1 must be a multiple of 4 so drop the lower bits */
240 y1 &= 0xFFFC; 868 y1 &= 0xFFFC;
241 /* y2 must be a multiple of 4 , but - 1 so up the lower bits */ 869 /* y2 must be a multiple of 4 , but - 1 so up the lower bits */
@@ -265,6 +893,7 @@ static void broadsheetfb_dpy_update_pages(struct broadsheetfb_par *par,
265 broadsheet_send_command(par, BS_CMD_WAIT_DSPE_FREND); 893 broadsheet_send_command(par, BS_CMD_WAIT_DSPE_FREND);
266 894
267 par->board->wait_for_rdy(par); 895 par->board->wait_for_rdy(par);
896 mutex_unlock(&(par->io_lock));
268 897
269} 898}
270 899
@@ -272,13 +901,15 @@ static void broadsheetfb_dpy_update(struct broadsheetfb_par *par)
272{ 901{
273 u16 args[5]; 902 u16 args[5];
274 903
904 mutex_lock(&(par->io_lock));
275 args[0] = 0x3 << 4; 905 args[0] = 0x3 << 4;
276 broadsheet_send_cmdargs(par, BS_CMD_LD_IMG, 1, args); 906 broadsheet_send_cmdargs(par, BS_CMD_LD_IMG, 1, args);
277 907
278 args[0] = 0x154; 908 args[0] = 0x154;
279 broadsheet_send_cmdargs(par, BS_CMD_WR_REG, 1, args); 909 broadsheet_send_cmdargs(par, BS_CMD_WR_REG, 1, args);
280 broadsheet_burst_write(par, DPY_W*DPY_H/2, 910 broadsheet_burst_write(par, (panel_table[par->panel_index].w *
281 (u16 *) par->info->screen_base); 911 panel_table[par->panel_index].h)/2,
912 (u16 *) par->info->screen_base);
282 913
283 broadsheet_send_command(par, BS_CMD_LD_IMG_END); 914 broadsheet_send_command(par, BS_CMD_LD_IMG_END);
284 915
@@ -290,7 +921,7 @@ static void broadsheetfb_dpy_update(struct broadsheetfb_par *par)
290 broadsheet_send_command(par, BS_CMD_WAIT_DSPE_FREND); 921 broadsheet_send_command(par, BS_CMD_WAIT_DSPE_FREND);
291 922
292 par->board->wait_for_rdy(par); 923 par->board->wait_for_rdy(par);
293 924 mutex_unlock(&(par->io_lock));
294} 925}
295 926
296/* this is called back from the deferred io workqueue */ 927/* this is called back from the deferred io workqueue */
@@ -436,6 +1067,8 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
436 unsigned char *videomemory; 1067 unsigned char *videomemory;
437 struct broadsheetfb_par *par; 1068 struct broadsheetfb_par *par;
438 int i; 1069 int i;
1070 int dpyw, dpyh;
1071 int panel_index;
439 1072
440 /* pick up board specific routines */ 1073 /* pick up board specific routines */
441 board = dev->dev.platform_data; 1074 board = dev->dev.platform_data;
@@ -450,7 +1083,24 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
450 if (!info) 1083 if (!info)
451 goto err; 1084 goto err;
452 1085
453 videomemorysize = (DPY_W*DPY_H); 1086 switch (board->get_panel_type()) {
1087 case 37:
1088 panel_index = 1;
1089 break;
1090 case 97:
1091 panel_index = 2;
1092 break;
1093 case 6:
1094 default:
1095 panel_index = 0;
1096 break;
1097 }
1098
1099 dpyw = panel_table[panel_index].w;
1100 dpyh = panel_table[panel_index].h;
1101
1102 videomemorysize = roundup((dpyw*dpyh), PAGE_SIZE);
1103
454 videomemory = vmalloc(videomemorysize); 1104 videomemory = vmalloc(videomemorysize);
455 if (!videomemory) 1105 if (!videomemory)
456 goto err_fb_rel; 1106 goto err_fb_rel;
@@ -460,16 +1110,25 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
460 info->screen_base = (char *)videomemory; 1110 info->screen_base = (char *)videomemory;
461 info->fbops = &broadsheetfb_ops; 1111 info->fbops = &broadsheetfb_ops;
462 1112
1113 broadsheetfb_var.xres = dpyw;
1114 broadsheetfb_var.yres = dpyh;
1115 broadsheetfb_var.xres_virtual = dpyw;
1116 broadsheetfb_var.yres_virtual = dpyh;
463 info->var = broadsheetfb_var; 1117 info->var = broadsheetfb_var;
1118
1119 broadsheetfb_fix.line_length = dpyw;
464 info->fix = broadsheetfb_fix; 1120 info->fix = broadsheetfb_fix;
465 info->fix.smem_len = videomemorysize; 1121 info->fix.smem_len = videomemorysize;
466 par = info->par; 1122 par = info->par;
1123 par->panel_index = panel_index;
467 par->info = info; 1124 par->info = info;
468 par->board = board; 1125 par->board = board;
469 par->write_reg = broadsheet_write_reg; 1126 par->write_reg = broadsheet_write_reg;
470 par->read_reg = broadsheet_read_reg; 1127 par->read_reg = broadsheet_read_reg;
471 init_waitqueue_head(&par->waitq); 1128 init_waitqueue_head(&par->waitq);
472 1129
1130 mutex_init(&par->io_lock);
1131
473 info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; 1132 info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
474 1133
475 info->fbdefio = &broadsheetfb_defio; 1134 info->fbdefio = &broadsheetfb_defio;
@@ -496,13 +1155,20 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
496 if (retval < 0) 1155 if (retval < 0)
497 goto err_free_irq; 1156 goto err_free_irq;
498 1157
1158 broadsheet_identify(par);
1159
499 broadsheet_init(par); 1160 broadsheet_init(par);
500 1161
501 retval = register_framebuffer(info); 1162 retval = register_framebuffer(info);
502 if (retval < 0) 1163 if (retval < 0)
503 goto err_free_irq; 1164 goto err_free_irq;
1165
504 platform_set_drvdata(dev, info); 1166 platform_set_drvdata(dev, info);
505 1167
1168 retval = device_create_file(&dev->dev, &dev_attr_loadstore_waveform);
1169 if (retval < 0)
1170 goto err_unreg_fb;
1171
506 printk(KERN_INFO 1172 printk(KERN_INFO
507 "fb%d: Broadsheet frame buffer, using %dK of video memory\n", 1173 "fb%d: Broadsheet frame buffer, using %dK of video memory\n",
508 info->node, videomemorysize >> 10); 1174 info->node, videomemorysize >> 10);
@@ -510,6 +1176,8 @@ static int __devinit broadsheetfb_probe(struct platform_device *dev)
510 1176
511 return 0; 1177 return 0;
512 1178
1179err_unreg_fb:
1180 unregister_framebuffer(info);
513err_free_irq: 1181err_free_irq:
514 board->cleanup(par); 1182 board->cleanup(par);
515err_cmap: 1183err_cmap:
@@ -530,6 +1198,8 @@ static int __devexit broadsheetfb_remove(struct platform_device *dev)
530 1198
531 if (info) { 1199 if (info) {
532 struct broadsheetfb_par *par = info->par; 1200 struct broadsheetfb_par *par = info->par;
1201
1202 device_remove_file(info->dev, &dev_attr_loadstore_waveform);
533 unregister_framebuffer(info); 1203 unregister_framebuffer(info);
534 fb_deferred_io_cleanup(info); 1204 fb_deferred_io_cleanup(info);
535 par->board->cleanup(par); 1205 par->board->cleanup(par);
diff --git a/drivers/video/mb862xx/mb862xxfb.c b/drivers/video/mb862xx/mb862xxfb.c
index fabb0c59a211..8280a58a0e55 100644
--- a/drivers/video/mb862xx/mb862xxfb.c
+++ b/drivers/video/mb862xx/mb862xxfb.c
@@ -31,15 +31,6 @@
31#define CARMINE_MEM_SIZE 0x8000000 31#define CARMINE_MEM_SIZE 0x8000000
32#define DRV_NAME "mb862xxfb" 32#define DRV_NAME "mb862xxfb"
33 33
34#if defined(CONFIG_LWMON5)
35static struct mb862xx_gc_mode lwmon5_gc_mode = {
36 /* Mode for Sharp LQ104V1DG61 TFT LCD Panel */
37 { "640x480", 60, 640, 480, 40000, 48, 16, 32, 11, 96, 2, 0, 0, 0 },
38 /* 16 bits/pixel, 32MB, 100MHz, SDRAM memory mode value */
39 16, 0x2000000, GC_CCF_COT_100, 0x414fb7f2
40};
41#endif
42
43#if defined(CONFIG_SOCRATES) 34#if defined(CONFIG_SOCRATES)
44static struct mb862xx_gc_mode socrates_gc_mode = { 35static struct mb862xx_gc_mode socrates_gc_mode = {
45 /* Mode for Prime View PM070WL4 TFT LCD Panel */ 36 /* Mode for Prime View PM070WL4 TFT LCD Panel */
@@ -600,10 +591,6 @@ static int __devinit of_platform_mb862xx_probe(struct of_device *ofdev,
600 goto irqdisp; 591 goto irqdisp;
601 } 592 }
602 593
603#if defined(CONFIG_LWMON5)
604 par->gc_mode = &lwmon5_gc_mode;
605#endif
606
607#if defined(CONFIG_SOCRATES) 594#if defined(CONFIG_SOCRATES)
608 par->gc_mode = &socrates_gc_mode; 595 par->gc_mode = &socrates_gc_mode;
609#endif 596#endif
diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c
index 01f77bcc68f9..afea9abbd678 100644
--- a/drivers/video/mbx/mbxfb.c
+++ b/drivers/video/mbx/mbxfb.c
@@ -693,7 +693,7 @@ static void __devinit setup_memc(struct fb_info *fbi)
693 unsigned long tmp; 693 unsigned long tmp;
694 int i; 694 int i;
695 695
696 /* FIXME: use platfrom specific parameters */ 696 /* FIXME: use platform specific parameters */
697 /* setup SDRAM controller */ 697 /* setup SDRAM controller */
698 write_reg_dly((LMCFG_LMC_DS | LMCFG_LMC_TS | LMCFG_LMD_TS | 698 write_reg_dly((LMCFG_LMC_DS | LMCFG_LMC_TS | LMCFG_LMD_TS |
699 LMCFG_LMA_TS), 699 LMCFG_LMA_TS),
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 0129f1bc3522..b895aae41630 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -893,7 +893,7 @@ const struct fb_videomode *fb_match_mode(const struct fb_var_screeninfo *var,
893} 893}
894 894
895/** 895/**
896 * fb_add_videomode: adds videomode entry to modelist 896 * fb_add_videomode - adds videomode entry to modelist
897 * @mode: videomode to add 897 * @mode: videomode to add
898 * @head: struct list_head of modelist 898 * @head: struct list_head of modelist
899 * 899 *
@@ -928,7 +928,7 @@ int fb_add_videomode(const struct fb_videomode *mode, struct list_head *head)
928} 928}
929 929
930/** 930/**
931 * fb_delete_videomode: removed videomode entry from modelist 931 * fb_delete_videomode - removed videomode entry from modelist
932 * @mode: videomode to remove 932 * @mode: videomode to remove
933 * @head: struct list_head of modelist 933 * @head: struct list_head of modelist
934 * 934 *
@@ -953,7 +953,7 @@ void fb_delete_videomode(const struct fb_videomode *mode,
953} 953}
954 954
955/** 955/**
956 * fb_destroy_modelist: destroy modelist 956 * fb_destroy_modelist - destroy modelist
957 * @head: struct list_head of modelist 957 * @head: struct list_head of modelist
958 */ 958 */
959void fb_destroy_modelist(struct list_head *head) 959void fb_destroy_modelist(struct list_head *head)
@@ -968,7 +968,7 @@ void fb_destroy_modelist(struct list_head *head)
968EXPORT_SYMBOL_GPL(fb_destroy_modelist); 968EXPORT_SYMBOL_GPL(fb_destroy_modelist);
969 969
970/** 970/**
971 * fb_videomode_to_modelist: convert mode array to mode list 971 * fb_videomode_to_modelist - convert mode array to mode list
972 * @modedb: array of struct fb_videomode 972 * @modedb: array of struct fb_videomode
973 * @num: number of entries in array 973 * @num: number of entries in array
974 * @head: struct list_head of modelist 974 * @head: struct list_head of modelist
diff --git a/drivers/video/nuc900fb.c b/drivers/video/nuc900fb.c
new file mode 100644
index 000000000000..6bf0d460a738
--- /dev/null
+++ b/drivers/video/nuc900fb.c
@@ -0,0 +1,779 @@
1/*
2 *
3 * Copyright (c) 2009 Nuvoton technology corporation
4 * All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Description:
12 * Nuvoton LCD Controller Driver
13 * Author:
14 * Wang Qiang (rurality.linux@gmail.com) 2009/12/11
15 */
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/errno.h>
19#include <linux/string.h>
20#include <linux/mm.h>
21#include <linux/tty.h>
22#include <linux/slab.h>
23#include <linux/delay.h>
24#include <linux/fb.h>
25#include <linux/init.h>
26#include <linux/dma-mapping.h>
27#include <linux/interrupt.h>
28#include <linux/workqueue.h>
29#include <linux/wait.h>
30#include <linux/platform_device.h>
31#include <linux/clk.h>
32#include <linux/cpufreq.h>
33#include <linux/io.h>
34#include <linux/pm.h>
35#include <linux/device.h>
36
37#include <mach/map.h>
38#include <mach/regs-clock.h>
39#include <mach/regs-ldm.h>
40#include <mach/fb.h>
41#include <mach/clkdev.h>
42
43#include "nuc900fb.h"
44
45
46/*
47 * Initialize the nuc900 video (dual) buffer address
48 */
49static void nuc900fb_set_lcdaddr(struct fb_info *info)
50{
51 struct nuc900fb_info *fbi = info->par;
52 void __iomem *regs = fbi->io;
53 unsigned long vbaddr1, vbaddr2;
54
55 vbaddr1 = info->fix.smem_start;
56 vbaddr2 = info->fix.smem_start;
57 vbaddr2 += info->fix.line_length * info->var.yres;
58
59 /* set frambuffer start phy addr*/
60 writel(vbaddr1, regs + REG_LCM_VA_BADDR0);
61 writel(vbaddr2, regs + REG_LCM_VA_BADDR1);
62
63 writel(fbi->regs.lcd_va_fbctrl, regs + REG_LCM_VA_FBCTRL);
64 writel(fbi->regs.lcd_va_scale, regs + REG_LCM_VA_SCALE);
65}
66
67/*
68 * calculate divider for lcd div
69 */
70static unsigned int nuc900fb_calc_pixclk(struct nuc900fb_info *fbi,
71 unsigned long pixclk)
72{
73 unsigned long clk = fbi->clk_rate;
74 unsigned long long div;
75
76 /* pixclk is in picseconds. our clock is in Hz*/
77 /* div = (clk * pixclk)/10^12 */
78 div = (unsigned long long)clk * pixclk;
79 div >>= 12;
80 do_div(div, 625 * 625UL * 625);
81
82 dev_dbg(fbi->dev, "pixclk %ld, divisor is %lld\n", pixclk, div);
83
84 return div;
85}
86
87/*
88 * Check the video params of 'var'.
89 */
90static int nuc900fb_check_var(struct fb_var_screeninfo *var,
91 struct fb_info *info)
92{
93 struct nuc900fb_info *fbi = info->par;
94 struct nuc900fb_mach_info *mach_info = fbi->dev->platform_data;
95 struct nuc900fb_display *display = NULL;
96 struct nuc900fb_display *default_display = mach_info->displays +
97 mach_info->default_display;
98 int i;
99
100 dev_dbg(fbi->dev, "check_var(var=%p, info=%p)\n", var, info);
101
102 /* validate x/y resolution */
103 /* choose default mode if possible */
104 if (var->xres == default_display->xres &&
105 var->yres == default_display->yres &&
106 var->bits_per_pixel == default_display->bpp)
107 display = default_display;
108 else
109 for (i = 0; i < mach_info->num_displays; i++)
110 if (var->xres == mach_info->displays[i].xres &&
111 var->yres == mach_info->displays[i].yres &&
112 var->bits_per_pixel == mach_info->displays[i].bpp) {
113 display = mach_info->displays + i;
114 break;
115 }
116
117 if (display == NULL) {
118 printk(KERN_ERR "wrong resolution or depth %dx%d at %d bit per pixel\n",
119 var->xres, var->yres, var->bits_per_pixel);
120 return -EINVAL;
121 }
122
123 /* it should be the same size as the display */
124 var->xres_virtual = display->xres;
125 var->yres_virtual = display->yres;
126 var->height = display->height;
127 var->width = display->width;
128
129 /* copy lcd settings */
130 var->pixclock = display->pixclock;
131 var->left_margin = display->left_margin;
132 var->right_margin = display->right_margin;
133 var->upper_margin = display->upper_margin;
134 var->lower_margin = display->lower_margin;
135 var->vsync_len = display->vsync_len;
136 var->hsync_len = display->hsync_len;
137
138 var->transp.offset = 0;
139 var->transp.length = 0;
140
141 fbi->regs.lcd_dccs = display->dccs;
142 fbi->regs.lcd_device_ctrl = display->devctl;
143 fbi->regs.lcd_va_fbctrl = display->fbctrl;
144 fbi->regs.lcd_va_scale = display->scale;
145
146 /* set R/G/B possions */
147 switch (var->bits_per_pixel) {
148 case 1:
149 case 2:
150 case 4:
151 case 8:
152 default:
153 var->red.offset = 0;
154 var->red.length = var->bits_per_pixel;
155 var->green = var->red;
156 var->blue = var->red;
157 break;
158 case 12:
159 var->red.length = 4;
160 var->green.length = 4;
161 var->blue.length = 4;
162 var->red.offset = 8;
163 var->green.offset = 4;
164 var->blue.offset = 0;
165 break;
166 case 16:
167 var->red.length = 5;
168 var->green.length = 6;
169 var->blue.length = 5;
170 var->red.offset = 11;
171 var->green.offset = 5;
172 var->blue.offset = 0;
173 break;
174 case 18:
175 var->red.length = 6;
176 var->green.length = 6;
177 var->blue.length = 6;
178 var->red.offset = 12;
179 var->green.offset = 6;
180 var->blue.offset = 0;
181 break;
182 case 32:
183 var->red.length = 8;
184 var->green.length = 8;
185 var->blue.length = 8;
186 var->red.offset = 16;
187 var->green.offset = 8;
188 var->blue.offset = 0;
189 break;
190 }
191
192 return 0;
193}
194
195/*
196 * Calculate lcd register values from var setting & save into hw
197 */
198static void nuc900fb_calculate_lcd_regs(const struct fb_info *info,
199 struct nuc900fb_hw *regs)
200{
201 const struct fb_var_screeninfo *var = &info->var;
202 int vtt = var->height + var->upper_margin + var->lower_margin;
203 int htt = var->width + var->left_margin + var->right_margin;
204 int hsync = var->width + var->right_margin;
205 int vsync = var->height + var->lower_margin;
206
207 regs->lcd_crtc_size = LCM_CRTC_SIZE_VTTVAL(vtt) |
208 LCM_CRTC_SIZE_HTTVAL(htt);
209 regs->lcd_crtc_dend = LCM_CRTC_DEND_VDENDVAL(var->height) |
210 LCM_CRTC_DEND_HDENDVAL(var->width);
211 regs->lcd_crtc_hr = LCM_CRTC_HR_EVAL(var->width + 5) |
212 LCM_CRTC_HR_SVAL(var->width + 1);
213 regs->lcd_crtc_hsync = LCM_CRTC_HSYNC_EVAL(hsync + var->hsync_len) |
214 LCM_CRTC_HSYNC_SVAL(hsync);
215 regs->lcd_crtc_vr = LCM_CRTC_VR_EVAL(vsync + var->vsync_len) |
216 LCM_CRTC_VR_SVAL(vsync);
217
218}
219
220/*
221 * Activate (set) the controller from the given framebuffer
222 * information
223 */
224static void nuc900fb_activate_var(struct fb_info *info)
225{
226 struct nuc900fb_info *fbi = info->par;
227 void __iomem *regs = fbi->io;
228 struct fb_var_screeninfo *var = &info->var;
229 int clkdiv;
230
231 clkdiv = nuc900fb_calc_pixclk(fbi, var->pixclock) - 1;
232 if (clkdiv < 0)
233 clkdiv = 0;
234
235 nuc900fb_calculate_lcd_regs(info, &fbi->regs);
236
237 /* set the new lcd registers*/
238
239 dev_dbg(fbi->dev, "new lcd register set:\n");
240 dev_dbg(fbi->dev, "dccs = 0x%08x\n", fbi->regs.lcd_dccs);
241 dev_dbg(fbi->dev, "dev_ctl = 0x%08x\n", fbi->regs.lcd_device_ctrl);
242 dev_dbg(fbi->dev, "crtc_size = 0x%08x\n", fbi->regs.lcd_crtc_size);
243 dev_dbg(fbi->dev, "crtc_dend = 0x%08x\n", fbi->regs.lcd_crtc_dend);
244 dev_dbg(fbi->dev, "crtc_hr = 0x%08x\n", fbi->regs.lcd_crtc_hr);
245 dev_dbg(fbi->dev, "crtc_hsync = 0x%08x\n", fbi->regs.lcd_crtc_hsync);
246 dev_dbg(fbi->dev, "crtc_vr = 0x%08x\n", fbi->regs.lcd_crtc_vr);
247
248 writel(fbi->regs.lcd_device_ctrl, regs + REG_LCM_DEV_CTRL);
249 writel(fbi->regs.lcd_crtc_size, regs + REG_LCM_CRTC_SIZE);
250 writel(fbi->regs.lcd_crtc_dend, regs + REG_LCM_CRTC_DEND);
251 writel(fbi->regs.lcd_crtc_hr, regs + REG_LCM_CRTC_HR);
252 writel(fbi->regs.lcd_crtc_hsync, regs + REG_LCM_CRTC_HSYNC);
253 writel(fbi->regs.lcd_crtc_vr, regs + REG_LCM_CRTC_VR);
254
255 /* set lcd address pointers */
256 nuc900fb_set_lcdaddr(info);
257
258 writel(fbi->regs.lcd_dccs, regs + REG_LCM_DCCS);
259}
260
261/*
262 * Alters the hardware state.
263 *
264 */
265static int nuc900fb_set_par(struct fb_info *info)
266{
267 struct fb_var_screeninfo *var = &info->var;
268
269 switch (var->bits_per_pixel) {
270 case 32:
271 case 24:
272 case 18:
273 case 16:
274 case 12:
275 info->fix.visual = FB_VISUAL_TRUECOLOR;
276 break;
277 case 1:
278 info->fix.visual = FB_VISUAL_MONO01;
279 break;
280 default:
281 info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
282 break;
283 }
284
285 info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8;
286
287 /* activate this new configuration */
288 nuc900fb_activate_var(info);
289 return 0;
290}
291
292static inline unsigned int chan_to_field(unsigned int chan,
293 struct fb_bitfield *bf)
294{
295 chan &= 0xffff;
296 chan >>= 16 - bf->length;
297 return chan << bf->offset;
298}
299
300static int nuc900fb_setcolreg(unsigned regno,
301 unsigned red, unsigned green, unsigned blue,
302 unsigned transp, struct fb_info *info)
303{
304 unsigned int val;
305
306 switch (info->fix.visual) {
307 case FB_VISUAL_TRUECOLOR:
308 /* true-colour, use pseuo-palette */
309 if (regno < 16) {
310 u32 *pal = info->pseudo_palette;
311
312 val = chan_to_field(red, &info->var.red);
313 val |= chan_to_field(green, &info->var.green);
314 val |= chan_to_field(blue, &info->var.blue);
315 pal[regno] = val;
316 }
317 break;
318
319 default:
320 return 1; /* unknown type */
321 }
322 return 0;
323}
324
325/**
326 * nuc900fb_blank
327 *
328 */
329static int nuc900fb_blank(int blank_mode, struct fb_info *info)
330{
331
332 return 0;
333}
334
335static struct fb_ops nuc900fb_ops = {
336 .owner = THIS_MODULE,
337 .fb_check_var = nuc900fb_check_var,
338 .fb_set_par = nuc900fb_set_par,
339 .fb_blank = nuc900fb_blank,
340 .fb_setcolreg = nuc900fb_setcolreg,
341 .fb_fillrect = cfb_fillrect,
342 .fb_copyarea = cfb_copyarea,
343 .fb_imageblit = cfb_imageblit,
344};
345
346
347static inline void modify_gpio(void __iomem *reg,
348 unsigned long set, unsigned long mask)
349{
350 unsigned long tmp;
351 tmp = readl(reg) & ~mask;
352 writel(tmp | set, reg);
353}
354
355/*
356 * Initialise LCD-related registers
357 */
358static int nuc900fb_init_registers(struct fb_info *info)
359{
360 struct nuc900fb_info *fbi = info->par;
361 struct nuc900fb_mach_info *mach_info = fbi->dev->platform_data;
362 void __iomem *regs = fbi->io;
363
364 /*reset the display engine*/
365 writel(0, regs + REG_LCM_DCCS);
366 writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_ENG_RST,
367 regs + REG_LCM_DCCS);
368 ndelay(100);
369 writel(readl(regs + REG_LCM_DCCS) & (~LCM_DCCS_ENG_RST),
370 regs + REG_LCM_DCCS);
371 ndelay(100);
372
373 writel(0, regs + REG_LCM_DEV_CTRL);
374
375 /* config gpio output */
376 modify_gpio(W90X900_VA_GPIO + 0x54, mach_info->gpio_dir,
377 mach_info->gpio_dir_mask);
378 modify_gpio(W90X900_VA_GPIO + 0x58, mach_info->gpio_data,
379 mach_info->gpio_data_mask);
380
381 return 0;
382}
383
384
385/*
386 * Alloc the SDRAM region of NUC900 for the frame buffer.
387 * The buffer should be a non-cached, non-buffered, memory region
388 * to allow palette and pixel writes without flushing the cache.
389 */
390static int __init nuc900fb_map_video_memory(struct fb_info *info)
391{
392 struct nuc900fb_info *fbi = info->par;
393 dma_addr_t map_dma;
394 unsigned long map_size = PAGE_ALIGN(info->fix.smem_len);
395
396 dev_dbg(fbi->dev, "nuc900fb_map_video_memory(fbi=%p) map_size %lu\n",
397 fbi, map_size);
398
399 info->screen_base = dma_alloc_writecombine(fbi->dev, map_size,
400 &map_dma, GFP_KERNEL);
401
402 if (!info->screen_base)
403 return -ENOMEM;
404
405 memset(info->screen_base, 0x00, map_size);
406 info->fix.smem_start = map_dma;
407
408 return 0;
409}
410
411static inline void nuc900fb_unmap_video_memory(struct fb_info *info)
412{
413 struct nuc900fb_info *fbi = info->par;
414 dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
415 info->screen_base, info->fix.smem_start);
416}
417
418static irqreturn_t nuc900fb_irqhandler(int irq, void *dev_id)
419{
420 struct nuc900fb_info *fbi = dev_id;
421 void __iomem *regs = fbi->io;
422 void __iomem *irq_base = fbi->irq_base;
423 unsigned long lcdirq = readl(regs + REG_LCM_INT_CS);
424
425 if (lcdirq & LCM_INT_CS_DISP_F_STATUS) {
426 writel(readl(irq_base) | 1<<30, irq_base);
427
428 /* wait VA_EN low */
429 if ((readl(regs + REG_LCM_DCCS) &
430 LCM_DCCS_SINGLE) == LCM_DCCS_SINGLE)
431 while ((readl(regs + REG_LCM_DCCS) &
432 LCM_DCCS_VA_EN) == LCM_DCCS_VA_EN)
433 ;
434 /* display_out-enable */
435 writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_DISP_OUT_EN,
436 regs + REG_LCM_DCCS);
437 /* va-enable*/
438 writel(readl(regs + REG_LCM_DCCS) | LCM_DCCS_VA_EN,
439 regs + REG_LCM_DCCS);
440 } else if (lcdirq & LCM_INT_CS_UNDERRUN_INT) {
441 writel(readl(irq_base) | LCM_INT_CS_UNDERRUN_INT, irq_base);
442 } else if (lcdirq & LCM_INT_CS_BUS_ERROR_INT) {
443 writel(readl(irq_base) | LCM_INT_CS_BUS_ERROR_INT, irq_base);
444 }
445
446 return IRQ_HANDLED;
447}
448
449#ifdef CONFIG_CPU_FREQ
450
451static int nuc900fb_cpufreq_transition(struct notifier_block *nb,
452 unsigned long val, void *data)
453{
454 struct nuc900fb_info *info;
455 struct fb_info *fbinfo;
456 long delta_f;
457 info = container_of(nb, struct nuc900fb_info, freq_transition);
458 fbinfo = platform_get_drvdata(to_platform_device(info->dev));
459
460 delta_f = info->clk_rate - clk_get_rate(info->clk);
461
462 if ((val == CPUFREQ_POSTCHANGE && delta_f > 0) ||
463 (val == CPUFREQ_PRECHANGE && delta_f < 0)) {
464 info->clk_rate = clk_get_rate(info->clk);
465 nuc900fb_activate_var(fbinfo);
466 }
467
468 return 0;
469}
470
471static inline int nuc900fb_cpufreq_register(struct nuc900fb_info *fbi)
472{
473 fbi->freq_transition.notifier_call = nuc900fb_cpufreq_transition;
474 return cpufreq_register_notifier(&fbi->freq_transition,
475 CPUFREQ_TRANSITION_NOTIFIER);
476}
477
478static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *fbi)
479{
480 cpufreq_unregister_notifier(&fbi->freq_transition,
481 CPUFREQ_TRANSITION_NOTIFIER);
482}
483#else
484static inline int nuc900fb_cpufreq_transition(struct notifier_block *nb,
485 unsigned long val, void *data)
486{
487 return 0;
488}
489
490static inline int nuc900fb_cpufreq_register(struct nuc900fb_info *fbi)
491{
492 return 0;
493}
494
495static inline void nuc900fb_cpufreq_deregister(struct nuc900fb_info *info)
496{
497}
498#endif
499
500static char driver_name[] = "nuc900fb";
501
502static int __devinit nuc900fb_probe(struct platform_device *pdev)
503{
504 struct nuc900fb_info *fbi;
505 struct nuc900fb_display *display;
506 struct fb_info *fbinfo;
507 struct nuc900fb_mach_info *mach_info;
508 struct resource *res;
509 int ret;
510 int irq;
511 int i;
512 int size;
513
514 dev_dbg(&pdev->dev, "devinit\n");
515 mach_info = pdev->dev.platform_data;
516 if (mach_info == NULL) {
517 dev_err(&pdev->dev,
518 "no platform data for lcd, cannot attach\n");
519 return -EINVAL;
520 }
521
522 if (mach_info->default_display > mach_info->num_displays) {
523 dev_err(&pdev->dev,
524 "default display No. is %d but only %d displays \n",
525 mach_info->default_display, mach_info->num_displays);
526 return -EINVAL;
527 }
528
529
530 display = mach_info->displays + mach_info->default_display;
531
532 irq = platform_get_irq(pdev, 0);
533 if (irq < 0) {
534 dev_err(&pdev->dev, "no irq for device\n");
535 return -ENOENT;
536 }
537
538 fbinfo = framebuffer_alloc(sizeof(struct nuc900fb_info), &pdev->dev);
539 if (!fbinfo)
540 return -ENOMEM;
541
542 platform_set_drvdata(pdev, fbinfo);
543
544 fbi = fbinfo->par;
545 fbi->dev = &pdev->dev;
546
547#ifdef CONFIG_CPU_NUC950
548 fbi->drv_type = LCDDRV_NUC950;
549#endif
550
551 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
552
553 size = (res->end - res->start) + 1;
554 fbi->mem = request_mem_region(res->start, size, pdev->name);
555 if (fbi->mem == NULL) {
556 dev_err(&pdev->dev, "failed to alloc memory region\n");
557 ret = -ENOENT;
558 goto free_fb;
559 }
560
561 fbi->io = ioremap(res->start, size);
562 if (fbi->io == NULL) {
563 dev_err(&pdev->dev, "ioremap() of lcd registers failed\n");
564 ret = -ENXIO;
565 goto release_mem_region;
566 }
567
568 fbi->irq_base = fbi->io + REG_LCM_INT_CS;
569
570
571 /* Stop the LCD */
572 writel(0, fbi->io + REG_LCM_DCCS);
573
574 /* fill the fbinfo*/
575 strcpy(fbinfo->fix.id, driver_name);
576 fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
577 fbinfo->fix.type_aux = 0;
578 fbinfo->fix.xpanstep = 0;
579 fbinfo->fix.ypanstep = 0;
580 fbinfo->fix.ywrapstep = 0;
581 fbinfo->fix.accel = FB_ACCEL_NONE;
582 fbinfo->var.nonstd = 0;
583 fbinfo->var.activate = FB_ACTIVATE_NOW;
584 fbinfo->var.accel_flags = 0;
585 fbinfo->var.vmode = FB_VMODE_NONINTERLACED;
586 fbinfo->fbops = &nuc900fb_ops;
587 fbinfo->flags = FBINFO_FLAG_DEFAULT;
588 fbinfo->pseudo_palette = &fbi->pseudo_pal;
589
590 ret = request_irq(irq, nuc900fb_irqhandler, IRQF_DISABLED,
591 pdev->name, fbinfo);
592 if (ret) {
593 dev_err(&pdev->dev, "cannot register irq handler %d -err %d\n",
594 irq, ret);
595 ret = -EBUSY;
596 goto release_regs;
597 }
598
599 nuc900_driver_clksrc_div(&pdev->dev, "ext", 0x2);
600
601 fbi->clk = clk_get(&pdev->dev, NULL);
602 if (!fbi->clk || IS_ERR(fbi->clk)) {
603 printk(KERN_ERR "nuc900-lcd:failed to get lcd clock source\n");
604 ret = -ENOENT;
605 goto release_irq;
606 }
607
608 clk_enable(fbi->clk);
609 dev_dbg(&pdev->dev, "got and enabled clock\n");
610
611 fbi->clk_rate = clk_get_rate(fbi->clk);
612
613 /* calutate the video buffer size */
614 for (i = 0; i < mach_info->num_displays; i++) {
615 unsigned long smem_len = mach_info->displays[i].xres;
616 smem_len *= mach_info->displays[i].yres;
617 smem_len *= mach_info->displays[i].bpp;
618 smem_len >>= 3;
619 if (fbinfo->fix.smem_len < smem_len)
620 fbinfo->fix.smem_len = smem_len;
621 }
622
623 /* Initialize Video Memory */
624 ret = nuc900fb_map_video_memory(fbinfo);
625 if (ret) {
626 printk(KERN_ERR "Failed to allocate video RAM: %x\n", ret);
627 goto release_clock;
628 }
629
630 dev_dbg(&pdev->dev, "got video memory\n");
631
632 fbinfo->var.xres = display->xres;
633 fbinfo->var.yres = display->yres;
634 fbinfo->var.bits_per_pixel = display->bpp;
635
636 nuc900fb_init_registers(fbinfo);
637
638 nuc900fb_check_var(&fbinfo->var, fbinfo);
639
640 ret = nuc900fb_cpufreq_register(fbi);
641 if (ret < 0) {
642 dev_err(&pdev->dev, "Failed to register cpufreq\n");
643 goto free_video_memory;
644 }
645
646 ret = register_framebuffer(fbinfo);
647 if (ret) {
648 printk(KERN_ERR "failed to register framebuffer device: %d\n",
649 ret);
650 goto free_cpufreq;
651 }
652
653 printk(KERN_INFO "fb%d: %s frame buffer device\n",
654 fbinfo->node, fbinfo->fix.id);
655
656 return 0;
657
658free_cpufreq:
659 nuc900fb_cpufreq_deregister(fbi);
660free_video_memory:
661 nuc900fb_unmap_video_memory(fbinfo);
662release_clock:
663 clk_disable(fbi->clk);
664 clk_put(fbi->clk);
665release_irq:
666 free_irq(irq, fbi);
667release_regs:
668 iounmap(fbi->io);
669release_mem_region:
670 release_mem_region((unsigned long)fbi->mem, size);
671free_fb:
672 framebuffer_release(fbinfo);
673 return ret;
674}
675
676/*
677 * shutdown the lcd controller
678 */
679static void nuc900fb_stop_lcd(struct fb_info *info)
680{
681 struct nuc900fb_info *fbi = info->par;
682 void __iomem *regs = fbi->io;
683
684 writel((~LCM_DCCS_DISP_INT_EN) | (~LCM_DCCS_VA_EN) | (~LCM_DCCS_OSD_EN),
685 regs + REG_LCM_DCCS);
686}
687
688/*
689 * Cleanup
690 */
691static int nuc900fb_remove(struct platform_device *pdev)
692{
693 struct fb_info *fbinfo = platform_get_drvdata(pdev);
694 struct nuc900fb_info *fbi = fbinfo->par;
695 int irq;
696
697 nuc900fb_stop_lcd(fbinfo);
698 msleep(1);
699
700 nuc900fb_unmap_video_memory(fbinfo);
701
702 iounmap(fbi->io);
703
704 irq = platform_get_irq(pdev, 0);
705 free_irq(irq, fbi);
706
707 release_resource(fbi->mem);
708 kfree(fbi->mem);
709
710 platform_set_drvdata(pdev, NULL);
711 framebuffer_release(fbinfo);
712
713 return 0;
714}
715
716#ifdef CONFIG_PM
717
718/*
719 * suspend and resume support for the lcd controller
720 */
721
722static int nuc900fb_suspend(struct platform_device *dev, pm_message_t state)
723{
724 struct fb_info *fbinfo = platform_get_drvdata(dev);
725 struct nuc900fb_info *info = fbinfo->par;
726
727 nuc900fb_stop_lcd();
728 msleep(1);
729 clk_disable(info->clk);
730 return 0;
731}
732
733static int nuc900fb_resume(struct platform_device *dev)
734{
735 struct fb_info *fbinfo = platform_get_drvdata(dev);
736 struct nuc900fb_info *fbi = fbinfo->par;
737
738 printk(KERN_INFO "nuc900fb resume\n");
739
740 clk_enable(fbi->clk);
741 msleep(1);
742
743 nuc900fb_init_registers(fbinfo);
744 nuc900fb_activate_var(bfinfo);
745
746 return 0;
747}
748
749#else
750#define nuc900fb_suspend NULL
751#define nuc900fb_resume NULL
752#endif
753
754static struct platform_driver nuc900fb_driver = {
755 .probe = nuc900fb_probe,
756 .remove = nuc900fb_remove,
757 .suspend = nuc900fb_suspend,
758 .resume = nuc900fb_resume,
759 .driver = {
760 .name = "nuc900-lcd",
761 .owner = THIS_MODULE,
762 },
763};
764
765int __devinit nuc900fb_init(void)
766{
767 return platform_driver_register(&nuc900fb_driver);
768}
769
770static void __exit nuc900fb_cleanup(void)
771{
772 platform_driver_unregister(&nuc900fb_driver);
773}
774
775module_init(nuc900fb_init);
776module_exit(nuc900fb_cleanup);
777
778MODULE_DESCRIPTION("Framebuffer driver for the NUC900");
779MODULE_LICENSE("GPL");
diff --git a/drivers/video/nuc900fb.h b/drivers/video/nuc900fb.h
new file mode 100644
index 000000000000..6c23aa3d3b89
--- /dev/null
+++ b/drivers/video/nuc900fb.h
@@ -0,0 +1,55 @@
1/*
2 *
3 * Copyright (c) 2009 Nuvoton technology corporation
4 * All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Auther:
12 * Wang Qiang(rurality.linux@gmail.com) 2009/12/16
13 */
14
15#ifndef __NUC900FB_H
16#define __NUC900FB_H
17
18#include <mach/map.h>
19#include <mach/fb.h>
20
21enum nuc900_lcddrv_type {
22 LCDDRV_NUC910,
23 LCDDRV_NUC930,
24 LCDDRV_NUC932,
25 LCDDRV_NUC950,
26 LCDDRV_NUC960,
27};
28
29
30#define PALETTE_BUFFER_SIZE 256
31#define PALETTE_BUFF_CLEAR (0x80000000) /* entry is clear/invalid */
32
33struct nuc900fb_info {
34 struct device *dev;
35 struct clk *clk;
36
37 struct resource *mem;
38 void __iomem *io;
39 void __iomem *irq_base;
40 int drv_type;
41 struct nuc900fb_hw regs;
42 unsigned long clk_rate;
43
44#ifdef CONFIG_CPU_FREQ
45 struct notifier_block freq_transition;
46#endif
47
48 /* keep these registers in case we need to re-write palette */
49 u32 palette_buffer[PALETTE_BUFFER_SIZE];
50 u32 pseudo_pal[16];
51};
52
53int nuc900fb_init(void);
54
55#endif /* __NUC900FB_H */
diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
index a33483910dc8..9557f963662e 100644
--- a/drivers/video/omap/lcdc.c
+++ b/drivers/video/omap/lcdc.c
@@ -389,7 +389,7 @@ static int omap_lcdc_enable_plane(int plane, int enable)
389/* 389/*
390 * Configure the LCD DMA for a palette load operation and do the palette 390 * Configure the LCD DMA for a palette load operation and do the palette
391 * downloading synchronously. We don't use the frame+palette load mode of 391 * downloading synchronously. We don't use the frame+palette load mode of
392 * the controller, since the palette can always be downloaded seperately. 392 * the controller, since the palette can always be downloaded separately.
393 */ 393 */
394static void load_palette(void) 394static void load_palette(void)
395{ 395{
diff --git a/drivers/video/pm2fb.c b/drivers/video/pm2fb.c
index 36436ee6c1a4..27f93aab6ddc 100644
--- a/drivers/video/pm2fb.c
+++ b/drivers/video/pm2fb.c
@@ -896,7 +896,7 @@ static int pm2fb_setcolreg(unsigned regno, unsigned red, unsigned green,
896 * Pseudocolor: 896 * Pseudocolor:
897 * uses offset = 0 && length = DAC register width. 897 * uses offset = 0 && length = DAC register width.
898 * var->{color}.offset is 0 898 * var->{color}.offset is 0
899 * var->{color}.length contains widht of DAC 899 * var->{color}.length contains width of DAC
900 * cmap is not used 900 * cmap is not used
901 * DAC[X] is programmed to (red, green, blue) 901 * DAC[X] is programmed to (red, green, blue)
902 * Truecolor: 902 * Truecolor:
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index 0deb0a8867b7..7b63429f1a7c 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -517,12 +517,12 @@ s1d13xxxfb_bitblt_copyarea(struct fb_info *info, const struct fb_copyarea *area)
517 src = (sy * stride) + (bpp * sx); 517 src = (sy * stride) + (bpp * sx);
518 } 518 }
519 519
520 /* set source adress */ 520 /* set source address */
521 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START0, (src & 0xff)); 521 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START0, (src & 0xff));
522 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START1, (src >> 8) & 0x00ff); 522 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START1, (src >> 8) & 0x00ff);
523 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START2, (src >> 16) & 0x00ff); 523 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_SRC_START2, (src >> 16) & 0x00ff);
524 524
525 /* set destination adress */ 525 /* set destination address */
526 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START0, (dst & 0xff)); 526 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START0, (dst & 0xff));
527 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START1, (dst >> 8) & 0x00ff); 527 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START1, (dst >> 8) & 0x00ff);
528 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START2, (dst >> 16) & 0x00ff); 528 s1d13xxxfb_writereg(info->par, S1DREG_BBLT_DST_START2, (dst >> 16) & 0x00ff);
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c
index 9d2b6bc49036..a531a0f7cdf2 100644
--- a/drivers/video/sis/sis_main.c
+++ b/drivers/video/sis/sis_main.c
@@ -1891,9 +1891,6 @@ static struct fb_ops sisfb_ops = {
1891 .fb_fillrect = fbcon_sis_fillrect, 1891 .fb_fillrect = fbcon_sis_fillrect,
1892 .fb_copyarea = fbcon_sis_copyarea, 1892 .fb_copyarea = fbcon_sis_copyarea,
1893 .fb_imageblit = cfb_imageblit, 1893 .fb_imageblit = cfb_imageblit,
1894#ifdef CONFIG_FB_SOFT_CURSOR
1895 .fb_cursor = soft_cursor,
1896#endif
1897 .fb_sync = fbcon_sis_sync, 1894 .fb_sync = fbcon_sis_sync,
1898#ifdef SIS_NEW_CONFIG_COMPAT 1895#ifdef SIS_NEW_CONFIG_COMPAT
1899 .fb_compat_ioctl= sisfb_ioctl, 1896 .fb_compat_ioctl= sisfb_ioctl,
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 35370d0ecf03..b7dc1800efa9 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -411,7 +411,7 @@ static int sm501fb_set_par_common(struct fb_info *info,
411 struct sm501fb_par *par = info->par; 411 struct sm501fb_par *par = info->par;
412 struct sm501fb_info *fbi = par->info; 412 struct sm501fb_info *fbi = par->info;
413 unsigned long pixclock; /* pixelclock in Hz */ 413 unsigned long pixclock; /* pixelclock in Hz */
414 unsigned long sm501pixclock; /* pixelclock the 501 can achive in Hz */ 414 unsigned long sm501pixclock; /* pixelclock the 501 can achieve in Hz */
415 unsigned int mem_type; 415 unsigned int mem_type;
416 unsigned int clock_type; 416 unsigned int clock_type;
417 unsigned int head_addr; 417 unsigned int head_addr;
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c
index 609d0a521ca2..79840f11fecb 100644
--- a/drivers/video/sstfb.c
+++ b/drivers/video/sstfb.c
@@ -1102,7 +1102,7 @@ static void sst_set_vidmod_ics(struct fb_info *info, const int bpp)
1102 * detect dac type 1102 * detect dac type
1103 * prerequisite : write to FbiInitx enabled, video and fbi and pci fifo reset, 1103 * prerequisite : write to FbiInitx enabled, video and fbi and pci fifo reset,
1104 * dram refresh disabled, FbiInit remaped. 1104 * dram refresh disabled, FbiInit remaped.
1105 * TODO: mmh.. maybe i shoud put the "prerequisite" in the func ... 1105 * TODO: mmh.. maybe i should put the "prerequisite" in the func ...
1106 */ 1106 */
1107 1107
1108 1108
diff --git a/drivers/video/via/Makefile b/drivers/video/via/Makefile
index e533b4b6aba4..eeed238ad6a2 100644
--- a/drivers/video/via/Makefile
+++ b/drivers/video/via/Makefile
@@ -4,4 +4,4 @@
4 4
5obj-$(CONFIG_FB_VIA) += viafb.o 5obj-$(CONFIG_FB_VIA) += viafb.o
6 6
7viafb-y :=viafbdev.o hw.o iface.o via_i2c.o dvi.o lcd.o ioctl.o accel.o via_utility.o vt1636.o global.o tblDPASetting.o viamode.o tbl1636.o 7viafb-y :=viafbdev.o hw.o via_i2c.o dvi.o lcd.o ioctl.o accel.o via_utility.o vt1636.o global.o tblDPASetting.o viamode.o tbl1636.o
diff --git a/drivers/video/via/chip.h b/drivers/video/via/chip.h
index 474f428aea92..8c06bd3c0b4d 100644
--- a/drivers/video/via/chip.h
+++ b/drivers/video/via/chip.h
@@ -107,7 +107,6 @@
107struct tmds_chip_information { 107struct tmds_chip_information {
108 int tmds_chip_name; 108 int tmds_chip_name;
109 int tmds_chip_slave_addr; 109 int tmds_chip_slave_addr;
110 int dvi_panel_id;
111 int data_mode; 110 int data_mode;
112 int output_interface; 111 int output_interface;
113 int i2c_port; 112 int i2c_port;
@@ -142,14 +141,9 @@ struct tmds_setting_information {
142 int iga_path; 141 int iga_path;
143 int h_active; 142 int h_active;
144 int v_active; 143 int v_active;
145 int bpp;
146 int refresh_rate;
147 int get_dvi_size_method;
148 int max_pixel_clock; 144 int max_pixel_clock;
149 int dvi_panel_size; 145 int max_hres;
150 int dvi_panel_hres; 146 int max_vres;
151 int dvi_panel_vres;
152 int native_size;
153}; 147};
154 148
155struct lvds_setting_information { 149struct lvds_setting_information {
@@ -160,7 +154,6 @@ struct lvds_setting_information {
160 int refresh_rate; 154 int refresh_rate;
161 int get_lcd_size_method; 155 int get_lcd_size_method;
162 int lcd_panel_id; 156 int lcd_panel_id;
163 int lcd_panel_size;
164 int lcd_panel_hres; 157 int lcd_panel_hres;
165 int lcd_panel_vres; 158 int lcd_panel_vres;
166 int display_method; 159 int display_method;
diff --git a/drivers/video/via/dvi.c b/drivers/video/via/dvi.c
index 67b36932212b..abe59b8c7a05 100644
--- a/drivers/video/via/dvi.c
+++ b/drivers/video/via/dvi.c
@@ -23,11 +23,10 @@
23static void tmds_register_write(int index, u8 data); 23static void tmds_register_write(int index, u8 data);
24static int tmds_register_read(int index); 24static int tmds_register_read(int index);
25static int tmds_register_read_bytes(int index, u8 *buff, int buff_len); 25static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
26static int check_reduce_blanking_mode(int mode_index, 26static void dvi_get_panel_size_from_DDCv1(struct tmds_chip_information
27 int refresh_rate); 27 *tmds_chip, struct tmds_setting_information *tmds_setting);
28static int dvi_get_panel_size_from_DDCv1(void); 28static void dvi_get_panel_size_from_DDCv2(struct tmds_chip_information
29static int dvi_get_panel_size_from_DDCv2(void); 29 *tmds_chip, struct tmds_setting_information *tmds_setting);
30static unsigned char dvi_get_panel_info(void);
31static int viafb_dvi_query_EDID(void); 30static int viafb_dvi_query_EDID(void);
32 31
33static int check_tmds_chip(int device_id_subaddr, int device_id) 32static int check_tmds_chip(int device_id_subaddr, int device_id)
@@ -38,23 +37,24 @@ static int check_tmds_chip(int device_id_subaddr, int device_id)
38 return FAIL; 37 return FAIL;
39} 38}
40 39
41void viafb_init_dvi_size(void) 40void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
41 struct tmds_setting_information *tmds_setting)
42{ 42{
43 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n"); 43 DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
44 DEBUG_MSG(KERN_INFO
45 "viaparinfo->tmds_setting_info->get_dvi_size_method %d\n",
46 viaparinfo->tmds_setting_info->get_dvi_size_method);
47 44
48 switch (viaparinfo->tmds_setting_info->get_dvi_size_method) { 45 viafb_dvi_sense();
49 case GET_DVI_SIZE_BY_SYSTEM_BIOS: 46 switch (viafb_dvi_query_EDID()) {
47 case 1:
48 dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting);
50 break; 49 break;
51 case GET_DVI_SZIE_BY_HW_STRAPPING: 50 case 2:
51 dvi_get_panel_size_from_DDCv2(tmds_chip, tmds_setting);
52 break; 52 break;
53 case GET_DVI_SIZE_BY_VGA_BIOS:
54 default: 53 default:
55 dvi_get_panel_info(); 54 printk(KERN_WARNING "viafb_init_dvi_size: DVI panel size undetected!\n");
56 break; 55 break;
57 } 56 }
57
58 return; 58 return;
59} 59}
60 60
@@ -189,42 +189,14 @@ static int tmds_register_read_bytes(int index, u8 *buff, int buff_len)
189 return 0; 189 return 0;
190} 190}
191 191
192static int check_reduce_blanking_mode(int mode_index,
193 int refresh_rate)
194{
195 if (refresh_rate != 60)
196 return false;
197
198 switch (mode_index) {
199 /* Following modes have reduce blanking mode. */
200 case VIA_RES_1360X768:
201 case VIA_RES_1400X1050:
202 case VIA_RES_1440X900:
203 case VIA_RES_1600X900:
204 case VIA_RES_1680X1050:
205 case VIA_RES_1920X1080:
206 case VIA_RES_1920X1200:
207 break;
208
209 default:
210 DEBUG_MSG(KERN_INFO
211 "This dvi mode %d have no reduce blanking mode!\n",
212 mode_index);
213 return false;
214 }
215
216 return true;
217}
218
219/* DVI Set Mode */ 192/* DVI Set Mode */
220void viafb_dvi_set_mode(int video_index, int mode_bpp, int set_iga) 193void viafb_dvi_set_mode(struct VideoModeTable *mode, int mode_bpp,
194 int set_iga)
221{ 195{
222 struct VideoModeTable *videoMode = NULL; 196 struct VideoModeTable *rb_mode;
223 struct crt_mode_table *pDviTiming; 197 struct crt_mode_table *pDviTiming;
224 unsigned long desirePixelClock, maxPixelClock; 198 unsigned long desirePixelClock, maxPixelClock;
225 int status = 0; 199 pDviTiming = mode->crtc;
226 videoMode = viafb_get_modetbl_pointer(video_index);
227 pDviTiming = videoMode->crtc;
228 desirePixelClock = pDviTiming->clk / 1000000; 200 desirePixelClock = pDviTiming->clk / 1000000;
229 maxPixelClock = (unsigned long)viaparinfo-> 201 maxPixelClock = (unsigned long)viaparinfo->
230 tmds_setting_info->max_pixel_clock; 202 tmds_setting_info->max_pixel_clock;
@@ -232,20 +204,14 @@ void viafb_dvi_set_mode(int video_index, int mode_bpp, int set_iga)
232 DEBUG_MSG(KERN_INFO "\nDVI_set_mode!!\n"); 204 DEBUG_MSG(KERN_INFO "\nDVI_set_mode!!\n");
233 205
234 if ((maxPixelClock != 0) && (desirePixelClock > maxPixelClock)) { 206 if ((maxPixelClock != 0) && (desirePixelClock > maxPixelClock)) {
235 /*Check if reduce-blanking mode is exist */ 207 rb_mode = viafb_get_rb_mode(mode->crtc[0].crtc.hor_addr,
236 status = 208 mode->crtc[0].crtc.ver_addr);
237 check_reduce_blanking_mode(video_index, 209 if (rb_mode) {
238 pDviTiming->refresh_rate); 210 mode = rb_mode;
239 if (status) { 211 pDviTiming = rb_mode->crtc;
240 video_index += 100; /*Use reduce-blanking mode */
241 videoMode = viafb_get_modetbl_pointer(video_index);
242 pDviTiming = videoMode->crtc;
243 DEBUG_MSG(KERN_INFO
244 "DVI use reduce blanking mode %d!!\n",
245 video_index);
246 } 212 }
247 } 213 }
248 viafb_fill_crtc_timing(pDviTiming, video_index, mode_bpp / 8, set_iga); 214 viafb_fill_crtc_timing(pDviTiming, mode, mode_bpp / 8, set_iga);
249 viafb_set_output_path(DEVICE_DVI, set_iga, 215 viafb_set_output_path(DEVICE_DVI, set_iga,
250 viaparinfo->chip_info->tmds_chip_info.output_interface); 216 viaparinfo->chip_info->tmds_chip_info.output_interface);
251} 217}
@@ -350,25 +316,18 @@ static int viafb_dvi_query_EDID(void)
350 return false; 316 return false;
351} 317}
352 318
353/* 319/* Get Panel Size Using EDID1 Table */
354 * 320static void dvi_get_panel_size_from_DDCv1(struct tmds_chip_information
355 * int dvi_get_panel_size_from_DDCv1(void) 321 *tmds_chip, struct tmds_setting_information *tmds_setting)
356 *
357 * - Get Panel Size Using EDID1 Table
358 *
359 * Return Type: int
360 *
361 */
362static int dvi_get_panel_size_from_DDCv1(void)
363{ 322{
364 int i, max_h = 0, max_v = 0, tmp, restore; 323 int i, max_h = 0, tmp, restore;
365 unsigned char rData; 324 unsigned char rData;
366 unsigned char EDID_DATA[18]; 325 unsigned char EDID_DATA[18];
367 326
368 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n"); 327 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n");
369 328
370 restore = viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr; 329 restore = tmds_chip->tmds_chip_slave_addr;
371 viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = 0xA0; 330 tmds_chip->tmds_chip_slave_addr = 0xA0;
372 331
373 rData = tmds_register_read(0x23); 332 rData = tmds_register_read(0x23);
374 if (rData & 0x3C) 333 if (rData & 0x3C)
@@ -414,8 +373,8 @@ static int dvi_get_panel_size_from_DDCv1(void)
414 /* The first two byte must be zero. */ 373 /* The first two byte must be zero. */
415 if (EDID_DATA[3] == 0xFD) { 374 if (EDID_DATA[3] == 0xFD) {
416 /* To get max pixel clock. */ 375 /* To get max pixel clock. */
417 viaparinfo->tmds_setting_info-> 376 tmds_setting->max_pixel_clock =
418 max_pixel_clock = EDID_DATA[9] * 10; 377 EDID_DATA[9] * 10;
419 } 378 }
420 } 379 }
421 break; 380 break;
@@ -425,154 +384,88 @@ static int dvi_get_panel_size_from_DDCv1(void)
425 } 384 }
426 } 385 }
427 386
387 tmds_setting->max_hres = max_h;
428 switch (max_h) { 388 switch (max_h) {
429 case 640: 389 case 640:
430 viaparinfo->tmds_setting_info->dvi_panel_size = 390 tmds_setting->max_vres = 480;
431 VIA_RES_640X480;
432 break; 391 break;
433 case 800: 392 case 800:
434 viaparinfo->tmds_setting_info->dvi_panel_size = 393 tmds_setting->max_vres = 600;
435 VIA_RES_800X600;
436 break; 394 break;
437 case 1024: 395 case 1024:
438 viaparinfo->tmds_setting_info->dvi_panel_size = 396 tmds_setting->max_vres = 768;
439 VIA_RES_1024X768;
440 break; 397 break;
441 case 1280: 398 case 1280:
442 viaparinfo->tmds_setting_info->dvi_panel_size = 399 tmds_setting->max_vres = 1024;
443 VIA_RES_1280X1024;
444 break; 400 break;
445 case 1400: 401 case 1400:
446 viaparinfo->tmds_setting_info->dvi_panel_size = 402 tmds_setting->max_vres = 1050;
447 VIA_RES_1400X1050;
448 break; 403 break;
449 case 1440: 404 case 1440:
450 viaparinfo->tmds_setting_info->dvi_panel_size = 405 tmds_setting->max_vres = 1050;
451 VIA_RES_1440X1050;
452 break; 406 break;
453 case 1600: 407 case 1600:
454 viaparinfo->tmds_setting_info->dvi_panel_size = 408 tmds_setting->max_vres = 1200;
455 VIA_RES_1600X1200;
456 break; 409 break;
457 case 1920: 410 case 1920:
458 if (max_v == 1200) { 411 tmds_setting->max_vres = 1080;
459 viaparinfo->tmds_setting_info->dvi_panel_size =
460 VIA_RES_1920X1200;
461 } else {
462 viaparinfo->tmds_setting_info->dvi_panel_size =
463 VIA_RES_1920X1080;
464 }
465
466 break; 412 break;
467 default: 413 default:
468 viaparinfo->tmds_setting_info->dvi_panel_size = 414 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! "
469 VIA_RES_1024X768; 415 "set default panel size.\n", max_h);
470 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d !\
471 set default panel size.\n", max_h);
472 break; 416 break;
473 } 417 }
474 418
475 DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n", 419 DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n",
476 viaparinfo->tmds_setting_info->max_pixel_clock); 420 tmds_setting->max_pixel_clock);
477 viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore; 421 tmds_chip->tmds_chip_slave_addr = restore;
478 return viaparinfo->tmds_setting_info->dvi_panel_size;
479} 422}
480 423
481/* 424/* Get Panel Size Using EDID2 Table */
482 * 425static void dvi_get_panel_size_from_DDCv2(struct tmds_chip_information
483 * int dvi_get_panel_size_from_DDCv2(void) 426 *tmds_chip, struct tmds_setting_information *tmds_setting)
484 *
485 * - Get Panel Size Using EDID2 Table
486 *
487 * Return Type: int
488 *
489 */
490static int dvi_get_panel_size_from_DDCv2(void)
491{ 427{
492 int HSize = 0, restore; 428 int restore;
493 unsigned char R_Buffer[2]; 429 unsigned char R_Buffer[2];
494 430
495 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n"); 431 DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n");
496 432
497 restore = viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr; 433 restore = tmds_chip->tmds_chip_slave_addr;
498 viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = 0xA2; 434 tmds_chip->tmds_chip_slave_addr = 0xA2;
499 435
500 /* Horizontal: 0x76, 0x77 */ 436 /* Horizontal: 0x76, 0x77 */
501 tmds_register_read_bytes(0x76, R_Buffer, 2); 437 tmds_register_read_bytes(0x76, R_Buffer, 2);
502 HSize = R_Buffer[0]; 438 tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8);
503 HSize += R_Buffer[1] << 8;
504 439
505 switch (HSize) { 440 switch (tmds_setting->max_hres) {
506 case 640: 441 case 640:
507 viaparinfo->tmds_setting_info->dvi_panel_size = 442 tmds_setting->max_vres = 480;
508 VIA_RES_640X480;
509 break; 443 break;
510 case 800: 444 case 800:
511 viaparinfo->tmds_setting_info->dvi_panel_size = 445 tmds_setting->max_vres = 600;
512 VIA_RES_800X600;
513 break; 446 break;
514 case 1024: 447 case 1024:
515 viaparinfo->tmds_setting_info->dvi_panel_size = 448 tmds_setting->max_vres = 768;
516 VIA_RES_1024X768;
517 break; 449 break;
518 case 1280: 450 case 1280:
519 viaparinfo->tmds_setting_info->dvi_panel_size = 451 tmds_setting->max_vres = 1024;
520 VIA_RES_1280X1024;
521 break; 452 break;
522 case 1400: 453 case 1400:
523 viaparinfo->tmds_setting_info->dvi_panel_size = 454 tmds_setting->max_vres = 1050;
524 VIA_RES_1400X1050;
525 break; 455 break;
526 case 1440: 456 case 1440:
527 viaparinfo->tmds_setting_info->dvi_panel_size = 457 tmds_setting->max_vres = 1050;
528 VIA_RES_1440X1050;
529 break; 458 break;
530 case 1600: 459 case 1600:
531 viaparinfo->tmds_setting_info->dvi_panel_size = 460 tmds_setting->max_vres = 1200;
532 VIA_RES_1600X1200;
533 break;
534 default:
535 viaparinfo->tmds_setting_info->dvi_panel_size =
536 VIA_RES_1024X768;
537 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d!\
538 set default panel size.\n", HSize);
539 break;
540 }
541
542 viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore;
543 return viaparinfo->tmds_setting_info->dvi_panel_size;
544}
545
546/*
547 *
548 * unsigned char dvi_get_panel_info(void)
549 *
550 * - Get Panel Size
551 *
552 * Return Type: unsigned char
553 */
554static unsigned char dvi_get_panel_info(void)
555{
556 unsigned char dvipanelsize;
557 DEBUG_MSG(KERN_INFO "dvi_get_panel_info! \n");
558
559 viafb_dvi_sense();
560 switch (viafb_dvi_query_EDID()) {
561 case 1:
562 dvi_get_panel_size_from_DDCv1();
563 break;
564 case 2:
565 dvi_get_panel_size_from_DDCv2();
566 break; 461 break;
567 default: 462 default:
463 DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! "
464 "set default panel size.\n", tmds_setting->max_hres);
568 break; 465 break;
569 } 466 }
570 467
571 DEBUG_MSG(KERN_INFO "dvi panel size is %2d \n", 468 tmds_chip->tmds_chip_slave_addr = restore;
572 viaparinfo->tmds_setting_info->dvi_panel_size);
573 dvipanelsize = (unsigned char)(viaparinfo->
574 tmds_setting_info->dvi_panel_size);
575 return dvipanelsize;
576} 469}
577 470
578/* If Disable DVI, turn off pad */ 471/* If Disable DVI, turn off pad */
diff --git a/drivers/video/via/dvi.h b/drivers/video/via/dvi.h
index e1ec37fb0dc3..0dffcfd395f3 100644
--- a/drivers/video/via/dvi.h
+++ b/drivers/video/via/dvi.h
@@ -53,12 +53,13 @@
53#define DEV_CONNECT_DVI 0x01 53#define DEV_CONNECT_DVI 0x01
54#define DEV_CONNECT_HDMI 0x02 54#define DEV_CONNECT_HDMI 0x02
55 55
56struct VideoModeTable *viafb_get_cea_mode_tbl_pointer(int Index);
57int viafb_dvi_sense(void); 56int viafb_dvi_sense(void);
58void viafb_dvi_disable(void); 57void viafb_dvi_disable(void);
59void viafb_dvi_enable(void); 58void viafb_dvi_enable(void);
60int viafb_tmds_trasmitter_identify(void); 59int viafb_tmds_trasmitter_identify(void);
61void viafb_init_dvi_size(void); 60void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
62void viafb_dvi_set_mode(int video_index, int mode_bpp, int set_iga); 61 struct tmds_setting_information *tmds_setting);
62void viafb_dvi_set_mode(struct VideoModeTable *videoMode, int mode_bpp,
63 int set_iga);
63 64
64#endif /* __DVI_H__ */ 65#endif /* __DVI_H__ */
diff --git a/drivers/video/via/global.c b/drivers/video/via/global.c
index b675cdbb03ad..1ee511b73307 100644
--- a/drivers/video/via/global.c
+++ b/drivers/video/via/global.c
@@ -23,15 +23,12 @@ int viafb_platform_epia_dvi = STATE_OFF;
23int viafb_device_lcd_dualedge = STATE_OFF; 23int viafb_device_lcd_dualedge = STATE_OFF;
24int viafb_bus_width = 12; 24int viafb_bus_width = 12;
25int viafb_display_hardware_layout = HW_LAYOUT_LCD_DVI; 25int viafb_display_hardware_layout = HW_LAYOUT_LCD_DVI;
26int viafb_memsize;
27int viafb_DeviceStatus = CRT_Device; 26int viafb_DeviceStatus = CRT_Device;
28int viafb_hotplug; 27int viafb_hotplug;
29int viafb_refresh = 60; 28int viafb_refresh = 60;
30int viafb_refresh1 = 60; 29int viafb_refresh1 = 60;
31int viafb_lcd_dsp_method = LCD_EXPANDSION; 30int viafb_lcd_dsp_method = LCD_EXPANDSION;
32int viafb_lcd_mode = LCD_OPENLDI; 31int viafb_lcd_mode = LCD_OPENLDI;
33int viafb_bpp = 32;
34int viafb_bpp1 = 32;
35int viafb_CRT_ON = 1; 32int viafb_CRT_ON = 1;
36int viafb_DVI_ON; 33int viafb_DVI_ON;
37int viafb_LCD_ON ; 34int viafb_LCD_ON ;
@@ -42,8 +39,6 @@ int viafb_hotplug_Xres = 640;
42int viafb_hotplug_Yres = 480; 39int viafb_hotplug_Yres = 480;
43int viafb_hotplug_bpp = 32; 40int viafb_hotplug_bpp = 32;
44int viafb_hotplug_refresh = 60; 41int viafb_hotplug_refresh = 60;
45unsigned int viafb_second_offset;
46int viafb_second_size;
47int viafb_primary_dev = None_Device; 42int viafb_primary_dev = None_Device;
48unsigned int viafb_second_xres = 640; 43unsigned int viafb_second_xres = 640;
49unsigned int viafb_second_yres = 480; 44unsigned int viafb_second_yres = 480;
diff --git a/drivers/video/via/global.h b/drivers/video/via/global.h
index d69d0ca99c2f..8d95d5fd1388 100644
--- a/drivers/video/via/global.h
+++ b/drivers/video/via/global.h
@@ -35,7 +35,6 @@
35 35
36#include "debug.h" 36#include "debug.h"
37 37
38#include "iface.h"
39#include "viafbdev.h" 38#include "viafbdev.h"
40#include "chip.h" 39#include "chip.h"
41#include "accel.h" 40#include "accel.h"
@@ -68,8 +67,6 @@ extern int viafb_refresh;
68extern int viafb_refresh1; 67extern int viafb_refresh1;
69extern int viafb_lcd_dsp_method; 68extern int viafb_lcd_dsp_method;
70extern int viafb_lcd_mode; 69extern int viafb_lcd_mode;
71extern int viafb_bpp;
72extern int viafb_bpp1;
73 70
74extern int viafb_CRT_ON; 71extern int viafb_CRT_ON;
75extern int viafb_hotplug_Xres; 72extern int viafb_hotplug_Xres;
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c
index 3e083ff67ae2..f2583b1b527f 100644
--- a/drivers/video/via/hw.c
+++ b/drivers/video/via/hw.c
@@ -524,7 +524,6 @@ static void dvi_patch_skew_dvp1(void);
524static void dvi_patch_skew_dvp_low(void); 524static void dvi_patch_skew_dvp_low(void);
525static void set_dvi_output_path(int set_iga, int output_interface); 525static void set_dvi_output_path(int set_iga, int output_interface);
526static void set_lcd_output_path(int set_iga, int output_interface); 526static void set_lcd_output_path(int set_iga, int output_interface);
527static int search_mode_setting(int ModeInfoIndex);
528static void load_fix_bit_crtc_reg(void); 527static void load_fix_bit_crtc_reg(void);
529static void init_gfx_chip_info(struct pci_dev *pdev, 528static void init_gfx_chip_info(struct pci_dev *pdev,
530 const struct pci_device_id *pdi); 529 const struct pci_device_id *pdi);
@@ -686,6 +685,84 @@ void viafb_set_secondary_pitch(u32 pitch)
686 viafb_write_reg_mask(0x71, VIACR, (pitch >> (10 - 7)) & 0x80, 0x80); 685 viafb_write_reg_mask(0x71, VIACR, (pitch >> (10 - 7)) & 0x80, 0x80);
687} 686}
688 687
688void viafb_set_primary_color_depth(u8 depth)
689{
690 u8 value;
691
692 DEBUG_MSG(KERN_DEBUG "viafb_set_primary_color_depth(%d)\n", depth);
693 switch (depth) {
694 case 8:
695 value = 0x00;
696 break;
697 case 15:
698 value = 0x04;
699 break;
700 case 16:
701 value = 0x14;
702 break;
703 case 24:
704 value = 0x0C;
705 break;
706 case 30:
707 value = 0x08;
708 break;
709 default:
710 printk(KERN_WARNING "viafb_set_primary_color_depth: "
711 "Unsupported depth: %d\n", depth);
712 return;
713 }
714
715 viafb_write_reg_mask(0x15, VIASR, value, 0x1C);
716}
717
718void viafb_set_secondary_color_depth(u8 depth)
719{
720 u8 value;
721
722 DEBUG_MSG(KERN_DEBUG "viafb_set_secondary_color_depth(%d)\n", depth);
723 switch (depth) {
724 case 8:
725 value = 0x00;
726 break;
727 case 16:
728 value = 0x40;
729 break;
730 case 24:
731 value = 0xC0;
732 break;
733 case 30:
734 value = 0x80;
735 break;
736 default:
737 printk(KERN_WARNING "viafb_set_secondary_color_depth: "
738 "Unsupported depth: %d\n", depth);
739 return;
740 }
741
742 viafb_write_reg_mask(0x67, VIACR, value, 0xC0);
743}
744
745static void set_color_register(u8 index, u8 red, u8 green, u8 blue)
746{
747 outb(0xFF, 0x3C6); /* bit mask of palette */
748 outb(index, 0x3C8);
749 outb(red, 0x3C9);
750 outb(green, 0x3C9);
751 outb(blue, 0x3C9);
752}
753
754void viafb_set_primary_color_register(u8 index, u8 red, u8 green, u8 blue)
755{
756 viafb_write_reg_mask(0x1A, VIASR, 0x00, 0x01);
757 set_color_register(index, red, green, blue);
758}
759
760void viafb_set_secondary_color_register(u8 index, u8 red, u8 green, u8 blue)
761{
762 viafb_write_reg_mask(0x1A, VIASR, 0x01, 0x01);
763 set_color_register(index, red, green, blue);
764}
765
689void viafb_set_output_path(int device, int set_iga, int output_interface) 766void viafb_set_output_path(int device, int set_iga, int output_interface)
690{ 767{
691 switch (device) { 768 switch (device) {
@@ -710,11 +787,8 @@ static void set_crt_output_path(int set_iga)
710 viafb_write_reg_mask(SR16, VIASR, 0x00, BIT6); 787 viafb_write_reg_mask(SR16, VIASR, 0x00, BIT6);
711 break; 788 break;
712 case IGA2: 789 case IGA2:
713 case IGA1_IGA2:
714 viafb_write_reg_mask(CR6A, VIACR, 0xC0, BIT6 + BIT7); 790 viafb_write_reg_mask(CR6A, VIACR, 0xC0, BIT6 + BIT7);
715 viafb_write_reg_mask(SR16, VIASR, 0x40, BIT6); 791 viafb_write_reg_mask(SR16, VIASR, 0x40, BIT6);
716 if (set_iga == IGA1_IGA2)
717 viafb_write_reg_mask(CR6B, VIACR, 0x08, BIT3);
718 break; 792 break;
719 } 793 }
720} 794}
@@ -904,13 +978,6 @@ static void set_lcd_output_path(int set_iga, int output_interface)
904 978
905 enable_second_display_channel(); 979 enable_second_display_channel();
906 break; 980 break;
907
908 case IGA1_IGA2:
909 viafb_write_reg_mask(CR6B, VIACR, 0x08, BIT3);
910 viafb_write_reg_mask(CR6A, VIACR, 0x08, BIT3);
911
912 disable_second_display_channel();
913 break;
914 } 981 }
915 982
916 switch (output_interface) { 983 switch (output_interface) {
@@ -987,49 +1054,6 @@ static void set_lcd_output_path(int set_iga, int output_interface)
987 } 1054 }
988} 1055}
989 1056
990/* Search Mode Index */
991static int search_mode_setting(int ModeInfoIndex)
992{
993 int i = 0;
994
995 while ((i < NUM_TOTAL_MODETABLE) &&
996 (ModeInfoIndex != CLE266Modes[i].ModeIndex))
997 i++;
998 if (i >= NUM_TOTAL_MODETABLE)
999 i = 0;
1000 return i;
1001
1002}
1003
1004struct VideoModeTable *viafb_get_modetbl_pointer(int Index)
1005{
1006 struct VideoModeTable *TmpTbl = NULL;
1007 TmpTbl = &CLE266Modes[search_mode_setting(Index)];
1008 return TmpTbl;
1009}
1010
1011struct VideoModeTable *viafb_get_cea_mode_tbl_pointer(int Index)
1012{
1013 struct VideoModeTable *TmpTbl = NULL;
1014 int i = 0;
1015 while ((i < NUM_TOTAL_CEA_MODES) &&
1016 (Index != CEA_HDMI_Modes[i].ModeIndex))
1017 i++;
1018 if ((i < NUM_TOTAL_CEA_MODES))
1019 TmpTbl = &CEA_HDMI_Modes[i];
1020 else {
1021 /*Still use general timing if don't find CEA timing */
1022 i = 0;
1023 while ((i < NUM_TOTAL_MODETABLE) &&
1024 (Index != CLE266Modes[i].ModeIndex))
1025 i++;
1026 if (i >= NUM_TOTAL_MODETABLE)
1027 i = 0;
1028 TmpTbl = &CLE266Modes[i];
1029 }
1030 return TmpTbl;
1031}
1032
1033static void load_fix_bit_crtc_reg(void) 1057static void load_fix_bit_crtc_reg(void)
1034{ 1058{
1035 /* always set to 1 */ 1059 /* always set to 1 */
@@ -1121,15 +1145,13 @@ void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga)
1121 struct io_register *reg = NULL; 1145 struct io_register *reg = NULL;
1122 1146
1123 switch (set_iga) { 1147 switch (set_iga) {
1124 case IGA1_IGA2:
1125 case IGA1: 1148 case IGA1:
1126 reg_value = IGA1_FETCH_COUNT_FORMULA(h_addr, bpp_byte); 1149 reg_value = IGA1_FETCH_COUNT_FORMULA(h_addr, bpp_byte);
1127 viafb_load_reg_num = fetch_count_reg. 1150 viafb_load_reg_num = fetch_count_reg.
1128 iga1_fetch_count_reg.reg_num; 1151 iga1_fetch_count_reg.reg_num;
1129 reg = fetch_count_reg.iga1_fetch_count_reg.reg; 1152 reg = fetch_count_reg.iga1_fetch_count_reg.reg;
1130 viafb_load_reg(reg_value, viafb_load_reg_num, reg, VIASR); 1153 viafb_load_reg(reg_value, viafb_load_reg_num, reg, VIASR);
1131 if (set_iga == IGA1) 1154 break;
1132 break;
1133 case IGA2: 1155 case IGA2:
1134 reg_value = IGA2_FETCH_COUNT_FORMULA(h_addr, bpp_byte); 1156 reg_value = IGA2_FETCH_COUNT_FORMULA(h_addr, bpp_byte);
1135 viafb_load_reg_num = fetch_count_reg. 1157 viafb_load_reg_num = fetch_count_reg.
@@ -1499,7 +1521,7 @@ void viafb_set_vclock(u32 CLK, int set_iga)
1499 /* H.W. Reset : ON */ 1521 /* H.W. Reset : ON */
1500 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7); 1522 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7);
1501 1523
1502 if ((set_iga == IGA1) || (set_iga == IGA1_IGA2)) { 1524 if (set_iga == IGA1) {
1503 /* Change D,N FOR VCLK */ 1525 /* Change D,N FOR VCLK */
1504 switch (viaparinfo->chip_info->gfx_chip_name) { 1526 switch (viaparinfo->chip_info->gfx_chip_name) {
1505 case UNICHROME_CLE266: 1527 case UNICHROME_CLE266:
@@ -1528,7 +1550,7 @@ void viafb_set_vclock(u32 CLK, int set_iga)
1528 } 1550 }
1529 } 1551 }
1530 1552
1531 if ((set_iga == IGA2) || (set_iga == IGA1_IGA2)) { 1553 if (set_iga == IGA2) {
1532 /* Change D,N FOR LCK */ 1554 /* Change D,N FOR LCK */
1533 switch (viaparinfo->chip_info->gfx_chip_name) { 1555 switch (viaparinfo->chip_info->gfx_chip_name) {
1534 case UNICHROME_CLE266: 1556 case UNICHROME_CLE266:
@@ -1557,12 +1579,12 @@ void viafb_set_vclock(u32 CLK, int set_iga)
1557 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7); 1579 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7);
1558 1580
1559 /* Reset PLL */ 1581 /* Reset PLL */
1560 if ((set_iga == IGA1) || (set_iga == IGA1_IGA2)) { 1582 if (set_iga == IGA1) {
1561 viafb_write_reg_mask(SR40, VIASR, 0x02, BIT1); 1583 viafb_write_reg_mask(SR40, VIASR, 0x02, BIT1);
1562 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT1); 1584 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT1);
1563 } 1585 }
1564 1586
1565 if ((set_iga == IGA2) || (set_iga == IGA1_IGA2)) { 1587 if (set_iga == IGA2) {
1566 viafb_write_reg_mask(SR40, VIASR, 0x01, BIT0); 1588 viafb_write_reg_mask(SR40, VIASR, 0x01, BIT0);
1567 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT0); 1589 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT0);
1568 } 1590 }
@@ -1805,47 +1827,15 @@ void viafb_load_crtc_timing(struct display_timing device_timing,
1805 viafb_lock_crt(); 1827 viafb_lock_crt();
1806} 1828}
1807 1829
1808void viafb_set_color_depth(int bpp_byte, int set_iga)
1809{
1810 if (set_iga == IGA1) {
1811 switch (bpp_byte) {
1812 case MODE_8BPP:
1813 viafb_write_reg_mask(SR15, VIASR, 0x22, 0x7E);
1814 break;
1815 case MODE_16BPP:
1816 viafb_write_reg_mask(SR15, VIASR, 0xB6, 0xFE);
1817 break;
1818 case MODE_32BPP:
1819 viafb_write_reg_mask(SR15, VIASR, 0xAE, 0xFE);
1820 break;
1821 }
1822 } else {
1823 switch (bpp_byte) {
1824 case MODE_8BPP:
1825 viafb_write_reg_mask(CR67, VIACR, 0x00, BIT6 + BIT7);
1826 break;
1827 case MODE_16BPP:
1828 viafb_write_reg_mask(CR67, VIACR, 0x40, BIT6 + BIT7);
1829 break;
1830 case MODE_32BPP:
1831 viafb_write_reg_mask(CR67, VIACR, 0xC0, BIT6 + BIT7);
1832 break;
1833 }
1834 }
1835}
1836
1837void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, 1830void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1838 int mode_index, int bpp_byte, int set_iga) 1831 struct VideoModeTable *video_mode, int bpp_byte, int set_iga)
1839{ 1832{
1840 struct VideoModeTable *video_mode;
1841 struct display_timing crt_reg; 1833 struct display_timing crt_reg;
1842 int i; 1834 int i;
1843 int index = 0; 1835 int index = 0;
1844 int h_addr, v_addr; 1836 int h_addr, v_addr;
1845 u32 pll_D_N; 1837 u32 pll_D_N;
1846 1838
1847 video_mode = &CLE266Modes[search_mode_setting(mode_index)];
1848
1849 for (i = 0; i < video_mode->mode_array; i++) { 1839 for (i = 0; i < video_mode->mode_array; i++) {
1850 index = i; 1840 index = i;
1851 1841
@@ -1858,8 +1848,10 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1858 1848
1859 /* Mode 640x480 has border, but LCD/DFP didn't have border. */ 1849 /* Mode 640x480 has border, but LCD/DFP didn't have border. */
1860 /* So we would delete border. */ 1850 /* So we would delete border. */
1861 if ((viafb_LCD_ON | viafb_DVI_ON) && (mode_index == VIA_RES_640X480) 1851 if ((viafb_LCD_ON | viafb_DVI_ON)
1862 && (viaparinfo->crt_setting_info->refresh_rate == 60)) { 1852 && video_mode->crtc[0].crtc.hor_addr == 640
1853 && video_mode->crtc[0].crtc.ver_addr == 480
1854 && viaparinfo->crt_setting_info->refresh_rate == 60) {
1863 /* The border is 8 pixels. */ 1855 /* The border is 8 pixels. */
1864 crt_reg.hor_blank_start = crt_reg.hor_blank_start - 8; 1856 crt_reg.hor_blank_start = crt_reg.hor_blank_start - 8;
1865 1857
@@ -1912,9 +1904,6 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
1912 && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400)) 1904 && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400))
1913 viafb_load_FIFO_reg(set_iga, h_addr, v_addr); 1905 viafb_load_FIFO_reg(set_iga, h_addr, v_addr);
1914 1906
1915 /* load SR Register About Memory and Color part */
1916 viafb_set_color_depth(bpp_byte, set_iga);
1917
1918 pll_D_N = viafb_get_clk_value(crt_table[index].clk); 1907 pll_D_N = viafb_get_clk_value(crt_table[index].clk);
1919 DEBUG_MSG(KERN_INFO "PLL=%x", pll_D_N); 1908 DEBUG_MSG(KERN_INFO "PLL=%x", pll_D_N);
1920 viafb_set_vclock(pll_D_N, set_iga); 1909 viafb_set_vclock(pll_D_N, set_iga);
@@ -1956,9 +1945,6 @@ void viafb_update_device_setting(int hres, int vres,
1956 1945
1957 viaparinfo->tmds_setting_info->h_active = hres; 1946 viaparinfo->tmds_setting_info->h_active = hres;
1958 viaparinfo->tmds_setting_info->v_active = vres; 1947 viaparinfo->tmds_setting_info->v_active = vres;
1959 viaparinfo->tmds_setting_info->bpp = bpp;
1960 viaparinfo->tmds_setting_info->refresh_rate =
1961 vmode_refresh;
1962 1948
1963 viaparinfo->lvds_setting_info->h_active = hres; 1949 viaparinfo->lvds_setting_info->h_active = hres;
1964 viaparinfo->lvds_setting_info->v_active = vres; 1950 viaparinfo->lvds_setting_info->v_active = vres;
@@ -1975,9 +1961,6 @@ void viafb_update_device_setting(int hres, int vres,
1975 if (viaparinfo->tmds_setting_info->iga_path == IGA2) { 1961 if (viaparinfo->tmds_setting_info->iga_path == IGA2) {
1976 viaparinfo->tmds_setting_info->h_active = hres; 1962 viaparinfo->tmds_setting_info->h_active = hres;
1977 viaparinfo->tmds_setting_info->v_active = vres; 1963 viaparinfo->tmds_setting_info->v_active = vres;
1978 viaparinfo->tmds_setting_info->bpp = bpp;
1979 viaparinfo->tmds_setting_info->refresh_rate =
1980 vmode_refresh;
1981 } 1964 }
1982 1965
1983 if (viaparinfo->lvds_setting_info->iga_path == IGA2) { 1966 if (viaparinfo->lvds_setting_info->iga_path == IGA2) {
@@ -2076,9 +2059,8 @@ static void init_tmds_chip_info(void)
2076 2059
2077 DEBUG_MSG(KERN_INFO "TMDS Chip = %d\n", 2060 DEBUG_MSG(KERN_INFO "TMDS Chip = %d\n",
2078 viaparinfo->chip_info->tmds_chip_info.tmds_chip_name); 2061 viaparinfo->chip_info->tmds_chip_info.tmds_chip_name);
2079 viaparinfo->tmds_setting_info->get_dvi_size_method = 2062 viafb_init_dvi_size(&viaparinfo->shared->chip_info.tmds_chip_info,
2080 GET_DVI_SIZE_BY_VGA_BIOS; 2063 &viaparinfo->shared->tmds_setting_info);
2081 viafb_init_dvi_size();
2082} 2064}
2083 2065
2084static void init_lvds_chip_info(void) 2066static void init_lvds_chip_info(void)
@@ -2195,28 +2177,19 @@ static void set_display_channel(void)
2195 } 2177 }
2196} 2178}
2197 2179
2198int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp, 2180int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
2199 int vmode_index1, int hor_res1, int ver_res1, int video_bpp1) 2181 struct VideoModeTable *vmode_tbl1, int video_bpp1)
2200{ 2182{
2201 int i, j; 2183 int i, j;
2202 int port; 2184 int port;
2203 u8 value, index, mask; 2185 u8 value, index, mask;
2204 struct VideoModeTable *vmode_tbl;
2205 struct crt_mode_table *crt_timing; 2186 struct crt_mode_table *crt_timing;
2206 struct VideoModeTable *vmode_tbl1 = NULL;
2207 struct crt_mode_table *crt_timing1 = NULL; 2187 struct crt_mode_table *crt_timing1 = NULL;
2208 2188
2209 DEBUG_MSG(KERN_INFO "Set Mode!!\n");
2210 DEBUG_MSG(KERN_INFO
2211 "vmode_index=%d hor_res=%d ver_res=%d video_bpp=%d\n",
2212 vmode_index, hor_res, ver_res, video_bpp);
2213
2214 device_screen_off(); 2189 device_screen_off();
2215 vmode_tbl = &CLE266Modes[search_mode_setting(vmode_index)];
2216 crt_timing = vmode_tbl->crtc; 2190 crt_timing = vmode_tbl->crtc;
2217 2191
2218 if (viafb_SAMM_ON == 1) { 2192 if (viafb_SAMM_ON == 1) {
2219 vmode_tbl1 = &CLE266Modes[search_mode_setting(vmode_index1)];
2220 crt_timing1 = vmode_tbl1->crtc; 2193 crt_timing1 = vmode_tbl1->crtc;
2221 } 2194 }
2222 2195
@@ -2267,12 +2240,11 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2267 outb(VPIT.SR[i - 1], VIASR + 1); 2240 outb(VPIT.SR[i - 1], VIASR + 1);
2268 } 2241 }
2269 2242
2270 viafb_set_primary_address(0); 2243 viafb_write_reg_mask(0x15, VIASR, 0xA2, 0xA2);
2271 viafb_set_secondary_address(viafb_SAMM_ON ? viafb_second_offset : 0);
2272 viafb_set_iga_path(); 2244 viafb_set_iga_path();
2273 2245
2274 /* Write CRTC */ 2246 /* Write CRTC */
2275 viafb_fill_crtc_timing(crt_timing, vmode_index, video_bpp / 8, IGA1); 2247 viafb_fill_crtc_timing(crt_timing, vmode_tbl, video_bpp / 8, IGA1);
2276 2248
2277 /* Write Graphic Controller */ 2249 /* Write Graphic Controller */
2278 for (i = 0; i < StdGR; i++) { 2250 for (i = 0; i < StdGR; i++) {
@@ -2292,65 +2264,25 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2292 2264
2293 /* Update Patch Register */ 2265 /* Update Patch Register */
2294 2266
2295 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) 2267 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266
2296 || (viaparinfo->chip_info->gfx_chip_name == UNICHROME_K400)) { 2268 || viaparinfo->chip_info->gfx_chip_name == UNICHROME_K400)
2297 for (i = 0; i < NUM_TOTAL_PATCH_MODE; i++) { 2269 && vmode_tbl->crtc[0].crtc.hor_addr == 1024
2298 if (res_patch_table[i].mode_index == vmode_index) { 2270 && vmode_tbl->crtc[0].crtc.ver_addr == 768) {
2299 for (j = 0; 2271 for (j = 0; j < res_patch_table[0].table_length; j++) {
2300 j < res_patch_table[i].table_length; j++) { 2272 index = res_patch_table[0].io_reg_table[j].index;
2301 index = 2273 port = res_patch_table[0].io_reg_table[j].port;
2302 res_patch_table[i]. 2274 value = res_patch_table[0].io_reg_table[j].value;
2303 io_reg_table[j].index; 2275 mask = res_patch_table[0].io_reg_table[j].mask;
2304 port = 2276 viafb_write_reg_mask(index, port, value, mask);
2305 res_patch_table[i].
2306 io_reg_table[j].port;
2307 value =
2308 res_patch_table[i].
2309 io_reg_table[j].value;
2310 mask =
2311 res_patch_table[i].
2312 io_reg_table[j].mask;
2313 viafb_write_reg_mask(index, port, value,
2314 mask);
2315 }
2316 }
2317 }
2318 }
2319
2320 if (viafb_SAMM_ON == 1) {
2321 if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)
2322 || (viaparinfo->chip_info->gfx_chip_name ==
2323 UNICHROME_K400)) {
2324 for (i = 0; i < NUM_TOTAL_PATCH_MODE; i++) {
2325 if (res_patch_table[i].mode_index ==
2326 vmode_index1) {
2327 for (j = 0;
2328 j <
2329 res_patch_table[i].
2330 table_length; j++) {
2331 index =
2332 res_patch_table[i].
2333 io_reg_table[j].index;
2334 port =
2335 res_patch_table[i].
2336 io_reg_table[j].port;
2337 value =
2338 res_patch_table[i].
2339 io_reg_table[j].value;
2340 mask =
2341 res_patch_table[i].
2342 io_reg_table[j].mask;
2343 viafb_write_reg_mask(index,
2344 port, value, mask);
2345 }
2346 }
2347 }
2348 } 2277 }
2349 } 2278 }
2350 2279
2351 viafb_set_primary_pitch(viafbinfo->fix.line_length); 2280 viafb_set_primary_pitch(viafbinfo->fix.line_length);
2352 viafb_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length 2281 viafb_set_secondary_pitch(viafb_dual_fb ? viafbinfo1->fix.line_length
2353 : viafbinfo->fix.line_length); 2282 : viafbinfo->fix.line_length);
2283 viafb_set_primary_color_depth(viaparinfo->depth);
2284 viafb_set_secondary_color_depth(viafb_dual_fb ? viaparinfo1->depth
2285 : viaparinfo->depth);
2354 /* Update Refresh Rate Setting */ 2286 /* Update Refresh Rate Setting */
2355 2287
2356 /* Clear On Screen */ 2288 /* Clear On Screen */
@@ -2359,11 +2291,11 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2359 if (viafb_CRT_ON) { 2291 if (viafb_CRT_ON) {
2360 if (viafb_SAMM_ON && (viaparinfo->crt_setting_info->iga_path == 2292 if (viafb_SAMM_ON && (viaparinfo->crt_setting_info->iga_path ==
2361 IGA2)) { 2293 IGA2)) {
2362 viafb_fill_crtc_timing(crt_timing1, vmode_index1, 2294 viafb_fill_crtc_timing(crt_timing1, vmode_tbl1,
2363 video_bpp1 / 8, 2295 video_bpp1 / 8,
2364 viaparinfo->crt_setting_info->iga_path); 2296 viaparinfo->crt_setting_info->iga_path);
2365 } else { 2297 } else {
2366 viafb_fill_crtc_timing(crt_timing, vmode_index, 2298 viafb_fill_crtc_timing(crt_timing, vmode_tbl,
2367 video_bpp / 8, 2299 video_bpp / 8,
2368 viaparinfo->crt_setting_info->iga_path); 2300 viaparinfo->crt_setting_info->iga_path);
2369 } 2301 }
@@ -2373,7 +2305,7 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2373 /* Patch if set_hres is not 8 alignment (1366) to viafb_setmode 2305 /* Patch if set_hres is not 8 alignment (1366) to viafb_setmode
2374 to 8 alignment (1368),there is several pixels (2 pixels) 2306 to 8 alignment (1368),there is several pixels (2 pixels)
2375 on right side of screen. */ 2307 on right side of screen. */
2376 if (hor_res % 8) { 2308 if (vmode_tbl->crtc[0].crtc.hor_addr % 8) {
2377 viafb_unlock_crt(); 2309 viafb_unlock_crt();
2378 viafb_write_reg(CR02, VIACR, 2310 viafb_write_reg(CR02, VIACR,
2379 viafb_read_reg(VIACR, CR02) - 1); 2311 viafb_read_reg(VIACR, CR02) - 1);
@@ -2384,14 +2316,14 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2384 if (viafb_DVI_ON) { 2316 if (viafb_DVI_ON) {
2385 if (viafb_SAMM_ON && 2317 if (viafb_SAMM_ON &&
2386 (viaparinfo->tmds_setting_info->iga_path == IGA2)) { 2318 (viaparinfo->tmds_setting_info->iga_path == IGA2)) {
2387 viafb_dvi_set_mode(viafb_get_mode_index 2319 viafb_dvi_set_mode(viafb_get_mode
2388 (viaparinfo->tmds_setting_info->h_active, 2320 (viaparinfo->tmds_setting_info->h_active,
2389 viaparinfo->tmds_setting_info-> 2321 viaparinfo->tmds_setting_info->
2390 v_active), 2322 v_active),
2391 video_bpp1, viaparinfo-> 2323 video_bpp1, viaparinfo->
2392 tmds_setting_info->iga_path); 2324 tmds_setting_info->iga_path);
2393 } else { 2325 } else {
2394 viafb_dvi_set_mode(viafb_get_mode_index 2326 viafb_dvi_set_mode(viafb_get_mode
2395 (viaparinfo->tmds_setting_info->h_active, 2327 (viaparinfo->tmds_setting_info->h_active,
2396 viaparinfo-> 2328 viaparinfo->
2397 tmds_setting_info->v_active), 2329 tmds_setting_info->v_active),
@@ -2445,8 +2377,8 @@ int viafb_setmode(int vmode_index, int hor_res, int ver_res, int video_bpp,
2445 2377
2446 /* If set mode normally, save resolution information for hot-plug . */ 2378 /* If set mode normally, save resolution information for hot-plug . */
2447 if (!viafb_hotplug) { 2379 if (!viafb_hotplug) {
2448 viafb_hotplug_Xres = hor_res; 2380 viafb_hotplug_Xres = vmode_tbl->crtc[0].crtc.hor_addr;
2449 viafb_hotplug_Yres = ver_res; 2381 viafb_hotplug_Yres = vmode_tbl->crtc[0].crtc.ver_addr;
2450 viafb_hotplug_bpp = video_bpp; 2382 viafb_hotplug_bpp = video_bpp;
2451 viafb_hotplug_refresh = viafb_refresh; 2383 viafb_hotplug_refresh = viafb_refresh;
2452 2384
@@ -2706,13 +2638,11 @@ void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
2706 2638
2707/*According var's xres, yres fill var's other timing information*/ 2639/*According var's xres, yres fill var's other timing information*/
2708void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh, 2640void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
2709 int mode_index) 2641 struct VideoModeTable *vmode_tbl)
2710{ 2642{
2711 struct VideoModeTable *vmode_tbl = NULL;
2712 struct crt_mode_table *crt_timing = NULL; 2643 struct crt_mode_table *crt_timing = NULL;
2713 struct display_timing crt_reg; 2644 struct display_timing crt_reg;
2714 int i = 0, index = 0; 2645 int i = 0, index = 0;
2715 vmode_tbl = &CLE266Modes[search_mode_setting(mode_index)];
2716 crt_timing = vmode_tbl->crtc; 2646 crt_timing = vmode_tbl->crtc;
2717 for (i = 0; i < vmode_tbl->mode_array; i++) { 2647 for (i = 0; i < vmode_tbl->mode_array; i++) {
2718 index = i; 2648 index = i;
@@ -2721,36 +2651,6 @@ void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
2721 } 2651 }
2722 2652
2723 crt_reg = crt_timing[index].crtc; 2653 crt_reg = crt_timing[index].crtc;
2724 switch (var->bits_per_pixel) {
2725 case 8:
2726 var->red.offset = 0;
2727 var->green.offset = 0;
2728 var->blue.offset = 0;
2729 var->red.length = 6;
2730 var->green.length = 6;
2731 var->blue.length = 6;
2732 break;
2733 case 16:
2734 var->red.offset = 11;
2735 var->green.offset = 5;
2736 var->blue.offset = 0;
2737 var->red.length = 5;
2738 var->green.length = 6;
2739 var->blue.length = 5;
2740 break;
2741 case 32:
2742 var->red.offset = 16;
2743 var->green.offset = 8;
2744 var->blue.offset = 0;
2745 var->red.length = 8;
2746 var->green.length = 8;
2747 var->blue.length = 8;
2748 break;
2749 default:
2750 /* never happed, put here to keep consistent */
2751 break;
2752 }
2753
2754 var->pixclock = viafb_get_pixclock(var->xres, var->yres, refresh); 2654 var->pixclock = viafb_get_pixclock(var->xres, var->yres, refresh);
2755 var->left_margin = 2655 var->left_margin =
2756 crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end); 2656 crt_reg.hor_total - (crt_reg.hor_sync_start + crt_reg.hor_sync_end);
diff --git a/drivers/video/via/hw.h b/drivers/video/via/hw.h
index b874d952b446..12ef32d334cb 100644
--- a/drivers/video/via/hw.h
+++ b/drivers/video/via/hw.h
@@ -22,6 +22,7 @@
22#ifndef __HW_H__ 22#ifndef __HW_H__
23#define __HW_H__ 23#define __HW_H__
24 24
25#include "viamode.h"
25#include "global.h" 26#include "global.h"
26 27
27/*************************************************** 28/***************************************************
@@ -862,8 +863,6 @@ struct pci_device_id_info {
862}; 863};
863 864
864extern unsigned int viafb_second_virtual_xres; 865extern unsigned int viafb_second_virtual_xres;
865extern unsigned int viafb_second_offset;
866extern int viafb_second_size;
867extern int viafb_SAMM_ON; 866extern int viafb_SAMM_ON;
868extern int viafb_dual_fb; 867extern int viafb_dual_fb;
869extern int viafb_LCD2_ON; 868extern int viafb_LCD2_ON;
@@ -874,8 +873,9 @@ extern int viafb_hotplug;
874void viafb_write_reg_mask(u8 index, int io_port, u8 data, u8 mask); 873void viafb_write_reg_mask(u8 index, int io_port, u8 data, u8 mask);
875void viafb_set_output_path(int device, int set_iga, 874void viafb_set_output_path(int device, int set_iga,
876 int output_interface); 875 int output_interface);
876
877void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, 877void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,
878 int mode_index, int bpp_byte, int set_iga); 878 struct VideoModeTable *video_mode, int bpp_byte, int set_iga);
879 879
880void viafb_set_vclock(u32 CLK, int set_iga); 880void viafb_set_vclock(u32 CLK, int set_iga);
881void viafb_load_reg(int timing_value, int viafb_load_reg_num, 881void viafb_load_reg(int timing_value, int viafb_load_reg_num,
@@ -891,16 +891,15 @@ void viafb_lock_crt(void);
891void viafb_unlock_crt(void); 891void viafb_unlock_crt(void);
892void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga); 892void viafb_load_fetch_count_reg(int h_addr, int bpp_byte, int set_iga);
893void viafb_write_regx(struct io_reg RegTable[], int ItemNum); 893void viafb_write_regx(struct io_reg RegTable[], int ItemNum);
894struct VideoModeTable *viafb_get_modetbl_pointer(int Index);
895u32 viafb_get_clk_value(int clk); 894u32 viafb_get_clk_value(int clk);
896void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active); 895void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active);
897void viafb_set_color_depth(int bpp_byte, int set_iga);
898void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\ 896void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
899 *p_gfx_dpa_setting); 897 *p_gfx_dpa_setting);
900 898
901int viafb_setmode(int vmode_index, int hor_res, int ver_res, 899int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
902 int video_bpp, int vmode_index1, int hor_res1, 900 struct VideoModeTable *vmode_tbl1, int video_bpp1);
903 int ver_res1, int video_bpp1); 901void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
902 struct VideoModeTable *vmode_tbl);
904void viafb_init_chip_info(struct pci_dev *pdev, 903void viafb_init_chip_info(struct pci_dev *pdev,
905 const struct pci_device_id *pdi); 904 const struct pci_device_id *pdi);
906void viafb_init_dac(int set_iga); 905void viafb_init_dac(int set_iga);
@@ -915,6 +914,8 @@ void viafb_set_primary_address(u32 addr);
915void viafb_set_secondary_address(u32 addr); 914void viafb_set_secondary_address(u32 addr);
916void viafb_set_primary_pitch(u32 pitch); 915void viafb_set_primary_pitch(u32 pitch);
917void viafb_set_secondary_pitch(u32 pitch); 916void viafb_set_secondary_pitch(u32 pitch);
917void viafb_set_primary_color_register(u8 index, u8 red, u8 green, u8 blue);
918void viafb_set_secondary_color_register(u8 index, u8 red, u8 green, u8 blue);
918void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len); 919void viafb_get_fb_info(unsigned int *fb_base, unsigned int *fb_len);
919 920
920#endif /* __HW_H__ */ 921#endif /* __HW_H__ */
diff --git a/drivers/video/via/iface.c b/drivers/video/via/iface.c
deleted file mode 100644
index 1570636c8d51..000000000000
--- a/drivers/video/via/iface.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation;
8 * either version 2, or (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE.See the GNU General Public License
14 * for more details.
15
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22#include "global.h"
23
24/* Get frame buffer size from VGA BIOS */
25
26unsigned int viafb_get_memsize(void)
27{
28 unsigned int m;
29
30 /* If memory size provided by user */
31 if (viafb_memsize)
32 m = viafb_memsize * Mb;
33 else {
34 m = (unsigned int)viafb_read_reg(VIASR, SR39);
35 m = m * (4 * Mb);
36
37 if ((m < (16 * Mb)) || (m > (64 * Mb)))
38 m = 16 * Mb;
39 }
40 DEBUG_MSG(KERN_INFO "framebuffer size = %d Mb\n", m / Mb);
41 return m;
42}
43
44/* Get Video Buffer Starting Physical Address(back door)*/
45
46unsigned long viafb_get_videobuf_addr(void)
47{
48 struct pci_dev *pdev = NULL;
49 unsigned char sys_mem;
50 unsigned char video_mem;
51 unsigned long sys_mem_size;
52 unsigned long video_mem_size;
53 /*system memory = 256 MB, video memory 64 MB */
54 unsigned long vmem_starting_adr = 0x0C000000;
55
56 pdev =
57 (struct pci_dev *)pci_get_device(VIA_K800_BRIDGE_VID,
58 VIA_K800_BRIDGE_DID, NULL);
59 if (pdev != NULL) {
60 pci_read_config_byte(pdev, VIA_K800_SYSTEM_MEMORY_REG,
61 &sys_mem);
62 pci_read_config_byte(pdev, VIA_K800_VIDEO_MEMORY_REG,
63 &video_mem);
64 video_mem = (video_mem & 0x70) >> 4;
65 sys_mem_size = ((unsigned long)sys_mem) << 24;
66 if (video_mem != 0)
67 video_mem_size = (1 << (video_mem)) * 1024 * 1024;
68 else
69 video_mem_size = 0;
70
71 vmem_starting_adr = sys_mem_size - video_mem_size;
72 pci_dev_put(pdev);
73 }
74
75 DEBUG_MSG(KERN_INFO "Video Memory Starting Address = %lx \n",
76 vmem_starting_adr);
77 return vmem_starting_adr;
78}
diff --git a/drivers/video/via/iface.h b/drivers/video/via/iface.h
deleted file mode 100644
index 790ec3e3aea2..000000000000
--- a/drivers/video/via/iface.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation;
8 * either version 2, or (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE.See the GNU General Public License
14 * for more details.
15
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __IFACE_H__
23#define __IFACE_H__
24
25#define Kb (1024)
26#define Mb (Kb*Kb)
27
28#define VIA_K800_BRIDGE_VID 0x1106
29#define VIA_K800_BRIDGE_DID 0x3204
30
31#define VIA_K800_SYSTEM_MEMORY_REG 0x47
32#define VIA_K800_VIDEO_MEMORY_REG 0xA1
33
34extern int viafb_memsize;
35unsigned int viafb_get_memsize(void);
36unsigned long viafb_get_videobuf_addr(void);
37
38#endif /* __IFACE_H__ */
diff --git a/drivers/video/via/lcd.c b/drivers/video/via/lcd.c
index 09353e2b92f6..1b1ccdc2d83d 100644
--- a/drivers/video/via/lcd.c
+++ b/drivers/video/via/lcd.c
@@ -22,25 +22,7 @@
22#include "global.h" 22#include "global.h"
23#include "lcdtbl.h" 23#include "lcdtbl.h"
24 24
25static struct iga2_shadow_crtc_timing iga2_shadow_crtc_reg = { 25#define viafb_compact_res(x, y) (((x)<<16)|(y))
26 /* IGA2 Shadow Horizontal Total */
27 {IGA2_SHADOW_HOR_TOTAL_REG_NUM, {{CR6D, 0, 7}, {CR71, 3, 3} } },
28 /* IGA2 Shadow Horizontal Blank End */
29 {IGA2_SHADOW_HOR_BLANK_END_REG_NUM, {{CR6E, 0, 7} } },
30 /* IGA2 Shadow Vertical Total */
31 {IGA2_SHADOW_VER_TOTAL_REG_NUM, {{CR6F, 0, 7}, {CR71, 0, 2} } },
32 /* IGA2 Shadow Vertical Addressable Video */
33 {IGA2_SHADOW_VER_ADDR_REG_NUM, {{CR70, 0, 7}, {CR71, 4, 6} } },
34 /* IGA2 Shadow Vertical Blank Start */
35 {IGA2_SHADOW_VER_BLANK_START_REG_NUM,
36 {{CR72, 0, 7}, {CR74, 4, 6} } },
37 /* IGA2 Shadow Vertical Blank End */
38 {IGA2_SHADOW_VER_BLANK_END_REG_NUM, {{CR73, 0, 7}, {CR74, 0, 2} } },
39 /* IGA2 Shadow Vertical Sync Start */
40 {IGA2_SHADOW_VER_SYNC_START_REG_NUM, {{CR75, 0, 7}, {CR76, 4, 6} } },
41 /* IGA2 Shadow Vertical Sync End */
42 {IGA2_SHADOW_VER_SYNC_END_REG_NUM, {{CR76, 0, 3} } }
43};
44 26
45static struct _lcd_scaling_factor lcd_scaling_factor = { 27static struct _lcd_scaling_factor lcd_scaling_factor = {
46 /* LCD Horizontal Scaling Factor Register */ 28 /* LCD Horizontal Scaling Factor Register */
@@ -59,16 +41,10 @@ static struct _lcd_scaling_factor lcd_scaling_factor_CLE = {
59 41
60static int check_lvds_chip(int device_id_subaddr, int device_id); 42static int check_lvds_chip(int device_id_subaddr, int device_id);
61static bool lvds_identify_integratedlvds(void); 43static bool lvds_identify_integratedlvds(void);
62static int fp_id_to_vindex(int panel_id); 44static void fp_id_to_vindex(int panel_id);
63static int lvds_register_read(int index); 45static int lvds_register_read(int index);
64static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres, 46static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
65 int panel_vres); 47 int panel_vres);
66static void load_lcd_k400_patch_tbl(int set_hres, int set_vres,
67 int panel_id);
68static void load_lcd_p880_patch_tbl(int set_hres, int set_vres,
69 int panel_id);
70static void load_lcd_patch_regs(int set_hres, int set_vres,
71 int panel_id, int set_iga);
72static void via_pitch_alignment_patch_lcd( 48static void via_pitch_alignment_patch_lcd(
73 struct lvds_setting_information *plvds_setting_info, 49 struct lvds_setting_information *plvds_setting_info,
74 struct lvds_chip_information 50 struct lvds_chip_information
@@ -98,8 +74,6 @@ static void check_diport_of_integrated_lvds(
98static struct display_timing lcd_centering_timging(struct display_timing 74static struct display_timing lcd_centering_timging(struct display_timing
99 mode_crt_reg, 75 mode_crt_reg,
100 struct display_timing panel_crt_reg); 76 struct display_timing panel_crt_reg);
101static void load_crtc_shadow_timing(struct display_timing mode_timing,
102 struct display_timing panel_timing);
103static void viafb_load_scaling_factor_for_p4m900(int set_hres, 77static void viafb_load_scaling_factor_for_p4m900(int set_hres,
104 int set_vres, int panel_hres, int panel_vres); 78 int set_vres, int panel_hres, int panel_vres);
105 79
@@ -125,33 +99,24 @@ void viafb_init_lcd_size(void)
125 break; 99 break;
126 case GET_LCD_SIZE_BY_VGA_BIOS: 100 case GET_LCD_SIZE_BY_VGA_BIOS:
127 DEBUG_MSG(KERN_INFO "Get LCD Size method by VGA BIOS !!\n"); 101 DEBUG_MSG(KERN_INFO "Get LCD Size method by VGA BIOS !!\n");
128 viaparinfo->lvds_setting_info->lcd_panel_size = 102 fp_id_to_vindex(viafb_lcd_panel_id);
129 fp_id_to_vindex(viafb_lcd_panel_id);
130 DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n", 103 DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n",
131 viaparinfo->lvds_setting_info->lcd_panel_id); 104 viaparinfo->lvds_setting_info->lcd_panel_id);
132 DEBUG_MSG(KERN_INFO "LCD Panel Size = %d\n",
133 viaparinfo->lvds_setting_info->lcd_panel_size);
134 break; 105 break;
135 case GET_LCD_SIZE_BY_USER_SETTING: 106 case GET_LCD_SIZE_BY_USER_SETTING:
136 DEBUG_MSG(KERN_INFO "Get LCD Size method by user setting !!\n"); 107 DEBUG_MSG(KERN_INFO "Get LCD Size method by user setting !!\n");
137 viaparinfo->lvds_setting_info->lcd_panel_size = 108 fp_id_to_vindex(viafb_lcd_panel_id);
138 fp_id_to_vindex(viafb_lcd_panel_id);
139 DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n", 109 DEBUG_MSG(KERN_INFO "LCD Panel_ID = %d\n",
140 viaparinfo->lvds_setting_info->lcd_panel_id); 110 viaparinfo->lvds_setting_info->lcd_panel_id);
141 DEBUG_MSG(KERN_INFO "LCD Panel Size = %d\n",
142 viaparinfo->lvds_setting_info->lcd_panel_size);
143 break; 111 break;
144 default: 112 default:
145 DEBUG_MSG(KERN_INFO "viafb_init_lcd_size fail\n"); 113 DEBUG_MSG(KERN_INFO "viafb_init_lcd_size fail\n");
146 viaparinfo->lvds_setting_info->lcd_panel_id = 114 viaparinfo->lvds_setting_info->lcd_panel_id =
147 LCD_PANEL_ID1_800X600; 115 LCD_PANEL_ID1_800X600;
148 viaparinfo->lvds_setting_info->lcd_panel_size = 116 fp_id_to_vindex(LCD_PANEL_ID1_800X600);
149 fp_id_to_vindex(LCD_PANEL_ID1_800X600);
150 } 117 }
151 viaparinfo->lvds_setting_info2->lcd_panel_id = 118 viaparinfo->lvds_setting_info2->lcd_panel_id =
152 viaparinfo->lvds_setting_info->lcd_panel_id; 119 viaparinfo->lvds_setting_info->lcd_panel_id;
153 viaparinfo->lvds_setting_info2->lcd_panel_size =
154 viaparinfo->lvds_setting_info->lcd_panel_size;
155 viaparinfo->lvds_setting_info2->lcd_panel_hres = 120 viaparinfo->lvds_setting_info2->lcd_panel_hres =
156 viaparinfo->lvds_setting_info->lcd_panel_hres; 121 viaparinfo->lvds_setting_info->lcd_panel_hres;
157 viaparinfo->lvds_setting_info2->lcd_panel_vres = 122 viaparinfo->lvds_setting_info2->lcd_panel_vres =
@@ -171,13 +136,13 @@ static bool lvds_identify_integratedlvds(void)
171 if (viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) { 136 if (viaparinfo->chip_info->lvds_chip_info.lvds_chip_name) {
172 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name = 137 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name =
173 INTEGRATED_LVDS; 138 INTEGRATED_LVDS;
174 DEBUG_MSG(KERN_INFO "Support two dual channel LVDS!\ 139 DEBUG_MSG(KERN_INFO "Support two dual channel LVDS! "
175 (Internal LVDS + External LVDS)\n"); 140 "(Internal LVDS + External LVDS)\n");
176 } else { 141 } else {
177 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name = 142 viaparinfo->chip_info->lvds_chip_info.lvds_chip_name =
178 INTEGRATED_LVDS; 143 INTEGRATED_LVDS;
179 DEBUG_MSG(KERN_INFO "Not found external LVDS,\ 144 DEBUG_MSG(KERN_INFO "Not found external LVDS, "
180 so can't support two dual channel LVDS!\n"); 145 "so can't support two dual channel LVDS!\n");
181 } 146 }
182 } else if (viafb_display_hardware_layout == HW_LAYOUT_LCD1_LCD2) { 147 } else if (viafb_display_hardware_layout == HW_LAYOUT_LCD1_LCD2) {
183 /* Two single channel LCD (Internal LVDS + Internal LVDS): */ 148 /* Two single channel LCD (Internal LVDS + Internal LVDS): */
@@ -185,8 +150,8 @@ static bool lvds_identify_integratedlvds(void)
185 INTEGRATED_LVDS; 150 INTEGRATED_LVDS;
186 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name = 151 viaparinfo->chip_info->lvds_chip_info2.lvds_chip_name =
187 INTEGRATED_LVDS; 152 INTEGRATED_LVDS;
188 DEBUG_MSG(KERN_INFO "Support two single channel LVDS!\ 153 DEBUG_MSG(KERN_INFO "Support two single channel LVDS! "
189 (Internal LVDS + Internal LVDS)\n"); 154 "(Internal LVDS + Internal LVDS)\n");
190 } else if (viafb_display_hardware_layout != HW_LAYOUT_DVI_ONLY) { 155 } else if (viafb_display_hardware_layout != HW_LAYOUT_DVI_ONLY) {
191 /* If we have found external LVDS, just use it, 156 /* If we have found external LVDS, just use it,
192 otherwise, we will use internal LVDS as default. */ 157 otherwise, we will use internal LVDS as default. */
@@ -248,7 +213,7 @@ int viafb_lvds_trasmitter_identify(void)
248 return FAIL; 213 return FAIL;
249} 214}
250 215
251static int fp_id_to_vindex(int panel_id) 216static void fp_id_to_vindex(int panel_id)
252{ 217{
253 DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n"); 218 DEBUG_MSG(KERN_INFO "fp_get_panel_id()\n");
254 219
@@ -264,7 +229,6 @@ static int fp_id_to_vindex(int panel_id)
264 LCD_PANEL_ID0_640X480; 229 LCD_PANEL_ID0_640X480;
265 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 230 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
266 viaparinfo->lvds_setting_info->LCDDithering = 1; 231 viaparinfo->lvds_setting_info->LCDDithering = 1;
267 return VIA_RES_640X480;
268 break; 232 break;
269 case 0x1: 233 case 0x1:
270 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; 234 viaparinfo->lvds_setting_info->lcd_panel_hres = 800;
@@ -273,7 +237,6 @@ static int fp_id_to_vindex(int panel_id)
273 LCD_PANEL_ID1_800X600; 237 LCD_PANEL_ID1_800X600;
274 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 238 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
275 viaparinfo->lvds_setting_info->LCDDithering = 1; 239 viaparinfo->lvds_setting_info->LCDDithering = 1;
276 return VIA_RES_800X600;
277 break; 240 break;
278 case 0x2: 241 case 0x2:
279 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; 242 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024;
@@ -282,7 +245,6 @@ static int fp_id_to_vindex(int panel_id)
282 LCD_PANEL_ID2_1024X768; 245 LCD_PANEL_ID2_1024X768;
283 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 246 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
284 viaparinfo->lvds_setting_info->LCDDithering = 1; 247 viaparinfo->lvds_setting_info->LCDDithering = 1;
285 return VIA_RES_1024X768;
286 break; 248 break;
287 case 0x3: 249 case 0x3:
288 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 250 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -291,7 +253,6 @@ static int fp_id_to_vindex(int panel_id)
291 LCD_PANEL_ID3_1280X768; 253 LCD_PANEL_ID3_1280X768;
292 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 254 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
293 viaparinfo->lvds_setting_info->LCDDithering = 1; 255 viaparinfo->lvds_setting_info->LCDDithering = 1;
294 return VIA_RES_1280X768;
295 break; 256 break;
296 case 0x4: 257 case 0x4:
297 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 258 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -300,7 +261,6 @@ static int fp_id_to_vindex(int panel_id)
300 LCD_PANEL_ID4_1280X1024; 261 LCD_PANEL_ID4_1280X1024;
301 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 262 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
302 viaparinfo->lvds_setting_info->LCDDithering = 1; 263 viaparinfo->lvds_setting_info->LCDDithering = 1;
303 return VIA_RES_1280X1024;
304 break; 264 break;
305 case 0x5: 265 case 0x5:
306 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400; 266 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400;
@@ -309,7 +269,6 @@ static int fp_id_to_vindex(int panel_id)
309 LCD_PANEL_ID5_1400X1050; 269 LCD_PANEL_ID5_1400X1050;
310 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 270 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
311 viaparinfo->lvds_setting_info->LCDDithering = 1; 271 viaparinfo->lvds_setting_info->LCDDithering = 1;
312 return VIA_RES_1400X1050;
313 break; 272 break;
314 case 0x6: 273 case 0x6:
315 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600; 274 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600;
@@ -318,7 +277,6 @@ static int fp_id_to_vindex(int panel_id)
318 LCD_PANEL_ID6_1600X1200; 277 LCD_PANEL_ID6_1600X1200;
319 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 278 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
320 viaparinfo->lvds_setting_info->LCDDithering = 1; 279 viaparinfo->lvds_setting_info->LCDDithering = 1;
321 return VIA_RES_1600X1200;
322 break; 280 break;
323 case 0x8: 281 case 0x8:
324 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; 282 viaparinfo->lvds_setting_info->lcd_panel_hres = 800;
@@ -327,7 +285,6 @@ static int fp_id_to_vindex(int panel_id)
327 LCD_PANEL_IDA_800X480; 285 LCD_PANEL_IDA_800X480;
328 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 286 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
329 viaparinfo->lvds_setting_info->LCDDithering = 1; 287 viaparinfo->lvds_setting_info->LCDDithering = 1;
330 return VIA_RES_800X480;
331 break; 288 break;
332 case 0x9: 289 case 0x9:
333 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; 290 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024;
@@ -336,7 +293,6 @@ static int fp_id_to_vindex(int panel_id)
336 LCD_PANEL_ID2_1024X768; 293 LCD_PANEL_ID2_1024X768;
337 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 294 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
338 viaparinfo->lvds_setting_info->LCDDithering = 1; 295 viaparinfo->lvds_setting_info->LCDDithering = 1;
339 return VIA_RES_1024X768;
340 break; 296 break;
341 case 0xA: 297 case 0xA:
342 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; 298 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024;
@@ -345,7 +301,6 @@ static int fp_id_to_vindex(int panel_id)
345 LCD_PANEL_ID2_1024X768; 301 LCD_PANEL_ID2_1024X768;
346 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 302 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
347 viaparinfo->lvds_setting_info->LCDDithering = 0; 303 viaparinfo->lvds_setting_info->LCDDithering = 0;
348 return VIA_RES_1024X768;
349 break; 304 break;
350 case 0xB: 305 case 0xB:
351 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; 306 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024;
@@ -354,7 +309,6 @@ static int fp_id_to_vindex(int panel_id)
354 LCD_PANEL_ID2_1024X768; 309 LCD_PANEL_ID2_1024X768;
355 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 310 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
356 viaparinfo->lvds_setting_info->LCDDithering = 0; 311 viaparinfo->lvds_setting_info->LCDDithering = 0;
357 return VIA_RES_1024X768;
358 break; 312 break;
359 case 0xC: 313 case 0xC:
360 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 314 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -363,7 +317,6 @@ static int fp_id_to_vindex(int panel_id)
363 LCD_PANEL_ID3_1280X768; 317 LCD_PANEL_ID3_1280X768;
364 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 318 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
365 viaparinfo->lvds_setting_info->LCDDithering = 0; 319 viaparinfo->lvds_setting_info->LCDDithering = 0;
366 return VIA_RES_1280X768;
367 break; 320 break;
368 case 0xD: 321 case 0xD:
369 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 322 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -372,7 +325,6 @@ static int fp_id_to_vindex(int panel_id)
372 LCD_PANEL_ID4_1280X1024; 325 LCD_PANEL_ID4_1280X1024;
373 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 326 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
374 viaparinfo->lvds_setting_info->LCDDithering = 0; 327 viaparinfo->lvds_setting_info->LCDDithering = 0;
375 return VIA_RES_1280X1024;
376 break; 328 break;
377 case 0xE: 329 case 0xE:
378 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400; 330 viaparinfo->lvds_setting_info->lcd_panel_hres = 1400;
@@ -381,7 +333,6 @@ static int fp_id_to_vindex(int panel_id)
381 LCD_PANEL_ID5_1400X1050; 333 LCD_PANEL_ID5_1400X1050;
382 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 334 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
383 viaparinfo->lvds_setting_info->LCDDithering = 0; 335 viaparinfo->lvds_setting_info->LCDDithering = 0;
384 return VIA_RES_1400X1050;
385 break; 336 break;
386 case 0xF: 337 case 0xF:
387 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600; 338 viaparinfo->lvds_setting_info->lcd_panel_hres = 1600;
@@ -390,7 +341,6 @@ static int fp_id_to_vindex(int panel_id)
390 LCD_PANEL_ID6_1600X1200; 341 LCD_PANEL_ID6_1600X1200;
391 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 342 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
392 viaparinfo->lvds_setting_info->LCDDithering = 0; 343 viaparinfo->lvds_setting_info->LCDDithering = 0;
393 return VIA_RES_1600X1200;
394 break; 344 break;
395 case 0x10: 345 case 0x10:
396 viaparinfo->lvds_setting_info->lcd_panel_hres = 1366; 346 viaparinfo->lvds_setting_info->lcd_panel_hres = 1366;
@@ -399,7 +349,6 @@ static int fp_id_to_vindex(int panel_id)
399 LCD_PANEL_ID7_1366X768; 349 LCD_PANEL_ID7_1366X768;
400 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 350 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
401 viaparinfo->lvds_setting_info->LCDDithering = 0; 351 viaparinfo->lvds_setting_info->LCDDithering = 0;
402 return VIA_RES_1368X768;
403 break; 352 break;
404 case 0x11: 353 case 0x11:
405 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024; 354 viaparinfo->lvds_setting_info->lcd_panel_hres = 1024;
@@ -408,7 +357,6 @@ static int fp_id_to_vindex(int panel_id)
408 LCD_PANEL_ID8_1024X600; 357 LCD_PANEL_ID8_1024X600;
409 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 358 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
410 viaparinfo->lvds_setting_info->LCDDithering = 1; 359 viaparinfo->lvds_setting_info->LCDDithering = 1;
411 return VIA_RES_1024X600;
412 break; 360 break;
413 case 0x12: 361 case 0x12:
414 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 362 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -417,7 +365,6 @@ static int fp_id_to_vindex(int panel_id)
417 LCD_PANEL_ID3_1280X768; 365 LCD_PANEL_ID3_1280X768;
418 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 366 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
419 viaparinfo->lvds_setting_info->LCDDithering = 1; 367 viaparinfo->lvds_setting_info->LCDDithering = 1;
420 return VIA_RES_1280X768;
421 break; 368 break;
422 case 0x13: 369 case 0x13:
423 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 370 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -426,7 +373,6 @@ static int fp_id_to_vindex(int panel_id)
426 LCD_PANEL_ID9_1280X800; 373 LCD_PANEL_ID9_1280X800;
427 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 374 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
428 viaparinfo->lvds_setting_info->LCDDithering = 1; 375 viaparinfo->lvds_setting_info->LCDDithering = 1;
429 return VIA_RES_1280X800;
430 break; 376 break;
431 case 0x14: 377 case 0x14:
432 viaparinfo->lvds_setting_info->lcd_panel_hres = 1360; 378 viaparinfo->lvds_setting_info->lcd_panel_hres = 1360;
@@ -435,7 +381,6 @@ static int fp_id_to_vindex(int panel_id)
435 LCD_PANEL_IDB_1360X768; 381 LCD_PANEL_IDB_1360X768;
436 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 382 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
437 viaparinfo->lvds_setting_info->LCDDithering = 0; 383 viaparinfo->lvds_setting_info->LCDDithering = 0;
438 return VIA_RES_1360X768;
439 break; 384 break;
440 case 0x15: 385 case 0x15:
441 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280; 386 viaparinfo->lvds_setting_info->lcd_panel_hres = 1280;
@@ -444,7 +389,6 @@ static int fp_id_to_vindex(int panel_id)
444 LCD_PANEL_ID3_1280X768; 389 LCD_PANEL_ID3_1280X768;
445 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1; 390 viaparinfo->lvds_setting_info->device_lcd_dualedge = 1;
446 viaparinfo->lvds_setting_info->LCDDithering = 0; 391 viaparinfo->lvds_setting_info->LCDDithering = 0;
447 return VIA_RES_1280X768;
448 break; 392 break;
449 case 0x16: 393 case 0x16:
450 viaparinfo->lvds_setting_info->lcd_panel_hres = 480; 394 viaparinfo->lvds_setting_info->lcd_panel_hres = 480;
@@ -453,7 +397,6 @@ static int fp_id_to_vindex(int panel_id)
453 LCD_PANEL_IDC_480X640; 397 LCD_PANEL_IDC_480X640;
454 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 398 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
455 viaparinfo->lvds_setting_info->LCDDithering = 1; 399 viaparinfo->lvds_setting_info->LCDDithering = 1;
456 return VIA_RES_480X640;
457 break; 400 break;
458 default: 401 default:
459 viaparinfo->lvds_setting_info->lcd_panel_hres = 800; 402 viaparinfo->lvds_setting_info->lcd_panel_hres = 800;
@@ -462,7 +405,6 @@ static int fp_id_to_vindex(int panel_id)
462 LCD_PANEL_ID1_800X600; 405 LCD_PANEL_ID1_800X600;
463 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0; 406 viaparinfo->lvds_setting_info->device_lcd_dualedge = 0;
464 viaparinfo->lvds_setting_info->LCDDithering = 1; 407 viaparinfo->lvds_setting_info->LCDDithering = 1;
465 return VIA_RES_800X600;
466 } 408 }
467} 409}
468 410
@@ -573,284 +515,6 @@ static void load_lcd_scaling(int set_hres, int set_vres, int panel_hres,
573 } 515 }
574} 516}
575 517
576static void load_lcd_k400_patch_tbl(int set_hres, int set_vres,
577 int panel_id)
578{
579 int vmode_index;
580 int reg_num = 0;
581 struct io_reg *lcd_patch_reg = NULL;
582
583 vmode_index = viafb_get_mode_index(set_hres, set_vres);
584 switch (panel_id) {
585 /* LCD 800x600 */
586 case LCD_PANEL_ID1_800X600:
587 switch (vmode_index) {
588 case VIA_RES_640X400:
589 case VIA_RES_640X480:
590 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_8X6;
591 lcd_patch_reg = K400_LCD_RES_6X4_8X6;
592 break;
593 case VIA_RES_720X480:
594 case VIA_RES_720X576:
595 reg_num = NUM_TOTAL_K400_LCD_RES_7X4_8X6;
596 lcd_patch_reg = K400_LCD_RES_7X4_8X6;
597 break;
598 }
599 break;
600
601 /* LCD 1024x768 */
602 case LCD_PANEL_ID2_1024X768:
603 switch (vmode_index) {
604 case VIA_RES_640X400:
605 case VIA_RES_640X480:
606 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_10X7;
607 lcd_patch_reg = K400_LCD_RES_6X4_10X7;
608 break;
609 case VIA_RES_720X480:
610 case VIA_RES_720X576:
611 reg_num = NUM_TOTAL_K400_LCD_RES_7X4_10X7;
612 lcd_patch_reg = K400_LCD_RES_7X4_10X7;
613 break;
614 case VIA_RES_800X600:
615 reg_num = NUM_TOTAL_K400_LCD_RES_8X6_10X7;
616 lcd_patch_reg = K400_LCD_RES_8X6_10X7;
617 break;
618 }
619 break;
620
621 /* LCD 1280x1024 */
622 case LCD_PANEL_ID4_1280X1024:
623 switch (vmode_index) {
624 case VIA_RES_640X400:
625 case VIA_RES_640X480:
626 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_12X10;
627 lcd_patch_reg = K400_LCD_RES_6X4_12X10;
628 break;
629 case VIA_RES_720X480:
630 case VIA_RES_720X576:
631 reg_num = NUM_TOTAL_K400_LCD_RES_7X4_12X10;
632 lcd_patch_reg = K400_LCD_RES_7X4_12X10;
633 break;
634 case VIA_RES_800X600:
635 reg_num = NUM_TOTAL_K400_LCD_RES_8X6_12X10;
636 lcd_patch_reg = K400_LCD_RES_8X6_12X10;
637 break;
638 case VIA_RES_1024X768:
639 reg_num = NUM_TOTAL_K400_LCD_RES_10X7_12X10;
640 lcd_patch_reg = K400_LCD_RES_10X7_12X10;
641 break;
642
643 }
644 break;
645
646 /* LCD 1400x1050 */
647 case LCD_PANEL_ID5_1400X1050:
648 switch (vmode_index) {
649 case VIA_RES_640X480:
650 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_14X10;
651 lcd_patch_reg = K400_LCD_RES_6X4_14X10;
652 break;
653 case VIA_RES_800X600:
654 reg_num = NUM_TOTAL_K400_LCD_RES_8X6_14X10;
655 lcd_patch_reg = K400_LCD_RES_8X6_14X10;
656 break;
657 case VIA_RES_1024X768:
658 reg_num = NUM_TOTAL_K400_LCD_RES_10X7_14X10;
659 lcd_patch_reg = K400_LCD_RES_10X7_14X10;
660 break;
661 case VIA_RES_1280X768:
662 case VIA_RES_1280X800:
663 case VIA_RES_1280X960:
664 case VIA_RES_1280X1024:
665 reg_num = NUM_TOTAL_K400_LCD_RES_12X10_14X10;
666 lcd_patch_reg = K400_LCD_RES_12X10_14X10;
667 break;
668 }
669 break;
670
671 /* LCD 1600x1200 */
672 case LCD_PANEL_ID6_1600X1200:
673 switch (vmode_index) {
674 case VIA_RES_640X400:
675 case VIA_RES_640X480:
676 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_16X12;
677 lcd_patch_reg = K400_LCD_RES_6X4_16X12;
678 break;
679 case VIA_RES_720X480:
680 case VIA_RES_720X576:
681 reg_num = NUM_TOTAL_K400_LCD_RES_7X4_16X12;
682 lcd_patch_reg = K400_LCD_RES_7X4_16X12;
683 break;
684 case VIA_RES_800X600:
685 reg_num = NUM_TOTAL_K400_LCD_RES_8X6_16X12;
686 lcd_patch_reg = K400_LCD_RES_8X6_16X12;
687 break;
688 case VIA_RES_1024X768:
689 reg_num = NUM_TOTAL_K400_LCD_RES_10X7_16X12;
690 lcd_patch_reg = K400_LCD_RES_10X7_16X12;
691 break;
692 case VIA_RES_1280X768:
693 case VIA_RES_1280X800:
694 case VIA_RES_1280X960:
695 case VIA_RES_1280X1024:
696 reg_num = NUM_TOTAL_K400_LCD_RES_12X10_16X12;
697 lcd_patch_reg = K400_LCD_RES_12X10_16X12;
698 break;
699 }
700 break;
701
702 /* LCD 1366x768 */
703 case LCD_PANEL_ID7_1366X768:
704 switch (vmode_index) {
705 case VIA_RES_640X480:
706 reg_num = NUM_TOTAL_K400_LCD_RES_6X4_1366X7;
707 lcd_patch_reg = K400_LCD_RES_6X4_1366X7;
708 break;
709 case VIA_RES_720X480:
710 case VIA_RES_720X576:
711 reg_num = NUM_TOTAL_K400_LCD_RES_7X4_1366X7;
712 lcd_patch_reg = K400_LCD_RES_7X4_1366X7;
713 break;
714 case VIA_RES_800X600:
715 reg_num = NUM_TOTAL_K400_LCD_RES_8X6_1366X7;
716 lcd_patch_reg = K400_LCD_RES_8X6_1366X7;
717 break;
718 case VIA_RES_1024X768:
719 reg_num = NUM_TOTAL_K400_LCD_RES_10X7_1366X7;
720 lcd_patch_reg = K400_LCD_RES_10X7_1366X7;
721 break;
722 case VIA_RES_1280X768:
723 case VIA_RES_1280X800:
724 case VIA_RES_1280X960:
725 case VIA_RES_1280X1024:
726 reg_num = NUM_TOTAL_K400_LCD_RES_12X10_1366X7;
727 lcd_patch_reg = K400_LCD_RES_12X10_1366X7;
728 break;
729 }
730 break;
731
732 /* LCD 1360x768 */
733 case LCD_PANEL_IDB_1360X768:
734 break;
735 }
736 if (reg_num != 0) {
737 /* H.W. Reset : ON */
738 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7);
739
740 viafb_write_regx(lcd_patch_reg, reg_num);
741
742 /* H.W. Reset : OFF */
743 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7);
744
745 /* Reset PLL */
746 viafb_write_reg_mask(SR40, VIASR, 0x02, BIT1);
747 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT1);
748
749 /* Fire! */
750 outb(inb(VIARMisc) | (BIT2 + BIT3), VIAWMisc);
751 }
752}
753
754static void load_lcd_p880_patch_tbl(int set_hres, int set_vres,
755 int panel_id)
756{
757 int vmode_index;
758 int reg_num = 0;
759 struct io_reg *lcd_patch_reg = NULL;
760
761 vmode_index = viafb_get_mode_index(set_hres, set_vres);
762
763 switch (panel_id) {
764 case LCD_PANEL_ID5_1400X1050:
765 switch (vmode_index) {
766 case VIA_RES_640X480:
767 reg_num = NUM_TOTAL_P880_LCD_RES_6X4_14X10;
768 lcd_patch_reg = P880_LCD_RES_6X4_14X10;
769 break;
770 case VIA_RES_800X600:
771 reg_num = NUM_TOTAL_P880_LCD_RES_8X6_14X10;
772 lcd_patch_reg = P880_LCD_RES_8X6_14X10;
773 break;
774 }
775 break;
776 case LCD_PANEL_ID6_1600X1200:
777 switch (vmode_index) {
778 case VIA_RES_640X400:
779 case VIA_RES_640X480:
780 reg_num = NUM_TOTAL_P880_LCD_RES_6X4_16X12;
781 lcd_patch_reg = P880_LCD_RES_6X4_16X12;
782 break;
783 case VIA_RES_720X480:
784 case VIA_RES_720X576:
785 reg_num = NUM_TOTAL_P880_LCD_RES_7X4_16X12;
786 lcd_patch_reg = P880_LCD_RES_7X4_16X12;
787 break;
788 case VIA_RES_800X600:
789 reg_num = NUM_TOTAL_P880_LCD_RES_8X6_16X12;
790 lcd_patch_reg = P880_LCD_RES_8X6_16X12;
791 break;
792 case VIA_RES_1024X768:
793 reg_num = NUM_TOTAL_P880_LCD_RES_10X7_16X12;
794 lcd_patch_reg = P880_LCD_RES_10X7_16X12;
795 break;
796 case VIA_RES_1280X768:
797 case VIA_RES_1280X960:
798 case VIA_RES_1280X1024:
799 reg_num = NUM_TOTAL_P880_LCD_RES_12X10_16X12;
800 lcd_patch_reg = P880_LCD_RES_12X10_16X12;
801 break;
802 }
803 break;
804
805 }
806 if (reg_num != 0) {
807 /* H.W. Reset : ON */
808 viafb_write_reg_mask(CR17, VIACR, 0x00, BIT7);
809
810 viafb_write_regx(lcd_patch_reg, reg_num);
811
812 /* H.W. Reset : OFF */
813 viafb_write_reg_mask(CR17, VIACR, 0x80, BIT7);
814
815 /* Reset PLL */
816 viafb_write_reg_mask(SR40, VIASR, 0x02, BIT1);
817 viafb_write_reg_mask(SR40, VIASR, 0x00, BIT1);
818
819 /* Fire! */
820 outb(inb(VIARMisc) | (BIT2 + BIT3), VIAWMisc);
821 }
822}
823
824static void load_lcd_patch_regs(int set_hres, int set_vres,
825 int panel_id, int set_iga)
826{
827 int vmode_index;
828
829 vmode_index = viafb_get_mode_index(set_hres, set_vres);
830
831 viafb_unlock_crt();
832
833 /* Patch for simultaneous & Expansion */
834 if ((set_iga == IGA1_IGA2) &&
835 (viaparinfo->lvds_setting_info->display_method ==
836 LCD_EXPANDSION)) {
837 switch (viaparinfo->chip_info->gfx_chip_name) {
838 case UNICHROME_CLE266:
839 case UNICHROME_K400:
840 load_lcd_k400_patch_tbl(set_hres, set_vres, panel_id);
841 break;
842 case UNICHROME_K800:
843 break;
844 case UNICHROME_PM800:
845 case UNICHROME_CN700:
846 case UNICHROME_CX700:
847 load_lcd_p880_patch_tbl(set_hres, set_vres, panel_id);
848 }
849 }
850
851 viafb_lock_crt();
852}
853
854static void via_pitch_alignment_patch_lcd( 518static void via_pitch_alignment_patch_lcd(
855 struct lvds_setting_information *plvds_setting_info, 519 struct lvds_setting_information *plvds_setting_info,
856 struct lvds_chip_information 520 struct lvds_chip_information
@@ -949,29 +613,25 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
949 struct lvds_setting_information *plvds_setting_info, 613 struct lvds_setting_information *plvds_setting_info,
950 struct lvds_chip_information *plvds_chip_info) 614 struct lvds_chip_information *plvds_chip_info)
951{ 615{
952 int video_index = plvds_setting_info->lcd_panel_size;
953 int set_iga = plvds_setting_info->iga_path; 616 int set_iga = plvds_setting_info->iga_path;
954 int mode_bpp = plvds_setting_info->bpp; 617 int mode_bpp = plvds_setting_info->bpp;
955 int set_hres, set_vres; 618 int set_hres = plvds_setting_info->h_active;
956 int panel_hres, panel_vres; 619 int set_vres = plvds_setting_info->v_active;
620 int panel_hres = plvds_setting_info->lcd_panel_hres;
621 int panel_vres = plvds_setting_info->lcd_panel_vres;
957 u32 pll_D_N; 622 u32 pll_D_N;
958 int offset;
959 struct display_timing mode_crt_reg, panel_crt_reg; 623 struct display_timing mode_crt_reg, panel_crt_reg;
960 struct crt_mode_table *panel_crt_table = NULL; 624 struct crt_mode_table *panel_crt_table = NULL;
961 struct VideoModeTable *vmode_tbl = NULL; 625 struct VideoModeTable *vmode_tbl = viafb_get_mode(panel_hres,
626 panel_vres);
962 627
963 DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n"); 628 DEBUG_MSG(KERN_INFO "viafb_lcd_set_mode!!\n");
964 /* Get mode table */ 629 /* Get mode table */
965 mode_crt_reg = mode_crt_table->crtc; 630 mode_crt_reg = mode_crt_table->crtc;
966 /* Get panel table Pointer */ 631 /* Get panel table Pointer */
967 vmode_tbl = viafb_get_modetbl_pointer(video_index);
968 panel_crt_table = vmode_tbl->crtc; 632 panel_crt_table = vmode_tbl->crtc;
969 panel_crt_reg = panel_crt_table->crtc; 633 panel_crt_reg = panel_crt_table->crtc;
970 DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n"); 634 DEBUG_MSG(KERN_INFO "bellow viafb_lcd_set_mode!!\n");
971 set_hres = plvds_setting_info->h_active;
972 set_vres = plvds_setting_info->v_active;
973 panel_hres = plvds_setting_info->lcd_panel_hres;
974 panel_vres = plvds_setting_info->lcd_panel_vres;
975 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name) 635 if (VT1636_LVDS == plvds_chip_info->lvds_chip_name)
976 viafb_init_lvds_vt1636(plvds_setting_info, plvds_chip_info); 636 viafb_init_lvds_vt1636(plvds_setting_info, plvds_chip_info);
977 plvds_setting_info->vclk = panel_crt_table->clk; 637 plvds_setting_info->vclk = panel_crt_table->clk;
@@ -1001,54 +661,12 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
1001 } 661 }
1002 } 662 }
1003 663
1004 if (set_iga == IGA1_IGA2) { 664 /* Fetch count for IGA2 only */
1005 load_crtc_shadow_timing(mode_crt_reg, panel_crt_reg); 665 viafb_load_fetch_count_reg(set_hres, mode_bpp / 8, set_iga);
1006 /* Fill shadow registers */
1007
1008 switch (plvds_setting_info->lcd_panel_id) {
1009 case LCD_PANEL_ID0_640X480:
1010 offset = 80;
1011 break;
1012 case LCD_PANEL_ID1_800X600:
1013 case LCD_PANEL_IDA_800X480:
1014 offset = 110;
1015 break;
1016 case LCD_PANEL_ID2_1024X768:
1017 offset = 150;
1018 break;
1019 case LCD_PANEL_ID3_1280X768:
1020 case LCD_PANEL_ID4_1280X1024:
1021 case LCD_PANEL_ID5_1400X1050:
1022 case LCD_PANEL_ID9_1280X800:
1023 offset = 190;
1024 break;
1025 case LCD_PANEL_ID6_1600X1200:
1026 offset = 250;
1027 break;
1028 case LCD_PANEL_ID7_1366X768:
1029 case LCD_PANEL_IDB_1360X768:
1030 offset = 212;
1031 break;
1032 default:
1033 offset = 140;
1034 break;
1035 }
1036
1037 /* Offset for simultaneous */
1038 viafb_set_secondary_pitch(offset << 3);
1039 DEBUG_MSG(KERN_INFO "viafb_load_reg!!\n");
1040 viafb_load_fetch_count_reg(set_hres, 4, IGA2);
1041 /* Fetch count for simultaneous */
1042 } else { /* SAMM */
1043 /* Fetch count for IGA2 only */
1044 viafb_load_fetch_count_reg(set_hres, mode_bpp / 8, set_iga);
1045
1046 if ((viaparinfo->chip_info->gfx_chip_name != UNICHROME_CLE266)
1047 && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400))
1048 viafb_load_FIFO_reg(set_iga, set_hres, set_vres);
1049 666
1050 viafb_set_color_depth(mode_bpp / 8, set_iga); 667 if ((viaparinfo->chip_info->gfx_chip_name != UNICHROME_CLE266)
1051 } 668 && (viaparinfo->chip_info->gfx_chip_name != UNICHROME_K400))
669 viafb_load_FIFO_reg(set_iga, set_hres, set_vres);
1052 670
1053 fill_lcd_format(); 671 fill_lcd_format();
1054 672
@@ -1065,11 +683,6 @@ void viafb_lcd_set_mode(struct crt_mode_table *mode_crt_table,
1065 || (UNICHROME_K8M890 == viaparinfo->chip_info->gfx_chip_name)) 683 || (UNICHROME_K8M890 == viaparinfo->chip_info->gfx_chip_name))
1066 viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0); 684 viafb_write_reg_mask(CR6A, VIACR, 0x01, BIT0);
1067 685
1068 load_lcd_patch_regs(set_hres, set_vres,
1069 plvds_setting_info->lcd_panel_id, set_iga);
1070
1071 DEBUG_MSG(KERN_INFO "load_lcd_patch_regs!!\n");
1072
1073 /* Patch for non 32bit alignment mode */ 686 /* Patch for non 32bit alignment mode */
1074 via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info); 687 via_pitch_alignment_patch_lcd(plvds_setting_info, plvds_chip_info);
1075} 688}
@@ -1283,8 +896,7 @@ void viafb_lcd_enable(void)
1283 viafb_write_reg_mask(CR6A, VIACR, 0x48, 0x48); 896 viafb_write_reg_mask(CR6A, VIACR, 0x48, 0x48);
1284 } 897 }
1285 898
1286 if ((viaparinfo->lvds_setting_info->iga_path == IGA1) 899 if (viaparinfo->lvds_setting_info->iga_path == IGA1) {
1287 || (viaparinfo->lvds_setting_info->iga_path == IGA1_IGA2)) {
1288 /* CRT path set to IGA2 */ 900 /* CRT path set to IGA2 */
1289 viafb_write_reg_mask(SR16, VIASR, 0x40, 0x40); 901 viafb_write_reg_mask(SR16, VIASR, 0x40, 0x40);
1290 /* IGA2 path disabled */ 902 /* IGA2 path disabled */
@@ -1476,210 +1088,6 @@ static struct display_timing lcd_centering_timging(struct display_timing
1476 return crt_reg; 1088 return crt_reg;
1477} 1089}
1478 1090
1479static void load_crtc_shadow_timing(struct display_timing mode_timing,
1480 struct display_timing panel_timing)
1481{
1482 struct io_register *reg = NULL;
1483 int i;
1484 int viafb_load_reg_Num = 0;
1485 int reg_value = 0;
1486
1487 if (viaparinfo->lvds_setting_info->display_method == LCD_EXPANDSION) {
1488 /* Expansion */
1489 for (i = 12; i < 20; i++) {
1490 switch (i) {
1491 case H_TOTAL_SHADOW_INDEX:
1492 reg_value =
1493 IGA2_HOR_TOTAL_SHADOW_FORMULA
1494 (panel_timing.hor_total);
1495 viafb_load_reg_Num =
1496 iga2_shadow_crtc_reg.hor_total_shadow.
1497 reg_num;
1498 reg = iga2_shadow_crtc_reg.hor_total_shadow.reg;
1499 break;
1500 case H_BLANK_END_SHADOW_INDEX:
1501 reg_value =
1502 IGA2_HOR_BLANK_END_SHADOW_FORMULA
1503 (panel_timing.hor_blank_start,
1504 panel_timing.hor_blank_end);
1505 viafb_load_reg_Num =
1506 iga2_shadow_crtc_reg.
1507 hor_blank_end_shadow.reg_num;
1508 reg =
1509 iga2_shadow_crtc_reg.
1510 hor_blank_end_shadow.reg;
1511 break;
1512 case V_TOTAL_SHADOW_INDEX:
1513 reg_value =
1514 IGA2_VER_TOTAL_SHADOW_FORMULA
1515 (panel_timing.ver_total);
1516 viafb_load_reg_Num =
1517 iga2_shadow_crtc_reg.ver_total_shadow.
1518 reg_num;
1519 reg = iga2_shadow_crtc_reg.ver_total_shadow.reg;
1520 break;
1521 case V_ADDR_SHADOW_INDEX:
1522 reg_value =
1523 IGA2_VER_ADDR_SHADOW_FORMULA
1524 (panel_timing.ver_addr);
1525 viafb_load_reg_Num =
1526 iga2_shadow_crtc_reg.ver_addr_shadow.
1527 reg_num;
1528 reg = iga2_shadow_crtc_reg.ver_addr_shadow.reg;
1529 break;
1530 case V_BLANK_SATRT_SHADOW_INDEX:
1531 reg_value =
1532 IGA2_VER_BLANK_START_SHADOW_FORMULA
1533 (panel_timing.ver_blank_start);
1534 viafb_load_reg_Num =
1535 iga2_shadow_crtc_reg.
1536 ver_blank_start_shadow.reg_num;
1537 reg =
1538 iga2_shadow_crtc_reg.
1539 ver_blank_start_shadow.reg;
1540 break;
1541 case V_BLANK_END_SHADOW_INDEX:
1542 reg_value =
1543 IGA2_VER_BLANK_END_SHADOW_FORMULA
1544 (panel_timing.ver_blank_start,
1545 panel_timing.ver_blank_end);
1546 viafb_load_reg_Num =
1547 iga2_shadow_crtc_reg.
1548 ver_blank_end_shadow.reg_num;
1549 reg =
1550 iga2_shadow_crtc_reg.
1551 ver_blank_end_shadow.reg;
1552 break;
1553 case V_SYNC_SATRT_SHADOW_INDEX:
1554 reg_value =
1555 IGA2_VER_SYNC_START_SHADOW_FORMULA
1556 (panel_timing.ver_sync_start);
1557 viafb_load_reg_Num =
1558 iga2_shadow_crtc_reg.
1559 ver_sync_start_shadow.reg_num;
1560 reg =
1561 iga2_shadow_crtc_reg.
1562 ver_sync_start_shadow.reg;
1563 break;
1564 case V_SYNC_END_SHADOW_INDEX:
1565 reg_value =
1566 IGA2_VER_SYNC_END_SHADOW_FORMULA
1567 (panel_timing.ver_sync_start,
1568 panel_timing.ver_sync_end);
1569 viafb_load_reg_Num =
1570 iga2_shadow_crtc_reg.
1571 ver_sync_end_shadow.reg_num;
1572 reg =
1573 iga2_shadow_crtc_reg.
1574 ver_sync_end_shadow.reg;
1575 break;
1576 }
1577 viafb_load_reg(reg_value,
1578 viafb_load_reg_Num, reg, VIACR);
1579 }
1580 } else { /* Centering */
1581 for (i = 12; i < 20; i++) {
1582 switch (i) {
1583 case H_TOTAL_SHADOW_INDEX:
1584 reg_value =
1585 IGA2_HOR_TOTAL_SHADOW_FORMULA
1586 (panel_timing.hor_total);
1587 viafb_load_reg_Num =
1588 iga2_shadow_crtc_reg.hor_total_shadow.
1589 reg_num;
1590 reg = iga2_shadow_crtc_reg.hor_total_shadow.reg;
1591 break;
1592 case H_BLANK_END_SHADOW_INDEX:
1593 reg_value =
1594 IGA2_HOR_BLANK_END_SHADOW_FORMULA
1595 (panel_timing.hor_blank_start,
1596 panel_timing.hor_blank_end);
1597 viafb_load_reg_Num =
1598 iga2_shadow_crtc_reg.
1599 hor_blank_end_shadow.reg_num;
1600 reg =
1601 iga2_shadow_crtc_reg.
1602 hor_blank_end_shadow.reg;
1603 break;
1604 case V_TOTAL_SHADOW_INDEX:
1605 reg_value =
1606 IGA2_VER_TOTAL_SHADOW_FORMULA
1607 (panel_timing.ver_total);
1608 viafb_load_reg_Num =
1609 iga2_shadow_crtc_reg.ver_total_shadow.
1610 reg_num;
1611 reg = iga2_shadow_crtc_reg.ver_total_shadow.reg;
1612 break;
1613 case V_ADDR_SHADOW_INDEX:
1614 reg_value =
1615 IGA2_VER_ADDR_SHADOW_FORMULA
1616 (mode_timing.ver_addr);
1617 viafb_load_reg_Num =
1618 iga2_shadow_crtc_reg.ver_addr_shadow.
1619 reg_num;
1620 reg = iga2_shadow_crtc_reg.ver_addr_shadow.reg;
1621 break;
1622 case V_BLANK_SATRT_SHADOW_INDEX:
1623 reg_value =
1624 IGA2_VER_BLANK_START_SHADOW_FORMULA
1625 (mode_timing.ver_blank_start);
1626 viafb_load_reg_Num =
1627 iga2_shadow_crtc_reg.
1628 ver_blank_start_shadow.reg_num;
1629 reg =
1630 iga2_shadow_crtc_reg.
1631 ver_blank_start_shadow.reg;
1632 break;
1633 case V_BLANK_END_SHADOW_INDEX:
1634 reg_value =
1635 IGA2_VER_BLANK_END_SHADOW_FORMULA
1636 (panel_timing.ver_blank_start,
1637 panel_timing.ver_blank_end);
1638 viafb_load_reg_Num =
1639 iga2_shadow_crtc_reg.
1640 ver_blank_end_shadow.reg_num;
1641 reg =
1642 iga2_shadow_crtc_reg.
1643 ver_blank_end_shadow.reg;
1644 break;
1645 case V_SYNC_SATRT_SHADOW_INDEX:
1646 reg_value =
1647 IGA2_VER_SYNC_START_SHADOW_FORMULA(
1648 (panel_timing.ver_sync_start -
1649 panel_timing.ver_blank_start) +
1650 (panel_timing.ver_addr -
1651 mode_timing.ver_addr) / 2 +
1652 mode_timing.ver_addr);
1653 viafb_load_reg_Num =
1654 iga2_shadow_crtc_reg.ver_sync_start_shadow.
1655 reg_num;
1656 reg =
1657 iga2_shadow_crtc_reg.ver_sync_start_shadow.
1658 reg;
1659 break;
1660 case V_SYNC_END_SHADOW_INDEX:
1661 reg_value =
1662 IGA2_VER_SYNC_END_SHADOW_FORMULA(
1663 (panel_timing.ver_sync_start -
1664 panel_timing.ver_blank_start) +
1665 (panel_timing.ver_addr -
1666 mode_timing.ver_addr) / 2 +
1667 mode_timing.ver_addr,
1668 panel_timing.ver_sync_end);
1669 viafb_load_reg_Num =
1670 iga2_shadow_crtc_reg.ver_sync_end_shadow.
1671 reg_num;
1672 reg =
1673 iga2_shadow_crtc_reg.ver_sync_end_shadow.
1674 reg;
1675 break;
1676 }
1677 viafb_load_reg(reg_value,
1678 viafb_load_reg_Num, reg, VIACR);
1679 }
1680 }
1681}
1682
1683bool viafb_lcd_get_mobile_state(bool *mobile) 1091bool viafb_lcd_get_mobile_state(bool *mobile)
1684{ 1092{
1685 unsigned char *romptr, *tableptr; 1093 unsigned char *romptr, *tableptr;
diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h
index 7cd03e2a1275..d55aaa7b912c 100644
--- a/drivers/video/via/share.h
+++ b/drivers/video/via/share.h
@@ -43,61 +43,6 @@
43/* Video Memory Size */ 43/* Video Memory Size */
44#define VIDEO_MEMORY_SIZE_16M 0x1000000 44#define VIDEO_MEMORY_SIZE_16M 0x1000000
45 45
46/* Definition Mode Index
47*/
48#define VIA_RES_640X480 0
49#define VIA_RES_800X600 1
50#define VIA_RES_1024X768 2
51#define VIA_RES_1152X864 3
52#define VIA_RES_1280X1024 4
53#define VIA_RES_1600X1200 5
54#define VIA_RES_1440X1050 6
55#define VIA_RES_1280X768 7
56#define VIA_RES_1280X960 8
57#define VIA_RES_1920X1440 9
58#define VIA_RES_848X480 10
59#define VIA_RES_1400X1050 11
60#define VIA_RES_720X480 12
61#define VIA_RES_720X576 13
62#define VIA_RES_1024X512 14
63#define VIA_RES_856X480 15
64#define VIA_RES_1024X576 16
65#define VIA_RES_640X400 17
66#define VIA_RES_1280X720 18
67#define VIA_RES_1920X1080 19
68#define VIA_RES_800X480 20
69#define VIA_RES_1368X768 21
70#define VIA_RES_1024X600 22
71#define VIA_RES_1280X800 23
72#define VIA_RES_1680X1050 24
73#define VIA_RES_960X600 25
74#define VIA_RES_1000X600 26
75#define VIA_RES_1088X612 27
76#define VIA_RES_1152X720 28
77#define VIA_RES_1200X720 29
78#define VIA_RES_1280X600 30
79#define VIA_RES_1360X768 31
80#define VIA_RES_1366X768 32
81#define VIA_RES_1440X900 33
82#define VIA_RES_1600X900 34
83#define VIA_RES_1600X1024 35
84#define VIA_RES_1792X1344 36
85#define VIA_RES_1856X1392 37
86#define VIA_RES_1920X1200 38
87#define VIA_RES_2048X1536 39
88#define VIA_RES_480X640 40
89
90/*Reduce Blanking*/
91#define VIA_RES_1360X768_RB 131
92#define VIA_RES_1440X900_RB 133
93#define VIA_RES_1400X1050_RB 111
94#define VIA_RES_1600X900_RB 134
95#define VIA_RES_1680X1050_RB 124
96#define VIA_RES_1920X1080_RB 119
97#define VIA_RES_1920X1200_RB 138
98
99#define VIA_RES_INVALID 255
100
101/* standard VGA IO port 46/* standard VGA IO port
102*/ 47*/
103#define VIARMisc 0x3CC 48#define VIARMisc 0x3CC
@@ -118,7 +63,6 @@
118/* Display path */ 63/* Display path */
119#define IGA1 1 64#define IGA1 1
120#define IGA2 2 65#define IGA2 2
121#define IGA1_IGA2 3
122 66
123/* Define Color Depth */ 67/* Define Color Depth */
124#define MODE_8BPP 1 68#define MODE_8BPP 1
diff --git a/drivers/video/via/via_utility.c b/drivers/video/via/via_utility.c
index d53c3d54ed8e..aefdeeec89b1 100644
--- a/drivers/video/via/via_utility.c
+++ b/drivers/video/via/via_utility.c
@@ -239,15 +239,3 @@ void viafb_get_gamma_support_state(int bpp, unsigned int *support_state)
239 else 239 else
240 *support_state = CRT_Device | DVI_Device | LCD_Device; 240 *support_state = CRT_Device | DVI_Device | LCD_Device;
241} 241}
242
243int viafb_input_parameter_converter(int parameter_value)
244{
245 int result;
246
247 if (parameter_value >= 1 && parameter_value <= 9)
248 result = 1 << (parameter_value - 1);
249 else
250 result = 1;
251
252 return result;
253}
diff --git a/drivers/video/via/via_utility.h b/drivers/video/via/via_utility.h
index 2fd455202ebd..1670ba82143f 100644
--- a/drivers/video/via/via_utility.h
+++ b/drivers/video/via/via_utility.h
@@ -30,6 +30,5 @@ bool viafb_lcd_get_support_expand_state(u32 xres, u32 yres);
30void viafb_set_gamma_table(int bpp, unsigned int *gamma_table); 30void viafb_set_gamma_table(int bpp, unsigned int *gamma_table);
31void viafb_get_gamma_table(unsigned int *gamma_table); 31void viafb_get_gamma_table(unsigned int *gamma_table);
32void viafb_get_gamma_support_state(int bpp, unsigned int *support_state); 32void viafb_get_gamma_support_state(int bpp, unsigned int *support_state);
33int viafb_input_parameter_converter(int parameter_value);
34 33
35#endif /* __VIAUTILITY_H__ */ 34#endif /* __VIAUTILITY_H__ */
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 3028e7ddc3b5..ce7783b63f6a 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -26,18 +26,22 @@
26 26
27#include "global.h" 27#include "global.h"
28 28
29static struct fb_var_screeninfo default_var;
30static char *viafb_name = "Via"; 29static char *viafb_name = "Via";
31static u32 pseudo_pal[17]; 30static u32 pseudo_pal[17];
32 31
33/* video mode */ 32/* video mode */
34static char *viafb_mode = "640x480"; 33static char *viafb_mode;
35static char *viafb_mode1 = "640x480"; 34static char *viafb_mode1;
35static int viafb_bpp = 32;
36static int viafb_bpp1 = 32;
37
38static unsigned int viafb_second_offset;
39static int viafb_second_size;
36 40
37static int viafb_accel = 1; 41static int viafb_accel = 1;
38 42
39/* Added for specifying active devices.*/ 43/* Added for specifying active devices.*/
40char *viafb_active_dev = ""; 44char *viafb_active_dev;
41 45
42/*Added for specify lcd output port*/ 46/*Added for specify lcd output port*/
43char *viafb_lcd_port = ""; 47char *viafb_lcd_port = "";
@@ -50,18 +54,78 @@ static void apply_second_mode_setting(struct fb_var_screeninfo
50 *sec_var); 54 *sec_var);
51static void retrieve_device_setting(struct viafb_ioctl_setting 55static void retrieve_device_setting(struct viafb_ioctl_setting
52 *setting_info); 56 *setting_info);
57static int viafb_pan_display(struct fb_var_screeninfo *var,
58 struct fb_info *info);
53 59
54static struct fb_ops viafb_ops; 60static struct fb_ops viafb_ops;
55 61
56 62
63static void viafb_fill_var_color_info(struct fb_var_screeninfo *var, u8 depth)
64{
65 var->grayscale = 0;
66 var->red.msb_right = 0;
67 var->green.msb_right = 0;
68 var->blue.msb_right = 0;
69 var->transp.offset = 0;
70 var->transp.length = 0;
71 var->transp.msb_right = 0;
72 var->nonstd = 0;
73 switch (depth) {
74 case 8:
75 var->bits_per_pixel = 8;
76 var->red.offset = 0;
77 var->green.offset = 0;
78 var->blue.offset = 0;
79 var->red.length = 8;
80 var->green.length = 8;
81 var->blue.length = 8;
82 break;
83 case 15:
84 var->bits_per_pixel = 16;
85 var->red.offset = 10;
86 var->green.offset = 5;
87 var->blue.offset = 0;
88 var->red.length = 5;
89 var->green.length = 5;
90 var->blue.length = 5;
91 break;
92 case 16:
93 var->bits_per_pixel = 16;
94 var->red.offset = 11;
95 var->green.offset = 5;
96 var->blue.offset = 0;
97 var->red.length = 5;
98 var->green.length = 6;
99 var->blue.length = 5;
100 break;
101 case 24:
102 var->bits_per_pixel = 32;
103 var->red.offset = 16;
104 var->green.offset = 8;
105 var->blue.offset = 0;
106 var->red.length = 8;
107 var->green.length = 8;
108 var->blue.length = 8;
109 break;
110 case 30:
111 var->bits_per_pixel = 32;
112 var->red.offset = 20;
113 var->green.offset = 10;
114 var->blue.offset = 0;
115 var->red.length = 10;
116 var->green.length = 10;
117 var->blue.length = 10;
118 break;
119 }
120}
121
57static void viafb_update_fix(struct fb_info *info) 122static void viafb_update_fix(struct fb_info *info)
58{ 123{
59 u32 bpp = info->var.bits_per_pixel; 124 u32 bpp = info->var.bits_per_pixel;
60 125
61 info->fix.visual = 126 info->fix.visual =
62 bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR; 127 bpp == 8 ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
63 info->fix.line_length = 128 info->fix.line_length = (info->var.xres_virtual * bpp / 8 + 7) & ~7;
64 ((info->var.xres_virtual + 7) & ~7) * bpp / 8;
65} 129}
66 130
67static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix, 131static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
@@ -75,6 +139,7 @@ static void viafb_setup_fixinfo(struct fb_fix_screeninfo *fix,
75 139
76 fix->type = FB_TYPE_PACKED_PIXELS; 140 fix->type = FB_TYPE_PACKED_PIXELS;
77 fix->type_aux = 0; 141 fix->type_aux = 0;
142 fix->visual = FB_VISUAL_TRUECOLOR;
78 143
79 fix->xpanstep = fix->ywrapstep = 0; 144 fix->xpanstep = fix->ywrapstep = 0;
80 fix->ypanstep = 1; 145 fix->ypanstep = 1;
@@ -97,9 +162,10 @@ static int viafb_release(struct fb_info *info, int user)
97static int viafb_check_var(struct fb_var_screeninfo *var, 162static int viafb_check_var(struct fb_var_screeninfo *var,
98 struct fb_info *info) 163 struct fb_info *info)
99{ 164{
100 int vmode_index, htotal, vtotal; 165 int htotal, vtotal, depth;
166 struct VideoModeTable *vmode_entry;
101 struct viafb_par *ppar = info->par; 167 struct viafb_par *ppar = info->par;
102 u32 long_refresh; 168 u32 long_refresh, line;
103 169
104 DEBUG_MSG(KERN_INFO "viafb_check_var!\n"); 170 DEBUG_MSG(KERN_INFO "viafb_check_var!\n");
105 /* Sanity check */ 171 /* Sanity check */
@@ -107,26 +173,36 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
107 if (var->vmode & FB_VMODE_INTERLACED || var->vmode & FB_VMODE_DOUBLE) 173 if (var->vmode & FB_VMODE_INTERLACED || var->vmode & FB_VMODE_DOUBLE)
108 return -EINVAL; 174 return -EINVAL;
109 175
110 vmode_index = viafb_get_mode_index(var->xres, var->yres); 176 vmode_entry = viafb_get_mode(var->xres, var->yres);
111 if (vmode_index == VIA_RES_INVALID) { 177 if (!vmode_entry) {
112 DEBUG_MSG(KERN_INFO 178 DEBUG_MSG(KERN_INFO
113 "viafb: Mode %dx%dx%d not supported!!\n", 179 "viafb: Mode %dx%dx%d not supported!!\n",
114 var->xres, var->yres, var->bits_per_pixel); 180 var->xres, var->yres, var->bits_per_pixel);
115 return -EINVAL; 181 return -EINVAL;
116 } 182 }
117 183
118 if (24 == var->bits_per_pixel) 184 depth = fb_get_color_depth(var, &info->fix);
119 var->bits_per_pixel = 32; 185 if (!depth)
186 depth = var->bits_per_pixel;
120 187
121 if (var->bits_per_pixel != 8 && var->bits_per_pixel != 16 && 188 if (depth < 0 || depth > 32)
122 var->bits_per_pixel != 32)
123 return -EINVAL; 189 return -EINVAL;
190 else if (!depth)
191 depth = 24;
192 else if (depth == 15 && viafb_dual_fb && ppar->iga_path == IGA1)
193 depth = 15;
194 else if (depth == 30)
195 depth = 30;
196 else if (depth <= 8)
197 depth = 8;
198 else if (depth <= 16)
199 depth = 16;
200 else
201 depth = 24;
124 202
125 if ((var->xres_virtual * (var->bits_per_pixel >> 3)) & 0x1F) 203 viafb_fill_var_color_info(var, depth);
126 /*32 pixel alignment */ 204 line = (var->xres_virtual * var->bits_per_pixel / 8 + 7) & ~7;
127 var->xres_virtual = (var->xres_virtual + 31) & ~31; 205 if (line * var->yres_virtual > ppar->memsize)
128 if (var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8 >
129 ppar->memsize)
130 return -EINVAL; 206 return -EINVAL;
131 207
132 /* Based on var passed in to calculate the refresh, 208 /* Based on var passed in to calculate the refresh,
@@ -142,7 +218,7 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
142 viafb_refresh = viafb_get_refresh(var->xres, var->yres, long_refresh); 218 viafb_refresh = viafb_get_refresh(var->xres, var->yres, long_refresh);
143 219
144 /* Adjust var according to our driver's own table */ 220 /* Adjust var according to our driver's own table */
145 viafb_fill_var_timing_info(var, viafb_refresh, vmode_index); 221 viafb_fill_var_timing_info(var, viafb_refresh, vmode_entry);
146 if (info->var.accel_flags & FB_ACCELF_TEXT && 222 if (info->var.accel_flags & FB_ACCELF_TEXT &&
147 !ppar->shared->engine_mmio) 223 !ppar->shared->engine_mmio)
148 info->var.accel_flags = 0; 224 info->var.accel_flags = 0;
@@ -153,39 +229,45 @@ static int viafb_check_var(struct fb_var_screeninfo *var,
153static int viafb_set_par(struct fb_info *info) 229static int viafb_set_par(struct fb_info *info)
154{ 230{
155 struct viafb_par *viapar = info->par; 231 struct viafb_par *viapar = info->par;
156 int vmode_index; 232 struct VideoModeTable *vmode_entry, *vmode_entry1 = NULL;
157 int vmode_index1 = 0;
158 DEBUG_MSG(KERN_INFO "viafb_set_par!\n"); 233 DEBUG_MSG(KERN_INFO "viafb_set_par!\n");
159 234
160 viapar->depth = fb_get_color_depth(&info->var, &info->fix); 235 viapar->depth = fb_get_color_depth(&info->var, &info->fix);
161 viafb_update_device_setting(info->var.xres, info->var.yres, 236 viafb_update_device_setting(viafbinfo->var.xres, viafbinfo->var.yres,
162 info->var.bits_per_pixel, viafb_refresh, 0); 237 viafbinfo->var.bits_per_pixel, viafb_refresh, 0);
163 238
164 vmode_index = viafb_get_mode_index(info->var.xres, info->var.yres); 239 vmode_entry = viafb_get_mode(viafbinfo->var.xres, viafbinfo->var.yres);
165 240 if (viafb_dual_fb) {
166 if (viafb_SAMM_ON == 1) { 241 vmode_entry1 = viafb_get_mode(viafbinfo1->var.xres,
242 viafbinfo1->var.yres);
243 viafb_update_device_setting(viafbinfo1->var.xres,
244 viafbinfo1->var.yres, viafbinfo1->var.bits_per_pixel,
245 viafb_refresh1, 1);
246 } else if (viafb_SAMM_ON == 1) {
167 DEBUG_MSG(KERN_INFO 247 DEBUG_MSG(KERN_INFO
168 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n", 248 "viafb_second_xres = %d, viafb_second_yres = %d, bpp = %d\n",
169 viafb_second_xres, viafb_second_yres, viafb_bpp1); 249 viafb_second_xres, viafb_second_yres, viafb_bpp1);
170 vmode_index1 = viafb_get_mode_index(viafb_second_xres, 250 vmode_entry1 = viafb_get_mode(viafb_second_xres,
171 viafb_second_yres); 251 viafb_second_yres);
172 DEBUG_MSG(KERN_INFO "->viafb_SAMM_ON: index=%d\n",
173 vmode_index1);
174 252
175 viafb_update_device_setting(viafb_second_xres, 253 viafb_update_device_setting(viafb_second_xres,
176 viafb_second_yres, viafb_bpp1, viafb_refresh1, 1); 254 viafb_second_yres, viafb_bpp1, viafb_refresh1, 1);
177 } 255 }
178 256
179 if (vmode_index != VIA_RES_INVALID) { 257 if (vmode_entry) {
180 viafb_update_fix(info); 258 viafb_update_fix(info);
181 viafb_bpp = info->var.bits_per_pixel; 259 if (viafb_dual_fb && viapar->iga_path == IGA2)
260 viafb_bpp1 = info->var.bits_per_pixel;
261 else
262 viafb_bpp = info->var.bits_per_pixel;
263
182 if (info->var.accel_flags & FB_ACCELF_TEXT) 264 if (info->var.accel_flags & FB_ACCELF_TEXT)
183 info->flags &= ~FBINFO_HWACCEL_DISABLED; 265 info->flags &= ~FBINFO_HWACCEL_DISABLED;
184 else 266 else
185 info->flags |= FBINFO_HWACCEL_DISABLED; 267 info->flags |= FBINFO_HWACCEL_DISABLED;
186 viafb_setmode(vmode_index, info->var.xres, info->var.yres, 268 viafb_setmode(vmode_entry, info->var.bits_per_pixel,
187 info->var.bits_per_pixel, vmode_index1, 269 vmode_entry1, viafb_bpp1);
188 viafb_second_xres, viafb_second_yres, viafb_bpp1); 270 viafb_pan_display(&info->var, info);
189 } 271 }
190 272
191 return 0; 273 return 0;
@@ -195,234 +277,52 @@ static int viafb_set_par(struct fb_info *info)
195static int viafb_setcolreg(unsigned regno, unsigned red, unsigned green, 277static int viafb_setcolreg(unsigned regno, unsigned red, unsigned green,
196unsigned blue, unsigned transp, struct fb_info *info) 278unsigned blue, unsigned transp, struct fb_info *info)
197{ 279{
198 u8 sr1a, sr1b, cr67, cr6a, rev = 0, shift = 10; 280 struct viafb_par *viapar = info->par;
199 unsigned cmap_entries = (info->var.bits_per_pixel == 8) ? 256 : 16; 281 u32 r, g, b;
200 DEBUG_MSG(KERN_INFO "viafb_setcolreg!\n");
201 if (regno >= cmap_entries)
202 return 1;
203 if (UNICHROME_CLE266 == viaparinfo->chip_info->gfx_chip_name) {
204 /*
205 * Read PCI bus 0,dev 0,function 0,index 0xF6 to get chip rev.
206 */
207 outl(0x80000000 | (0xf6 & ~3), (unsigned long)0xCF8);
208 rev = (inl((unsigned long)0xCFC) >> ((0xf6 & 3) * 8)) & 0xff;
209 }
210 switch (info->var.bits_per_pixel) {
211 case 8:
212 outb(0x1A, 0x3C4);
213 sr1a = inb(0x3C5);
214 outb(0x1B, 0x3C4);
215 sr1b = inb(0x3C5);
216 outb(0x67, 0x3D4);
217 cr67 = inb(0x3D5);
218 outb(0x6A, 0x3D4);
219 cr6a = inb(0x3D5);
220
221 /* Map the 3C6/7/8/9 to the IGA2 */
222 outb(0x1A, 0x3C4);
223 outb(sr1a | 0x01, 0x3C5);
224 /* Second Display Engine colck always on */
225 outb(0x1B, 0x3C4);
226 outb(sr1b | 0x80, 0x3C5);
227 /* Second Display Color Depth 8 */
228 outb(0x67, 0x3D4);
229 outb(cr67 & 0x3F, 0x3D5);
230 outb(0x6A, 0x3D4);
231 /* Second Display Channel Reset CR6A[6]) */
232 outb(cr6a & 0xBF, 0x3D5);
233 /* Second Display Channel Enable CR6A[7] */
234 outb(cr6a | 0x80, 0x3D5);
235 /* Second Display Channel stop reset) */
236 outb(cr6a | 0x40, 0x3D5);
237
238 /* Bit mask of palette */
239 outb(0xFF, 0x3c6);
240 /* Write one register of IGA2 */
241 outb(regno, 0x3C8);
242 if (UNICHROME_CLE266 == viaparinfo->chip_info->gfx_chip_name &&
243 rev >= 15) {
244 shift = 8;
245 viafb_write_reg_mask(CR6A, VIACR, BIT5, BIT5);
246 viafb_write_reg_mask(SR15, VIASR, BIT7, BIT7);
247 } else {
248 shift = 10;
249 viafb_write_reg_mask(CR6A, VIACR, 0, BIT5);
250 viafb_write_reg_mask(SR15, VIASR, 0, BIT7);
251 }
252 outb(red >> shift, 0x3C9);
253 outb(green >> shift, 0x3C9);
254 outb(blue >> shift, 0x3C9);
255
256 /* Map the 3C6/7/8/9 to the IGA1 */
257 outb(0x1A, 0x3C4);
258 outb(sr1a & 0xFE, 0x3C5);
259 /* Bit mask of palette */
260 outb(0xFF, 0x3c6);
261 /* Write one register of IGA1 */
262 outb(regno, 0x3C8);
263 outb(red >> shift, 0x3C9);
264 outb(green >> shift, 0x3C9);
265 outb(blue >> shift, 0x3C9);
266
267 outb(0x1A, 0x3C4);
268 outb(sr1a, 0x3C5);
269 outb(0x1B, 0x3C4);
270 outb(sr1b, 0x3C5);
271 outb(0x67, 0x3D4);
272 outb(cr67, 0x3D5);
273 outb(0x6A, 0x3D4);
274 outb(cr6a, 0x3D5);
275 break;
276 case 16:
277 ((u32 *) info->pseudo_palette)[regno] = (red & 0xF800) |
278 ((green & 0xFC00) >> 5) | ((blue & 0xF800) >> 11);
279 break;
280 case 32:
281 ((u32 *) info->pseudo_palette)[regno] =
282 ((transp & 0xFF00) << 16) |
283 ((red & 0xFF00) << 8) |
284 ((green & 0xFF00)) | ((blue & 0xFF00) >> 8);
285 break;
286 }
287
288 return 0;
289 282
290} 283 if (info->fix.visual == FB_VISUAL_PSEUDOCOLOR) {
284 if (regno > 255)
285 return -EINVAL;
291 286
292/*CALLED BY: fb_set_cmap */ 287 if (!viafb_dual_fb || viapar->iga_path == IGA1)
293/* fb_set_var, pass 256 colors */ 288 viafb_set_primary_color_register(regno, red >> 8,
294/*CALLED BY: fb_set_cmap */ 289 green >> 8, blue >> 8);
295/* fbcon_set_palette, pass 16 colors */
296static int viafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
297{
298 u32 len = cmap->len;
299 u32 i;
300 u16 *pred = cmap->red;
301 u16 *pgreen = cmap->green;
302 u16 *pblue = cmap->blue;
303 u16 *ptransp = cmap->transp;
304 u8 sr1a, sr1b, cr67, cr6a, rev = 0, shift = 10;
305 if (len > 256)
306 return 1;
307 if (UNICHROME_CLE266 == viaparinfo->chip_info->gfx_chip_name) {
308 /*
309 * Read PCI bus 0, dev 0, function 0, index 0xF6 to get chip
310 * rev.
311 */
312 outl(0x80000000 | (0xf6 & ~3), (unsigned long)0xCF8);
313 rev = (inl((unsigned long)0xCFC) >> ((0xf6 & 3) * 8)) & 0xff;
314 }
315 switch (info->var.bits_per_pixel) {
316 case 8:
317 outb(0x1A, 0x3C4);
318 sr1a = inb(0x3C5);
319 outb(0x1B, 0x3C4);
320 sr1b = inb(0x3C5);
321 outb(0x67, 0x3D4);
322 cr67 = inb(0x3D5);
323 outb(0x6A, 0x3D4);
324 cr6a = inb(0x3D5);
325 /* Map the 3C6/7/8/9 to the IGA2 */
326 outb(0x1A, 0x3C4);
327 outb(sr1a | 0x01, 0x3C5);
328 outb(0x1B, 0x3C4);
329 /* Second Display Engine colck always on */
330 outb(sr1b | 0x80, 0x3C5);
331 outb(0x67, 0x3D4);
332 /* Second Display Color Depth 8 */
333 outb(cr67 & 0x3F, 0x3D5);
334 outb(0x6A, 0x3D4);
335 /* Second Display Channel Reset CR6A[6]) */
336 outb(cr6a & 0xBF, 0x3D5);
337 /* Second Display Channel Enable CR6A[7] */
338 outb(cr6a | 0x80, 0x3D5);
339 /* Second Display Channel stop reset) */
340 outb(cr6a | 0xC0, 0x3D5);
341
342 /* Bit mask of palette */
343 outb(0xFF, 0x3c6);
344 outb(0x00, 0x3C8);
345 if (UNICHROME_CLE266 == viaparinfo->chip_info->gfx_chip_name &&
346 rev >= 15) {
347 shift = 8;
348 viafb_write_reg_mask(CR6A, VIACR, BIT5, BIT5);
349 viafb_write_reg_mask(SR15, VIASR, BIT7, BIT7);
350 } else {
351 shift = 10;
352 viafb_write_reg_mask(CR6A, VIACR, 0, BIT5);
353 viafb_write_reg_mask(SR15, VIASR, 0, BIT7);
354 }
355 for (i = 0; i < len; i++) {
356 outb((*(pred + i)) >> shift, 0x3C9);
357 outb((*(pgreen + i)) >> shift, 0x3C9);
358 outb((*(pblue + i)) >> shift, 0x3C9);
359 }
360 290
361 outb(0x1A, 0x3C4); 291 if (!viafb_dual_fb || viapar->iga_path == IGA2)
362 /* Map the 3C6/7/8/9 to the IGA1 */ 292 viafb_set_secondary_color_register(regno, red >> 8,
363 outb(sr1a & 0xFE, 0x3C5); 293 green >> 8, blue >> 8);
364 /* Bit mask of palette */ 294 } else {
365 outb(0xFF, 0x3c6); 295 if (regno > 15)
366 outb(0x00, 0x3C8); 296 return -EINVAL;
367 for (i = 0; i < len; i++) {
368 outb((*(pred + i)) >> shift, 0x3C9);
369 outb((*(pgreen + i)) >> shift, 0x3C9);
370 outb((*(pblue + i)) >> shift, 0x3C9);
371 }
372 297
373 outb(0x1A, 0x3C4); 298 r = (red >> (16 - info->var.red.length))
374 outb(sr1a, 0x3C5); 299 << info->var.red.offset;
375 outb(0x1B, 0x3C4); 300 b = (blue >> (16 - info->var.blue.length))
376 outb(sr1b, 0x3C5); 301 << info->var.blue.offset;
377 outb(0x67, 0x3D4); 302 g = (green >> (16 - info->var.green.length))
378 outb(cr67, 0x3D5); 303 << info->var.green.offset;
379 outb(0x6A, 0x3D4); 304 ((u32 *) info->pseudo_palette)[regno] = r | g | b;
380 outb(cr6a, 0x3D5);
381 break;
382 case 16:
383 if (len > 17)
384 return 0; /* Because static u32 pseudo_pal[17]; */
385 for (i = 0; i < len; i++)
386 ((u32 *) info->pseudo_palette)[i] =
387 (*(pred + i) & 0xF800) |
388 ((*(pgreen + i) & 0xFC00) >> 5) |
389 ((*(pblue + i) & 0xF800) >> 11);
390 break;
391 case 32:
392 if (len > 17)
393 return 0;
394 if (ptransp) {
395 for (i = 0; i < len; i++)
396 ((u32 *) info->pseudo_palette)[i] =
397 ((*(ptransp + i) & 0xFF00) << 16) |
398 ((*(pred + i) & 0xFF00) << 8) |
399 ((*(pgreen + i) & 0xFF00)) |
400 ((*(pblue + i) & 0xFF00) >> 8);
401 } else {
402 for (i = 0; i < len; i++)
403 ((u32 *) info->pseudo_palette)[i] =
404 0x00000000 |
405 ((*(pred + i) & 0xFF00) << 8) |
406 ((*(pgreen + i) & 0xFF00)) |
407 ((*(pblue + i) & 0xFF00) >> 8);
408 }
409 break;
410 } 305 }
306
411 return 0; 307 return 0;
412} 308}
413 309
414static int viafb_pan_display(struct fb_var_screeninfo *var, 310static int viafb_pan_display(struct fb_var_screeninfo *var,
415 struct fb_info *info) 311 struct fb_info *info)
416{ 312{
417 unsigned int offset; 313 struct viafb_par *viapar = info->par;
418 314 u32 vram_addr = (var->yoffset * var->xres_virtual + var->xoffset)
419 DEBUG_MSG(KERN_INFO "viafb_pan_display!\n"); 315 * (var->bits_per_pixel / 8) + viapar->vram_addr;
420 316
421 offset = (var->xoffset + (var->yoffset * var->xres_virtual)) * 317 DEBUG_MSG(KERN_DEBUG "viafb_pan_display, address = %d\n", vram_addr);
422 var->bits_per_pixel / 16; 318 if (!viafb_dual_fb) {
319 viafb_set_primary_address(vram_addr);
320 viafb_set_secondary_address(vram_addr);
321 } else if (viapar->iga_path == IGA1)
322 viafb_set_primary_address(vram_addr);
323 else
324 viafb_set_secondary_address(vram_addr);
423 325
424 DEBUG_MSG(KERN_INFO "\nviafb_pan_display,offset =%d ", offset);
425 viafb_set_primary_address(offset);
426 return 0; 326 return 0;
427} 327}
428 328
@@ -476,6 +376,7 @@ static int viafb_ioctl(struct fb_info *info, u_int cmd, u_long arg)
476 u32 gpu32; 376 u32 gpu32;
477 377
478 DEBUG_MSG(KERN_INFO "viafb_ioctl: 0x%X !!\n", cmd); 378 DEBUG_MSG(KERN_INFO "viafb_ioctl: 0x%X !!\n", cmd);
379 printk(KERN_WARNING "viafb_ioctl: Please avoid this interface as it is unstable and might change or vanish at any time!\n");
479 memset(&u, 0, sizeof(u)); 380 memset(&u, 0, sizeof(u));
480 381
481 switch (cmd) { 382 switch (cmd) {
@@ -1015,23 +916,6 @@ static int viafb_sync(struct fb_info *info)
1015 return 0; 916 return 0;
1016} 917}
1017 918
1018int viafb_get_mode_index(int hres, int vres)
1019{
1020 u32 i;
1021 DEBUG_MSG(KERN_INFO "viafb_get_mode_index!\n");
1022
1023 for (i = 0; i < NUM_TOTAL_MODETABLE; i++)
1024 if (CLE266Modes[i].mode_array &&
1025 CLE266Modes[i].crtc[0].crtc.hor_addr == hres &&
1026 CLE266Modes[i].crtc[0].crtc.ver_addr == vres)
1027 break;
1028
1029 if (i == NUM_TOTAL_MODETABLE)
1030 return VIA_RES_INVALID;
1031
1032 return CLE266Modes[i].ModeIndex;
1033}
1034
1035static void check_available_device_to_enable(int device_id) 919static void check_available_device_to_enable(int device_id)
1036{ 920{
1037 int device_num = 0; 921 int device_num = 0;
@@ -1330,7 +1214,7 @@ static void retrieve_device_setting(struct viafb_ioctl_setting
1330 setting_info->lcd_attributes.lcd_mode = viafb_lcd_mode; 1214 setting_info->lcd_attributes.lcd_mode = viafb_lcd_mode;
1331} 1215}
1332 1216
1333static void parse_active_dev(void) 1217static int parse_active_dev(void)
1334{ 1218{
1335 viafb_CRT_ON = STATE_OFF; 1219 viafb_CRT_ON = STATE_OFF;
1336 viafb_DVI_ON = STATE_OFF; 1220 viafb_DVI_ON = STATE_OFF;
@@ -1341,60 +1225,63 @@ static void parse_active_dev(void)
1341 IGA path to devices in SAMM case. */ 1225 IGA path to devices in SAMM case. */
1342 /* Note: The previous of active_dev is primary device, 1226 /* Note: The previous of active_dev is primary device,
1343 and the following is secondary device. */ 1227 and the following is secondary device. */
1344 if (!strncmp(viafb_active_dev, "CRT+DVI", 7)) { 1228 if (!viafb_active_dev) {
1229 viafb_CRT_ON = STATE_ON;
1230 viafb_SAMM_ON = STATE_OFF;
1231 } else if (!strcmp(viafb_active_dev, "CRT+DVI")) {
1345 /* CRT+DVI */ 1232 /* CRT+DVI */
1346 viafb_CRT_ON = STATE_ON; 1233 viafb_CRT_ON = STATE_ON;
1347 viafb_DVI_ON = STATE_ON; 1234 viafb_DVI_ON = STATE_ON;
1348 viafb_primary_dev = CRT_Device; 1235 viafb_primary_dev = CRT_Device;
1349 } else if (!strncmp(viafb_active_dev, "DVI+CRT", 7)) { 1236 } else if (!strcmp(viafb_active_dev, "DVI+CRT")) {
1350 /* DVI+CRT */ 1237 /* DVI+CRT */
1351 viafb_CRT_ON = STATE_ON; 1238 viafb_CRT_ON = STATE_ON;
1352 viafb_DVI_ON = STATE_ON; 1239 viafb_DVI_ON = STATE_ON;
1353 viafb_primary_dev = DVI_Device; 1240 viafb_primary_dev = DVI_Device;
1354 } else if (!strncmp(viafb_active_dev, "CRT+LCD", 7)) { 1241 } else if (!strcmp(viafb_active_dev, "CRT+LCD")) {
1355 /* CRT+LCD */ 1242 /* CRT+LCD */
1356 viafb_CRT_ON = STATE_ON; 1243 viafb_CRT_ON = STATE_ON;
1357 viafb_LCD_ON = STATE_ON; 1244 viafb_LCD_ON = STATE_ON;
1358 viafb_primary_dev = CRT_Device; 1245 viafb_primary_dev = CRT_Device;
1359 } else if (!strncmp(viafb_active_dev, "LCD+CRT", 7)) { 1246 } else if (!strcmp(viafb_active_dev, "LCD+CRT")) {
1360 /* LCD+CRT */ 1247 /* LCD+CRT */
1361 viafb_CRT_ON = STATE_ON; 1248 viafb_CRT_ON = STATE_ON;
1362 viafb_LCD_ON = STATE_ON; 1249 viafb_LCD_ON = STATE_ON;
1363 viafb_primary_dev = LCD_Device; 1250 viafb_primary_dev = LCD_Device;
1364 } else if (!strncmp(viafb_active_dev, "DVI+LCD", 7)) { 1251 } else if (!strcmp(viafb_active_dev, "DVI+LCD")) {
1365 /* DVI+LCD */ 1252 /* DVI+LCD */
1366 viafb_DVI_ON = STATE_ON; 1253 viafb_DVI_ON = STATE_ON;
1367 viafb_LCD_ON = STATE_ON; 1254 viafb_LCD_ON = STATE_ON;
1368 viafb_primary_dev = DVI_Device; 1255 viafb_primary_dev = DVI_Device;
1369 } else if (!strncmp(viafb_active_dev, "LCD+DVI", 7)) { 1256 } else if (!strcmp(viafb_active_dev, "LCD+DVI")) {
1370 /* LCD+DVI */ 1257 /* LCD+DVI */
1371 viafb_DVI_ON = STATE_ON; 1258 viafb_DVI_ON = STATE_ON;
1372 viafb_LCD_ON = STATE_ON; 1259 viafb_LCD_ON = STATE_ON;
1373 viafb_primary_dev = LCD_Device; 1260 viafb_primary_dev = LCD_Device;
1374 } else if (!strncmp(viafb_active_dev, "LCD+LCD2", 8)) { 1261 } else if (!strcmp(viafb_active_dev, "LCD+LCD2")) {
1375 viafb_LCD_ON = STATE_ON; 1262 viafb_LCD_ON = STATE_ON;
1376 viafb_LCD2_ON = STATE_ON; 1263 viafb_LCD2_ON = STATE_ON;
1377 viafb_primary_dev = LCD_Device; 1264 viafb_primary_dev = LCD_Device;
1378 } else if (!strncmp(viafb_active_dev, "LCD2+LCD", 8)) { 1265 } else if (!strcmp(viafb_active_dev, "LCD2+LCD")) {
1379 viafb_LCD_ON = STATE_ON; 1266 viafb_LCD_ON = STATE_ON;
1380 viafb_LCD2_ON = STATE_ON; 1267 viafb_LCD2_ON = STATE_ON;
1381 viafb_primary_dev = LCD2_Device; 1268 viafb_primary_dev = LCD2_Device;
1382 } else if (!strncmp(viafb_active_dev, "CRT", 3)) { 1269 } else if (!strcmp(viafb_active_dev, "CRT")) {
1383 /* CRT only */ 1270 /* CRT only */
1384 viafb_CRT_ON = STATE_ON; 1271 viafb_CRT_ON = STATE_ON;
1385 viafb_SAMM_ON = STATE_OFF; 1272 viafb_SAMM_ON = STATE_OFF;
1386 } else if (!strncmp(viafb_active_dev, "DVI", 3)) { 1273 } else if (!strcmp(viafb_active_dev, "DVI")) {
1387 /* DVI only */ 1274 /* DVI only */
1388 viafb_DVI_ON = STATE_ON; 1275 viafb_DVI_ON = STATE_ON;
1389 viafb_SAMM_ON = STATE_OFF; 1276 viafb_SAMM_ON = STATE_OFF;
1390 } else if (!strncmp(viafb_active_dev, "LCD", 3)) { 1277 } else if (!strcmp(viafb_active_dev, "LCD")) {
1391 /* LCD only */ 1278 /* LCD only */
1392 viafb_LCD_ON = STATE_ON; 1279 viafb_LCD_ON = STATE_ON;
1393 viafb_SAMM_ON = STATE_OFF; 1280 viafb_SAMM_ON = STATE_OFF;
1394 } else { 1281 } else
1395 viafb_CRT_ON = STATE_ON; 1282 return -EINVAL;
1396 viafb_SAMM_ON = STATE_OFF; 1283
1397 } 1284 return 0;
1398} 1285}
1399 1286
1400static int parse_port(char *opt_str, int *output_interface) 1287static int parse_port(char *opt_str, int *output_interface)
@@ -1823,35 +1710,37 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
1823 remove_proc_entry("viafb", NULL); 1710 remove_proc_entry("viafb", NULL);
1824} 1711}
1825 1712
1826static void parse_mode(const char *str, u32 *xres, u32 *yres) 1713static int parse_mode(const char *str, u32 *xres, u32 *yres)
1827{ 1714{
1828 char *ptr; 1715 char *ptr;
1829 1716
1717 if (!str) {
1718 *xres = 640;
1719 *yres = 480;
1720 return 0;
1721 }
1722
1830 *xres = simple_strtoul(str, &ptr, 10); 1723 *xres = simple_strtoul(str, &ptr, 10);
1831 if (ptr[0] != 'x') 1724 if (ptr[0] != 'x')
1832 goto out_default; 1725 return -EINVAL;
1833 1726
1834 *yres = simple_strtoul(&ptr[1], &ptr, 10); 1727 *yres = simple_strtoul(&ptr[1], &ptr, 10);
1835 if (ptr[0]) 1728 if (ptr[0])
1836 goto out_default; 1729 return -EINVAL;
1837
1838 return;
1839 1730
1840out_default: 1731 return 0;
1841 printk(KERN_WARNING "viafb received invalid mode string: %s\n", str);
1842 *xres = 640;
1843 *yres = 480;
1844} 1732}
1845 1733
1846static int __devinit via_pci_probe(struct pci_dev *pdev, 1734static int __devinit via_pci_probe(struct pci_dev *pdev,
1847 const struct pci_device_id *ent) 1735 const struct pci_device_id *ent)
1848{ 1736{
1849 u32 default_xres, default_yres; 1737 u32 default_xres, default_yres;
1850 int vmode_index; 1738 struct VideoModeTable *vmode_entry;
1739 struct fb_var_screeninfo default_var;
1851 u32 viafb_par_length; 1740 u32 viafb_par_length;
1852 1741
1853 DEBUG_MSG(KERN_INFO "VIAFB PCI Probe!!\n"); 1742 DEBUG_MSG(KERN_INFO "VIAFB PCI Probe!!\n");
1854 1743 memset(&default_var, 0, sizeof(default_var));
1855 viafb_par_length = ALIGN(sizeof(struct viafb_par), BITS_PER_LONG/8); 1744 viafb_par_length = ALIGN(sizeof(struct viafb_par), BITS_PER_LONG/8);
1856 1745
1857 /* Allocate fb_info and ***_par here, also including some other needed 1746 /* Allocate fb_info and ***_par here, also including some other needed
@@ -1877,7 +1766,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
1877 1766
1878 if (viafb_dual_fb) 1767 if (viafb_dual_fb)
1879 viafb_SAMM_ON = 1; 1768 viafb_SAMM_ON = 1;
1880 parse_active_dev();
1881 parse_lcd_port(); 1769 parse_lcd_port();
1882 parse_dvi_port(); 1770 parse_dvi_port();
1883 1771
@@ -1926,9 +1814,7 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
1926 } 1814 }
1927 1815
1928 parse_mode(viafb_mode, &default_xres, &default_yres); 1816 parse_mode(viafb_mode, &default_xres, &default_yres);
1929 vmode_index = viafb_get_mode_index(default_xres, default_yres); 1817 vmode_entry = viafb_get_mode(default_xres, default_yres);
1930 DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index);
1931
1932 if (viafb_SAMM_ON == 1) { 1818 if (viafb_SAMM_ON == 1) {
1933 parse_mode(viafb_mode1, &viafb_second_xres, 1819 parse_mode(viafb_mode1, &viafb_second_xres,
1934 &viafb_second_yres); 1820 &viafb_second_yres);
@@ -1947,19 +1833,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
1947 viafb_second_virtual_yres = viafb_second_yres; 1833 viafb_second_virtual_yres = viafb_second_yres;
1948 } 1834 }
1949 1835
1950 switch (viafb_bpp) {
1951 case 0 ... 8:
1952 viafb_bpp = 8;
1953 break;
1954 case 9 ... 16:
1955 viafb_bpp = 16;
1956 break;
1957 case 17 ... 32:
1958 viafb_bpp = 32;
1959 break;
1960 default:
1961 viafb_bpp = 8;
1962 }
1963 default_var.xres = default_xres; 1836 default_var.xres = default_xres;
1964 default_var.yres = default_yres; 1837 default_var.yres = default_yres;
1965 switch (default_xres) { 1838 switch (default_xres) {
@@ -1972,8 +1845,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
1972 } 1845 }
1973 default_var.yres_virtual = default_yres; 1846 default_var.yres_virtual = default_yres;
1974 default_var.bits_per_pixel = viafb_bpp; 1847 default_var.bits_per_pixel = viafb_bpp;
1975 if (default_var.bits_per_pixel == 15)
1976 default_var.bits_per_pixel = 16;
1977 default_var.pixclock = 1848 default_var.pixclock =
1978 viafb_get_pixclock(default_xres, default_yres, viafb_refresh); 1849 viafb_get_pixclock(default_xres, default_yres, viafb_refresh);
1979 default_var.left_margin = (default_xres >> 3) & 0xf8; 1850 default_var.left_margin = (default_xres >> 3) & 0xf8;
@@ -1982,6 +1853,8 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
1982 default_var.lower_margin = 4; 1853 default_var.lower_margin = 4;
1983 default_var.hsync_len = default_var.left_margin; 1854 default_var.hsync_len = default_var.left_margin;
1984 default_var.vsync_len = 4; 1855 default_var.vsync_len = 4;
1856 viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo);
1857 viafbinfo->var = default_var;
1985 1858
1986 if (viafb_dual_fb) { 1859 if (viafb_dual_fb) {
1987 viafbinfo1 = framebuffer_alloc(viafb_par_length, &pdev->dev); 1860 viafbinfo1 = framebuffer_alloc(viafb_par_length, &pdev->dev);
@@ -2016,8 +1889,6 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
2016 default_var.yres = viafb_second_yres; 1889 default_var.yres = viafb_second_yres;
2017 default_var.xres_virtual = viafb_second_virtual_xres; 1890 default_var.xres_virtual = viafb_second_virtual_xres;
2018 default_var.yres_virtual = viafb_second_virtual_yres; 1891 default_var.yres_virtual = viafb_second_virtual_yres;
2019 if (viafb_bpp1 != viafb_bpp)
2020 viafb_bpp1 = viafb_bpp;
2021 default_var.bits_per_pixel = viafb_bpp1; 1892 default_var.bits_per_pixel = viafb_bpp1;
2022 default_var.pixclock = 1893 default_var.pixclock =
2023 viafb_get_pixclock(viafb_second_xres, viafb_second_yres, 1894 viafb_get_pixclock(viafb_second_xres, viafb_second_yres,
@@ -2037,9 +1908,7 @@ static int __devinit via_pci_probe(struct pci_dev *pdev,
2037 &viafbinfo1->fix); 1908 &viafbinfo1->fix);
2038 } 1909 }
2039 1910
2040 viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo); 1911 viafb_check_var(&viafbinfo->var, viafbinfo);
2041 viafb_check_var(&default_var, viafbinfo);
2042 viafbinfo->var = default_var;
2043 viafb_update_fix(viafbinfo); 1912 viafb_update_fix(viafbinfo);
2044 viaparinfo->depth = fb_get_color_depth(&viafbinfo->var, 1913 viaparinfo->depth = fb_get_color_depth(&viafbinfo->var,
2045 &viafbinfo->fix); 1914 &viafbinfo->fix);
@@ -2197,12 +2066,20 @@ static struct pci_driver viafb_driver = {
2197 2066
2198static int __init viafb_init(void) 2067static int __init viafb_init(void)
2199{ 2068{
2069 u32 dummy;
2200#ifndef MODULE 2070#ifndef MODULE
2201 char *option = NULL; 2071 char *option = NULL;
2202 if (fb_get_options("viafb", &option)) 2072 if (fb_get_options("viafb", &option))
2203 return -ENODEV; 2073 return -ENODEV;
2204 viafb_setup(option); 2074 viafb_setup(option);
2205#endif 2075#endif
2076 if (parse_mode(viafb_mode, &dummy, &dummy)
2077 || parse_mode(viafb_mode1, &dummy, &dummy)
2078 || viafb_bpp < 0 || viafb_bpp > 32
2079 || viafb_bpp1 < 0 || viafb_bpp1 > 32
2080 || parse_active_dev())
2081 return -EINVAL;
2082
2206 printk(KERN_INFO 2083 printk(KERN_INFO
2207 "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n", 2084 "VIA Graphics Intergration Chipset framebuffer %d.%d initializing\n",
2208 VERSION_MAJOR, VERSION_MINOR); 2085 VERSION_MAJOR, VERSION_MINOR);
@@ -2230,15 +2107,12 @@ static struct fb_ops viafb_ops = {
2230 .fb_cursor = viafb_cursor, 2107 .fb_cursor = viafb_cursor,
2231 .fb_ioctl = viafb_ioctl, 2108 .fb_ioctl = viafb_ioctl,
2232 .fb_sync = viafb_sync, 2109 .fb_sync = viafb_sync,
2233 .fb_setcmap = viafb_setcmap,
2234}; 2110};
2235 2111
2236module_init(viafb_init); 2112module_init(viafb_init);
2237module_exit(viafb_exit); 2113module_exit(viafb_exit);
2238 2114
2239#ifdef MODULE 2115#ifdef MODULE
2240module_param(viafb_memsize, int, S_IRUSR);
2241
2242module_param(viafb_mode, charp, S_IRUSR); 2116module_param(viafb_mode, charp, S_IRUSR);
2243MODULE_PARM_DESC(viafb_mode, "Set resolution (default=640x480)"); 2117MODULE_PARM_DESC(viafb_mode, "Set resolution (default=640x480)");
2244 2118
diff --git a/drivers/video/via/viafbdev.h b/drivers/video/via/viafbdev.h
index 0c94d2441922..61b5953cd159 100644
--- a/drivers/video/via/viafbdev.h
+++ b/drivers/video/via/viafbdev.h
@@ -83,22 +83,16 @@ struct viafb_par {
83 83
84extern unsigned int viafb_second_virtual_yres; 84extern unsigned int viafb_second_virtual_yres;
85extern unsigned int viafb_second_virtual_xres; 85extern unsigned int viafb_second_virtual_xres;
86extern unsigned int viafb_second_offset;
87extern int viafb_second_size;
88extern int viafb_SAMM_ON; 86extern int viafb_SAMM_ON;
89extern int viafb_dual_fb; 87extern int viafb_dual_fb;
90extern int viafb_LCD2_ON; 88extern int viafb_LCD2_ON;
91extern int viafb_LCD_ON; 89extern int viafb_LCD_ON;
92extern int viafb_DVI_ON; 90extern int viafb_DVI_ON;
93extern int viafb_hotplug; 91extern int viafb_hotplug;
94extern int viafb_memsize;
95 92
96extern int strict_strtoul(const char *cp, unsigned int base, 93extern int strict_strtoul(const char *cp, unsigned int base,
97 unsigned long *res); 94 unsigned long *res);
98 95
99void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
100 int mode_index);
101int viafb_get_mode_index(int hres, int vres);
102u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information 96u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
103 *plvds_setting_info, struct lvds_chip_information 97 *plvds_setting_info, struct lvds_chip_information
104 *plvds_chip_info, u8 index); 98 *plvds_chip_info, u8 index);
diff --git a/drivers/video/via/viamode.c b/drivers/video/via/viamode.c
index b74f8a67923c..af50e244016c 100644
--- a/drivers/video/via/viamode.c
+++ b/drivers/video/via/viamode.c
@@ -412,7 +412,7 @@ struct io_reg PM1024x768[] = { {VIASR, 0x16, 0xBF, 0x0C},
412}; 412};
413 413
414struct patch_table res_patch_table[] = { 414struct patch_table res_patch_table[] = {
415 {VIA_RES_1024X768, ARRAY_SIZE(PM1024x768), PM1024x768} 415 {ARRAY_SIZE(PM1024x768), PM1024x768}
416}; 416};
417 417
418/* struct VPITTable { 418/* struct VPITTable {
@@ -879,169 +879,151 @@ struct crt_mode_table CRTM2048x1536[] = {
879 {2800, 2048, 2048, 752, 2200, 224, 1592, 1536, 1536, 56, 1539, 4} } 879 {2800, 2048, 2048, 752, 2200, 224, 1592, 1536, 1536, 56, 1539, 4} }
880}; 880};
881 881
882/* Video Mode Table */ 882struct VideoModeTable viafb_modes[] = {
883/* struct VideoModeTable {*/
884/* int ModeIndex;*/
885/* struct crt_mode_table *crtc;*/
886/* int mode_array;*/
887/* };*/
888struct VideoModeTable CLE266Modes[] = {
889 /* Display : 480x640 (GTF) */ 883 /* Display : 480x640 (GTF) */
890 {VIA_RES_480X640, CRTM480x640, ARRAY_SIZE(CRTM480x640)}, 884 {CRTM480x640, ARRAY_SIZE(CRTM480x640)},
891 885
892 /* Display : 640x480 */ 886 /* Display : 640x480 */
893 {VIA_RES_640X480, CRTM640x480, ARRAY_SIZE(CRTM640x480)}, 887 {CRTM640x480, ARRAY_SIZE(CRTM640x480)},
894 888
895 /* Display : 720x480 (GTF) */ 889 /* Display : 720x480 (GTF) */
896 {VIA_RES_720X480, CRTM720x480, ARRAY_SIZE(CRTM720x480)}, 890 {CRTM720x480, ARRAY_SIZE(CRTM720x480)},
897 891
898 /* Display : 720x576 (GTF) */ 892 /* Display : 720x576 (GTF) */
899 {VIA_RES_720X576, CRTM720x576, ARRAY_SIZE(CRTM720x576)}, 893 {CRTM720x576, ARRAY_SIZE(CRTM720x576)},
900 894
901 /* Display : 800x600 */ 895 /* Display : 800x600 */
902 {VIA_RES_800X600, CRTM800x600, ARRAY_SIZE(CRTM800x600)}, 896 {CRTM800x600, ARRAY_SIZE(CRTM800x600)},
903 897
904 /* Display : 800x480 (CVT) */ 898 /* Display : 800x480 (CVT) */
905 {VIA_RES_800X480, CRTM800x480, ARRAY_SIZE(CRTM800x480)}, 899 {CRTM800x480, ARRAY_SIZE(CRTM800x480)},
906 900
907 /* Display : 848x480 (CVT) */ 901 /* Display : 848x480 (CVT) */
908 {VIA_RES_848X480, CRTM848x480, ARRAY_SIZE(CRTM848x480)}, 902 {CRTM848x480, ARRAY_SIZE(CRTM848x480)},
909 903
910 /* Display : 852x480 (GTF) */ 904 /* Display : 852x480 (GTF) */
911 {VIA_RES_856X480, CRTM852x480, ARRAY_SIZE(CRTM852x480)}, 905 {CRTM852x480, ARRAY_SIZE(CRTM852x480)},
912 906
913 /* Display : 1024x512 (GTF) */ 907 /* Display : 1024x512 (GTF) */
914 {VIA_RES_1024X512, CRTM1024x512, ARRAY_SIZE(CRTM1024x512)}, 908 {CRTM1024x512, ARRAY_SIZE(CRTM1024x512)},
915 909
916 /* Display : 1024x600 */ 910 /* Display : 1024x600 */
917 {VIA_RES_1024X600, CRTM1024x600, ARRAY_SIZE(CRTM1024x600)}, 911 {CRTM1024x600, ARRAY_SIZE(CRTM1024x600)},
918
919 /* Display : 1024x576 (GTF) */
920 /*{ VIA_RES_1024X576, CRTM1024x576, ARRAY_SIZE(CRTM1024x576)}, */
921 912
922 /* Display : 1024x768 */ 913 /* Display : 1024x768 */
923 {VIA_RES_1024X768, CRTM1024x768, ARRAY_SIZE(CRTM1024x768)}, 914 {CRTM1024x768, ARRAY_SIZE(CRTM1024x768)},
924 915
925 /* Display : 1152x864 */ 916 /* Display : 1152x864 */
926 {VIA_RES_1152X864, CRTM1152x864, ARRAY_SIZE(CRTM1152x864)}, 917 {CRTM1152x864, ARRAY_SIZE(CRTM1152x864)},
927 918
928 /* Display : 1280x768 (GTF) */ 919 /* Display : 1280x768 (GTF) */
929 {VIA_RES_1280X768, CRTM1280x768, ARRAY_SIZE(CRTM1280x768)}, 920 {CRTM1280x768, ARRAY_SIZE(CRTM1280x768)},
930 921
931 /* Display : 960x600 (CVT) */ 922 /* Display : 960x600 (CVT) */
932 {VIA_RES_960X600, CRTM960x600, ARRAY_SIZE(CRTM960x600)}, 923 {CRTM960x600, ARRAY_SIZE(CRTM960x600)},
933 924
934 /* Display : 1000x600 (GTF) */ 925 /* Display : 1000x600 (GTF) */
935 {VIA_RES_1000X600, CRTM1000x600, ARRAY_SIZE(CRTM1000x600)}, 926 {CRTM1000x600, ARRAY_SIZE(CRTM1000x600)},
936 927
937 /* Display : 1024x576 (GTF) */ 928 /* Display : 1024x576 (GTF) */
938 {VIA_RES_1024X576, CRTM1024x576, ARRAY_SIZE(CRTM1024x576)}, 929 {CRTM1024x576, ARRAY_SIZE(CRTM1024x576)},
939 930
940 /* Display : 1088x612 (GTF) */ 931 /* Display : 1088x612 (GTF) */
941 {VIA_RES_1088X612, CRTM1088x612, ARRAY_SIZE(CRTM1088x612)}, 932 {CRTM1088x612, ARRAY_SIZE(CRTM1088x612)},
942 933
943 /* Display : 1152x720 (CVT) */ 934 /* Display : 1152x720 (CVT) */
944 {VIA_RES_1152X720, CRTM1152x720, ARRAY_SIZE(CRTM1152x720)}, 935 {CRTM1152x720, ARRAY_SIZE(CRTM1152x720)},
945 936
946 /* Display : 1200x720 (GTF) */ 937 /* Display : 1200x720 (GTF) */
947 {VIA_RES_1200X720, CRTM1200x720, ARRAY_SIZE(CRTM1200x720)}, 938 {CRTM1200x720, ARRAY_SIZE(CRTM1200x720)},
948 939
949 /* Display : 1280x600 (GTF) */ 940 /* Display : 1280x600 (GTF) */
950 {VIA_RES_1280X600, CRTM1280x600, ARRAY_SIZE(CRTM1280x600)}, 941 {CRTM1280x600, ARRAY_SIZE(CRTM1280x600)},
951 942
952 /* Display : 1280x800 (CVT) */ 943 /* Display : 1280x800 (CVT) */
953 {VIA_RES_1280X800, CRTM1280x800, ARRAY_SIZE(CRTM1280x800)}, 944 {CRTM1280x800, ARRAY_SIZE(CRTM1280x800)},
954
955 /* Display : 1280x800 (GTF) */
956 /*{ M1280x800, CRTM1280x800, ARRAY_SIZE(CRTM1280x800)}, */
957 945
958 /* Display : 1280x960 */ 946 /* Display : 1280x960 */
959 {VIA_RES_1280X960, CRTM1280x960, ARRAY_SIZE(CRTM1280x960)}, 947 {CRTM1280x960, ARRAY_SIZE(CRTM1280x960)},
960 948
961 /* Display : 1280x1024 */ 949 /* Display : 1280x1024 */
962 {VIA_RES_1280X1024, CRTM1280x1024, ARRAY_SIZE(CRTM1280x1024)}, 950 {CRTM1280x1024, ARRAY_SIZE(CRTM1280x1024)},
963 951
964 /* Display : 1360x768 (CVT) */ 952 /* Display : 1360x768 (CVT) */
965 {VIA_RES_1360X768, CRTM1360x768, ARRAY_SIZE(CRTM1360x768)}, 953 {CRTM1360x768, ARRAY_SIZE(CRTM1360x768)},
966
967 /* Display : 1360x768 (CVT Reduce Blanking) */
968 {VIA_RES_1360X768_RB, CRTM1360x768_RB,
969 ARRAY_SIZE(CRTM1360x768_RB)},
970 954
971 /* Display : 1366x768 */ 955 /* Display : 1366x768 */
972 {VIA_RES_1366X768, CRTM1366x768, ARRAY_SIZE(CRTM1366x768)}, 956 {CRTM1366x768, ARRAY_SIZE(CRTM1366x768)},
973 957
974 /* Display : 1368x768 (GTF) */ 958 /* Display : 1368x768 (GTF) */
975 /*{ M1368x768,CRTM1368x768,ARRAY_SIZE(CRTM1368x768)}, */ 959 {CRTM1368x768, ARRAY_SIZE(CRTM1368x768)},
976 /* Display : 1368x768 (GTF) */
977 {VIA_RES_1368X768, CRTM1368x768, ARRAY_SIZE(CRTM1368x768)},
978 960
979 /* Display : 1440x900 (CVT) */ 961 /* Display : 1440x900 (CVT) */
980 {VIA_RES_1440X900, CRTM1440x900, ARRAY_SIZE(CRTM1440x900)}, 962 {CRTM1440x900, ARRAY_SIZE(CRTM1440x900)},
981
982 /* Display : 1440x900 (CVT Reduce Blanking) */
983 {VIA_RES_1440X900_RB, CRTM1440x900_RB,
984 ARRAY_SIZE(CRTM1440x900_RB)},
985 963
986 /* Display : 1440x1050 (GTF) */ 964 /* Display : 1440x1050 (GTF) */
987 {VIA_RES_1440X1050, CRTM1440x1050, ARRAY_SIZE(CRTM1440x1050)}, 965 {CRTM1440x1050, ARRAY_SIZE(CRTM1440x1050)},
988
989 /* Display : 1400x1050 (CVT Reduce Blanking) */
990 {VIA_RES_1400X1050_RB, CRTM1400x1050_RB,
991 ARRAY_SIZE(CRTM1400x1050_RB)},
992 966
993 /* Display : 1600x900 (CVT) */ 967 /* Display : 1600x900 (CVT) */
994 {VIA_RES_1600X900, CRTM1600x900, ARRAY_SIZE(CRTM1600x900)}, 968 {CRTM1600x900, ARRAY_SIZE(CRTM1600x900)},
995
996 /* Display : 1600x900 (CVT Reduce Blanking) */
997 {VIA_RES_1600X900_RB, CRTM1600x900_RB,
998 ARRAY_SIZE(CRTM1600x900_RB)},
999 969
1000 /* Display : 1600x1024 (GTF) */ 970 /* Display : 1600x1024 (GTF) */
1001 {VIA_RES_1600X1024, CRTM1600x1024, ARRAY_SIZE(CRTM1600x1024)}, 971 {CRTM1600x1024, ARRAY_SIZE(CRTM1600x1024)},
1002 972
1003 /* Display : 1600x1200 */ 973 /* Display : 1600x1200 */
1004 {VIA_RES_1600X1200, CRTM1600x1200, ARRAY_SIZE(CRTM1600x1200)}, 974 {CRTM1600x1200, ARRAY_SIZE(CRTM1600x1200)},
1005 975
1006 /* Display : 1680x1050 (CVT) */ 976 /* Display : 1680x1050 (CVT) */
1007 {VIA_RES_1680X1050, CRTM1680x1050, ARRAY_SIZE(CRTM1680x1050)}, 977 {CRTM1680x1050, ARRAY_SIZE(CRTM1680x1050)},
1008
1009 /* Display : 1680x1050 (CVT Reduce Blanking) */
1010 {VIA_RES_1680X1050_RB, CRTM1680x1050_RB,
1011 ARRAY_SIZE(CRTM1680x1050_RB)},
1012 978
1013 /* Display : 1792x1344 (DMT) */ 979 /* Display : 1792x1344 (DMT) */
1014 {VIA_RES_1792X1344, CRTM1792x1344, ARRAY_SIZE(CRTM1792x1344)}, 980 {CRTM1792x1344, ARRAY_SIZE(CRTM1792x1344)},
1015 981
1016 /* Display : 1856x1392 (DMT) */ 982 /* Display : 1856x1392 (DMT) */
1017 {VIA_RES_1856X1392, CRTM1856x1392, ARRAY_SIZE(CRTM1856x1392)}, 983 {CRTM1856x1392, ARRAY_SIZE(CRTM1856x1392)},
1018 984
1019 /* Display : 1920x1440 */ 985 /* Display : 1920x1440 */
1020 {VIA_RES_1920X1440, CRTM1920x1440, ARRAY_SIZE(CRTM1920x1440)}, 986 {CRTM1920x1440, ARRAY_SIZE(CRTM1920x1440)},
1021 987
1022 /* Display : 2048x1536 */ 988 /* Display : 2048x1536 */
1023 {VIA_RES_2048X1536, CRTM2048x1536, ARRAY_SIZE(CRTM2048x1536)}, 989 {CRTM2048x1536, ARRAY_SIZE(CRTM2048x1536)},
1024 990
1025 /* Display : 1280x720 */ 991 /* Display : 1280x720 */
1026 {VIA_RES_1280X720, CRTM1280x720, ARRAY_SIZE(CRTM1280x720)}, 992 {CRTM1280x720, ARRAY_SIZE(CRTM1280x720)},
1027 993
1028 /* Display : 1920x1080 (CVT) */ 994 /* Display : 1920x1080 (CVT) */
1029 {VIA_RES_1920X1080, CRTM1920x1080, ARRAY_SIZE(CRTM1920x1080)}, 995 {CRTM1920x1080, ARRAY_SIZE(CRTM1920x1080)},
1030
1031 /* Display : 1920x1080 (CVT Reduce Blanking) */
1032 {VIA_RES_1920X1080_RB, CRTM1920x1080_RB,
1033 ARRAY_SIZE(CRTM1920x1080_RB)},
1034 996
1035 /* Display : 1920x1200 (CVT) */ 997 /* Display : 1920x1200 (CVT) */
1036 {VIA_RES_1920X1200, CRTM1920x1200, ARRAY_SIZE(CRTM1920x1200)}, 998 {CRTM1920x1200, ARRAY_SIZE(CRTM1920x1200)},
1037
1038 /* Display : 1920x1200 (CVT Reduce Blanking) */
1039 {VIA_RES_1920X1200_RB, CRTM1920x1200_RB,
1040 ARRAY_SIZE(CRTM1920x1200_RB)},
1041 999
1042 /* Display : 1400x1050 (CVT) */ 1000 /* Display : 1400x1050 (CVT) */
1043 {VIA_RES_1400X1050, CRTM1400x1050, ARRAY_SIZE(CRTM1400x1050)} 1001 {CRTM1400x1050, ARRAY_SIZE(CRTM1400x1050)}
1044}; 1002};
1003
1004struct VideoModeTable viafb_rb_modes[] = {
1005 /* Display : 1360x768 (CVT Reduce Blanking) */
1006 {CRTM1360x768_RB, ARRAY_SIZE(CRTM1360x768_RB)},
1007
1008 /* Display : 1440x900 (CVT Reduce Blanking) */
1009 {CRTM1440x900_RB, ARRAY_SIZE(CRTM1440x900_RB)},
1010
1011 /* Display : 1400x1050 (CVT Reduce Blanking) */
1012 {CRTM1400x1050_RB, ARRAY_SIZE(CRTM1400x1050_RB)},
1013
1014 /* Display : 1600x900 (CVT Reduce Blanking) */
1015 {CRTM1600x900_RB, ARRAY_SIZE(CRTM1600x900_RB)},
1016
1017 /* Display : 1680x1050 (CVT Reduce Blanking) */
1018 {CRTM1680x1050_RB, ARRAY_SIZE(CRTM1680x1050_RB)},
1019
1020 /* Display : 1920x1080 (CVT Reduce Blanking) */
1021 {CRTM1920x1080_RB, ARRAY_SIZE(CRTM1920x1080_RB)},
1022
1023 /* Display : 1920x1200 (CVT Reduce Blanking) */
1024 {CRTM1920x1200_RB, ARRAY_SIZE(CRTM1920x1200_RB)}
1025};
1026
1045struct crt_mode_table CEAM1280x720[] = { 1027struct crt_mode_table CEAM1280x720[] = {
1046 {REFRESH_60, CLK_74_270M, M1280X720_CEA_R60_HSP, 1028 {REFRESH_60, CLK_74_270M, M1280X720_CEA_R60_HSP,
1047 M1280X720_CEA_R60_VSP, 1029 M1280X720_CEA_R60_VSP,
@@ -1056,8 +1038,8 @@ struct crt_mode_table CEAM1920x1080[] = {
1056}; 1038};
1057struct VideoModeTable CEA_HDMI_Modes[] = { 1039struct VideoModeTable CEA_HDMI_Modes[] = {
1058 /* Display : 1280x720 */ 1040 /* Display : 1280x720 */
1059 {VIA_RES_1280X720, CEAM1280x720, ARRAY_SIZE(CEAM1280x720)}, 1041 {CEAM1280x720, ARRAY_SIZE(CEAM1280x720)},
1060 {VIA_RES_1920X1080, CEAM1920x1080, ARRAY_SIZE(CEAM1920x1080)} 1042 {CEAM1920x1080, ARRAY_SIZE(CEAM1920x1080)}
1061}; 1043};
1062 1044
1063int NUM_TOTAL_RES_MAP_REFRESH = ARRAY_SIZE(res_map_refresh_tbl); 1045int NUM_TOTAL_RES_MAP_REFRESH = ARRAY_SIZE(res_map_refresh_tbl);
@@ -1069,4 +1051,28 @@ int NUM_TOTAL_CX700_ModeXregs = ARRAY_SIZE(CX700_ModeXregs);
1069int NUM_TOTAL_VX855_ModeXregs = ARRAY_SIZE(VX855_ModeXregs); 1051int NUM_TOTAL_VX855_ModeXregs = ARRAY_SIZE(VX855_ModeXregs);
1070int NUM_TOTAL_CLE266_ModeXregs = ARRAY_SIZE(CLE266_ModeXregs); 1052int NUM_TOTAL_CLE266_ModeXregs = ARRAY_SIZE(CLE266_ModeXregs);
1071int NUM_TOTAL_PATCH_MODE = ARRAY_SIZE(res_patch_table); 1053int NUM_TOTAL_PATCH_MODE = ARRAY_SIZE(res_patch_table);
1072int NUM_TOTAL_MODETABLE = ARRAY_SIZE(CLE266Modes); 1054
1055
1056struct VideoModeTable *viafb_get_mode(int hres, int vres)
1057{
1058 u32 i;
1059 for (i = 0; i < ARRAY_SIZE(viafb_modes); i++)
1060 if (viafb_modes[i].mode_array &&
1061 viafb_modes[i].crtc[0].crtc.hor_addr == hres &&
1062 viafb_modes[i].crtc[0].crtc.ver_addr == vres)
1063 return &viafb_modes[i];
1064
1065 return NULL;
1066}
1067
1068struct VideoModeTable *viafb_get_rb_mode(int hres, int vres)
1069{
1070 u32 i;
1071 for (i = 0; i < ARRAY_SIZE(viafb_rb_modes); i++)
1072 if (viafb_rb_modes[i].mode_array &&
1073 viafb_rb_modes[i].crtc[0].crtc.hor_addr == hres &&
1074 viafb_rb_modes[i].crtc[0].crtc.ver_addr == vres)
1075 return &viafb_rb_modes[i];
1076
1077 return NULL;
1078}
diff --git a/drivers/video/via/viamode.h b/drivers/video/via/viamode.h
index a9d6554fabdf..5b1ced86514b 100644
--- a/drivers/video/via/viamode.h
+++ b/drivers/video/via/viamode.h
@@ -32,13 +32,11 @@ struct VPITTable {
32}; 32};
33 33
34struct VideoModeTable { 34struct VideoModeTable {
35 int ModeIndex;
36 struct crt_mode_table *crtc; 35 struct crt_mode_table *crtc;
37 int mode_array; 36 int mode_array;
38}; 37};
39 38
40struct patch_table { 39struct patch_table {
41 int mode_index;
42 int table_length; 40 int table_length;
43 struct io_reg *io_reg_table; 41 struct io_reg *io_reg_table;
44}; 42};
@@ -59,13 +57,11 @@ extern int NUM_TOTAL_CX700_ModeXregs;
59extern int NUM_TOTAL_VX855_ModeXregs; 57extern int NUM_TOTAL_VX855_ModeXregs;
60extern int NUM_TOTAL_CLE266_ModeXregs; 58extern int NUM_TOTAL_CLE266_ModeXregs;
61extern int NUM_TOTAL_PATCH_MODE; 59extern int NUM_TOTAL_PATCH_MODE;
62extern int NUM_TOTAL_MODETABLE;
63 60
64/********************/ 61/********************/
65/* Mode Table */ 62/* Mode Table */
66/********************/ 63/********************/
67 64
68extern struct VideoModeTable CLE266Modes[];
69extern struct crt_mode_table CEAM1280x720[]; 65extern struct crt_mode_table CEAM1280x720[];
70extern struct crt_mode_table CEAM1920x1080[]; 66extern struct crt_mode_table CEAM1920x1080[];
71extern struct VideoModeTable CEA_HDMI_Modes[]; 67extern struct VideoModeTable CEA_HDMI_Modes[];
@@ -81,4 +77,8 @@ extern struct io_reg CLE266_ModeXregs[];
81extern struct io_reg PM1024x768[]; 77extern struct io_reg PM1024x768[];
82extern struct patch_table res_patch_table[]; 78extern struct patch_table res_patch_table[];
83extern struct VPITTable VPIT; 79extern struct VPITTable VPIT;
80
81struct VideoModeTable *viafb_get_mode(int hres, int vres);
82struct VideoModeTable *viafb_get_rb_mode(int hres, int vres);
83
84#endif /* __VIAMODE_H__ */ 84#endif /* __VIAMODE_H__ */
diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index 406caa6a71cb..e5f74416d4b7 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -214,7 +214,7 @@ static int ds2482_wait_1wire_idle(struct ds2482_data *pdev)
214 (++retries < DS2482_WAIT_IDLE_TIMEOUT)); 214 (++retries < DS2482_WAIT_IDLE_TIMEOUT));
215 } 215 }
216 216
217 if (retries > DS2482_WAIT_IDLE_TIMEOUT) 217 if (retries >= DS2482_WAIT_IDLE_TIMEOUT)
218 printk(KERN_ERR "%s: timeout on channel %d\n", 218 printk(KERN_ERR "%s: timeout on channel %d\n",
219 __func__, pdev->channel); 219 __func__, pdev->channel);
220 220
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index 65244c02551b..492670358cbf 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -102,7 +102,7 @@ static u8 mxc_w1_ds2_touch_bit(void *data, u8 bit)
102 return ((__raw_readb(ctrl_addr)) >> 3) & 0x1; 102 return ((__raw_readb(ctrl_addr)) >> 3) & 0x1;
103} 103}
104 104
105static int __init mxc_w1_probe(struct platform_device *pdev) 105static int __devinit mxc_w1_probe(struct platform_device *pdev)
106{ 106{
107 struct mxc_w1_device *mdev; 107 struct mxc_w1_device *mdev;
108 struct resource *res; 108 struct resource *res;
@@ -166,7 +166,7 @@ failed_clk:
166/* 166/*
167 * disassociate the w1 device from the driver 167 * disassociate the w1 device from the driver
168 */ 168 */
169static int mxc_w1_remove(struct platform_device *pdev) 169static int __devexit mxc_w1_remove(struct platform_device *pdev)
170{ 170{
171 struct mxc_w1_device *mdev = platform_get_drvdata(pdev); 171 struct mxc_w1_device *mdev = platform_get_drvdata(pdev);
172 struct resource *res; 172 struct resource *res;
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index acc7e3b7fe17..ad5897dc4495 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -986,7 +986,7 @@ int w1_process(void *data)
986 return 0; 986 return 0;
987} 987}
988 988
989static int w1_init(void) 989static int __init w1_init(void)
990{ 990{
991 int retval; 991 int retval;
992 992
@@ -1034,7 +1034,7 @@ err_out_exit_init:
1034 return retval; 1034 return retval;
1035} 1035}
1036 1036
1037static void w1_fini(void) 1037static void __exit w1_fini(void)
1038{ 1038{
1039 struct w1_master *dev; 1039 struct w1_master *dev;
1040 1040
diff --git a/drivers/zorro/zorro.ids b/drivers/zorro/zorro.ids
index 0c0f99e2dd62..de24e3decedd 100644
--- a/drivers/zorro/zorro.ids
+++ b/drivers/zorro/zorro.ids
@@ -108,7 +108,7 @@
108 0c00 500XP/SupraDrive WordSync [SCSI Host Adapter] 108 0c00 500XP/SupraDrive WordSync [SCSI Host Adapter]
109 0d00 SupraDrive WordSync II [SCSI Host Adapter] 109 0d00 SupraDrive WordSync II [SCSI Host Adapter]
110 1000 2400zi+ [Modem] 110 1000 2400zi+ [Modem]
1110422 Computer Systems Assosiates 1110422 Computer Systems Associates
112 1100 Magnum 40 [Accelerator and SCSI Host Adapter] 112 1100 Magnum 40 [Accelerator and SCSI Host Adapter]
113 1500 12 Gauge [SCSI Host Adapter] 113 1500 12 Gauge [SCSI Host Adapter]
1140439 Marc Michael Groth 1140439 Marc Michael Groth
diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c
index dc5ef14bdc1c..8306d53307ed 100644
--- a/fs/affs/bitmap.c
+++ b/fs/affs/bitmap.c
@@ -128,7 +128,7 @@ err_range:
128/* 128/*
129 * Allocate a block in the given allocation zone. 129 * Allocate a block in the given allocation zone.
130 * Since we have to byte-swap the bitmap on little-endian 130 * Since we have to byte-swap the bitmap on little-endian
131 * machines, this is rather expensive. Therefor we will 131 * machines, this is rather expensive. Therefore we will
132 * preallocate up to 16 blocks from the same word, if 132 * preallocate up to 16 blocks from the same word, if
133 * possible. We are not doing preallocations in the 133 * possible. We are not doing preallocations in the
134 * header zone, though. 134 * header zone, though.
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 6d6a16c5e9bb..2c32d00a6690 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -1374,7 +1374,7 @@ static inline void fill_note(struct memelfnote *note, const char *name, int type
1374 1374
1375/* 1375/*
1376 * fill up all the fields in prstatus from the given task struct, except 1376 * fill up all the fields in prstatus from the given task struct, except
1377 * registers which need to be filled up seperately. 1377 * registers which need to be filled up separately.
1378 */ 1378 */
1379static void fill_prstatus(struct elf_prstatus *prstatus, 1379static void fill_prstatus(struct elf_prstatus *prstatus,
1380 struct task_struct *p, long signr) 1380 struct task_struct *p, long signr)
diff --git a/fs/bio.c b/fs/bio.c
index dc17afd672e3..e1f922184b45 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -264,13 +264,12 @@ EXPORT_SYMBOL(bio_init);
264 * bio_alloc_bioset - allocate a bio for I/O 264 * bio_alloc_bioset - allocate a bio for I/O
265 * @gfp_mask: the GFP_ mask given to the slab allocator 265 * @gfp_mask: the GFP_ mask given to the slab allocator
266 * @nr_iovecs: number of iovecs to pre-allocate 266 * @nr_iovecs: number of iovecs to pre-allocate
267 * @bs: the bio_set to allocate from. If %NULL, just use kmalloc 267 * @bs: the bio_set to allocate from.
268 * 268 *
269 * Description: 269 * Description:
270 * bio_alloc_bioset will first try its own mempool to satisfy the allocation. 270 * bio_alloc_bioset will try its own mempool to satisfy the allocation.
271 * If %__GFP_WAIT is set then we will block on the internal pool waiting 271 * If %__GFP_WAIT is set then we will block on the internal pool waiting
272 * for a &struct bio to become free. If a %NULL @bs is passed in, we will 272 * for a &struct bio to become free.
273 * fall back to just using @kmalloc to allocate the required memory.
274 * 273 *
275 * Note that the caller must set ->bi_destructor on successful return 274 * Note that the caller must set ->bi_destructor on successful return
276 * of a bio, to do the appropriate freeing of the bio once the reference 275 * of a bio, to do the appropriate freeing of the bio once the reference
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2b59201b955c..0427183e3e05 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -901,7 +901,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
901 root->highest_objectid = 0; 901 root->highest_objectid = 0;
902 root->name = NULL; 902 root->name = NULL;
903 root->in_sysfs = 0; 903 root->in_sysfs = 0;
904 root->inode_tree.rb_node = NULL; 904 root->inode_tree = RB_ROOT;
905 905
906 INIT_LIST_HEAD(&root->dirty_list); 906 INIT_LIST_HEAD(&root->dirty_list);
907 INIT_LIST_HEAD(&root->orphan_list); 907 INIT_LIST_HEAD(&root->orphan_list);
@@ -1673,7 +1673,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
1673 insert_inode_hash(fs_info->btree_inode); 1673 insert_inode_hash(fs_info->btree_inode);
1674 1674
1675 spin_lock_init(&fs_info->block_group_cache_lock); 1675 spin_lock_init(&fs_info->block_group_cache_lock);
1676 fs_info->block_group_cache_tree.rb_node = NULL; 1676 fs_info->block_group_cache_tree = RB_ROOT;
1677 1677
1678 extent_io_tree_init(&fs_info->freed_extents[0], 1678 extent_io_tree_init(&fs_info->freed_extents[0],
1679 fs_info->btree_inode->i_mapping, GFP_NOFS); 1679 fs_info->btree_inode->i_mapping, GFP_NOFS);
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b177ed319612..7073cbb1b2d4 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -104,8 +104,8 @@ void extent_io_exit(void)
104void extent_io_tree_init(struct extent_io_tree *tree, 104void extent_io_tree_init(struct extent_io_tree *tree,
105 struct address_space *mapping, gfp_t mask) 105 struct address_space *mapping, gfp_t mask)
106{ 106{
107 tree->state.rb_node = NULL; 107 tree->state = RB_ROOT;
108 tree->buffer.rb_node = NULL; 108 tree->buffer = RB_ROOT;
109 tree->ops = NULL; 109 tree->ops = NULL;
110 tree->dirty_bytes = 0; 110 tree->dirty_bytes = 0;
111 spin_lock_init(&tree->lock); 111 spin_lock_init(&tree->lock);
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 428fcac45f90..28d87ba60ce8 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -35,7 +35,7 @@ void extent_map_exit(void)
35 */ 35 */
36void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask) 36void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask)
37{ 37{
38 tree->map.rb_node = NULL; 38 tree->map = RB_ROOT;
39 rwlock_init(&tree->lock); 39 rwlock_init(&tree->lock);
40} 40}
41 41
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index cb2849f03251..dd831ed31eea 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -870,7 +870,7 @@ __btrfs_return_cluster_to_free_space(
870 tree_insert_offset(&block_group->free_space_offset, 870 tree_insert_offset(&block_group->free_space_offset,
871 entry->offset, &entry->offset_index, 0); 871 entry->offset, &entry->offset_index, 0);
872 } 872 }
873 cluster->root.rb_node = NULL; 873 cluster->root = RB_ROOT;
874 874
875out: 875out:
876 spin_unlock(&cluster->lock); 876 spin_unlock(&cluster->lock);
@@ -1355,7 +1355,7 @@ void btrfs_init_free_cluster(struct btrfs_free_cluster *cluster)
1355{ 1355{
1356 spin_lock_init(&cluster->lock); 1356 spin_lock_init(&cluster->lock);
1357 spin_lock_init(&cluster->refill_lock); 1357 spin_lock_init(&cluster->refill_lock);
1358 cluster->root.rb_node = NULL; 1358 cluster->root = RB_ROOT;
1359 cluster->max_size = 0; 1359 cluster->max_size = 0;
1360 cluster->points_to_bitmap = false; 1360 cluster->points_to_bitmap = false;
1361 INIT_LIST_HEAD(&cluster->block_group_list); 1361 INIT_LIST_HEAD(&cluster->block_group_list);
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
index 1fe1282ef47c..9116c6d0c5a9 100644
--- a/fs/btrfs/ordered-data.h
+++ b/fs/btrfs/ordered-data.h
@@ -129,7 +129,7 @@ static inline void
129btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t) 129btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t)
130{ 130{
131 mutex_init(&t->mutex); 131 mutex_init(&t->mutex);
132 t->tree.rb_node = NULL; 132 t->tree = RB_ROOT;
133 t->last = NULL; 133 t->last = NULL;
134} 134}
135 135
diff --git a/fs/btrfs/ref-cache.h b/fs/btrfs/ref-cache.h
index bc283ad2db73..e2a55cb2072b 100644
--- a/fs/btrfs/ref-cache.h
+++ b/fs/btrfs/ref-cache.h
@@ -52,7 +52,7 @@ static inline size_t btrfs_leaf_ref_size(int nr_extents)
52 52
53static inline void btrfs_leaf_ref_tree_init(struct btrfs_leaf_ref_tree *tree) 53static inline void btrfs_leaf_ref_tree_init(struct btrfs_leaf_ref_tree *tree)
54{ 54{
55 tree->root.rb_node = NULL; 55 tree->root = RB_ROOT;
56 INIT_LIST_HEAD(&tree->list); 56 INIT_LIST_HEAD(&tree->list);
57 spin_lock_init(&tree->lock); 57 spin_lock_init(&tree->lock);
58} 58}
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index ab7ab5318745..0109e5606bad 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -170,14 +170,14 @@ struct async_merge {
170 170
171static void mapping_tree_init(struct mapping_tree *tree) 171static void mapping_tree_init(struct mapping_tree *tree)
172{ 172{
173 tree->rb_root.rb_node = NULL; 173 tree->rb_root = RB_ROOT;
174 spin_lock_init(&tree->lock); 174 spin_lock_init(&tree->lock);
175} 175}
176 176
177static void backref_cache_init(struct backref_cache *cache) 177static void backref_cache_init(struct backref_cache *cache)
178{ 178{
179 int i; 179 int i;
180 cache->rb_root.rb_node = NULL; 180 cache->rb_root = RB_ROOT;
181 for (i = 0; i < BTRFS_MAX_LEVEL; i++) 181 for (i = 0; i < BTRFS_MAX_LEVEL; i++)
182 INIT_LIST_HEAD(&cache->pending[i]); 182 INIT_LIST_HEAD(&cache->pending[i]);
183 spin_lock_init(&cache->lock); 183 spin_lock_init(&cache->lock);
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 8a1ea6e64575..f8b4521de907 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -128,7 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
128{ 128{
129 struct btrfs_fs_info *info = root->fs_info; 129 struct btrfs_fs_info *info = root->fs_info;
130 substring_t args[MAX_OPT_ARGS]; 130 substring_t args[MAX_OPT_ARGS];
131 char *p, *num; 131 char *p, *num, *orig;
132 int intarg; 132 int intarg;
133 int ret = 0; 133 int ret = 0;
134 134
@@ -143,6 +143,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
143 if (!options) 143 if (!options)
144 return -ENOMEM; 144 return -ENOMEM;
145 145
146 orig = options;
146 147
147 while ((p = strsep(&options, ",")) != NULL) { 148 while ((p = strsep(&options, ",")) != NULL) {
148 int token; 149 int token;
@@ -280,7 +281,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
280 } 281 }
281 } 282 }
282out: 283out:
283 kfree(options); 284 kfree(orig);
284 return ret; 285 return ret;
285} 286}
286 287
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index b2acc79f1b34..2a36e236a492 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -69,7 +69,7 @@ static noinline int join_transaction(struct btrfs_root *root)
69 cur_trans->commit_done = 0; 69 cur_trans->commit_done = 0;
70 cur_trans->start_time = get_seconds(); 70 cur_trans->start_time = get_seconds();
71 71
72 cur_trans->delayed_refs.root.rb_node = NULL; 72 cur_trans->delayed_refs.root = RB_ROOT;
73 cur_trans->delayed_refs.num_entries = 0; 73 cur_trans->delayed_refs.num_entries = 0;
74 cur_trans->delayed_refs.num_heads_ready = 0; 74 cur_trans->delayed_refs.num_heads_ready = 0;
75 cur_trans->delayed_refs.num_heads = 0; 75 cur_trans->delayed_refs.num_heads = 0;
diff --git a/fs/buffer.c b/fs/buffer.c
index 6fa530256bfd..c9c266db0624 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2893,7 +2893,7 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block,
2893 2893
2894 /* 2894 /*
2895 * The page straddles i_size. It must be zeroed out on each and every 2895 * The page straddles i_size. It must be zeroed out on each and every
2896 * writepage invokation because it may be mmapped. "A file is mapped 2896 * writepage invocation because it may be mmapped. "A file is mapped
2897 * in multiples of the page size. For a file that is not a multiple of 2897 * in multiples of the page size. For a file that is not a multiple of
2898 * the page size, the remaining memory is zeroed when mapped, and 2898 * the page size, the remaining memory is zeroed when mapped, and
2899 * writes to that region are not written out to the file." 2899 * writes to that region are not written out to the file."
@@ -3265,7 +3265,7 @@ static void recalc_bh_state(void)
3265 3265
3266struct buffer_head *alloc_buffer_head(gfp_t gfp_flags) 3266struct buffer_head *alloc_buffer_head(gfp_t gfp_flags)
3267{ 3267{
3268 struct buffer_head *ret = kmem_cache_alloc(bh_cachep, gfp_flags); 3268 struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
3269 if (ret) { 3269 if (ret) {
3270 INIT_LIST_HEAD(&ret->b_assoc_buffers); 3270 INIT_LIST_HEAD(&ret->b_assoc_buffers);
3271 get_cpu_var(bh_accounting).nr++; 3271 get_cpu_var(bh_accounting).nr++;
@@ -3352,15 +3352,6 @@ int bh_submit_read(struct buffer_head *bh)
3352} 3352}
3353EXPORT_SYMBOL(bh_submit_read); 3353EXPORT_SYMBOL(bh_submit_read);
3354 3354
3355static void
3356init_buffer_head(void *data)
3357{
3358 struct buffer_head *bh = data;
3359
3360 memset(bh, 0, sizeof(*bh));
3361 INIT_LIST_HEAD(&bh->b_assoc_buffers);
3362}
3363
3364void __init buffer_init(void) 3355void __init buffer_init(void)
3365{ 3356{
3366 int nrpages; 3357 int nrpages;
@@ -3369,7 +3360,7 @@ void __init buffer_init(void)
3369 sizeof(struct buffer_head), 0, 3360 sizeof(struct buffer_head), 0,
3370 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 3361 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
3371 SLAB_MEM_SPREAD), 3362 SLAB_MEM_SPREAD),
3372 init_buffer_head); 3363 NULL);
3373 3364
3374 /* 3365 /*
3375 * Limit the bh occupancy to 10% of ZONE_NORMAL 3366 * Limit the bh occupancy to 10% of ZONE_NORMAL
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index 20692fbfdb24..a20bea598933 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -136,7 +136,7 @@ asn1_enum_decode(struct asn1_ctx *ctx, __le32 *val)
136 return 0; 136 return 0;
137 } 137 }
138 138
139 ch = *(ctx->pointer)++; /* ch has 0xa, ptr points to lenght octet */ 139 ch = *(ctx->pointer)++; /* ch has 0xa, ptr points to length octet */
140 if ((ch) == ASN1_ENUM) /* if ch value is ENUM, 0xa */ 140 if ((ch) == ASN1_ENUM) /* if ch value is ENUM, 0xa */
141 *val = *(++(ctx->pointer)); /* value has enum value */ 141 *val = *(++(ctx->pointer)); /* value has enum value */
142 else 142 else
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index b44ce0a0711c..b1d61d0bdfc7 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -54,7 +54,7 @@ void cifs_dfs_release_automount_timer(void)
54 * Extracts sharename form full UNC. 54 * Extracts sharename form full UNC.
55 * i.e. strips from UNC trailing path that is not part of share 55 * i.e. strips from UNC trailing path that is not part of share
56 * name and fixup missing '\' in the begining of DFS node refferal 56 * name and fixup missing '\' in the begining of DFS node refferal
57 * if neccessary. 57 * if necessary.
58 * Returns pointer to share name on success or ERR_PTR on error. 58 * Returns pointer to share name on success or ERR_PTR on error.
59 * Caller is responsible for freeing returned string. 59 * Caller is responsible for freeing returned string.
60 */ 60 */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 9d17df3e0768..611835899844 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -3886,7 +3886,7 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
3886 goto parse_DFS_referrals_exit; 3886 goto parse_DFS_referrals_exit;
3887 } 3887 }
3888 3888
3889 /* collect neccessary data from referrals */ 3889 /* collect necessary data from referrals */
3890 for (i = 0; i < *num_of_nodes; i++) { 3890 for (i = 0; i < *num_of_nodes; i++) {
3891 char *temp; 3891 char *temp;
3892 int max_len; 3892 int max_len;
diff --git a/fs/compat.c b/fs/compat.c
index 00d90c2e66f0..030602d453b7 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1795,6 +1795,24 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
1795 return ret; 1795 return ret;
1796} 1796}
1797 1797
1798struct compat_sel_arg_struct {
1799 compat_ulong_t n;
1800 compat_uptr_t inp;
1801 compat_uptr_t outp;
1802 compat_uptr_t exp;
1803 compat_uptr_t tvp;
1804};
1805
1806asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg)
1807{
1808 struct compat_sel_arg_struct a;
1809
1810 if (copy_from_user(&a, arg, sizeof(a)))
1811 return -EFAULT;
1812 return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
1813 compat_ptr(a.exp), compat_ptr(a.tvp));
1814}
1815
1798#ifdef HAVE_SET_RESTORE_SIGMASK 1816#ifdef HAVE_SET_RESTORE_SIGMASK
1799static long do_compat_pselect(int n, compat_ulong_t __user *inp, 1817static long do_compat_pselect(int n, compat_ulong_t __user *inp,
1800 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 1818 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
diff --git a/fs/dlm/member.c b/fs/dlm/member.c
index 84f70bfb0baf..b12532e553f8 100644
--- a/fs/dlm/member.c
+++ b/fs/dlm/member.c
@@ -312,7 +312,7 @@ int dlm_ls_stop(struct dlm_ls *ls)
312 /* 312 /*
313 * This in_recovery lock does two things: 313 * This in_recovery lock does two things:
314 * 1) Keeps this function from returning until all threads are out 314 * 1) Keeps this function from returning until all threads are out
315 * of locking routines and locking is truely stopped. 315 * of locking routines and locking is truly stopped.
316 * 2) Keeps any new requests from being processed until it's unlocked 316 * 2) Keeps any new requests from being processed until it's unlocked
317 * when recovery is complete. 317 * when recovery is complete.
318 */ 318 */
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index e844accbf55d..1bee604cc6cd 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -164,7 +164,7 @@ void ext3_msg(struct super_block *sb, const char *prefix,
164 * write out the superblock safely. 164 * write out the superblock safely.
165 * 165 *
166 * We'll just use the journal_abort() error code to record an error in 166 * We'll just use the journal_abort() error code to record an error in
167 * the journal instead. On recovery, the journal will compain about 167 * the journal instead. On recovery, the journal will complain about
168 * that error until we've noted it down and cleared it. 168 * that error until we've noted it down and cleared it.
169 */ 169 */
170 170
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 506713a2ebd8..54df209d2eed 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -69,7 +69,7 @@
69 * 69 *
70 * pa_lstart -> the logical start block for this prealloc space 70 * pa_lstart -> the logical start block for this prealloc space
71 * pa_pstart -> the physical start block for this prealloc space 71 * pa_pstart -> the physical start block for this prealloc space
72 * pa_len -> lenght for this prealloc space 72 * pa_len -> length for this prealloc space
73 * pa_free -> free space available in this prealloc space 73 * pa_free -> free space available in this prealloc space
74 * 74 *
75 * The inode preallocation space is used looking at the _logical_ start 75 * The inode preallocation space is used looking at the _logical_ start
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ce84a6ed4a48..ba191dae8730 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -302,7 +302,7 @@ void ext4_journal_abort_handle(const char *caller, const char *err_fn,
302 * write out the superblock safely. 302 * write out the superblock safely.
303 * 303 *
304 * We'll just use the jbd2_journal_abort() error code to record an error in 304 * We'll just use the jbd2_journal_abort() error code to record an error in
305 * the journal instead. On recovery, the journal will compain about 305 * the journal instead. On recovery, the journal will complain about
306 * that error until we've noted it down and cleared it. 306 * that error until we've noted it down and cleared it.
307 */ 307 */
308 308
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 1a822ce2b24b..ec14d19ce501 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -850,7 +850,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
850 req->in.args[0].size = sizeof(*arg); 850 req->in.args[0].size = sizeof(*arg);
851 req->in.args[0].value = arg; 851 req->in.args[0].value = arg;
852 req->out.numargs = 1; 852 req->out.numargs = 1;
853 /* Variable length arguement used for backward compatibility 853 /* Variable length argument used for backward compatibility
854 with interface version < 7.5. Rest of init_out is zeroed 854 with interface version < 7.5. Rest of init_out is zeroed
855 by do_get_request(), so a short reply is not a problem */ 855 by do_get_request(), so a short reply is not a problem */
856 req->out.argvar = 1; 856 req->out.argvar = 1;
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index a054b526dc08..c1309ed1c496 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1001,7 +1001,7 @@ static const struct lm_lockops nolock_ops = {
1001/** 1001/**
1002 * gfs2_lm_mount - mount a locking protocol 1002 * gfs2_lm_mount - mount a locking protocol
1003 * @sdp: the filesystem 1003 * @sdp: the filesystem
1004 * @args: mount arguements 1004 * @args: mount arguments
1005 * @silent: if 1, don't complain if the FS isn't a GFS2 fs 1005 * @silent: if 1, don't complain if the FS isn't a GFS2 fs
1006 * 1006 *
1007 * Returns: errno 1007 * Returns: errno
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index 99e9fea11077..5ae71e75a491 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -1398,7 +1398,7 @@ int journal_stop(handle_t *handle)
1398 * the case where our storage is so fast that it is more optimal to go 1398 * the case where our storage is so fast that it is more optimal to go
1399 * ahead and force a flush and wait for the transaction to be committed 1399 * ahead and force a flush and wait for the transaction to be committed
1400 * than it is to wait for an arbitrary amount of time for new writers to 1400 * than it is to wait for an arbitrary amount of time for new writers to
1401 * join the transaction. We acheive this by measuring how long it takes 1401 * join the transaction. We achieve this by measuring how long it takes
1402 * to commit a transaction, and compare it with how long this 1402 * to commit a transaction, and compare it with how long this
1403 * transaction has been running, and if run time < commit time then we 1403 * transaction has been running, and if run time < commit time then we
1404 * sleep for the delta and commit. This greatly helps super fast disks 1404 * sleep for the delta and commit. This greatly helps super fast disks
diff --git a/fs/locks.c b/fs/locks.c
index ae9ded026b7c..ab24d49fc048 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1455,7 +1455,7 @@ EXPORT_SYMBOL(generic_setlease);
1455 * leases held by processes on this node. 1455 * leases held by processes on this node.
1456 * 1456 *
1457 * There is also no break_lease method; filesystems that 1457 * There is also no break_lease method; filesystems that
1458 * handle their own leases shoud break leases themselves from the 1458 * handle their own leases should break leases themselves from the
1459 * filesystem's open, create, and (on truncate) setattr methods. 1459 * filesystem's open, create, and (on truncate) setattr methods.
1460 * 1460 *
1461 * Warning: the only current setlease methods exist only to disable 1461 * Warning: the only current setlease methods exist only to disable
diff --git a/fs/mpage.c b/fs/mpage.c
index 42381bd6543b..598d54e200eb 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -561,7 +561,7 @@ page_is_mapped:
561 if (page->index >= end_index) { 561 if (page->index >= end_index) {
562 /* 562 /*
563 * The page straddles i_size. It must be zeroed out on each 563 * The page straddles i_size. It must be zeroed out on each
564 * and every writepage invokation because it may be mmapped. 564 * and every writepage invocation because it may be mmapped.
565 * "A file is mapped in multiples of the page size. For a file 565 * "A file is mapped in multiples of the page size. For a file
566 * that is not a multiple of the page size, the remaining memory 566 * that is not a multiple of the page size, the remaining memory
567 * is zeroed when mapped, and writes to that region are not 567 * is zeroed when mapped, and writes to that region are not
diff --git a/fs/namei.c b/fs/namei.c
index 48e60a187325..1c0fca6e899e 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2544,7 +2544,7 @@ SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname
2544 * e) conversion from fhandle to dentry may come in the wrong moment - when 2544 * e) conversion from fhandle to dentry may come in the wrong moment - when
2545 * we are removing the target. Solution: we will have to grab ->i_mutex 2545 * we are removing the target. Solution: we will have to grab ->i_mutex
2546 * in the fhandle_to_dentry code. [FIXME - current nfsfh.c relies on 2546 * in the fhandle_to_dentry code. [FIXME - current nfsfh.c relies on
2547 * ->i_mutex on parents, which works but leads to some truely excessive 2547 * ->i_mutex on parents, which works but leads to some truly excessive
2548 * locking]. 2548 * locking].
2549 */ 2549 */
2550static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, 2550static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 78c7e24e5129..c47b4d7bafa7 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1528,7 +1528,7 @@ static void write_cinfo(__be32 **p, struct nfsd4_change_info *c)
1528 } } while (0); 1528 } } while (0);
1529 1529
1530/* Encode as an array of strings the string given with components 1530/* Encode as an array of strings the string given with components
1531 * seperated @sep. 1531 * separated @sep.
1532 */ 1532 */
1533static __be32 nfsd4_encode_components(char sep, char *components, 1533static __be32 nfsd4_encode_components(char sep, char *components,
1534 __be32 **pp, int *buflen) 1534 __be32 **pp, int *buflen)
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
deleted file mode 100644
index 37c11e194372..000000000000
--- a/fs/ntfs/ChangeLog
+++ /dev/null
@@ -1,1702 +0,0 @@
1ToDo/Notes:
2 - Find and fix bugs.
3 - The only places in the kernel where a file is resized are
4 ntfs_file_write*() and ntfs_truncate() for both of which i_mutex is
5 held. Just have to be careful in read-/writepage and other helpers
6 not running under i_mutex that we play nice. Also need to be careful
7 with initialized_size extension in ntfs_file_write*() and writepage.
8 UPDATE: The only things that need to be checked are the compressed
9 write and the other attribute resize/write cases like index
10 attributes, etc. For now none of these are implemented so are safe.
11 - Implement filling in of holes in aops.c::ntfs_writepage() and its
12 helpers.
13 - Implement mft.c::sync_mft_mirror_umount(). We currently will just
14 leave the volume dirty on umount if the final iput(vol->mft_ino)
15 causes a write of any mirrored mft records due to the mft mirror
16 inode having been discarded already. Whether this can actually ever
17 happen is unclear however so it is worth waiting until someone hits
18 the problem.
19
202.1.29 - Fix a deadlock at mount time.
21
22 - During mount the VFS holds s_umount lock on the superblock. So when
23 we try to empty the journal $LogFile contents by calling
24 ntfs_attr_set() when the machine does not have much memory and the
25 journal is large ntfs_attr_set() results in the VM trying to balance
26 dirty pages which in turn tries to that the s_umount lock and thus we
27 get a deadlock. The solution is to not use ntfs_attr_set() and
28 instead do the zeroing by hand at the block level rather than page
29 cache level.
30 - Fix sparse warnings.
31
322.1.28 - Fix a deadlock.
33
34 - Fix deadlock in fs/ntfs/inode.c::ntfs_put_inode(). Thanks to Sergey
35 Vlasov for the report and detailed analysis of the deadlock. The fix
36 involved getting rid of ntfs_put_inode() altogether and hence NTFS no
37 longer has a ->put_inode super operation.
38
392.1.27 - Various bug fixes and cleanups.
40
41 - Fix two compiler warnings on Alpha. Thanks to Andrew Morton for
42 reporting them.
43 - Fix an (innocent) off-by-one error in the runlist code.
44 - Fix a buggette in an "should be impossible" case handling where we
45 continued the attribute lookup loop instead of aborting it.
46 - Use buffer_migrate_page() for the ->migratepage function of all ntfs
47 address space operations.
48 - Fix comparison of $MFT and $MFTMirr to not bail out when there are
49 unused, invalid mft records which are the same in both $MFT and
50 $MFTMirr.
51 - Add support for sparse files which have a compression unit of 0.
52 - Remove all the make_bad_inode() calls. This should only be called
53 from read inode and new inode code paths.
54 - Limit name length in fs/ntfs/unistr.c::ntfs_nlstoucs() to maximum
55 allowed by NTFS, i.e. 255 Unicode characters, not including the
56 terminating NULL (which is not stored on disk).
57 - Improve comments on file attribute flags in fs/ntfs/layout.h.
58 - Fix a bug in fs/ntfs/inode.c::ntfs_read_locked_index_inode() where we
59 forgot to update a temporary variable so loading index inodes which
60 have an index allocation attribute failed.
61 - Add a missing call to flush_dcache_mft_record_page() in
62 fs/ntfs/inode.c::ntfs_write_inode().
63 - Handle the recently introduced -ENAMETOOLONG return value from
64 fs/ntfs/unistr.c::ntfs_nlstoucs() in fs/ntfs/namei.c::ntfs_lookup().
65 - Semaphore to mutex conversion. (Ingo Molnar)
66
672.1.26 - Minor bug fixes and updates.
68
69 - Fix a potential overflow in file.c where a cast to s64 was missing in
70 a left shift of a page index.
71 - The struct inode has had its i_sem semaphore changed to a mutex named
72 i_mutex.
73 - We have struct kmem_cache now so use it instead of the typedef
74 kmem_cache_t. (Pekka Enberg)
75 - Implement support for sector sizes above 512 bytes (up to the maximum
76 supported by NTFS which is 4096 bytes).
77 - Do more detailed reporting of why we cannot mount read-write by
78 special casing the VOLUME_MODIFIED_BY_CHKDSK flag.
79 - Miscellaneous updates to layout.h.
80 - Cope with attribute list attribute having invalid flags. Windows
81 copes with this and even chkdsk does not detect or fix this so we
82 have to cope with it, too. Thanks to Pawel Kot for reporting the
83 problem.
84
852.1.25 - (Almost) fully implement write(2) and truncate(2).
86
87 - Change ntfs_map_runlist_nolock(), ntfs_attr_find_vcn_nolock() and
88 {__,}ntfs_cluster_free() to also take an optional attribute search
89 context as argument. This allows calling these functions with the
90 mft record mapped. Update all callers.
91 - Fix potential deadlock in ntfs_mft_data_extend_allocation_nolock()
92 error handling by passing in the active search context when calling
93 ntfs_cluster_free().
94 - Change ntfs_cluster_alloc() to take an extra boolean parameter
95 specifying whether the cluster are being allocated to extend an
96 attribute or to fill a hole.
97 - Change ntfs_attr_make_non_resident() to call ntfs_cluster_alloc()
98 with @is_extension set to TRUE and remove the runlist terminator
99 fixup code as this is now done by ntfs_cluster_alloc().
100 - Change ntfs_attr_make_non_resident to take the attribute value size
101 as an extra parameter. This is needed since we need to know the size
102 before we can map the mft record and our callers always know it. The
103 reason we cannot simply read the size from the vfs inode i_size is
104 that this is not necessarily uptodate. This happens when
105 ntfs_attr_make_non_resident() is called in the ->truncate call path.
106 - Fix ntfs_attr_make_non_resident() to update the vfs inode i_blocks
107 which is zero for a resident attribute but should no longer be zero
108 once the attribute is non-resident as it then has real clusters
109 allocated.
110 - Add fs/ntfs/attrib.[hc]::ntfs_attr_extend_allocation(), a function to
111 extend the allocation of an attributes. Optionally, the data size,
112 but not the initialized size can be extended, too.
113 - Implement fs/ntfs/inode.[hc]::ntfs_truncate(). It only supports
114 uncompressed and unencrypted files and it never creates sparse files
115 at least for the moment (making a file sparse requires us to modify
116 its directory entries and we do not support directory operations at
117 the moment). Also, support for highly fragmented files, i.e. ones
118 whose data attribute is split across multiple extents, is severly
119 limited. When such a case is encountered, EOPNOTSUPP is returned.
120 - Enable ATTR_SIZE attribute changes in ntfs_setattr(). This completes
121 the initial implementation of file truncation. Now both open(2)ing
122 a file with the O_TRUNC flag and the {,f}truncate(2) system calls
123 will resize a file appropriately. The limitations are that only
124 uncompressed and unencrypted files are supported. Also, there is
125 only very limited support for highly fragmented files (the ones whose
126 $DATA attribute is split into multiple attribute extents).
127 - In attrib.c::ntfs_attr_set() call balance_dirty_pages_ratelimited()
128 and cond_resched() in the main loop as we could be dirtying a lot of
129 pages and this ensures we play nice with the VM and the system as a
130 whole.
131 - Implement file operations ->write, ->aio_write, ->writev for regular
132 files. This replaces the old use of generic_file_write(), et al and
133 the address space operations ->prepare_write and ->commit_write.
134 This means that both sparse and non-sparse (unencrypted and
135 uncompressed) files can now be extended using the normal write(2)
136 code path. There are two limitations at present and these are that
137 we never create sparse files and that we only have limited support
138 for highly fragmented files, i.e. ones whose data attribute is split
139 across multiple extents. When such a case is encountered,
140 EOPNOTSUPP is returned.
141 - $EA attributes can be both resident and non-resident.
142 - Use %z for size_t to fix compilation warnings. (Andrew Morton)
143 - Fix compilation warnings with gcc-4.0.2 on SUSE 10.0.
144 - Document extended attribute ($EA) NEED_EA flag. (Based on libntfs
145 patch by Yura Pakhuchiy.)
146
1472.1.24 - Lots of bug fixes and support more clean journal states.
148
149 - Support journals ($LogFile) which have been modified by chkdsk. This
150 means users can boot into Windows after we marked the volume dirty.
151 The Windows boot will run chkdsk and then reboot. The user can then
152 immediately boot into Linux rather than having to do a full Windows
153 boot first before rebooting into Linux and we will recognize such a
154 journal and empty it as it is clean by definition. Note, this only
155 works if chkdsk left the journal in an obviously clean state.
156 - Support journals ($LogFile) with only one restart page as well as
157 journals with two different restart pages. We sanity check both and
158 either use the only sane one or the more recent one of the two in the
159 case that both are valid.
160 - Add fs/ntfs/malloc.h::ntfs_malloc_nofs_nofail() which is analogous to
161 ntfs_malloc_nofs() but it performs allocations with __GFP_NOFAIL and
162 hence cannot fail.
163 - Use ntfs_malloc_nofs_nofail() in the two critical regions in
164 fs/ntfs/runlist.c::ntfs_runlists_merge(). This means we no longer
165 need to panic() if the allocation fails as it now cannot fail.
166 - Fix two nasty runlist merging bugs that had gone unnoticed so far.
167 Thanks to Stefano Picerno for the bug report.
168 - Remove two bogus BUG_ON()s from fs/ntfs/mft.c.
169 - Fix handling of valid but empty mapping pairs array in
170 fs/ntfs/runlist.c::ntfs_mapping_pairs_decompress().
171 - Report unrepresentable inodes during ntfs_readdir() as KERN_WARNING
172 messages and include the inode number. Thanks to Yura Pakhuchiy for
173 pointing this out.
174 - Change ntfs_rl_truncate_nolock() to throw away the runlist if the new
175 length is zero.
176 - Add runlist.[hc]::ntfs_rl_punch_nolock() which punches a caller
177 specified hole into a runlist.
178 - Fix a bug in fs/ntfs/index.c::ntfs_index_lookup(). When the returned
179 index entry is in the index root, we forgot to set the @ir pointer in
180 the index context. Thanks to Yura Pakhuchiy for finding this bug.
181 - Remove bogus setting of PageError in ntfs_read_compressed_block().
182 - Add fs/ntfs/attrib.[hc]::ntfs_resident_attr_value_resize().
183 - Fix a bug in ntfs_map_runlist_nolock() where we forgot to protect
184 access to the allocated size in the ntfs inode with the size lock.
185 - Fix ntfs_attr_vcn_to_lcn_nolock() and ntfs_attr_find_vcn_nolock() to
186 return LCN_ENOENT when there is no runlist and the allocated size is
187 zero.
188 - Fix load_attribute_list() to handle the case of a NULL runlist.
189 - Fix handling of sparse attributes in ntfs_attr_make_non_resident().
190 - Add BUG() checks to ntfs_attr_make_non_resident() and ntfs_attr_set()
191 to ensure that these functions are never called for compressed or
192 encrypted attributes.
193 - Fix cluster (de)allocators to work when the runlist is NULL and more
194 importantly to take a locked runlist rather than them locking it
195 which leads to lock reversal.
196 - Truncate {a,c,m}time to the ntfs supported time granularity when
197 updating the times in the inode in ntfs_setattr().
198 - Fixup handling of sparse, compressed, and encrypted attributes in
199 fs/ntfs/inode.c::ntfs_read_locked_{,attr_,index_}inode(),
200 fs/ntfs/aops.c::ntfs_{read,write}page().
201 - Make ntfs_write_block() not instantiate sparse blocks if they contain
202 only zeroes.
203 - Optimize fs/ntfs/aops.c::ntfs_write_block() by extending the page
204 lock protection over the buffer submission for i/o which allows the
205 removal of the get_bh()/put_bh() pairs for each buffer.
206 - Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the case
207 where a concurrent truncate has truncated the runlist under our feet.
208 - Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c.
209 - In fs/ntfs/aops.c::ntfs_end_buffer_async_read(), use a bit spin lock
210 in the first buffer head instead of a driver global spin lock to
211 improve scalability.
212 - Minor fix to error handling and error message display in
213 fs/ntfs/aops.c::ntfs_prepare_nonresident_write().
214 - Change the mount options {u,f,d}mask to always parse the number as
215 an octal number to conform to how chmod(1) works, too. Thanks to
216 Giuseppe Bilotta and Horst von Brand for pointing out the errors of
217 my ways.
218 - Fix various bugs in the runlist merging code. (Based on libntfs
219 changes by Richard Russon.)
220 - Fix sparse warnings that have crept in over time.
221 - Change ntfs_cluster_free() to require a write locked runlist on entry
222 since we otherwise get into a lock reversal deadlock if a read locked
223 runlist is passed in. In the process also change it to take an ntfs
224 inode instead of a vfs inode as parameter.
225 - Fix the definition of the CHKD ntfs record magic. It had an off by
226 two error causing it to be CHKB instead of CHKD.
227 - Fix a stupid bug in __ntfs_bitmap_set_bits_in_run() which caused the
228 count to become negative and hence we had a wild memset() scribbling
229 all over the system's ram.
230
2312.1.23 - Implement extension of resident files and make writing safe as well as
232 many bug fixes, cleanups, and enhancements...
233
234 - Add printk rate limiting for ntfs_warning() and ntfs_error() when
235 compiled without debug. This avoids a possible denial of service
236 attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this
237 out.
238 - Fix compilation warnings on ia64. (Randy Dunlap)
239 - Use i_size_{read,write}() instead of reading i_size by hand and cache
240 the value where apropriate.
241 - Add size_lock to the ntfs_inode structure. This is an rw spinlock
242 and it locks against access to the inode sizes. Note, ->size_lock
243 is also accessed from irq context so you must use the _irqsave and
244 _irqrestore lock and unlock functions, respectively. Protect all
245 accesses to allocated_size, initialized_size, and compressed_size.
246 - Minor optimization to fs/ntfs/super.c::ntfs_statfs() and its helpers.
247 - Implement extension of resident files in the regular file write code
248 paths (fs/ntfs/aops.c::ntfs_{prepare,commit}_write()). At present
249 this only works until the data attribute becomes too big for the mft
250 record after which we abort the write returning -EOPNOTSUPP from
251 ntfs_prepare_write().
252 - Add disable_sparse mount option together with a per volume sparse
253 enable bit which is set appropriately and a per inode sparse disable
254 bit which is preset on some system file inodes as appropriate.
255 - Enforce that sparse support is disabled on NTFS volumes pre 3.0.
256 - Fix a bug in fs/ntfs/runlist.c::ntfs_mapping_pairs_decompress() in
257 the creation of the unmapped runlist element for the base attribute
258 extent.
259 - Split ntfs_map_runlist() into ntfs_map_runlist() and a non-locking
260 helper ntfs_map_runlist_nolock() which is used by ntfs_map_runlist().
261 This allows us to map runlist fragments with the runlist lock already
262 held without having to drop and reacquire it around the call. Adapt
263 all callers.
264 - Change ntfs_find_vcn() to ntfs_find_vcn_nolock() which takes a locked
265 runlist. This allows us to find runlist elements with the runlist
266 lock already held without having to drop and reacquire it around the
267 call. Adapt all callers.
268 - Change time to u64 in time.h::ntfs2utc() as it otherwise generates a
269 warning in the do_div() call on sparc32. Thanks to Meelis Roos for
270 the report and analysis of the warning.
271 - Fix a nasty runlist merge bug when merging two holes.
272 - Set the ntfs_inode->allocated_size to the real allocated size in the
273 mft record for resident attributes (fs/ntfs/inode.c).
274 - Small readability cleanup to use "a" instead of "ctx->attr"
275 everywhere (fs/ntfs/inode.c).
276 - Make fs/ntfs/namei.c::ntfs_get_{parent,dentry} static and move the
277 definition of ntfs_export_ops from fs/ntfs/super.c to namei.c. Also,
278 declare ntfs_export_ops in fs/ntfs/ntfs.h.
279 - Correct sparse file handling. The compressed values need to be
280 checked and set in the ntfs inode as done for compressed files and
281 the compressed size needs to be used for vfs inode->i_blocks instead
282 of the allocated size, again, as done for compressed files.
283 - Add AT_EA in addition to AT_DATA to whitelist for being allowed to be
284 non-resident in fs/ntfs/attrib.c::ntfs_attr_can_be_non_resident().
285 - Add fs/ntfs/attrib.c::ntfs_attr_vcn_to_lcn_nolock() used by the new
286 write code.
287 - Fix bug in fs/ntfs/attrib.c::ntfs_find_vcn_nolock() where after
288 dropping the read lock and taking the write lock we were not checking
289 whether someone else did not already do the work we wanted to do.
290 - Rename fs/ntfs/attrib.c::ntfs_find_vcn_nolock() to
291 ntfs_attr_find_vcn_nolock() and update all callers.
292 - Add fs/ntfs/attrib.[hc]::ntfs_attr_make_non_resident().
293 - Fix sign of various error return values to be negative in
294 fs/ntfs/lcnalloc.c.
295 - Modify ->readpage and ->writepage (fs/ntfs/aops.c) so they detect and
296 handle the case where an attribute is converted from resident to
297 non-resident by a concurrent file write.
298 - Remove checks for NULL before calling kfree() since kfree() does the
299 checking itself. (Jesper Juhl)
300 - Some utilities modify the boot sector but do not update the checksum.
301 Thus, relax the checking in fs/ntfs/super.c::is_boot_sector_ntfs() to
302 only emit a warning when the checksum is incorrect rather than
303 refusing the mount. Thanks to Bernd Casimir for pointing this
304 problem out.
305 - Update attribute definition handling.
306 - Add NTFS_MAX_CLUSTER_SIZE and NTFS_MAX_PAGES_PER_CLUSTER constants.
307 - Use NTFS_MAX_CLUSTER_SIZE in super.c instead of hard coding 0x10000.
308 - Use MAX_BUF_PER_PAGE instead of variable sized array allocation for
309 better code generation and one less sparse warning in fs/ntfs/aops.c.
310 - Remove spurious void pointer casts from fs/ntfs/. (Pekka Enberg)
311 - Use C99 style structure initialization after memory allocation where
312 possible (fs/ntfs/{attrib.c,index.c,super.c}). Thanks to Al Viro and
313 Pekka Enberg.
314 - Stamp the transaction log ($UsnJrnl), aka user space journal, if it
315 is active on the volume and we are mounting read-write or remounting
316 from read-only to read-write.
317 - Fix a bug in address space operations error recovery code paths where
318 if the runlist was not mapped at all and a mapping error occured we
319 would leave the runlist locked on exit to the function so that the
320 next access to the same file would try to take the lock and deadlock.
321 - Detect the case when Windows has been suspended to disk on the volume
322 to be mounted and if this is the case do not allow (re)mounting
323 read-write. This is done by parsing hiberfil.sys if present.
324 - Fix several occurences of a bug where we would perform 'var & ~const'
325 with a 64-bit variable and a int, i.e. 32-bit, constant. This causes
326 the higher order 32-bits of the 64-bit variable to be zeroed. To fix
327 this cast the 'const' to the same 64-bit type as 'var'.
328 - Change the runlist terminator of the newly allocated cluster(s) to
329 LCN_ENOENT in ntfs_attr_make_non_resident(). Otherwise the runlist
330 code gets confused.
331 - Add an extra parameter @last_vcn to ntfs_get_size_for_mapping_pairs()
332 and ntfs_mapping_pairs_build() to allow the runlist encoding to be
333 partial which is desirable when filling holes in sparse attributes.
334 Update all callers.
335 - Change ntfs_map_runlist_nolock() to only decompress the mapping pairs
336 if the requested vcn is inside it. Otherwise we get into problems
337 when we try to map an out of bounds vcn because we then try to map
338 the already mapped runlist fragment which causes
339 ntfs_mapping_pairs_decompress() to fail and return error. Update
340 ntfs_attr_find_vcn_nolock() accordingly.
341 - Fix a nasty deadlock that appeared in recent kernels.
342 The situation: VFS inode X on a mounted ntfs volume is dirty. For
343 same inode X, the ntfs_inode is dirty and thus corresponding on-disk
344 inode, i.e. mft record, which is in a dirty PAGE_CACHE_PAGE belonging
345 to the table of inodes, i.e. $MFT, inode 0.
346 What happens:
347 Process 1: sys_sync()/umount()/whatever... calls
348 __sync_single_inode() for $MFT -> do_writepages() -> write_page for
349 the dirty page containing the on-disk inode X, the page is now locked
350 -> ntfs_write_mst_block() which clears PageUptodate() on the page to
351 prevent anyone else getting hold of it whilst it does the write out.
352 This is necessary as the on-disk inode needs "fixups" applied before
353 the write to disk which are removed again after the write and
354 PageUptodate is then set again. It then analyses the page looking
355 for dirty on-disk inodes and when it finds one it calls
356 ntfs_may_write_mft_record() to see if it is safe to write this
357 on-disk inode. This then calls ilookup5() to check if the
358 corresponding VFS inode is in icache(). This in turn calls ifind()
359 which waits on the inode lock via wait_on_inode whilst holding the
360 global inode_lock.
361 Process 2: pdflush results in a call to __sync_single_inode for the
362 same VFS inode X on the ntfs volume. This locks the inode (I_LOCK)
363 then calls write-inode -> ntfs_write_inode -> map_mft_record() ->
364 read_cache_page() for the page (in page cache of table of inodes
365 $MFT, inode 0) containing the on-disk inode. This page has
366 PageUptodate() clear because of Process 1 (see above) so
367 read_cache_page() blocks when it tries to take the page lock for the
368 page so it can call ntfs_read_page().
369 Thus Process 1 is holding the page lock on the page containing the
370 on-disk inode X and it is waiting on the inode X to be unlocked in
371 ifind() so it can write the page out and then unlock the page.
372 And Process 2 is holding the inode lock on inode X and is waiting for
373 the page to be unlocked so it can call ntfs_readpage() or discover
374 that Process 1 set PageUptodate() again and use the page.
375 Thus we have a deadlock due to ifind() waiting on the inode lock.
376 The solution: The fix is to use the newly introduced
377 ilookup5_nowait() which does not wait on the inode's lock and hence
378 avoids the deadlock. This is safe as we do not care about the VFS
379 inode and only use the fact that it is in the VFS inode cache and the
380 fact that the vfs and ntfs inodes are one struct in memory to find
381 the ntfs inode in memory if present. Also, the ntfs inode has its
382 own locking so it does not matter if the vfs inode is locked.
383 - Fix bug in mft record writing where we forgot to set the device in
384 the buffers when mapping them after the VM had discarded them.
385 Thanks to Martin MOKREJÃ… for the bug report.
386
3872.1.22 - Many bug and race fixes and error handling improvements.
388
389 - Improve error handling in fs/ntfs/inode.c::ntfs_truncate().
390 - Change fs/ntfs/inode.c::ntfs_truncate() to return an error code
391 instead of void and provide a helper ntfs_truncate_vfs() for the
392 vfs ->truncate method.
393 - Add a new ntfs inode flag NInoTruncateFailed() and modify
394 fs/ntfs/inode.c::ntfs_truncate() to set and clear it appropriately.
395 - Fix min_size and max_size definitions in ATTR_DEF structure in
396 fs/ntfs/layout.h to be signed.
397 - Add attribute definition handling helpers to fs/ntfs/attrib.[hc]:
398 ntfs_attr_size_bounds_check(), ntfs_attr_can_be_non_resident(), and
399 ntfs_attr_can_be_resident(), which in turn use the new private helper
400 ntfs_attr_find_in_attrdef().
401 - In fs/ntfs/aops.c::mark_ntfs_record_dirty(), take the
402 mapping->private_lock around the dirtying of the buffer heads
403 analagous to the way it is done in __set_page_dirty_buffers().
404 - Ensure the mft record size does not exceed the PAGE_CACHE_SIZE at
405 mount time as this cannot work with the current implementation.
406 - Check for location of attribute name and improve error handling in
407 general in fs/ntfs/inode.c::ntfs_read_locked_inode() and friends.
408 - In fs/ntfs/aops.c::ntfs_writepage(), if the page is fully outside
409 i_size, i.e. race with truncate, invalidate the buffers on the page
410 so that they become freeable and hence the page does not leak.
411 - Remove unused function fs/ntfs/runlist.c::ntfs_rl_merge(). (Adrian
412 Bunk)
413 - Fix stupid bug in fs/ntfs/attrib.c::ntfs_attr_find() that resulted in
414 a NULL pointer dereference in the error code path when a corrupt
415 attribute was found. (Thanks to Domen Puncer for the bug report.)
416 - Add MODULE_VERSION() to fs/ntfs/super.c.
417 - Make several functions and variables static. (Adrian Bunk)
418 - Modify fs/ntfs/aops.c::mark_ntfs_record_dirty() so it allocates
419 buffers for the page if they are not present and then marks the
420 buffers belonging to the ntfs record dirty. This causes the buffers
421 to become busy and hence they are safe from removal until the page
422 has been written out.
423 - Fix stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find() in the
424 error handling code path that resulted in a BUG() due to trying to
425 unmap an extent mft record when the mapping of it had failed and it
426 thus was not mapped. (Thanks to Ken MacFerrin for the bug report.)
427 - Drop the runlist lock after the vcn has been read in
428 fs/ntfs/lcnalloc.c::__ntfs_cluster_free().
429 - Rewrite handling of multi sector transfer errors. We now do not set
430 PageError() when such errors are detected in the async i/o handler
431 fs/ntfs/aops.c::ntfs_end_buffer_async_read(). All users of mst
432 protected attributes now check the magic of each ntfs record as they
433 use it and act appropriately. This has the effect of making errors
434 granular per ntfs record rather than per page which solves the case
435 where we cannot access any of the ntfs records in a page when a
436 single one of them had an mst error. (Thanks to Ken MacFerrin for
437 the bug report.)
438 - Fix error handling in fs/ntfs/quota.c::ntfs_mark_quotas_out_of_date()
439 where we failed to release i_mutex on the $Quota/$Q attribute inode.
440 - Fix bug in handling of bad inodes in fs/ntfs/namei.c::ntfs_lookup().
441 - Add mapping of unmapped buffers to all remaining code paths, i.e.
442 fs/ntfs/aops.c::ntfs_write_mst_block(), mft.c::ntfs_sync_mft_mirror(),
443 and write_mft_record_nolock(). From now on we require that the
444 complete runlist for the mft mirror is always mapped into memory.
445 - Add creation of buffers to fs/ntfs/mft.c::ntfs_sync_mft_mirror().
446 - Improve error handling in fs/ntfs/aops.c::ntfs_{read,write}_block().
447 - Cleanup fs/ntfs/aops.c::ntfs_{read,write}page() since we know that a
448 resident attribute will be smaller than a page which makes the code
449 simpler. Also make the code more tolerant to concurrent ->truncate.
450
4512.1.21 - Fix some races and bugs, rewrite mft write code, add mft allocator.
452
453 - Implement extent mft record deallocation
454 fs/ntfs/mft.c::ntfs_extent_mft_record_free().
455 - Splitt runlist related functions off from attrib.[hc] to runlist.[hc].
456 - Add vol->mft_data_pos and initialize it at mount time.
457 - Rename init_runlist() to ntfs_init_runlist(), ntfs_vcn_to_lcn() to
458 ntfs_rl_vcn_to_lcn(), decompress_mapping_pairs() to
459 ntfs_mapping_pairs_decompress(), ntfs_merge_runlists() to
460 ntfs_runlists_merge() and adapt all callers.
461 - Add fs/ntfs/runlist.[hc]::ntfs_get_nr_significant_bytes(),
462 ntfs_get_size_for_mapping_pairs(), ntfs_write_significant_bytes(),
463 and ntfs_mapping_pairs_build(), adapted from libntfs.
464 - Make fs/ntfs/lcnalloc.c::ntfs_cluster_free_from_rl_nolock() not
465 static and add a declaration for it to lcnalloc.h.
466 - Add fs/ntfs/lcnalloc.h::ntfs_cluster_free_from_rl() which is a static
467 inline wrapper for ntfs_cluster_free_from_rl_nolock() which takes the
468 cluster bitmap lock for the duration of the call.
469 - Add fs/ntfs/attrib.[hc]::ntfs_attr_record_resize().
470 - Implement the equivalent of memset() for an ntfs attribute in
471 fs/ntfs/attrib.[hc]::ntfs_attr_set() and switch
472 fs/ntfs/logfile.c::ntfs_empty_logfile() to using it.
473 - Remove unnecessary casts from LCN_* constants.
474 - Implement fs/ntfs/runlist.c::ntfs_rl_truncate_nolock().
475 - Add MFT_RECORD_OLD as a copy of MFT_RECORD in fs/ntfs/layout.h and
476 change MFT_RECORD to contain the NTFS 3.1+ specific fields.
477 - Add a helper function fs/ntfs/aops.c::mark_ntfs_record_dirty() which
478 marks all buffers belonging to an ntfs record dirty, followed by
479 marking the page the ntfs record is in dirty and also marking the vfs
480 inode containing the ntfs record dirty (I_DIRTY_PAGES).
481 - Switch fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to using the
482 new helper fs/ntfs/aops.c::mark_ntfs_record_dirty() and remove the no
483 longer needed fs/ntfs/index.[hc]::__ntfs_index_entry_mark_dirty().
484 - Move ntfs_{un,}map_page() from ntfs.h to aops.h and fix resulting
485 include errors.
486 - Move the typedefs for runlist_element and runlist from types.h to
487 runlist.h and fix resulting include errors.
488 - Remove unused {__,}format_mft_record() from fs/ntfs/mft.c.
489 - Modify fs/ntfs/mft.c::__mark_mft_record_dirty() to use the helper
490 mark_ntfs_record_dirty() which also changes the behaviour in that we
491 now set the buffers belonging to the mft record dirty as well as the
492 page itself.
493 - Update fs/ntfs/mft.c::write_mft_record_nolock() and sync_mft_mirror()
494 to cope with the fact that there now are dirty buffers in mft pages.
495 - Update fs/ntfs/inode.c::ntfs_write_inode() to also use the helper
496 mark_ntfs_record_dirty() and thus to set the buffers belonging to the
497 mft record dirty as well as the page itself.
498 - Fix compiler warnings on x86-64 in fs/ntfs/dir.c. (Randy Dunlap,
499 slightly modified by me)
500 - Add fs/ntfs/mft.c::try_map_mft_record() which fails with -EALREADY if
501 the mft record is already locked and otherwise behaves the same way
502 as fs/ntfs/mft.c::map_mft_record().
503 - Modify fs/ntfs/mft.c::write_mft_record_nolock() so that it only
504 writes the mft record if the buffers belonging to it are dirty.
505 Otherwise we assume that it was written out by other means already.
506 - Attempting to write outside initialized size is _not_ a bug so remove
507 the bug check from fs/ntfs/aops.c::ntfs_write_mst_block(). It is in
508 fact required to write outside initialized size when preparing to
509 extend the initialized size.
510 - Map the page instead of using page_address() before writing to it in
511 fs/ntfs/aops.c::ntfs_mft_writepage().
512 - Provide exclusion between opening an inode / mapping an mft record
513 and accessing the mft record in fs/ntfs/mft.c::ntfs_mft_writepage()
514 by setting the page not uptodate throughout ntfs_mft_writepage().
515 - Clear the page uptodate flag in fs/ntfs/aops.c::ntfs_write_mst_block()
516 to ensure noone can see the page whilst the mst fixups are applied.
517 - Add the helper fs/ntfs/mft.c::ntfs_may_write_mft_record() which
518 checks if an mft record may be written out safely obtaining any
519 necessary locks in the process. This is used by
520 fs/ntfs/aops.c::ntfs_write_mst_block().
521 - Modify fs/ntfs/aops.c::ntfs_write_mst_block() to also work for
522 writing mft records and improve its error handling in the process.
523 Now if any of the records in the page fail to be written out, all
524 other records will be written out instead of aborting completely.
525 - Remove ntfs_mft_aops and update all users to use ntfs_mst_aops.
526 - Modify fs/ntfs/inode.c::ntfs_read_locked_inode() to set the
527 ntfs_mst_aops for all inodes which are NInoMstProtected() and
528 ntfs_aops for all other inodes.
529 - Rename fs/ntfs/mft.c::sync_mft_mirror{,_umount}() to
530 ntfs_sync_mft_mirror{,_umount}() and change their parameters so they
531 no longer require an ntfs inode to be present. Update all callers.
532 - Cleanup the error handling in fs/ntfs/mft.c::ntfs_sync_mft_mirror().
533 - Clear the page uptodate flag in fs/ntfs/mft.c::ntfs_sync_mft_mirror()
534 to ensure noone can see the page whilst the mst fixups are applied.
535 - Remove the no longer needed fs/ntfs/mft.c::ntfs_mft_writepage() and
536 fs/ntfs/mft.c::try_map_mft_record().
537 - Fix callers of fs/ntfs/aops.c::mark_ntfs_record_dirty() to call it
538 with the ntfs inode which contains the page rather than the ntfs
539 inode the mft record of which is in the page.
540 - Fix race condition in fs/ntfs/inode.c::ntfs_put_inode() by moving the
541 index inode bitmap inode release code from there to
542 fs/ntfs/inode.c::ntfs_clear_big_inode(). (Thanks to Christoph
543 Hellwig for spotting this.)
544 - Fix race condition in fs/ntfs/inode.c::ntfs_put_inode() by taking the
545 inode semaphore around the code that sets ni->itype.index.bmp_ino to
546 NULL and reorganize the code to optimize it a bit. (Thanks to
547 Christoph Hellwig for spotting this.)
548 - Modify fs/ntfs/aops.c::mark_ntfs_record_dirty() to no longer take the
549 ntfs inode as a parameter as this is confusing and misleading and the
550 needed ntfs inode is available via NTFS_I(page->mapping->host).
551 Adapt all callers to this change.
552 - Modify fs/ntfs/mft.c::write_mft_record_nolock() and
553 fs/ntfs/aops.c::ntfs_write_mst_block() to only check the dirty state
554 of the first buffer in a record and to take this as the ntfs record
555 dirty state. We cannot look at the dirty state for subsequent
556 buffers because we might be racing with
557 fs/ntfs/aops.c::mark_ntfs_record_dirty().
558 - Move the static inline ntfs_init_big_inode() from fs/ntfs/inode.c to
559 inode.h and make fs/ntfs/inode.c::__ntfs_init_inode() non-static and
560 add a declaration for it to inode.h. Fix some compilation issues
561 that resulted due to #includes and header file interdependencies.
562 - Simplify setup of i_mode in fs/ntfs/inode.c::ntfs_read_locked_inode().
563 - Add helpers fs/ntfs/layout.h::MK_MREF() and MK_LE_MREF().
564 - Modify fs/ntfs/mft.c::map_extent_mft_record() to only verify the mft
565 record sequence number if it is specified (i.e. not zero).
566 - Add fs/ntfs/mft.[hc]::ntfs_mft_record_alloc() and various helper
567 functions used by it.
568 - Update Documentation/filesystems/ntfs.txt with instructions on how to
569 use the Device-Mapper driver with NTFS ftdisk/LDM raid. This removes
570 the linear raid problem with the Software RAID / MD driver when one
571 or more of the devices has an odd number of sectors.
572
5732.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
574
575 - Fix stupid bug in fs/ntfs/attrib.c::ntfs_attr_reinit_search_ctx()
576 where we did not clear ctx->al_entry but it was still set due to
577 changes in ntfs_attr_lookup() and ntfs_external_attr_find() in
578 particular.
579 - Fix another stupid bug in fs/ntfs/attrib.c::ntfs_external_attr_find()
580 where we forgot to unmap the extent mft record when we had finished
581 enumerating an attribute which caused a bug check to trigger when the
582 VFS calls ->clear_inode.
583
5842.1.19 - Many cleanups, improvements, and a minor bug fix.
585
586 - Update ->setattr (fs/ntfs/inode.c::ntfs_setattr()) to refuse to
587 change the uid, gid, and mode of an inode as we do not support NTFS
588 ACLs yet.
589 - Remove BKL use from ntfs_setattr() syncing up with the rest of the
590 kernel.
591 - Get rid of the ugly transparent union in fs/ntfs/dir.c::ntfs_readdir()
592 and ntfs_filldir() as per suggestion from Al Viro.
593 - Change '\0' and L'\0' to simply 0 as per advice from Linus Torvalds.
594 - Update ->truncate (fs/ntfs/inode.c::ntfs_truncate()) to check if the
595 inode size has changed and to only output an error if so.
596 - Rename fs/ntfs/attrib.h::attribute_value_length() to ntfs_attr_size().
597 - Add le{16,32,64} as well as sle{16,32,64} data types to
598 fs/ntfs/types.h.
599 - Change ntfschar to be le16 instead of u16 in fs/ntfs/types.h.
600 - Add le versions of VCN, LCN, and LSN called leVCN, leLCN, and leLSN,
601 respectively, to fs/ntfs/types.h.
602 - Update endianness conversion macros in fs/ntfs/endian.h to use the
603 new types as appropriate.
604 - Do proper type casting when using sle64_to_cpup() in fs/ntfs/dir.c
605 and index.c.
606 - Add leMFT_REF data type to fs/ntfs/layout.h.
607 - Update all NTFS header files with the new little endian data types.
608 Affected files are fs/ntfs/layout.h, logfile.h, and time.h.
609 - Do proper type casting when using ntfs_is_*_recordp() in
610 fs/ntfs/logfile.c, mft.c, and super.c.
611 - Fix all the sparse bitwise warnings. Had to change all the typedef
612 enums storing little endian values to simple enums plus a typedef for
613 the datatype to make sparse happy.
614 - Fix a bug found by the new sparse bitwise warnings where the default
615 upcase table was defined as a pointer to wchar_t rather than ntfschar
616 in fs/ntfs/ntfs.h and super.c.
617 - Change {const_,}cpu_to_le{16,32}(0) to just 0 as suggested by Al Viro.
618
6192.1.18 - Fix scheduling latencies at mount time as well as an endianness bug.
620
621 - Remove vol->nr_mft_records as it was pretty meaningless and optimize
622 the calculation of total/free inodes as used by statfs().
623 - Fix scheduling latencies in ntfs_fill_super() by dropping the BKL
624 because the code itself is using the ntfs_lock semaphore which
625 provides safe locking. (Ingo Molnar)
626 - Fix a potential bug in fs/ntfs/mft.c::map_extent_mft_record() that
627 could occur in the future for when we start closing/freeing extent
628 inodes if we don't set base_ni->ext.extent_ntfs_inos to NULL after
629 we free it.
630 - Rename {find,lookup}_attr() to ntfs_attr_{find,lookup}() as well as
631 find_external_attr() to ntfs_external_attr_find() to cleanup the
632 namespace a bit and to be more consistent with libntfs.
633 - Rename {{re,}init,get,put}_attr_search_ctx() to
634 ntfs_attr_{{re,}init,get,put}_search_ctx() as well as the type
635 attr_search_context to ntfs_attr_search_ctx.
636 - Force use of ntfs_attr_find() in ntfs_attr_lookup() when searching
637 for the attribute list attribute itself.
638 - Fix endianness bug in ntfs_external_attr_find().
639 - Change ntfs_{external_,}attr_find() to return 0 on success, -ENOENT
640 if the attribute is not found, and -EIO on real error. In the case
641 of -ENOENT, the search context is updated to describe the attribute
642 before which the attribute being searched for would need to be
643 inserted if such an action were to be desired and in the case of
644 ntfs_external_attr_find() the search context is also updated to
645 indicate the attribute list entry before which the attribute list
646 entry of the attribute being searched for would need to be inserted
647 if such an action were to be desired. Also make ntfs_find_attr()
648 static and remove its prototype from attrib.h as it is not used
649 anywhere other than attrib.c. Update ntfs_attr_lookup() and all
650 callers of ntfs_{external,}attr_{find,lookup}() for the new return
651 values.
652 - Minor cleanup of fs/ntfs/inode.c::ntfs_init_locked_inode().
653
6542.1.17 - Fix bugs in mount time error code paths and other updates.
655
656 - Implement bitmap modification code (fs/ntfs/bitmap.[hc]). This
657 includes functions to set/clear a single bit or a run of bits.
658 - Add fs/ntfs/attrib.[hc]::ntfs_find_vcn() which returns the locked
659 runlist element containing a particular vcn. It also takes care of
660 mapping any needed runlist fragments.
661 - Implement cluster (de-)allocation code (fs/ntfs/lcnalloc.[hc]).
662 - Load attribute definition table from $AttrDef at mount time.
663 - Fix bugs in mount time error code paths involving (de)allocation of
664 the default and volume upcase tables.
665 - Remove ntfs_nr_mounts as it is no longer used.
666
6672.1.16 - Implement access time updates, file sync, async io, and read/writev.
668
669 - Add support for readv/writev and aio_read/aio_write (fs/ntfs/file.c).
670 This is done by setting the appropriate file operations pointers to
671 the generic helper functions provided by mm/filemap.c.
672 - Implement fsync, fdatasync, and msync both for files (fs/ntfs/file.c)
673 and directories (fs/ntfs/dir.c).
674 - Add support for {a,m,c}time updates to inode.c::ntfs_write_inode().
675 Note, except for the root directory and any other system files opened
676 by the user, the system files will not have their access times
677 updated as they are only accessed at the inode level an hence the
678 file level functions which cause the times to be updated are never
679 invoked.
680
6812.1.15 - Invalidate quotas when (re)mounting read-write.
682
683 - Add new element itype.index.collation_rule to the ntfs inode
684 structure and set it appropriately in ntfs_read_locked_inode().
685 - Implement a new inode type "index" to allow efficient access to the
686 indices found in various system files and adapt inode handling
687 accordingly (fs/ntfs/inode.[hc]). An index inode is essentially an
688 attribute inode (NInoAttr() is true) with an attribute type of
689 AT_INDEX_ALLOCATION. As such, it is no longer allowed to call
690 ntfs_attr_iget() with an attribute type of AT_INDEX_ALLOCATION as
691 there would be no way to distinguish between normal attribute inodes
692 and index inodes. The function to obtain an index inode is
693 ntfs_index_iget() and it uses the helper function
694 ntfs_read_locked_index_inode(). Note, we do not overload
695 ntfs_attr_iget() as indices consist of multiple attributes so using
696 ntfs_attr_iget() to obtain an index inode would be confusing.
697 - Ensure that there is no overflow when doing page->index <<
698 PAGE_CACHE_SHIFT by casting page->index to s64 in fs/ntfs/aops.c.
699 - Use atomic kmap instead of kmap() in fs/ntfs/aops.c::ntfs_read_page()
700 and ntfs_read_block().
701 - Use case sensitive attribute lookups instead of case insensitive ones.
702 - Lock all page cache pages belonging to mst protected attributes while
703 accessing them to ensure we never see corrupt data while the page is
704 under writeout.
705 - Add framework for generic ntfs collation (fs/ntfs/collation.[hc]).
706 We have ntfs_is_collation_rule_supported() to check if the collation
707 rule you want to use is supported and ntfs_collation() which actually
708 collates two data items. We currently only support COLLATION_BINARY
709 and COLLATION_NTOFS_ULONG but support for other collation rules will
710 be added as the need arises.
711 - Add a new type, ntfs_index_context, to allow retrieval of an index
712 entry using the corresponding index key. To get an index context,
713 use ntfs_index_ctx_get() and to release it, use ntfs_index_ctx_put().
714 This also adds a new slab cache for the index contexts. To lookup a
715 key in an index inode, use ntfs_index_lookup(). After modifying an
716 index entry, call ntfs_index_entry_flush_dcache_page() followed by
717 ntfs_index_entry_mark_dirty() to ensure the changes are written out
718 to disk. For details see fs/ntfs/index.[hc]. Note, at present, if
719 an index entry is in the index allocation attribute rather than the
720 index root attribute it will not be written out (you will get a
721 warning message about discarded changes instead).
722 - Load the quota file ($Quota) and check if quota tracking is enabled
723 and if so, mark the quotas out of date. This causes windows to
724 rescan the volume on boot and update all quota entries.
725 - Add a set_page_dirty address space operation for ntfs_m[fs]t_aops.
726 It is simply set to __set_page_dirty_nobuffers() to make sure that
727 running set_page_dirty() on a page containing mft/ntfs records will
728 not affect the dirty state of the page buffers.
729 - Add fs/ntfs/index.c::__ntfs_index_entry_mark_dirty() which sets all
730 buffers that are inside the ntfs record in the page dirty after which
731 it sets the page dirty. This allows ->writepage to only write the
732 dirty index records rather than having to write all the records in
733 the page. Modify fs/ntfs/index.h::ntfs_index_entry_mark_dirty() to
734 use this rather than __set_page_dirty_nobuffers().
735 - Implement fs/ntfs/aops.c::ntfs_write_mst_block() which enables the
736 writing of page cache pages belonging to mst protected attributes
737 like the index allocation attribute in directory indices and other
738 indices like $Quota/$Q, etc. This means that the quota is now marked
739 out of date on all volumes rather than only on ones where the quota
740 defaults entry is in the index root attribute of the $Quota/$Q index.
741
7422.1.14 - Fix an NFSd caused deadlock reported by several users.
743
744 - Modify fs/ntfs/ntfs_readdir() to copy the index root attribute value
745 to a buffer so that we can put the search context and unmap the mft
746 record before calling the filldir() callback. We need to do this
747 because of NFSd which calls ->lookup() from its filldir callback()
748 and this causes NTFS to deadlock as ntfs_lookup() maps the mft record
749 of the directory and since ntfs_readdir() has got it mapped already
750 ntfs_lookup() deadlocks.
751
7522.1.13 - Enable overwriting of resident files and housekeeping of system files.
753
754 - Implement writing of mft records (fs/ntfs/mft.[hc]), which includes
755 keeping the mft mirror in sync with the mft when mirrored mft records
756 are written. The functions are write_mft_record{,_nolock}(). The
757 implementation is quite rudimentary for now with lots of things not
758 implemented yet but I am not sure any of them can actually occur so
759 I will wait for people to hit each one and only then implement it.
760 - Commit open system inodes at umount time. This should make it
761 virtually impossible for sync_mft_mirror_umount() to ever be needed.
762 - Implement ->write_inode (fs/ntfs/inode.c::ntfs_write_inode()) for the
763 ntfs super operations. This gives us inode writing via the VFS inode
764 dirty code paths. Note: Access time updates are not implemented yet.
765 - Implement fs/ntfs/mft.[hc]::{,__}mark_mft_record_dirty() and make
766 fs/ntfs/aops.c::ntfs_writepage() and ntfs_commit_write() use it, thus
767 finally enabling resident file overwrite! (-8 This also includes a
768 placeholder for ->writepage (ntfs_mft_writepage()), which for now
769 just redirties the page and returns. Also, at umount time, we for
770 now throw away all mft data page cache pages after the last call to
771 ntfs_commit_inode() in the hope that all inodes will have been
772 written out by then and hence no dirty (meta)data will be lost. We
773 also check for this case and emit an error message telling the user
774 to run chkdsk.
775 - Use set_page_writeback() and end_page_writeback() in the resident
776 attribute code path of fs/ntfs/aops.c::ntfs_writepage() otherwise
777 the radix-tree tag PAGECACHE_TAG_DIRTY remains set even though the
778 page is clean.
779 - Implement ntfs_mft_writepage() so it now checks if any of the mft
780 records in the page are dirty and if so redirties the page and
781 returns. Otherwise it just returns (after doing set_page_writeback(),
782 unlock_page(), end_page_writeback() or the radix-tree tag
783 PAGECACHE_TAG_DIRTY remains set even though the page is clean), thus
784 alowing the VM to do with the page as it pleases. Also, at umount
785 time, now only throw away dirty mft (meta)data pages if dirty inodes
786 are present and ask the user to email us if they see this happening.
787 - Add functions ntfs_{clear,set}_volume_flags(), to modify the volume
788 information flags (fs/ntfs/super.c).
789 - Mark the volume dirty when (re)mounting read-write and mark it clean
790 when unmounting or remounting read-only. If any volume errors are
791 found, the volume is left marked dirty to force chkdsk to run.
792 - Add code to set the NT4 compatibility flag when (re)mounting
793 read-write for newer NTFS versions but leave it commented out for now
794 since we do not make any modifications that are NTFS 1.2 specific yet
795 and since setting this flag breaks Captive-NTFS which is not nice.
796 This code must be enabled once we start writing NTFS 1.2 specific
797 changes otherwise Windows NTFS driver might crash / cause corruption.
798
7992.1.12 - Fix the second fix to the decompression engine and some cleanups.
800
801 - Add a new address space operations struct, ntfs_mst_aops, for mst
802 protected attributes. This is because the default ntfs_aops do not
803 make sense with mst protected data and were they to write anything to
804 such an attribute they would cause data corruption so we provide
805 ntfs_mst_aops which does not have any write related operations set.
806 - Cleanup dirty ntfs inode handling (fs/ntfs/inode.[hc]) which also
807 includes an adapted ntfs_commit_inode() and an implementation of
808 ntfs_write_inode() which for now just cleans dirty inodes without
809 writing them (it does emit a warning that this is happening).
810 - Undo the second decompression engine fix (see 2.1.9 release ChangeLog
811 entry) as it was only fixing a theoretical bug but at the same time
812 it badly broke the handling of sparse and uncompressed compression
813 blocks.
814
8152.1.11 - Driver internal cleanups.
816
817 - Only build logfile.o if building the driver with read-write support.
818 - Really final white space cleanups.
819 - Use generic_ffs() instead of ffs() in logfile.c which allows the
820 log_page_size variable to be optimized by gcc into a constant.
821 - Rename uchar_t to ntfschar everywhere as uchar_t is unsigned 1-byte
822 char as defined by POSIX and as found on some systems.
823
8242.1.10 - Force read-only (re)mounting of volumes with unsupported volume flags.
825
826 - Finish off the white space cleanups (remove trailing spaces, etc).
827 - Clean up ntfs_fill_super() and ntfs_read_inode_mount() by removing
828 the kludges around the first iget(). Instead of (re)setting ->s_op
829 we have the $MFT inode set up by explicit new_inode() / set ->i_ino /
830 insert_inode_hash() / call ntfs_read_inode_mount() directly. This
831 kills the need for second super_operations and allows to return error
832 from ntfs_read_inode_mount() without resorting to ugly "poisoning"
833 tricks. (Al Viro)
834 - Force read-only (re)mounting if any of the following bits are set in
835 the volume information flags:
836 VOLUME_IS_DIRTY, VOLUME_RESIZE_LOG_FILE,
837 VOLUME_UPGRADE_ON_MOUNT, VOLUME_DELETE_USN_UNDERWAY,
838 VOLUME_REPAIR_OBJECT_ID, VOLUME_MODIFIED_BY_CHKDSK
839 To make this easier we define VOLUME_MUST_MOUNT_RO_MASK with all the
840 above bits set so the test is made easy.
841
8422.1.9 - Fix two bugs in decompression engine.
843
844 - Fix a bug where we would not always detect that we have reached the
845 end of a compression block because we were ending at minus one byte
846 which is effectively the same as being at the end. The fix is to
847 check whether the uncompressed buffer has been fully filled and if so
848 we assume we have reached the end of the compression block. A big
849 thank you to Marcin Gibuła for the bug report, the assistance in
850 tracking down the bug and testing the fix.
851 - Fix a possible bug where when a compressed read is truncated to the
852 end of the file, the offset inside the last page was not truncated.
853
8542.1.8 - Handle $MFT mirror and $LogFile, improve time handling, and cleanups.
855
856 - Use get_bh() instead of manual atomic_inc() in fs/ntfs/compress.c.
857 - Modify fs/ntfs/time.c::ntfs2utc(), get_current_ntfs_time(), and
858 utc2ntfs() to work with struct timespec instead of time_t on the
859 Linux UTC time side thus preserving the full precision of the NTFS
860 time and only loosing up to 99 nano-seconds in the Linux UTC time.
861 - Move fs/ntfs/time.c to fs/ntfs/time.h and make the time functions
862 static inline.
863 - Remove unused ntfs_dirty_inode().
864 - Cleanup super operations declaration in fs/ntfs/super.c.
865 - Wrap flush_dcache_mft_record_page() in #ifdef NTFS_RW.
866 - Add NInoTestSetFoo() and NInoTestClearFoo() macro magic to
867 fs/ntfs/inode.h and use it to declare NInoTest{Set,Clear}Dirty.
868 - Move typedefs for ntfs_attr and test_t from fs/ntfs/inode.c to
869 fs/ntfs/inode.h so they can be used elsewhere.
870 - Determine the mft mirror size as the number of mirrored mft records
871 and store it in ntfs_volume->mftmirr_size (fs/ntfs/super.c).
872 - Load the mft mirror at mount time and compare the mft records stored
873 in it to the ones in the mft. Force a read-only mount if the two do
874 not match (fs/ntfs/super.c).
875 - Fix type casting related warnings on 64-bit architectures. Thanks
876 to Meelis Roos for reporting them.
877 - Move %L to %ll as %L is floating point and %ll is integer which is
878 what we want.
879 - Read the journal ($LogFile) and determine if the volume has been
880 shutdown cleanly and force a read-only mount if not (fs/ntfs/super.c
881 and fs/ntfs/logfile.c). This is a little bit of a crude check in
882 that we only look at the restart areas and not at the actual log
883 records so that there will be a very small number of cases where we
884 think that a volume is dirty when in fact it is clean. This should
885 only affect volumes that have not been shutdown cleanly and did not
886 have any pending, non-check-pointed i/o.
887 - If the $LogFile indicates a clean shutdown and a read-write (re)mount
888 is requested, empty $LogFile by overwriting it with 0xff bytes to
889 ensure that Windows cannot cause data corruption by replaying a stale
890 journal after Linux has written to the volume.
891
8922.1.7 - Enable NFS exporting of mounted NTFS volumes.
893
894 - Set i_generation in the VFS inode from the seq_no of the NTFS inode.
895 - Make ntfs_lookup() NFS export safe, i.e. use d_splice_alias(), etc.
896 - Implement ->get_dentry() in fs/ntfs/namei.c::ntfs_get_dentry() as the
897 default doesn't allow inode number 0 which is a valid inode on NTFS
898 and even if it did allow that it uses iget() instead of ntfs_iget()
899 which makes it useless for us.
900 - Implement ->get_parent() in fs/ntfs/namei.c::ntfs_get_parent() as the
901 default just returns -EACCES which is not very useful.
902 - Define export operations (->s_export_op) for NTFS (ntfs_export_ops)
903 and set them up in the super block at mount time (super.c) this
904 allows mounted NTFS volumes to be exported via NFS.
905 - Add missing return -EOPNOTSUPP; in
906 fs/ntfs/aops.c::ntfs_commit_nonresident_write().
907 - Enforce no atime and no dir atime updates at mount/remount time as
908 they are not implemented yet anyway.
909 - Move a few assignments in fs/ntfs/attrib.c::load_attribute_list() to
910 after a NULL check. Thanks to Dave Jones for pointing this out.
911
9122.1.6 - Fix minor bug in handling of compressed directories.
913
914 - Fix bug in handling of compressed directories. A compressed
915 directory is not really compressed so when we set the ->i_blocks
916 field of a compressed directory inode we were setting it from the
917 non-existing field ni->itype.compressed.size which gave random
918 results... For directories we now always use ni->allocated_size.
919
9202.1.5 - Fix minor bug in attribute list attribute handling.
921
922 - Fix bug in attribute list handling. Actually it is not as much a bug
923 as too much protection in that we were not allowing attribute lists
924 which waste space on disk while Windows XP clearly allows it and in
925 fact creates such attribute lists so our driver was failing.
926 - Update NTFS documentation ready for 2.6 kernel release.
927
9282.1.4 - Reduce compiler requirements.
929
930 - Remove all uses of unnamed structs and unions in the driver to make
931 old and newer gcc versions happy. Makes it a bit uglier IMO but at
932 least people will stop hassling me about it.
933
9342.1.3 - Important bug fixes in corner cases.
935
936 - super.c::parse_ntfs_boot_sector(): Correct the check for 64-bit
937 clusters. (Philipp Thomas)
938 - attrib.c::load_attribute_list(): Fix bug when initialized_size is a
939 multiple of the block_size but not the cluster size. (Szabolcs
940 Szakacsits)
941
9422.1.2 - Important bug fixes aleviating the hangs in statfs.
943
944 - Fix buggy free cluster and free inode determination logic.
945
9462.1.1 - Minor updates.
947
948 - Add handling for initialized_size != data_size in compressed files.
949 - Reduce function local stack usage from 0x3d4 bytes to just noise in
950 fs/ntfs/upcase.c. (Randy Dunlap)
951 - Remove compiler warnings for newer gcc.
952 - Pages are no longer kmapped by mm/filemap.c::generic_file_write()
953 around calls to ->{prepare,commit}_write. Adapt NTFS appropriately
954 in fs/ntfs/aops.c::ntfs_prepare_nonresident_write() by using
955 kmap_atomic(KM_USER0).
956
9572.1.0 - First steps towards write support: implement file overwrite.
958
959 - Add configuration option for developmental write support with an
960 appropriately scary configuration help text.
961 - Initial implementation of fs/ntfs/aops.c::ntfs_writepage() and its
962 helper fs/ntfs/aops.c::ntfs_write_block(). This enables mmap(2) based
963 overwriting of existing files on ntfs. Note: Resident files are
964 only written into memory, and not written out to disk at present, so
965 avoid writing to files smaller than about 1kiB.
966 - Initial implementation of fs/ntfs/aops.c::ntfs_prepare_write(), its
967 helper fs/ntfs/aops.c::ntfs_prepare_nonresident_write() and their
968 counterparts, fs/ntfs/aops.c::ntfs_commit_write(), and
969 fs/ntfs/aops.c::ntfs_commit_nonresident_write(), respectively. Also,
970 add generic_file_write() to the ntfs file operations (fs/ntfs/file.c).
971 This enables write(2) based overwriting of existing files on ntfs.
972 Note: As with mmap(2) based overwriting, resident files are only
973 written into memory, and not written out to disk at present, so avoid
974 writing to files smaller than about 1kiB.
975 - Implement ->truncate (fs/ntfs/inode.c::ntfs_truncate()) and
976 ->setattr() (fs/ntfs/inode.c::ntfs_setattr()) inode operations for
977 files with the purpose of intercepting and aborting all i_size
978 changes which we do not support yet. ntfs_truncate() actually only
979 emits a warning message but AFAICS our interception of i_size changes
980 elsewhere means ntfs_truncate() never gets called for i_size changes.
981 It is only called from generic_file_write() when we fail in
982 ntfs_prepare_{,nonresident_}write() in order to discard any
983 instantiated buffers beyond i_size. Thus i_size is not actually
984 changed so our warning message is enough. Unfortunately it is not
985 possible to easily determine if i_size is being changed or not hence
986 we just emit an appropriately worded error message.
987
9882.0.25 - Small bug fixes and cleanups.
989
990 - Unlock the page in an out of memory error code path in
991 fs/ntfs/aops.c::ntfs_read_block().
992 - If fs/ntfs/aops.c::ntfs_read_page() is called on an uptodate page,
993 just unlock the page and return. (This can happen due to ->writepage
994 clearing PageUptodate() during write out of MstProtected()
995 attributes.
996 - Remove leaked write code again.
997
9982.0.24 - Cleanups.
999
1000 - Treat BUG_ON() as ASSERT() not VERIFY(), i.e. do not use side effects
1001 inside BUG_ON(). (Adam J. Richter)
1002 - Split logical OR expressions inside BUG_ON() into individual BUG_ON()
1003 calls for improved debugging. (Adam J. Richter)
1004 - Add errors flag to the ntfs volume state, accessed via
1005 NVol{,Set,Clear}Errors(vol).
1006 - Do not allow read-write remounts of read-only volumes with errors.
1007 - Clarify comment for ntfs file operation sendfile which was added by
1008 Christoph Hellwig a while ago (just using generic_file_sendfile())
1009 to say that ntfs ->sendfile is only used for the case where the
1010 source data is on the ntfs partition and the destination is
1011 somewhere else, i.e. nothing we need to concern ourselves with.
1012 - Add generic_file_write() as our ntfs file write operation.
1013
10142.0.23 - Major bug fixes (races, deadlocks, non-i386 architectures).
1015
1016 - Massive internal locking changes to mft record locking. Fixes lock
1017 recursion and replaces the mrec_lock read/write semaphore with a
1018 mutex. Also removes the now superfluous mft_count. This fixes several
1019 race conditions and deadlocks, especially in the future write code.
1020 - Fix ntfs over loopback for compressed files by adding an
1021 optimization barrier. (gcc was screwing up otherwise ?)
1022 - Miscellaneous cleanups all over the code and a fix or two in error
1023 handling code paths.
1024 Thanks go to Christoph Hellwig for pointing out the following two:
1025 - Remove now unused function fs/ntfs/malloc.h::vmalloc_nofs().
1026 - Fix ntfs_free() for ia64 and parisc by checking for VMALLOC_END, too.
1027
10282.0.22 - Cleanups, mainly to ntfs_readdir(), and use C99 initializers.
1029
1030 - Change fs/ntfs/dir.c::ntfs_reddir() to only read/write ->f_pos once
1031 at entry/exit respectively.
1032 - Use C99 initializers for structures.
1033 - Remove unused variable blocks from fs/ntfs/aops.c::ntfs_read_block().
1034
10352.0.21 - Check for, and refuse to work with too large files/directories/volumes.
1036
1037 - Limit volume size at mount time to 2TiB on architectures where
1038 unsigned long is 32-bits (fs/ntfs/super.c::parse_ntfs_boot_sector()).
1039 This is the most we can do without overflowing the 32-bit limit of
1040 the block device size imposed on us by sb_bread() and sb_getblk()
1041 for the time being.
1042 - Limit file/directory size at open() time to 16TiB on architectures
1043 where unsigned long is 32-bits (fs/ntfs/file.c::ntfs_file_open() and
1044 fs/ntfs/dir.c::ntfs_dir_open()). This is the most we can do without
1045 overflowing the page cache page index.
1046
10472.0.20 - Support non-resident directory index bitmaps, fix page leak in readdir.
1048
1049 - Move the directory index bitmap to use an attribute inode instead of
1050 having special fields for it inside the ntfs inode structure. This
1051 means that the index bitmaps now use the page cache for i/o, too,
1052 and also as a side effect we get support for non-resident index
1053 bitmaps for free.
1054 - Simplify/cleanup error handling in fs/ntfs/dir.c::ntfs_readdir() and
1055 fix a page leak that manifested itself in some cases.
1056 - Add fs/ntfs/inode.c::ntfs_put_inode(), which we need to release the
1057 index bitmap inode on the final iput().
1058
10592.0.19 - Fix race condition, improvements, and optimizations in i/o interface.
1060
1061 - Apply block optimization added to fs/ntfs/aops.c::ntfs_read_block()
1062 to fs/ntfs/compress.c::ntfs_file_read_compressed_block() as well.
1063 - Drop the "file" from ntfs_file_read_compressed_block().
1064 - Rename fs/ntfs/aops.c::ntfs_enb_buffer_read_async() to
1065 ntfs_end_buffer_async_read() (more like the fs/buffer.c counterpart).
1066 - Update ntfs_end_buffer_async_read() with the improved logic from
1067 its updated counterpart fs/buffer.c::end_buffer_async_read(). Apply
1068 further logic improvements to better determine when we set PageError.
1069 - Update submission of buffers in fs/ntfs/aops.c::ntfs_read_block() to
1070 check for the buffers being uptodate first in line with the updated
1071 fs/buffer.c::block_read_full_page(). This plugs a small race
1072 condition.
1073
10742.0.18 - Fix race condition in reading of compressed files.
1075
1076 - There was a narrow window between checking a buffer head for being
1077 uptodate and locking it in ntfs_file_read_compressed_block(). We now
1078 lock the buffer and then check whether it is uptodate or not.
1079
10802.0.17 - Cleanups and optimizations - shrinking the ToDo list.
1081
1082 - Modify fs/ntfs/inode.c::ntfs_read_locked_inode() to return an error
1083 code and update callers, i.e. ntfs_iget(), to pass that error code
1084 up instead of just using -EIO.
1085 - Modifications to super.c to ensure that both mount and remount
1086 cannot set any write related options when the driver is compiled
1087 read-only.
1088 - Optimize block resolution in fs/ntfs/aops.c::ntfs_read_block() to
1089 cache the current runlist element. This should improve performance
1090 when reading very large and/or very fragmented data.
1091
10922.0.16 - Convert access to $MFT/$BITMAP to attribute inode API.
1093
1094 - Fix a stupid bug introduced in 2.0.15 where we were unmapping the
1095 wrong inode in fs/ntfs/inode.c::ntfs_attr_iget().
1096 - Fix debugging check in fs/ntfs/aops.c::ntfs_read_block().
1097 - Convert $MFT/$BITMAP access to attribute inode API and remove all
1098 remnants of the ugly mftbmp address space and operations hack. This
1099 means we finally have only one readpage function as well as only one
1100 async io completion handler. Yey! The mft bitmap is now just an
1101 attribute inode and is accessed from vol->mftbmp_ino just as if it
1102 were a normal file. Fake inodes rule. (-:
1103
11042.0.15 - Fake inodes based attribute i/o via the pagecache, fixes and cleanups.
1105
1106 - Fix silly bug in fs/ntfs/super.c::parse_options() which was causing
1107 remounts to fail when the partition had an entry in /etc/fstab and
1108 the entry specified the nls= option.
1109 - Apply same macro magic used in fs/ntfs/inode.h to fs/ntfs/volume.h to
1110 expand all the helper functions NVolFoo(), NVolSetFoo(), and
1111 NVolClearFoo().
1112 - Move copyright statement from driver initialisation message to
1113 module description (fs/super.c). This makes the initialisation
1114 message fit on one line and fits in better with rest of kernel.
1115 - Update fs/ntfs/attrib.c::map_run_list() to work on both real and
1116 attribute inodes, and both for files and directories.
1117 - Implement fake attribute inodes allowing all attribute i/o to go via
1118 the page cache and to use all the normal vfs/mm functionality:
1119 - Add ntfs_attr_iget() and its helper ntfs_read_locked_attr_inode()
1120 to fs/ntfs/inode.c.
1121 - Add needed cleanup code to ntfs_clear_big_inode().
1122 - Merge address space operations for files and directories (aops.c),
1123 now just have ntfs_aops:
1124 - Rename:
1125 end_buffer_read_attr_async() -> ntfs_end_buffer_read_async(),
1126 ntfs_attr_read_block() -> ntfs_read_block(),
1127 ntfs_file_read_page() -> ntfs_readpage().
1128 - Rewrite fs/ntfs/aops.c::ntfs_readpage() to work on both real and
1129 attribute inodes, and both for files and directories.
1130 - Remove obsolete fs/ntfs/aops.c::ntfs_mst_readpage().
1131
11322.0.14 - Run list merging code cleanup, minor locking changes, typo fixes.
1133
1134 - Change fs/ntfs/super.c::ntfs_statfs() to not rely on BKL by moving
1135 the locking out of super.c::get_nr_free_mft_records() and taking and
1136 dropping the mftbmp_lock rw_semaphore in ntfs_statfs() itself.
1137 - Bring attribute runlist merging code (fs/ntfs/attrib.c) in sync with
1138 current userspace ntfs library code. This means that if a merge
1139 fails the original runlists are always left unmodified instead of
1140 being silently corrupted.
1141 - Misc typo fixes.
1142
11432.0.13 - Use iget5_locked() in preparation for fake inodes and small cleanups.
1144
1145 - Remove nr_mft_bits and the now superfluous union with nr_mft_records
1146 from ntfs_volume structure.
1147 - Remove nr_lcn_bits and the now superfluous union with nr_clusters
1148 from ntfs_volume structure.
1149 - Use iget5_locked() and friends instead of conventional iget(). Wrap
1150 the call in fs/ntfs/inode.c::ntfs_iget() and update callers of iget()
1151 to use ntfs_iget(). Leave only one iget() call at mount time so we
1152 don't need an ntfs_iget_mount().
1153 - Change fs/ntfs/inode.c::ntfs_new_extent_inode() to take mft_no as an
1154 additional argument.
1155
11562.0.12 - Initial cleanup of address space operations following 2.0.11 changes.
1157
1158 - Merge fs/ntfs/aops.c::end_buffer_read_mst_async() and
1159 fs/ntfs/aops.c::end_buffer_read_file_async() into one function
1160 fs/ntfs/aops.c::end_buffer_read_attr_async() using NInoMstProtected()
1161 to determine whether to apply mst fixups or not.
1162 - Above change allows merging fs/ntfs/aops.c::ntfs_file_read_block()
1163 and fs/ntfs/aops.c::ntfs_mst_readpage() into one function
1164 fs/ntfs/aops.c::ntfs_attr_read_block(). Also, create a tiny wrapper
1165 fs/ntfs/aops.c::ntfs_mst_readpage() to transform the parameters from
1166 the VFS readpage function prototype to the ntfs_attr_read_block()
1167 function prototype.
1168
11692.0.11 - Initial preparations for fake inode based attribute i/o.
1170
1171 - Move definition of ntfs_inode_state_bits to fs/ntfs/inode.h and
1172 do some macro magic (adapted from include/linux/buffer_head.h) to
1173 expand all the helper functions NInoFoo(), NInoSetFoo(), and
1174 NInoClearFoo().
1175 - Add new flag to ntfs_inode_state_bits: NI_Sparse.
1176 - Add new fields to ntfs_inode structure to allow use of fake inodes
1177 for attribute i/o: type, name, name_len. Also add new state bits:
1178 NI_Attr, which, if set, indicates the inode is a fake inode, and
1179 NI_MstProtected, which, if set, indicates the attribute uses multi
1180 sector transfer protection, i.e. fixups need to be applied after
1181 reads and before/after writes.
1182 - Rename fs/ntfs/inode.c::ntfs_{new,clear,destroy}_inode() to
1183 ntfs_{new,clear,destroy}_extent_inode() and update callers.
1184 - Use ntfs_clear_extent_inode() in fs/ntfs/inode.c::__ntfs_clear_inode()
1185 instead of ntfs_destroy_extent_inode().
1186 - Cleanup memory deallocations in {__,}ntfs_clear_{,big_}inode().
1187 - Make all operations on ntfs inode state bits use the NIno* functions.
1188 - Set up the new ntfs inode fields and state bits in
1189 fs/ntfs/inode.c::ntfs_read_inode() and add appropriate cleanup of
1190 allocated memory to __ntfs_clear_inode().
1191 - Cleanup ntfs_inode structure a bit for better ordering of elements
1192 w.r.t. their size to allow better packing of the structure in memory.
1193
11942.0.10 - There can only be 2^32 - 1 inodes on an NTFS volume.
1195
1196 - Add check at mount time to verify that the number of inodes on the
1197 volume does not exceed 2^32 - 1, which is the maximum allowed for
1198 NTFS according to Microsoft.
1199 - Change mft_no member of ntfs_inode structure to be unsigned long.
1200 Update all users. This makes ntfs_inode->mft_no just a copy of struct
1201 inode->i_ino. But we can't just always use struct inode->i_ino and
1202 remove mft_no because extent inodes do not have an attached struct
1203 inode.
1204
12052.0.9 - Decompression engine now uses a single buffer and other cleanups.
1206
1207 - Change decompression engine to use a single buffer protected by a
1208 spin lock instead of per-CPU buffers. (Rusty Russell)
1209 - Do not update cb_pos when handling a partial final page during
1210 decompression of a sparse compression block, as the value is later
1211 reset without being read/used. (Rusty Russell)
1212 - Switch to using the new KM_BIO_SRC_IRQ for atomic kmap()s. (Andrew
1213 Morton)
1214 - Change buffer size in ntfs_readdir()/ntfs_filldir() to use
1215 NLS_MAX_CHARSET_SIZE which makes the buffers almost 1kiB each but
1216 it also makes everything safer so it is a good thing.
1217 - Miscellaneous minor cleanups to comments.
1218
12192.0.8 - Major updates for handling of case sensitivity and dcache aliasing.
1220
1221 Big thanks go to Al Viro and other inhabitants of #kernel for investing
1222 their time to discuss the case sensitivity and dcache aliasing issues.
1223
1224 - Remove unused source file fs/ntfs/attraops.c.
1225 - Remove show_inodes mount option(s), thus dropping support for
1226 displaying of short file names.
1227 - Remove deprecated mount option posix.
1228 - Restore show_sys_files mount option.
1229 - Add new mount option case_sensitive, to determine if the driver
1230 treats file names as case sensitive or not. If case sensitive, create
1231 file names in the POSIX namespace. Otherwise create file names in the
1232 LONG/WIN32 namespace. Note, files remain accessible via their short
1233 file name, if it exists.
1234 - Remove really dumb logic bug in boot sector recovery code.
1235 - Fix dcache aliasing issues wrt short/long file names via changes
1236 to fs/ntfs/dir.c::ntfs_lookup_inode_by_name() and
1237 fs/ntfs/namei.c::ntfs_lookup():
1238 - Add additional argument to ntfs_lookup_inode_by_name() in which we
1239 return information about the matching file name if the case is not
1240 matching or the match is a short file name. See comments above the
1241 function definition for details.
1242 - Change ntfs_lookup() to only create dcache entries for the correctly
1243 cased file name and only for the WIN32 namespace counterpart of DOS
1244 namespace file names. This ensures we have only one dentry per
1245 directory and also removes all dcache aliasing issues between short
1246 and long file names once we add write support. See comments above
1247 function for details.
1248 - Fix potential 1 byte overflow in fs/ntfs/unistr.c::ntfs_ucstonls().
1249
12502.0.7 - Minor cleanups and updates for changes in core kernel code.
1251
1252 - Remove much of the NULL struct element initializers.
1253 - Various updates to make compatible with recent kernels.
1254 - Remove defines of MAX_BUF_PER_PAGE and include linux/buffer_head.h
1255 in fs/ntfs/ntfs.h instead.
1256 - Remove no longer needed KERNEL_VERSION checks. We are now in the
1257 kernel proper so they are no longer needed.
1258
12592.0.6 - Major bugfix to make compatible with other kernel changes.
1260
1261 - Initialize the mftbmp address space properly now that there are more
1262 fields in the struct address_space. This was leading to hangs and
1263 oopses on umount since 2.5.12 because of changes to other parts of
1264 the kernel. We probably want a kernel generic init_address_space()
1265 function...
1266 - Drop BKL from ntfs_readdir() after consultation with Al Viro. The
1267 only caller of ->readdir() is vfs_readdir() which holds i_mutex
1268 during the call, and i_mutex is sufficient protection against changes
1269 in the directory inode (including ->i_size).
1270 - Use generic_file_llseek() for directories (as opposed to
1271 default_llseek()) as this downs i_mutex instead of the BKL which is
1272 what we now need for exclusion against ->f_pos changes considering we
1273 no longer take the BKL in ntfs_readdir().
1274
12752.0.5 - Major bugfix. Buffer overflow in extent inode handling.
1276
1277 - No need to set old blocksize in super.c::ntfs_fill_super() as the
1278 VFS does so via invocation of deactivate_super() calling
1279 fs->fill_super() calling block_kill_super() which does it.
1280 - BKL moved from VFS into dir.c::ntfs_readdir(). (Linus Torvalds)
1281 -> Do we really need it? I don't think so as we have exclusion on
1282 the directory ntfs_inode rw_semaphore mrec_lock. We mmight have to
1283 move the ->f_pos accesses under the mrec_lock though. Check this...
1284 - Fix really, really, really stupid buffer overflow in extent inode
1285 handling in mft.c::map_extent_mft_record().
1286
12872.0.4 - Cleanups and updates for kernel 2.5.11.
1288
1289 - Add documentation on how to use the MD driver to be able to use NTFS
1290 stripe and volume sets in Linux and generally cleanup documentation
1291 a bit.
1292 Remove all uses of kdev_t in favour of struct block_device *:
1293 - Change compress.c::ntfs_file_read_compressed_block() to use
1294 sb_getblk() instead of getblk().
1295 - Change super.c::ntfs_fill_super() to use bdev_hardsect_size() instead
1296 of get_hardsect_size().
1297 - No need to get old blocksize in super.c::ntfs_fill_super() as
1298 fs/super.c::get_sb_bdev() already does this.
1299 - Set bh->b_bdev instead of bh->b_dev throughout aops.c.
1300
13012.0.3 - Small bug fixes, cleanups, and performance improvements.
1302
1303 - Remove some dead code from mft.c.
1304 - Optimize readpage and read_block functions throughout aops.c so that
1305 only initialized blocks are read. Non-initialized ones have their
1306 buffer head mapped, zeroed, and set up to date, without scheduling
1307 any i/o. Thanks to Al Viro for advice on how to avoid the device i/o.
1308 Thanks go to Andrew Morton for spotting the below:
1309 - Fix buglet in allocate_compression_buffers() error code path.
1310 - Call flush_dcache_page() after modifying page cache page contents in
1311 ntfs_file_readpage().
1312 - Check for existence of page buffers throughout aops.c before calling
1313 create_empty_buffers(). This happens when an I/O error occurs and the
1314 read is retried. (It also happens once writing is implemented so that
1315 needed doing anyway but I had left it for later...)
1316 - Don't BUG_ON() uptodate and/or mapped buffers throughout aops.c in
1317 readpage and read_block functions. Reasoning same as above (i.e. I/O
1318 error retries and future write code paths.)
1319
13202.0.2 - Minor updates and cleanups.
1321
1322 - Cleanup: rename mst.c::__post_read_mst_fixup to post_write_mst_fixup
1323 and cleanup the code a bit, removing the unused size parameter.
1324 - Change default fmask to 0177 and update documentation.
1325 - Change attrib.c::get_attr_search_ctx() to return the search context
1326 directly instead of taking the address of a pointer. A return value
1327 of NULL means the allocation failed. Updated all callers
1328 appropriately.
1329 - Update to 2.5.9 kernel (preserving backwards compatibility) by
1330 replacing all occurences of page->buffers with page_buffers(page).
1331 - Fix minor bugs in runlist merging, also minor cleanup.
1332 - Updates to bootsector layout and mft mirror contents descriptions.
1333 - Small bug fix in error detection in unistr.c and some cleanups.
1334 - Grow name buffer allocations in unistr.c in aligned mutlipled of 64
1335 bytes.
1336
13372.0.1 - Minor updates.
1338
1339 - Make default umask correspond to documentation.
1340 - Improve documentation.
1341 - Set default mode to include execute bit. The {u,f,d}mask can be used
1342 to take it away if desired. This allows binaries to be executed from
1343 a mounted ntfs partition.
1344
13452.0.0 - New version number. Remove TNG from the name. Now in the kernel.
1346
1347 - Add kill_super, just keeping up with the vfs changes in the kernel.
1348 - Repeat some changes from tng-0.0.8 that somehow got lost on the way
1349 from the CVS import into BitKeeper.
1350 - Begin to implement proper handling of allocated_size vs
1351 initialized_size vs data_size (i.e. i_size). Done are
1352 mft.c::ntfs_mft_readpage(), aops.c::end_buffer_read_index_async(),
1353 and attrib.c::load_attribute_list().
1354 - Lock the runlist in attrib.c::load_attribute_list() while using it.
1355 - Fix memory leak in ntfs_file_read_compressed_block() and generally
1356 clean up compress.c a little, removing some uncommented/unused debug
1357 code.
1358 - Tidy up dir.c a little bit.
1359 - Don't bother getting the runlist in inode.c::ntfs_read_inode().
1360 - Merge mft.c::ntfs_mft_readpage() and aops.c::ntfs_index_readpage()
1361 creating aops.c::ntfs_mst_readpage(), improving the handling of
1362 holes and overflow in the process and implementing the correct
1363 equivalent of ntfs_file_get_block() in ntfs_mst_readpage() itself.
1364 I am aiming for correctness at the moment. Modularisation can come
1365 later.
1366 - Rename aops.c::end_buffer_read_index_async() to
1367 end_buffer_read_mst_async() and optimize the overflow checking and
1368 handling.
1369 - Use the host of the mftbmp address space mapping to hold the ntfs
1370 volume. This is needed so the async i/o completion handler can
1371 retrieve a pointer to the volume. Hopefully this will not cause
1372 problems elsewhere in the kernel... Otherwise will need to use a
1373 fake inode.
1374 - Complete implementation of proper handling of allocated_size vs
1375 initialized_size vs data_size (i.e. i_size) in whole driver.
1376 Basically aops.c is now completely rewritten.
1377 - Change NTFS driver name to just NTFS and set version number to 2.0.0
1378 to make a clear distinction from the old driver which is still on
1379 version 1.1.22.
1380
1381tng-0.0.8 - 08/03/2002 - Now using BitKeeper, http://linux-ntfs.bkbits.net/
1382
1383 - Replace bdevname(sb->s_dev) with sb->s_id.
1384 - Remove now superfluous new-line characters in all callers of
1385 ntfs_debug().
1386 - Apply kludge in ntfs_read_inode(), setting i_nlink to 1 for
1387 directories. Without this the "find" utility gets very upset which is
1388 fair enough as Linux/Unix do not support directory hard links.
1389 - Further runlist merging work. (Richard Russon)
1390 - Backwards compatibility for gcc-2.95. (Richard Russon)
1391 - Update to kernel 2.5.5-pre1 and rediff the now tiny patch.
1392 - Convert to new filesystem declaration using ->ntfs_get_sb() and
1393 replacing ntfs_read_super() with ntfs_fill_super().
1394 - Set s_maxbytes to MAX_LFS_FILESIZE to avoid page cache page index
1395 overflow on 32-bit architectures.
1396 - Cleanup upcase loading code to use ntfs_(un)map_page().
1397 - Disable/reenable preemtion in critical sections of compession engine.
1398 - Replace device size determination in ntfs_fill_super() with
1399 sb->s_bdev->bd_inode->i_size (in bytes) and remove now superfluous
1400 function super.c::get_nr_blocks().
1401 - Implement a mount time option (show_inodes) allowing choice of which
1402 types of inode names readdir() returns and modify ntfs_filldir()
1403 accordingly. There are several parameters to show_inodes:
1404 system: system files
1405 win32: long file names (including POSIX file names) [DEFAULT]
1406 long: same as win32
1407 dos: short file names only (excluding POSIX file names)
1408 short: same as dos
1409 posix: same as both win32 and dos
1410 all: all file names
1411 Note that the options are additive, i.e. specifying:
1412 -o show_inodes=system,show_inodes=win32,show_inodes=dos
1413 is the same as specifying:
1414 -o show_inodes=all
1415 Note that the "posix" and "all" options will show all directory
1416 names, BUT the link count on each directory inode entry is set to 1,
1417 due to Linux not supporting directory hard links. This may well
1418 confuse some userspace applications, since the directory names will
1419 have the same inode numbers. Thus it is NOT advisable to use the
1420 "posix" or "all" options. We provide them only for completeness sake.
1421 - Add copies of allocated_size, initialized_size, and compressed_size to
1422 the ntfs inode structure and set them up in
1423 inode.c::ntfs_read_inode(). These reflect the unnamed data attribute
1424 for files and the index allocation attribute for directories.
1425 - Add copies of allocated_size and initialized_size to ntfs inode for
1426 $BITMAP attribute of large directories and set them up in
1427 inode.c::ntfs_read_inode().
1428 - Add copies of allocated_size and initialized_size to ntfs volume for
1429 $BITMAP attribute of $MFT and set them up in
1430 super.c::load_system_files().
1431 - Parse deprecated ntfs driver options (iocharset, show_sys_files,
1432 posix, and utf8) and tell user what the new options to use are. Note
1433 we still do support them but they will be removed with kernel 2.7.x.
1434 - Change all occurences of integer long long printf formatting to hex
1435 as printk() will not support long long integer format if/when the
1436 div64 patch goes into the kernel.
1437 - Make slab caches have stable names and change the names to what they
1438 were intended to be. These changes are required/made possible by the
1439 new slab cache name handling which removes the length limitation by
1440 requiring the caller of kmem_cache_create() to supply a stable name
1441 which is then referenced but not copied.
1442 - Rename run_list structure to run_list_element and create a new
1443 run_list structure containing a pointer to a run_list_element
1444 structure and a read/write semaphore. Adapt all users of runlists
1445 to new scheme and take and release the lock as needed. This fixes a
1446 nasty race as the run_list changes even when inodes are locked for
1447 reading and even when the inode isn't locked at all, so we really
1448 needed the serialization. We use a semaphore rather than a spinlock
1449 as memory allocations can sleep and doing everything GFP_ATOMIC
1450 would be silly.
1451 - Cleanup read_inode() removing all code checking for lowest_vcn != 0.
1452 This can never happen due to the nature of lookup_attr() and how we
1453 support attribute lists. If it did happen it would imply the inode
1454 being corrupt.
1455 - Check for lowest_vcn != 0 in ntfs_read_inode() and mark the inode as
1456 bad if found.
1457 - Update to 2.5.6-pre2 changes in struct address_space.
1458 - Use parent_ino() when accessing d_parent inode number in dir.c.
1459 - Import Sourceforge CVS repository into BitKeeper repository:
1460 http://linux-ntfs.bkbits.net/ntfs-tng-2.5
1461 - Update fs/Makefile, fs/Config.help, fs/Config.in, and
1462 Documentation/filesystems/ntfs.txt for NTFS TNG.
1463 - Create kernel configuration option controlling whether debugging
1464 is enabled or not.
1465 - Add the required export of end_buffer_io_sync() from the patches
1466 directory to the kernel code.
1467 - Update inode.c::ntfs_show_options() with show_inodes mount option.
1468 - Update errors mount option.
1469
1470tng-0.0.7 - 13/02/2002 - The driver is now feature complete for read-only!
1471
1472 - Cleanup mft.c and it's debug/error output in particular. Fix a minor
1473 bug in mapping of extent inodes. Update all the comments to fit all
1474 the recent code changes.
1475 - Modify vcn_to_lcn() to cope with entirely unmapped runlists.
1476 - Cleanups in compress.c, mostly comments and folding help.
1477 - Implement attrib.c::map_run_list() as a generic helper.
1478 - Make compress.c::ntfs_file_read_compressed_block() use map_run_list()
1479 thus making code shorter and enabling attribute list support.
1480 - Cleanup incorrect use of [su]64 with %L printf format specifier in
1481 all source files. Type casts to [unsigned] long long added to correct
1482 the mismatches (important for architectures which have long long not
1483 being 64 bits).
1484 - Merge async io completion handlers for directory indexes and $MFT
1485 data into one by setting the index_block_size{_bits} of the ntfs
1486 inode for $MFT to the mft_record_size{_bits} of the ntfs_volume.
1487 - Cleanup aops.c, update comments.
1488 - Make ntfs_file_get_block() use map_run_list() so all files now
1489 support attribute lists.
1490 - Make ntfs_dir_readpage() almost verbatim copy of
1491 block_read_full_page() by using ntfs_file_get_block() with only real
1492 difference being the use of our own async io completion handler
1493 rather than the default one, thus reducing the amount of code and
1494 automatically enabling attribute list support for directory indices.
1495 - Fix bug in load_attribute_list() - forgot to call brelse in error
1496 code path.
1497 - Change parameters to find_attr() and lookup_attr(). We no longer
1498 pass in the upcase table and its length. These can be gotten from
1499 ctx->ntfs_ino->vol->upcase{_len}. Update all callers.
1500 - Cleanups in attrib.c.
1501 - Implement merging of runlists, attrib.c::merge_run_lists() and its
1502 helpers. (Richard Russon)
1503 - Attribute lists part 2, attribute extents and multi part runlists:
1504 enable proper support for LCN_RL_NOT_MAPPED and automatic mapping of
1505 further runlist parts via attrib.c::map_run_list().
1506 - Tiny endianness bug fix in decompress_mapping_pairs().
1507
1508tng-0.0.6 - Encrypted directories, bug fixes, cleanups, debugging enhancements.
1509
1510 - Enable encrypted directories. (Their index root is marked encrypted
1511 to indicate that new files in that directory should be created
1512 encrypted.)
1513 - Fix bug in NInoBmpNonResident() macro. (Cut and paste error.)
1514 - Enable $Extend system directory. Most (if not all) extended system
1515 files do not have unnamed data attributes so ntfs_read_inode() had to
1516 special case them but that is ok, as the special casing recovery
1517 happens inside an error code path so there is zero slow down in the
1518 normal fast path. The special casing is done by introducing a new
1519 function inode.c::ntfs_is_extended_system_file() which checks if any
1520 of the hard links in the inode point to $Extend as being their parent
1521 directory and if they do we assume this is an extended system file.
1522 - Create a sysctl/proc interface to allow {dis,en}abling of debug output
1523 when compiled with -DDEBUG. Default is debug messages to be disabled.
1524 To enable them, one writes a non-zero value to /proc/sys/fs/ntfs-debug
1525 (if /proc is enabled) or uses sysctl(2) to effect the same (if sysctl
1526 interface is enabled). Inspired by old ntfs driver.
1527 - Add debug_msgs insmod/kernel boot parameter to set whether debug
1528 messages are {dis,en}abled. This is useful to enable debug messages
1529 during ntfs initialization and is the only way to activate debugging
1530 when the sysctl interface is not enabled.
1531 - Cleanup debug output in various places.
1532 - Remove all dollar signs ($) from the source (except comments) to
1533 enable compilation on architectures whose gcc compiler does not
1534 support dollar signs in the names of variables/constants. Attribute
1535 types now start with AT_ instead of $ and $I30 is now just I30.
1536 - Cleanup ntfs_lookup() and add consistency check of sequence numbers.
1537 - Load complete runlist for $MFT/$BITMAP during mount and cleanup
1538 access functions. This means we now cope with $MFT/$BITMAP being
1539 spread accross several mft records.
1540 - Disable modification of mft_zone_multiplier on remount. We can always
1541 reenable this later on if we really want to, but we will need to make
1542 sure we readjust the mft_zone size / layout accordingly.
1543
1544tng-0.0.5 - Modernize for 2.5.x and further in line-ing with Al Viro's comments.
1545
1546 - Use sb_set_blocksize() instead of set_blocksize() and verify the
1547 return value.
1548 - Use sb_bread() instead of bread() throughout.
1549 - Add index_vcn_size{_bits} to ntfs_inode structure to store the size
1550 of a directory index block vcn. Apply resulting simplifications in
1551 dir.c everywhere.
1552 - Fix a small bug somewhere (but forgot what it was).
1553 - Change ntfs_{debug,error,warning} to enable gcc to do type checking
1554 on the printf-format parameter list and fix bugs reported by gcc
1555 as a result. (Richard Russon)
1556 - Move inode allocation strategy to Al's new stuff but maintain the
1557 divorce of ntfs_inode from struct inode. To achieve this we have two
1558 separate slab caches, one for big ntfs inodes containing a struct
1559 inode and pure ntfs inodes and at the same time fix some faulty
1560 error code paths in ntfs_read_inode().
1561 - Show mount options in proc (inode.c::ntfs_show_options()).
1562
1563tng-0.0.4 - Big changes, getting in line with Al Viro's comments.
1564
1565 - Modified (un)map_mft_record functions to be common for read and write
1566 case. To specify which is which, added extra parameter at front of
1567 parameter list. Pass either READ or WRITE to this, each has the
1568 obvious meaning.
1569 - General cleanups to allow for easier folding in vi.
1570 - attrib.c::decompress_mapping_pairs() now accepts the old runlist
1571 argument, and invokes attrib.c::merge_run_lists() to merge the old
1572 and the new runlists.
1573 - Removed attrib.c::find_first_attr().
1574 - Implemented loading of attribute list and complete runlist for $MFT.
1575 This means we now cope with $MFT being spread across several mft
1576 records.
1577 - Adapt to 2.5.2-pre9 and the changed create_empty_buffers() syntax.
1578 - Adapt major/minor/kdev_t/[bk]devname stuff to new 2.5.x kernels.
1579 - Make ntfs_volume be allocated via kmalloc() instead of using a slab
1580 cache. There are too little ntfs_volume structures at any one time
1581 to justify a private slab cache.
1582 - Fix bogus kmap() use in async io completion. Now use kmap_atomic().
1583 Use KM_BIO_IRQ on advice from IRC/kernel...
1584 - Use ntfs_map_page() in map_mft_record() and create ->readpage method
1585 for reading $MFT (ntfs_mft_readpage). In the process create dedicated
1586 address space operations (ntfs_mft_aops) for $MFT inode mapping. Also
1587 removed the now superfluous exports from the kernel core patch.
1588 - Fix a bug where kfree() was used instead of ntfs_free().
1589 - Change map_mft_record() to take ntfs_inode as argument instead of
1590 vfs inode. Dito for unmap_mft_record(). Adapt all callers.
1591 - Add pointer to ntfs_volume to ntfs_inode.
1592 - Add mft record number and sequence number to ntfs_inode. Stop using
1593 i_ino and i_generation for in-driver purposes.
1594 - Implement attrib.c::merge_run_lists(). (Richard Russon)
1595 - Remove use of proper inodes by extent inodes. Move i_ino and
1596 i_generation to ntfs_inode to do this. Apply simplifications that
1597 result and remove iget_no_wait(), etc.
1598 - Pass ntfs_inode everywhere in the driver (used to be struct inode).
1599 - Add reference counting in ntfs_inode for the ntfs inode itself and
1600 for the mapped mft record.
1601 - Extend mft record mapping so we can (un)map extent mft records (new
1602 functions (un)map_extent_mft_record), and so mappings are reference
1603 counted and don't have to happen twice if already mapped - just ref
1604 count increases.
1605 - Add -o iocharset as alias to -o nls for backwards compatibility.
1606 - The latest core patch is now tiny. In fact just a single additional
1607 export is necessary over the base kernel.
1608
1609tng-0.0.3 - Cleanups, enhancements, bug fixes.
1610
1611 - Work on attrib.c::decompress_mapping_pairs() to detect base extents
1612 and setup the runlist appropriately using knowledge provided by the
1613 sizes in the base attribute record.
1614 - Balance the get_/put_attr_search_ctx() calls so we don't leak memory
1615 any more.
1616 - Introduce ntfs_malloc_nofs() and ntfs_free() to allocate/free a single
1617 page or use vmalloc depending on the amount of memory requested.
1618 - Cleanup error output. The __FUNCTION__ "(): " is now added
1619 automatically. Introduced a new header file debug.h to support this
1620 and also moved ntfs_debug() function into it.
1621 - Make reading of compressed files more intelligent and especially get
1622 rid of the vmalloc_nofs() from readpage(). This now uses per CPU
1623 buffers (allocated at first mount with cluster size <= 4kiB and
1624 deallocated on last umount with cluster size <= 4kiB), and
1625 asynchronous io for the compressed data using a list of buffer heads.
1626 Er, we use synchronous io as async io only works on whole pages
1627 covered by buffers and not on individual buffer heads...
1628 - Bug fix for reading compressed files with sparse compression blocks.
1629
1630tng-0.0.2 - Now handles larger/fragmented/compressed volumes/files/dirs.
1631
1632 - Fixed handling of directories when cluster size exceeds index block
1633 size.
1634 - Hide DOS only name space directory entries from readdir() but allow
1635 them in lookup(). This should fix the problem that Linux doesn't
1636 support directory hard links, while still allowing access to entries
1637 via their short file name. This also has the benefit of mimicking
1638 what Windows users are used to, so it is the ideal solution.
1639 - Implemented sync_page everywhere so no more hangs in D state when
1640 waiting for a page.
1641 - Stop using bforget() in favour of brelse().
1642 - Stop locking buffers unnecessarily.
1643 - Implemented compressed files (inode->mapping contains uncompressed
1644 data, raw compressed data is currently bread() into a vmalloc()ed
1645 memory buffer).
1646 - Enable compressed directories. (Their index root is marked compressed
1647 to indicate that new files in that directory should be created
1648 compressed.)
1649 - Use vsnprintf rather than vsprintf in the ntfs_error and ntfs_warning
1650 functions. (Thanks to Will Dyson for pointing this out.)
1651 - Moved the ntfs_inode and ntfs_volume (the former ntfs_inode_info and
1652 ntfs_sb_info) out of the common inode and super_block structures and
1653 started using the generic_ip and generic_sbp pointers instead. This
1654 makes ntfs entirely private with respect to the kernel tree.
1655 - Detect compiler version and abort with error message if gcc less than
1656 2.96 is used.
1657 - Fix bug in name comparison function in unistr.c.
1658 - Implement attribute lists part 1, the infrastructure: search contexts
1659 and operations, find_external_attr(), lookup_attr()) and make the
1660 code use the infrastructure.
1661 - Fix stupid buffer overflow bug that became apparent on larger run
1662 list containing attributes.
1663 - Fix bugs in readdir() that became apparent on larger directories.
1664
1665 The driver is now really useful and survives the test
1666 find . -type f -exec md5sum "{}" \;
1667 without any error messages on a over 1GiB sized partition with >16k
1668 files on it, including compressed files and directories and many files
1669 and directories with attribute lists.
1670
1671tng-0.0.1 - The first useful version.
1672
1673 - Added ntfs_lookup().
1674 - Added default upcase generation and handling.
1675 - Added compile options to be shown on module init.
1676 - Many bug fixes that were "hidden" before.
1677 - Update to latest kernel.
1678 - Added ntfs_readdir().
1679 - Added file operations for mmap(), read(), open() and llseek(). We just
1680 use the generic ones. The whole point of going through implementing
1681 readpage() methods and where possible get_block() call backs is that
1682 this allows us to make use of the generic high level methods provided
1683 by the kernel.
1684
1685 The driver is now actually useful! Yey. (-: It undoubtedly has got bugs
1686 though and it doesn't implement accesssing compressed files yet. Also,
1687 accessing files with attribute list attributes is not implemented yet
1688 either. But for small or simple filesystems it should work and allow
1689 you to list directories, use stat on directory entries and the file
1690 system, open, read, mmap and llseek around in files. A big mile stone
1691 has been reached!
1692
1693tng-0.0.0 - Initial version tag.
1694
1695 Initial driver implementation. The driver can mount and umount simple
1696 NTFS filesystems (i.e. ones without attribute lists in the system
1697 files). If the mount fails there might be problems in the error handling
1698 code paths, so be warned. Otherwise it seems to be loading the system
1699 files nicely and the mft record read mapping/unmapping seems to be
1700 working nicely, too. Proof of inode metadata in the page cache and non-
1701 resident file unnamed stream data in the page cache concepts is thus
1702 complete.
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index d8d0c65ac03c..73e743eea2c8 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -72,9 +72,9 @@
72 72
73#include "tcp_internal.h" 73#include "tcp_internal.h"
74 74
75#define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u" 75#define SC_NODEF_FMT "node %s (num %u) at %pI4:%u"
76#define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \ 76#define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num, \
77 NIPQUAD(sc->sc_node->nd_ipv4_address), \ 77 &sc->sc_node->nd_ipv4_address, \
78 ntohs(sc->sc_node->nd_ipv4_port) 78 ntohs(sc->sc_node->nd_ipv4_port)
79 79
80/* 80/*
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 8298608d4165..50c4ee805da4 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -1881,7 +1881,7 @@ out:
1881 * ocfs2_file_lock() and ocfs2_file_unlock() map to a single pair of 1881 * ocfs2_file_lock() and ocfs2_file_unlock() map to a single pair of
1882 * flock() calls. The locking approach this requires is sufficiently 1882 * flock() calls. The locking approach this requires is sufficiently
1883 * different from all other cluster lock types that we implement a 1883 * different from all other cluster lock types that we implement a
1884 * seperate path to the "low-level" dlm calls. In particular: 1884 * separate path to the "low-level" dlm calls. In particular:
1885 * 1885 *
1886 * - No optimization of lock levels is done - we take at exactly 1886 * - No optimization of lock levels is done - we take at exactly
1887 * what's been requested. 1887 * what's been requested.
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 5328529e7fd2..c562a7581cf9 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -453,7 +453,7 @@ static int ocfs2_get_clusters_nocache(struct inode *inode,
453 if (i == -1) { 453 if (i == -1) {
454 /* 454 /*
455 * Holes can be larger than the maximum size of an 455 * Holes can be larger than the maximum size of an
456 * extent, so we return their lengths in a seperate 456 * extent, so we return their lengths in a separate
457 * field. 457 * field.
458 */ 458 */
459 if (hole_len) { 459 if (hole_len) {
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index ebf3440d28ca..277575ddc05c 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -201,7 +201,8 @@ static const char *qnx4_checkroot(struct super_block *sb)
201 rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE); 201 rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE);
202 if (rootdir->di_fname != NULL) { 202 if (rootdir->di_fname != NULL) {
203 QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname)); 203 QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname));
204 if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) { 204 if (!strcmp(rootdir->di_fname,
205 QNX4_BMNAME)) {
205 found = 1; 206 found = 1;
206 qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL ); 207 qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL );
207 if (!qnx4_sb(sb)->BitMap) { 208 if (!qnx4_sb(sb)->BitMap) {
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index dc014f7def05..483442e66ed6 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -169,7 +169,7 @@ static int scan_bitmap_block(struct reiserfs_transaction_handle *th,
169 return 0; // No free blocks in this bitmap 169 return 0; // No free blocks in this bitmap
170 } 170 }
171 171
172 /* search for a first zero bit -- beggining of a window */ 172 /* search for a first zero bit -- beginning of a window */
173 *beg = reiserfs_find_next_zero_le_bit 173 *beg = reiserfs_find_next_zero_le_bit
174 ((unsigned long *)(bh->b_data), boundary, *beg); 174 ((unsigned long *)(bh->b_data), boundary, *beg);
175 175
diff --git a/fs/select.c b/fs/select.c
index 73715e90030f..500a669f7790 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -691,6 +691,23 @@ SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp,
691} 691}
692#endif /* HAVE_SET_RESTORE_SIGMASK */ 692#endif /* HAVE_SET_RESTORE_SIGMASK */
693 693
694#ifdef __ARCH_WANT_SYS_OLD_SELECT
695struct sel_arg_struct {
696 unsigned long n;
697 fd_set __user *inp, *outp, *exp;
698 struct timeval __user *tvp;
699};
700
701SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg)
702{
703 struct sel_arg_struct a;
704
705 if (copy_from_user(&a, arg, sizeof(a)))
706 return -EFAULT;
707 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
708}
709#endif
710
694struct poll_list { 711struct poll_list {
695 struct poll_list *next; 712 struct poll_list *next;
696 int len; 713 int len;
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index a00602b2e32d..bb863fe579ac 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -106,7 +106,7 @@ void udf_clear_inode(struct inode *inode)
106 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB && 106 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB &&
107 inode->i_size != iinfo->i_lenExtents) { 107 inode->i_size != iinfo->i_lenExtents) {
108 printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has " 108 printk(KERN_WARNING "UDF-fs (%s): Inode %lu (mode %o) has "
109 "inode size %llu different from extent lenght %llu. " 109 "inode size %llu different from extent length %llu. "
110 "Filesystem need not be standards compliant.\n", 110 "Filesystem need not be standards compliant.\n",
111 inode->i_sb->s_id, inode->i_ino, inode->i_mode, 111 inode->i_sb->s_id, inode->i_ino, inode->i_mode,
112 (unsigned long long)inode->i_size, 112 (unsigned long long)inode->i_size,
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 66b63a751615..14743d935a93 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1016,6 +1016,9 @@ magic_found:
1016 case UFS_FSSTABLE: 1016 case UFS_FSSTABLE:
1017 UFSD("fs is stable\n"); 1017 UFSD("fs is stable\n");
1018 break; 1018 break;
1019 case UFS_FSLOG:
1020 UFSD("fs is logging fs\n");
1021 break;
1019 case UFS_FSOSF1: 1022 case UFS_FSOSF1:
1020 UFSD("fs is DEC OSF/1\n"); 1023 UFSD("fs is DEC OSF/1\n");
1021 break; 1024 break;
diff --git a/fs/ufs/ufs_fs.h b/fs/ufs/ufs_fs.h
index 54bde1895a80..6943ec677c0b 100644
--- a/fs/ufs/ufs_fs.h
+++ b/fs/ufs/ufs_fs.h
@@ -138,6 +138,7 @@ typedef __u16 __bitwise __fs16;
138 138
139#define UFS_USEEFT ((__u16)65535) 139#define UFS_USEEFT ((__u16)65535)
140 140
141/* fs_clean values */
141#define UFS_FSOK 0x7c269d38 142#define UFS_FSOK 0x7c269d38
142#define UFS_FSACTIVE ((__s8)0x00) 143#define UFS_FSACTIVE ((__s8)0x00)
143#define UFS_FSCLEAN ((__s8)0x01) 144#define UFS_FSCLEAN ((__s8)0x01)
@@ -145,6 +146,11 @@ typedef __u16 __bitwise __fs16;
145#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */ 146#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */
146#define UFS_FSBAD ((__s8)0xff) 147#define UFS_FSBAD ((__s8)0xff)
147 148
149/* Solaris-specific fs_clean values */
150#define UFS_FSSUSPEND ((__s8)0xfe) /* temporarily suspended */
151#define UFS_FSLOG ((__s8)0xfd) /* logging fs */
152#define UFS_FSFIX ((__s8)0xfc) /* being repaired while mounted */
153
148/* From here to next blank line, s_flags for ufs_sb_info */ 154/* From here to next blank line, s_flags for ufs_sb_info */
149/* directory entry encoding */ 155/* directory entry encoding */
150#define UFS_DE_MASK 0x00000010 /* mask for the following */ 156#define UFS_DE_MASK 0x00000010 /* mask for the following */
@@ -227,11 +233,16 @@ typedef __u16 __bitwise __fs16;
227 */ 233 */
228#define ufs_cbtocylno(bno) \ 234#define ufs_cbtocylno(bno) \
229 ((bno) * uspi->s_nspf / uspi->s_spc) 235 ((bno) * uspi->s_nspf / uspi->s_spc)
230#define ufs_cbtorpos(bno) \ 236#define ufs_cbtorpos(bno) \
237 ((UFS_SB(sb)->s_flags & UFS_CG_SUN) ? \
238 (((((bno) * uspi->s_nspf % uspi->s_spc) % \
239 uspi->s_nsect) * \
240 uspi->s_nrpos) / uspi->s_nsect) \
241 : \
231 ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \ 242 ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
232 * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \ 243 * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
233 % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \ 244 % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
234 * uspi->s_nrpos) / uspi->s_npsect) 245 * uspi->s_nrpos) / uspi->s_npsect))
235 246
236/* 247/*
237 * The following macros optimize certain frequently calculated 248 * The following macros optimize certain frequently calculated
diff --git a/include/asm-generic/pci-dma-compat.h b/include/asm-generic/pci-dma-compat.h
index 37b3706226e7..1437b7da09b2 100644
--- a/include/asm-generic/pci-dma-compat.h
+++ b/include/asm-generic/pci-dma-compat.h
@@ -6,9 +6,6 @@
6 6
7#include <linux/dma-mapping.h> 7#include <linux/dma-mapping.h>
8 8
9/* note pci_set_dma_mask isn't here, since it's a public function
10 * exported from drivers/pci, use dma_supported instead */
11
12static inline int 9static inline int
13pci_dma_supported(struct pci_dev *hwdev, u64 mask) 10pci_dma_supported(struct pci_dev *hwdev, u64 mask)
14{ 11{
@@ -104,4 +101,16 @@ pci_dma_mapping_error(struct pci_dev *pdev, dma_addr_t dma_addr)
104 return dma_mapping_error(&pdev->dev, dma_addr); 101 return dma_mapping_error(&pdev->dev, dma_addr);
105} 102}
106 103
104#ifdef CONFIG_PCI
105static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
106{
107 return dma_set_mask(&dev->dev, mask);
108}
109
110static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
111{
112 return dma_set_coherent_mask(&dev->dev, mask);
113}
114#endif
115
107#endif 116#endif
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 882dc7248766..3e4737fa6cce 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -121,16 +121,15 @@ struct vfsmount;
121struct super_block; 121struct super_block;
122struct pacct_struct; 122struct pacct_struct;
123struct pid_namespace; 123struct pid_namespace;
124extern int acct_parm[]; /* for sysctl */
124extern void acct_auto_close_mnt(struct vfsmount *m); 125extern void acct_auto_close_mnt(struct vfsmount *m);
125extern void acct_auto_close(struct super_block *sb); 126extern void acct_auto_close(struct super_block *sb);
126extern void acct_init_pacct(struct pacct_struct *pacct);
127extern void acct_collect(long exitcode, int group_dead); 127extern void acct_collect(long exitcode, int group_dead);
128extern void acct_process(void); 128extern void acct_process(void);
129extern void acct_exit_ns(struct pid_namespace *); 129extern void acct_exit_ns(struct pid_namespace *);
130#else 130#else
131#define acct_auto_close_mnt(x) do { } while (0) 131#define acct_auto_close_mnt(x) do { } while (0)
132#define acct_auto_close(x) do { } while (0) 132#define acct_auto_close(x) do { } while (0)
133#define acct_init_pacct(x) do { } while (0)
134#define acct_collect(x,y) do { } while (0) 133#define acct_collect(x,y) do { } while (0)
135#define acct_process() do { } while (0) 134#define acct_process() do { } while (0)
136#define acct_exit_ns(ns) do { } while (0) 135#define acct_exit_ns(ns) do { } while (0)
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index c9bbcb2a75ae..b8ad1ea99586 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -37,16 +37,24 @@ extern void cgroup_post_fork(struct task_struct *p);
37extern void cgroup_exit(struct task_struct *p, int run_callbacks); 37extern void cgroup_exit(struct task_struct *p, int run_callbacks);
38extern int cgroupstats_build(struct cgroupstats *stats, 38extern int cgroupstats_build(struct cgroupstats *stats,
39 struct dentry *dentry); 39 struct dentry *dentry);
40extern int cgroup_load_subsys(struct cgroup_subsys *ss);
41extern void cgroup_unload_subsys(struct cgroup_subsys *ss);
40 42
41extern const struct file_operations proc_cgroup_operations; 43extern const struct file_operations proc_cgroup_operations;
42 44
43/* Define the enumeration of all cgroup subsystems */ 45/* Define the enumeration of all builtin cgroup subsystems */
44#define SUBSYS(_x) _x ## _subsys_id, 46#define SUBSYS(_x) _x ## _subsys_id,
45enum cgroup_subsys_id { 47enum cgroup_subsys_id {
46#include <linux/cgroup_subsys.h> 48#include <linux/cgroup_subsys.h>
47 CGROUP_SUBSYS_COUNT 49 CGROUP_BUILTIN_SUBSYS_COUNT
48}; 50};
49#undef SUBSYS 51#undef SUBSYS
52/*
53 * This define indicates the maximum number of subsystems that can be loaded
54 * at once. We limit to this many since cgroupfs_root has subsys_bits to keep
55 * track of all of them.
56 */
57#define CGROUP_SUBSYS_COUNT (BITS_PER_BYTE*sizeof(unsigned long))
50 58
51/* Per-subsystem/per-cgroup state maintained by the system. */ 59/* Per-subsystem/per-cgroup state maintained by the system. */
52struct cgroup_subsys_state { 60struct cgroup_subsys_state {
@@ -76,6 +84,12 @@ enum {
76 CSS_REMOVED, /* This CSS is dead */ 84 CSS_REMOVED, /* This CSS is dead */
77}; 85};
78 86
87/* Caller must verify that the css is not for root cgroup */
88static inline void __css_get(struct cgroup_subsys_state *css, int count)
89{
90 atomic_add(count, &css->refcnt);
91}
92
79/* 93/*
80 * Call css_get() to hold a reference on the css; it can be used 94 * Call css_get() to hold a reference on the css; it can be used
81 * for a reference obtained via: 95 * for a reference obtained via:
@@ -87,7 +101,7 @@ static inline void css_get(struct cgroup_subsys_state *css)
87{ 101{
88 /* We don't need to reference count the root state */ 102 /* We don't need to reference count the root state */
89 if (!test_bit(CSS_ROOT, &css->flags)) 103 if (!test_bit(CSS_ROOT, &css->flags))
90 atomic_inc(&css->refcnt); 104 __css_get(css, 1);
91} 105}
92 106
93static inline bool css_is_removed(struct cgroup_subsys_state *css) 107static inline bool css_is_removed(struct cgroup_subsys_state *css)
@@ -118,11 +132,11 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
118 * css_get() or css_tryget() 132 * css_get() or css_tryget()
119 */ 133 */
120 134
121extern void __css_put(struct cgroup_subsys_state *css); 135extern void __css_put(struct cgroup_subsys_state *css, int count);
122static inline void css_put(struct cgroup_subsys_state *css) 136static inline void css_put(struct cgroup_subsys_state *css)
123{ 137{
124 if (!test_bit(CSS_ROOT, &css->flags)) 138 if (!test_bit(CSS_ROOT, &css->flags))
125 __css_put(css); 139 __css_put(css, 1);
126} 140}
127 141
128/* bits in struct cgroup flags field */ 142/* bits in struct cgroup flags field */
@@ -221,6 +235,10 @@ struct cgroup {
221 235
222 /* For RCU-protected deletion */ 236 /* For RCU-protected deletion */
223 struct rcu_head rcu_head; 237 struct rcu_head rcu_head;
238
239 /* List of events which userspace want to recieve */
240 struct list_head event_list;
241 spinlock_t event_list_lock;
224}; 242};
225 243
226/* 244/*
@@ -258,7 +276,8 @@ struct css_set {
258 /* 276 /*
259 * Set of subsystem states, one for each subsystem. This array 277 * Set of subsystem states, one for each subsystem. This array
260 * is immutable after creation apart from the init_css_set 278 * is immutable after creation apart from the init_css_set
261 * during subsystem registration (at boot time). 279 * during subsystem registration (at boot time) and modular subsystem
280 * loading/unloading.
262 */ 281 */
263 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 282 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
264 283
@@ -363,6 +382,23 @@ struct cftype {
363 int (*trigger)(struct cgroup *cgrp, unsigned int event); 382 int (*trigger)(struct cgroup *cgrp, unsigned int event);
364 383
365 int (*release)(struct inode *inode, struct file *file); 384 int (*release)(struct inode *inode, struct file *file);
385
386 /*
387 * register_event() callback will be used to add new userspace
388 * waiter for changes related to the cftype. Implement it if
389 * you want to provide this functionality. Use eventfd_signal()
390 * on eventfd to send notification to userspace.
391 */
392 int (*register_event)(struct cgroup *cgrp, struct cftype *cft,
393 struct eventfd_ctx *eventfd, const char *args);
394 /*
395 * unregister_event() callback will be called when userspace
396 * closes the eventfd or on cgroup removing.
397 * This callback must be implemented, if you want provide
398 * notification functionality.
399 */
400 int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
401 struct eventfd_ctx *eventfd);
366}; 402};
367 403
368struct cgroup_scanner { 404struct cgroup_scanner {
@@ -428,6 +464,8 @@ struct cgroup_subsys {
428 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); 464 void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
429 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 465 int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
430 struct task_struct *tsk, bool threadgroup); 466 struct task_struct *tsk, bool threadgroup);
467 void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
468 struct task_struct *tsk, bool threadgroup);
431 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, 469 void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
432 struct cgroup *old_cgrp, struct task_struct *tsk, 470 struct cgroup *old_cgrp, struct task_struct *tsk,
433 bool threadgroup); 471 bool threadgroup);
@@ -472,6 +510,9 @@ struct cgroup_subsys {
472 /* used when use_id == true */ 510 /* used when use_id == true */
473 struct idr idr; 511 struct idr idr;
474 spinlock_t id_lock; 512 spinlock_t id_lock;
513
514 /* should be defined only by modular subsystems */
515 struct module *module;
475}; 516};
476 517
477#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; 518#define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys;
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ef68119a4fd2..717c691ecd8e 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -23,6 +23,7 @@
23typedef __compat_uid32_t compat_uid_t; 23typedef __compat_uid32_t compat_uid_t;
24typedef __compat_gid32_t compat_gid_t; 24typedef __compat_gid32_t compat_gid_t;
25 25
26struct compat_sel_arg_struct;
26struct rusage; 27struct rusage;
27 28
28struct compat_itimerspec { 29struct compat_itimerspec {
@@ -249,6 +250,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
249 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 250 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
250 struct compat_timeval __user *tvp); 251 struct compat_timeval __user *tvp);
251 252
253asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg);
254
252asmlinkage long compat_sys_wait4(compat_pid_t pid, 255asmlinkage long compat_sys_wait4(compat_pid_t pid,
253 compat_uint_t __user *stat_addr, int options, 256 compat_uint_t __user *stat_addr, int options,
254 struct compat_rusage __user *ru); 257 struct compat_rusage __user *ru);
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index b3c91d7cede4..8ba66a9d9022 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -16,6 +16,8 @@ static inline int dump_write(struct file *file, const void *addr, int nr)
16 16
17static inline int dump_seek(struct file *file, loff_t off) 17static inline int dump_seek(struct file *file, loff_t off)
18{ 18{
19 int ret = 1;
20
19 if (file->f_op->llseek && file->f_op->llseek != no_llseek) { 21 if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
20 if (file->f_op->llseek(file, off, SEEK_CUR) < 0) 22 if (file->f_op->llseek(file, off, SEEK_CUR) < 0)
21 return 0; 23 return 0;
@@ -29,13 +31,15 @@ static inline int dump_seek(struct file *file, loff_t off)
29 31
30 if (n > PAGE_SIZE) 32 if (n > PAGE_SIZE)
31 n = PAGE_SIZE; 33 n = PAGE_SIZE;
32 if (!dump_write(file, buf, n)) 34 if (!dump_write(file, buf, n)) {
33 return 0; 35 ret = 0;
36 break;
37 }
34 off -= n; 38 off -= n;
35 } 39 }
36 free_page((unsigned long)buf); 40 free_page((unsigned long)buf);
37 } 41 }
38 return 1; 42 return ret;
39} 43}
40 44
41#endif /* _LINUX_COREDUMP_H */ 45#endif /* _LINUX_COREDUMP_H */
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index 5032b9a31ae7..ad5ec1d0475e 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -14,11 +14,21 @@
14 14
15/* Code active when included from pre-boot environment: */ 15/* Code active when included from pre-boot environment: */
16 16
17/*
18 * Some architectures want to ensure there is no local data in their
19 * pre-boot environment, so that data can arbitarily relocated (via
20 * GOT references). This is achieved by defining STATIC_RW_DATA to
21 * be null.
22 */
23#ifndef STATIC_RW_DATA
24#define STATIC_RW_DATA static
25#endif
26
17/* A trivial malloc implementation, adapted from 27/* A trivial malloc implementation, adapted from
18 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994 28 * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
19 */ 29 */
20static unsigned long malloc_ptr; 30STATIC_RW_DATA unsigned long malloc_ptr;
21static int malloc_count; 31STATIC_RW_DATA int malloc_count;
22 32
23static void *malloc(int size) 33static void *malloc(int size)
24{ 34{
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index c30879cf93bc..96e87693d933 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -23,7 +23,7 @@
23#define DM9000_PLATF_NO_EEPROM (0x0010) 23#define DM9000_PLATF_NO_EEPROM (0x0010)
24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */ 24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */
25 25
26/* platfrom data for platfrom device structure's platfrom_data field */ 26/* platform data for platform device structure's platform_data field */
27 27
28struct dm9000_plat_data { 28struct dm9000_plat_data {
29 unsigned int flags; 29 unsigned int flags;
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 91b761846061..ca32ed78b057 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev)
127 return DMA_BIT_MASK(32); 127 return DMA_BIT_MASK(32);
128} 128}
129 129
130static inline int dma_set_coherent_mask(struct device *dev, u64 mask)
131{
132 if (!dma_supported(dev, mask))
133 return -EIO;
134 dev->coherent_dma_mask = mask;
135 return 0;
136}
137
130extern u64 dma_get_required_mask(struct device *dev); 138extern u64 dma_get_required_mask(struct device *dev);
131 139
132static inline unsigned int dma_get_max_seg_size(struct device *dev) 140static inline unsigned int dma_get_max_seg_size(struct device *dev)
@@ -232,4 +240,20 @@ struct dma_attrs;
232 240
233#endif /* CONFIG_HAVE_DMA_ATTRS */ 241#endif /* CONFIG_HAVE_DMA_ATTRS */
234 242
243#ifdef CONFIG_NEED_DMA_MAP_STATE
244#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME
245#define DEFINE_DMA_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME
246#define dma_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
247#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
248#define dma_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
249#define dma_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
250#else
251#define DEFINE_DMA_UNMAP_ADDR(ADDR_NAME)
252#define DEFINE_DMA_UNMAP_LEN(LEN_NAME)
253#define dma_unmap_addr(PTR, ADDR_NAME) (0)
254#define dma_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
255#define dma_unmap_len(PTR, LEN_NAME) (0)
256#define dma_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
257#endif
258
235#endif 259#endif
diff --git a/include/linux/hil.h b/include/linux/hil.h
index 13352d7d0caf..523785a9de70 100644
--- a/include/linux/hil.h
+++ b/include/linux/hil.h
@@ -168,14 +168,14 @@ enum hil_command {
168 HIL_CMD_PR6 = 0x45, /* Prompt6 */ 168 HIL_CMD_PR6 = 0x45, /* Prompt6 */
169 HIL_CMD_PR7 = 0x46, /* Prompt7 */ 169 HIL_CMD_PR7 = 0x46, /* Prompt7 */
170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */ 170 HIL_CMD_PRM = 0x47, /* Prompt (General Purpose) */
171 HIL_CMD_AK1 = 0x48, /* Acknowlege1 */ 171 HIL_CMD_AK1 = 0x48, /* Acknowledge1 */
172 HIL_CMD_AK2 = 0x49, /* Acknowlege2 */ 172 HIL_CMD_AK2 = 0x49, /* Acknowledge2 */
173 HIL_CMD_AK3 = 0x4a, /* Acknowlege3 */ 173 HIL_CMD_AK3 = 0x4a, /* Acknowledge3 */
174 HIL_CMD_AK4 = 0x4b, /* Acknowlege4 */ 174 HIL_CMD_AK4 = 0x4b, /* Acknowledge4 */
175 HIL_CMD_AK5 = 0x4c, /* Acknowlege5 */ 175 HIL_CMD_AK5 = 0x4c, /* Acknowledge5 */
176 HIL_CMD_AK6 = 0x4d, /* Acknowlege6 */ 176 HIL_CMD_AK6 = 0x4d, /* Acknowledge6 */
177 HIL_CMD_AK7 = 0x4e, /* Acknowlege7 */ 177 HIL_CMD_AK7 = 0x4e, /* Acknowledge7 */
178 HIL_CMD_ACK = 0x4f, /* Acknowlege (General Purpose) */ 178 HIL_CMD_ACK = 0x4f, /* Acknowledge (General Purpose) */
179 179
180 /* 0x50 to 0x78 reserved for future use */ 180 /* 0x50 to 0x78 reserved for future use */
181 /* 0x80 to 0xEF device-specific commands */ 181 /* 0x80 to 0xEF device-specific commands */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index abec69b63d7e..b1ed1cd8e2a8 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -32,14 +32,6 @@ extern struct fs_struct init_fs;
32} 32}
33 33
34extern struct nsproxy init_nsproxy; 34extern struct nsproxy init_nsproxy;
35#define INIT_NSPROXY(nsproxy) { \
36 .pid_ns = &init_pid_ns, \
37 .count = ATOMIC_INIT(1), \
38 .uts_ns = &init_uts_ns, \
39 .mnt_ns = NULL, \
40 INIT_NET_NS(net_ns) \
41 INIT_IPC_NS(ipc_ns) \
42}
43 35
44#define INIT_SIGHAND(sighand) { \ 36#define INIT_SIGHAND(sighand) { \
45 .count = ATOMIC_INIT(1), \ 37 .count = ATOMIC_INIT(1), \
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 1195a806fe0c..a0bb301afac0 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -42,7 +42,7 @@ struct io_context {
42 unsigned short ioprio; 42 unsigned short ioprio;
43 unsigned short ioprio_changed; 43 unsigned short ioprio_changed;
44 44
45#ifdef CONFIG_BLK_CGROUP 45#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
46 unsigned short cgroup_changed; 46 unsigned short cgroup_changed;
47#endif 47#endif
48 48
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index 07baa38bce37..51952989ad42 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -62,11 +62,6 @@ extern struct ipc_namespace init_ipc_ns;
62extern atomic_t nr_ipc_ns; 62extern atomic_t nr_ipc_ns;
63 63
64extern spinlock_t mq_lock; 64extern spinlock_t mq_lock;
65#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
66#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
67#else
68#define INIT_IPC_NS(ns)
69#endif
70 65
71#ifdef CONFIG_SYSVIPC 66#ifdef CONFIG_SYSVIPC
72extern int register_ipcns_notifier(struct ipc_namespace *); 67extern int register_ipcns_notifier(struct ipc_namespace *);
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index f7c9c75a2775..4b48318ac542 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -39,7 +39,6 @@
39#include <linux/module.h> 39#include <linux/module.h>
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/platform_device.h> 41#include <linux/platform_device.h>
42#include <linux/ipmi_smi.h>
43 42
44/* This files describes the interface for IPMI system management interface 43/* This files describes the interface for IPMI system management interface
45 drivers to bind into the IPMI message handler. */ 44 drivers to bind into the IPMI message handler. */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 384ca8bbf1ac..facb27fe7de0 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -27,6 +27,7 @@
27#define KMOD_PATH_LEN 256 27#define KMOD_PATH_LEN 256
28 28
29#ifdef CONFIG_MODULES 29#ifdef CONFIG_MODULES
30extern char modprobe_path[]; /* for sysctl */
30/* modprobe exit status on success, -ve on error. Return value 31/* modprobe exit status on success, -ve on error. Return value
31 * usually useless though. */ 32 * usually useless though. */
32extern int __request_module(bool wait, const char *name, ...) \ 33extern int __request_module(bool wait, const char *name, ...) \
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 10206a87da19..a03977a96d7e 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -12,6 +12,10 @@
12struct task_struct; 12struct task_struct;
13struct lockdep_map; 13struct lockdep_map;
14 14
15/* for sysctl */
16extern int prove_locking;
17extern int lock_stat;
18
15#ifdef CONFIG_LOCKDEP 19#ifdef CONFIG_LOCKDEP
16 20
17#include <linux/linkage.h> 21#include <linux/linkage.h>
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h
index 3a2b2d9b0472..de48d167568b 100644
--- a/include/linux/lru_cache.h
+++ b/include/linux/lru_cache.h
@@ -64,7 +64,7 @@ For crash recovery after replication node failure,
64 usually the condition is softened to regions that _may_ have been target of 64 usually the condition is softened to regions that _may_ have been target of
65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent 65 in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent
66 bitmap, trading frequency of meta data transactions against amount of 66 bitmap, trading frequency of meta data transactions against amount of
67 (possibly unneccessary) resync traffic. 67 (possibly unnecessary) resync traffic.
68 68
69 If we set a hard limit on the area that may be "hot" at any given time, we 69 If we set a hard limit on the area that may be "hot" at any given time, we
70 limit the amount of resync traffic needed for crash recovery. 70 limit the amount of resync traffic needed for crash recovery.
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 1f9b119f4ace..44301c6affa8 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -124,7 +124,6 @@ static inline bool mem_cgroup_disabled(void)
124 return false; 124 return false;
125} 125}
126 126
127extern bool mem_cgroup_oom_called(struct task_struct *task);
128void mem_cgroup_update_file_mapped(struct page *page, int val); 127void mem_cgroup_update_file_mapped(struct page *page, int val);
129unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, 128unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
130 gfp_t gfp_mask, int nid, 129 gfp_t gfp_mask, int nid,
@@ -258,11 +257,6 @@ static inline bool mem_cgroup_disabled(void)
258 return true; 257 return true;
259} 258}
260 259
261static inline bool mem_cgroup_oom_called(struct task_struct *task)
262{
263 return false;
264}
265
266static inline int 260static inline int
267mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) 261mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
268{ 262{
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3899395a03de..e70f21beb4b4 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -971,7 +971,13 @@ static inline void setmax_mm_hiwater_rss(unsigned long *maxrss,
971 *maxrss = hiwater_rss; 971 *maxrss = hiwater_rss;
972} 972}
973 973
974#if defined(SPLIT_RSS_COUNTING)
974void sync_mm_rss(struct task_struct *task, struct mm_struct *mm); 975void sync_mm_rss(struct task_struct *task, struct mm_struct *mm);
976#else
977static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
978{
979}
980#endif
975 981
976/* 982/*
977 * A callback you can register to apply pressure to ageable caches. 983 * A callback you can register to apply pressure to ageable caches.
@@ -1459,5 +1465,7 @@ extern void shake_page(struct page *p, int access);
1459extern atomic_long_t mce_bad_pages; 1465extern atomic_long_t mce_bad_pages;
1460extern int soft_offline_page(struct page *page, int flags); 1466extern int soft_offline_page(struct page *page, int flags);
1461 1467
1468extern void dump_page(struct page *page);
1469
1462#endif /* __KERNEL__ */ 1470#endif /* __KERNEL__ */
1463#endif /* _LINUX_MM_H */ 1471#endif /* _LINUX_MM_H */
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 048b46270aa5..b8bb9a6a1f37 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -203,7 +203,7 @@ enum {
203 NR_MM_COUNTERS 203 NR_MM_COUNTERS
204}; 204};
205 205
206#if USE_SPLIT_PTLOCKS 206#if USE_SPLIT_PTLOCKS && defined(CONFIG_MMU)
207#define SPLIT_RSS_COUNTING 207#define SPLIT_RSS_COUNTING
208struct mm_rss_stat { 208struct mm_rss_stat {
209 atomic_long_t count[NR_MM_COUNTERS]; 209 atomic_long_t count[NR_MM_COUNTERS];
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index bc209d8b7b5c..cf9e458e96b0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -342,7 +342,7 @@ struct zone {
342 * prev_priority holds the scanning priority for this zone. It is 342 * prev_priority holds the scanning priority for this zone. It is
343 * defined as the scanning priority at which we achieved our reclaim 343 * defined as the scanning priority at which we achieved our reclaim
344 * target at the previous try_to_free_pages() or balance_pgdat() 344 * target at the previous try_to_free_pages() or balance_pgdat()
345 * invokation. 345 * invocation.
346 * 346 *
347 * We use prev_priority as a measure of how much stress page reclaim is 347 * We use prev_priority as a measure of how much stress page reclaim is
348 * under - it drives the swappiness decision: whether to unmap mapped 348 * under - it drives the swappiness decision: whether to unmap mapped
diff --git a/include/linux/module.h b/include/linux/module.h
index dd618eb026aa..5e869ffd34aa 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -175,6 +175,7 @@ struct notifier_block;
175 175
176#ifdef CONFIG_MODULES 176#ifdef CONFIG_MODULES
177 177
178extern int modules_disabled; /* for sysctl */
178/* Get/put a kernel symbol (calls must be symmetric) */ 179/* Get/put a kernel symbol (calls must be symmetric) */
179void *__symbol_get(const char *symbol); 180void *__symbol_get(const char *symbol);
180void *__symbol_get_gpl(const char *symbol); 181void *__symbol_get_gpl(const char *symbol);
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index c4fa64b585ff..dba35e413371 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -483,7 +483,7 @@ static inline int num_node_state(enum node_states state)
483 type *name = kmalloc(sizeof(*name), gfp_flags) 483 type *name = kmalloc(sizeof(*name), gfp_flags)
484#define NODEMASK_FREE(m) kfree(m) 484#define NODEMASK_FREE(m) kfree(m)
485#else 485#else
486#define NODEMASK_ALLOC(type, name, gfp_flags) type _name, *name = &_name 486#define NODEMASK_ALLOC(type, name, gfp_flags) type _##name, *name = &_##name
487#define NODEMASK_FREE(m) do {} while (0) 487#define NODEMASK_FREE(m) do {} while (0)
488#endif 488#endif
489 489
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index b0e4eb126236..30b08136fdf3 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -118,6 +118,8 @@ static inline void __init page_cgroup_init_flatmem(void)
118#include <linux/swap.h> 118#include <linux/swap.h>
119 119
120#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 120#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
121extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
122 unsigned short old, unsigned short new);
121extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id); 123extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
122extern unsigned short lookup_swap_cgroup(swp_entry_t ent); 124extern unsigned short lookup_swap_cgroup(swp_entry_t ent);
123extern int swap_cgroup_swapon(int type, unsigned long max_pages); 125extern int swap_cgroup_swapon(int type, unsigned long max_pages);
diff --git a/include/linux/pci-dma.h b/include/linux/pci-dma.h
new file mode 100644
index 000000000000..549a041f9c08
--- /dev/null
+++ b/include/linux/pci-dma.h
@@ -0,0 +1,11 @@
1#ifndef _LINUX_PCI_DMA_H
2#define _LINUX_PCI_DMA_H
3
4#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) DEFINE_DMA_UNMAP_ADDR(ADDR_NAME);
5#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) DEFINE_DMA_UNMAP_LEN(LEN_NAME);
6#define pci_unmap_addr dma_unmap_addr
7#define pci_unmap_addr_set dma_unmap_addr_set
8#define pci_unmap_len dma_unmap_len
9#define pci_unmap_len_set dma_unmap_len_set
10
11#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index cd5809a5963e..a788fa12ff31 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -769,8 +769,6 @@ int pci_try_set_mwi(struct pci_dev *dev);
769void pci_clear_mwi(struct pci_dev *dev); 769void pci_clear_mwi(struct pci_dev *dev);
770void pci_intx(struct pci_dev *dev, int enable); 770void pci_intx(struct pci_dev *dev, int enable);
771void pci_msi_off(struct pci_dev *dev); 771void pci_msi_off(struct pci_dev *dev);
772int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
773int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
774int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 772int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
775int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 773int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
776int pcix_get_max_mmrbc(struct pci_dev *dev); 774int pcix_get_max_mmrbc(struct pci_dev *dev);
@@ -904,6 +902,7 @@ int pci_set_vga_state(struct pci_dev *pdev, bool decode,
904 unsigned int command_bits, bool change_bridge); 902 unsigned int command_bits, bool change_bridge);
905/* kmem_cache style wrapper around pci_alloc_consistent() */ 903/* kmem_cache style wrapper around pci_alloc_consistent() */
906 904
905#include <linux/pci-dma.h>
907#include <linux/dmapool.h> 906#include <linux/dmapool.h>
908 907
909#define pci_pool dma_pool 908#define pci_pool dma_pool
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 6673743946f7..600cc1fde64d 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -10,8 +10,10 @@
10#include <linux/wait.h> 10#include <linux/wait.h>
11#include <linux/string.h> 11#include <linux/string.h>
12#include <linux/fs.h> 12#include <linux/fs.h>
13#include <linux/sysctl.h>
13#include <asm/uaccess.h> 14#include <asm/uaccess.h>
14 15
16extern struct ctl_table epoll_table[]; /* for sysctl */
15/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating 17/* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
16 additional memory. */ 18 additional memory. */
17#define MAX_STACK_ALLOC 832 19#define MAX_STACK_ALLOC 832
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index c5eab89da51e..e1fb60729979 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -264,6 +264,9 @@ static inline void user_enable_single_step(struct task_struct *task)
264static inline void user_disable_single_step(struct task_struct *task) 264static inline void user_disable_single_step(struct task_struct *task)
265{ 265{
266} 266}
267#else
268extern void user_enable_single_step(struct task_struct *);
269extern void user_disable_single_step(struct task_struct *);
267#endif /* arch_has_single_step */ 270#endif /* arch_has_single_step */
268 271
269#ifndef arch_has_block_step 272#ifndef arch_has_block_step
@@ -291,6 +294,8 @@ static inline void user_enable_block_step(struct task_struct *task)
291{ 294{
292 BUG(); /* This can never be called. */ 295 BUG(); /* This can never be called. */
293} 296}
297#else
298extern void user_enable_block_step(struct task_struct *);
294#endif /* arch_has_block_step */ 299#endif /* arch_has_block_step */
295 300
296#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO 301#ifdef ARCH_HAS_USER_SINGLE_STEP_INFO
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 9c295411d01f..5210a5c60877 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -25,10 +25,10 @@
25 25
26 Some example of insert and search follows here. The search is a plain 26 Some example of insert and search follows here. The search is a plain
27 normal search over an ordered tree. The insert instead must be implemented 27 normal search over an ordered tree. The insert instead must be implemented
28 int two steps: as first thing the code must insert the element in 28 in two steps: First, the code must insert the element in order as a red leaf
29 order as a red leaf in the tree, then the support library function 29 in the tree, and then the support library function rb_insert_color() must
30 rb_insert_color() must be called. Such function will do the 30 be called. Such function will do the not trivial work to rebalance the
31 not trivial work to rebalance the rbtree if necessary. 31 rbtree, if necessary.
32 32
33----------------------------------------------------------------------- 33-----------------------------------------------------------------------
34static inline struct page * rb_search_page_cache(struct inode * inode, 34static inline struct page * rb_search_page_cache(struct inode * inode,
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index c84373626336..a005cac5e302 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -41,6 +41,10 @@
41#include <linux/lockdep.h> 41#include <linux/lockdep.h>
42#include <linux/completion.h> 42#include <linux/completion.h>
43 43
44#ifdef CONFIG_RCU_TORTURE_TEST
45extern int rcutorture_runnable; /* for sysctl */
46#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
47
44/** 48/**
45 * struct rcu_head - callback structure for use with RCU 49 * struct rcu_head - callback structure for use with RCU
46 * @next: next update requests in a list 50 * @next: next update requests in a list
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 988e55fe649b..3005d5a7fce5 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -64,6 +64,7 @@ extern void kernel_restart(char *cmd);
64extern void kernel_halt(void); 64extern void kernel_halt(void);
65extern void kernel_power_off(void); 65extern void kernel_power_off(void);
66 66
67extern int C_A_D; /* for sysctl */
67void ctrl_alt_del(void); 68void ctrl_alt_del(void);
68 69
69#define POWEROFF_CMD_PATH_LEN 256 70#define POWEROFF_CMD_PATH_LEN 256
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 60f88a7fb13d..14dbc83ded20 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
238 return (!(year % 4) && (year % 100)) || !(year % 400); 238 return (!(year % 4) && (year % 100)) || !(year % 400);
239} 239}
240 240
241#ifdef CONFIG_RTC_HCTOSYS
242extern int rtc_hctosys_ret;
243#else
244#define rtc_hctosys_ret -ENODEV
245#endif
246
241#endif /* __KERNEL__ */ 247#endif /* __KERNEL__ */
242 248
243#endif /* _LINUX_RTC_H_ */ 249#endif /* _LINUX_RTC_H_ */
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 281d8fd775e8..8d522ffeda33 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -16,6 +16,8 @@
16#include <linux/plist.h> 16#include <linux/plist.h>
17#include <linux/spinlock_types.h> 17#include <linux/spinlock_types.h>
18 18
19extern int max_lock_depth; /* for sysctl */
20
19/** 21/**
20 * The rt_mutex structure 22 * The rt_mutex structure
21 * 23 *
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 46c6f8d5dc06..8d70ff802da2 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1473,7 +1473,7 @@ struct task_struct {
1473 1473
1474 struct list_head *scm_work_list; 1474 struct list_head *scm_work_list;
1475#ifdef CONFIG_FUNCTION_GRAPH_TRACER 1475#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1476 /* Index of current stored adress in ret_stack */ 1476 /* Index of current stored address in ret_stack */
1477 int curr_ret_stack; 1477 int curr_ret_stack;
1478 /* Stack of return addresses for return function tracing */ 1478 /* Stack of return addresses for return function tracing */
1479 struct ftrace_ret_stack *ret_stack; 1479 struct ftrace_ret_stack *ret_stack;
@@ -2391,9 +2391,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2391 2391
2392static inline void thread_group_cputime_init(struct signal_struct *sig) 2392static inline void thread_group_cputime_init(struct signal_struct *sig)
2393{ 2393{
2394 sig->cputimer.cputime = INIT_CPUTIME;
2395 spin_lock_init(&sig->cputimer.lock); 2394 spin_lock_init(&sig->cputimer.lock);
2396 sig->cputimer.running = 0;
2397} 2395}
2398 2396
2399static inline void thread_group_cputime_free(struct signal_struct *sig) 2397static inline void thread_group_cputime_free(struct signal_struct *sig)
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 8c3dd36fe91a..78dd1e7120a9 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -491,9 +491,13 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
491{ 491{
492 struct uart_state *state = uport->state; 492 struct uart_state *state = uport->state;
493 struct tty_port *port = &state->port; 493 struct tty_port *port = &state->port;
494 struct tty_ldisc *ld = tty_ldisc_ref(port->tty);
495 struct timespec ts;
494 496
495 uport->icount.dcd++; 497 if (ld && ld->ops->dcd_change)
498 getnstimeofday(&ts);
496 499
500 uport->icount.dcd++;
497#ifdef CONFIG_HARD_PPS 501#ifdef CONFIG_HARD_PPS
498 if ((uport->flags & UPF_HARDPPS_CD) && status) 502 if ((uport->flags & UPF_HARDPPS_CD) && status)
499 hardpps(); 503 hardpps();
@@ -505,6 +509,11 @@ uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
505 else if (port->tty) 509 else if (port->tty)
506 tty_hangup(port->tty); 510 tty_hangup(port->tty);
507 } 511 }
512
513 if (ld && ld->ops->dcd_change)
514 ld->ops->dcd_change(port->tty, status, &ts);
515 if (ld)
516 tty_ldisc_deref(ld);
508} 517}
509 518
510/** 519/**
diff --git a/include/linux/signal.h b/include/linux/signal.h
index ab9272cc270c..fcd2b14b1932 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -7,6 +7,8 @@
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h> 8#include <linux/list.h>
9 9
10/* for sysctl */
11extern int print_fatal_signals;
10/* 12/*
11 * Real Time signals may be queued. 13 * Real Time signals may be queued.
12 */ 14 */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index a2602a8207a6..1f59d9340c4d 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -355,6 +355,7 @@ static inline void disable_swap_token(void)
355#ifdef CONFIG_CGROUP_MEM_RES_CTLR 355#ifdef CONFIG_CGROUP_MEM_RES_CTLR
356extern void 356extern void
357mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 357mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
358extern int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep);
358#else 359#else
359static inline void 360static inline void
360mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) 361mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
@@ -485,6 +486,14 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent)
485{ 486{
486} 487}
487 488
489#ifdef CONFIG_CGROUP_MEM_RES_CTLR
490static inline int
491mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep)
492{
493 return 0;
494}
495#endif
496
488#endif /* CONFIG_SWAP */ 497#endif /* CONFIG_SWAP */
489#endif /* __KERNEL__*/ 498#endif /* __KERNEL__*/
490#endif /* _LINUX_SWAP_H */ 499#endif /* _LINUX_SWAP_H */
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8126f239edf0..44f2ad0e8825 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -23,6 +23,7 @@ struct kexec_segment;
23struct linux_dirent; 23struct linux_dirent;
24struct linux_dirent64; 24struct linux_dirent64;
25struct list_head; 25struct list_head;
26struct mmap_arg_struct;
26struct msgbuf; 27struct msgbuf;
27struct msghdr; 28struct msghdr;
28struct mmsghdr; 29struct mmsghdr;
@@ -30,10 +31,13 @@ struct msqid_ds;
30struct new_utsname; 31struct new_utsname;
31struct nfsctl_arg; 32struct nfsctl_arg;
32struct __old_kernel_stat; 33struct __old_kernel_stat;
34struct oldold_utsname;
35struct old_utsname;
33struct pollfd; 36struct pollfd;
34struct rlimit; 37struct rlimit;
35struct rusage; 38struct rusage;
36struct sched_param; 39struct sched_param;
40struct sel_arg_struct;
37struct semaphore; 41struct semaphore;
38struct sembuf; 42struct sembuf;
39struct shmid_ds; 43struct shmid_ds;
@@ -638,6 +642,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds,
638 long timeout); 642 long timeout);
639asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, 643asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp,
640 fd_set __user *exp, struct timeval __user *tvp); 644 fd_set __user *exp, struct timeval __user *tvp);
645asmlinkage long sys_old_select(struct sel_arg_struct __user *arg);
641asmlinkage long sys_epoll_create(int size); 646asmlinkage long sys_epoll_create(int size);
642asmlinkage long sys_epoll_create1(int flags); 647asmlinkage long sys_epoll_create1(int flags);
643asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, 648asmlinkage long sys_epoll_ctl(int epfd, int op, int fd,
@@ -652,6 +657,8 @@ asmlinkage long sys_gethostname(char __user *name, int len);
652asmlinkage long sys_sethostname(char __user *name, int len); 657asmlinkage long sys_sethostname(char __user *name, int len);
653asmlinkage long sys_setdomainname(char __user *name, int len); 658asmlinkage long sys_setdomainname(char __user *name, int len);
654asmlinkage long sys_newuname(struct new_utsname __user *name); 659asmlinkage long sys_newuname(struct new_utsname __user *name);
660asmlinkage long sys_uname(struct old_utsname __user *);
661asmlinkage long sys_olduname(struct oldold_utsname __user *);
655 662
656asmlinkage long sys_getrlimit(unsigned int resource, 663asmlinkage long sys_getrlimit(unsigned int resource,
657 struct rlimit __user *rlim); 664 struct rlimit __user *rlim);
@@ -681,6 +688,8 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg);
681asmlinkage long sys_shmget(key_t key, size_t size, int flag); 688asmlinkage long sys_shmget(key_t key, size_t size, int flag);
682asmlinkage long sys_shmdt(char __user *shmaddr); 689asmlinkage long sys_shmdt(char __user *shmaddr);
683asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); 690asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf);
691asmlinkage long sys_ipc(unsigned int call, int first, int second,
692 unsigned long third, void __user *ptr, long fifth);
684 693
685asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); 694asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr);
686asmlinkage long sys_mq_unlink(const char __user *name); 695asmlinkage long sys_mq_unlink(const char __user *name);
@@ -836,4 +845,6 @@ asmlinkage long sys_perf_event_open(
836asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, 845asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len,
837 unsigned long prot, unsigned long flags, 846 unsigned long prot, unsigned long flags,
838 unsigned long fd, unsigned long pgoff); 847 unsigned long fd, unsigned long pgoff);
848asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg);
849
839#endif 850#endif
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 3398f4553269..b6523c1427ce 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -14,11 +14,6 @@
14extern struct kmem_cache *taskstats_cache; 14extern struct kmem_cache *taskstats_cache;
15extern struct mutex taskstats_exit_mutex; 15extern struct mutex taskstats_exit_mutex;
16 16
17static inline void taskstats_tgid_init(struct signal_struct *sig)
18{
19 sig->stats = NULL;
20}
21
22static inline void taskstats_tgid_free(struct signal_struct *sig) 17static inline void taskstats_tgid_free(struct signal_struct *sig)
23{ 18{
24 if (sig->stats) 19 if (sig->stats)
@@ -30,8 +25,6 @@ extern void taskstats_init_early(void);
30#else 25#else
31static inline void taskstats_exit(struct task_struct *tsk, int group_dead) 26static inline void taskstats_exit(struct task_struct *tsk, int group_dead)
32{} 27{}
33static inline void taskstats_tgid_init(struct signal_struct *sig)
34{}
35static inline void taskstats_tgid_free(struct signal_struct *sig) 28static inline void taskstats_tgid_free(struct signal_struct *sig)
36{} 29{}
37static inline void taskstats_init_early(void) 30static inline void taskstats_init_early(void)
diff --git a/include/linux/tty.h b/include/linux/tty.h
index d96e5882f129..568369a86306 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -514,6 +514,7 @@ extern void tty_ldisc_enable(struct tty_struct *tty);
514 514
515/* n_tty.c */ 515/* n_tty.c */
516extern struct tty_ldisc_ops tty_ldisc_N_TTY; 516extern struct tty_ldisc_ops tty_ldisc_N_TTY;
517extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
517 518
518/* tty_audit.c */ 519/* tty_audit.c */
519#ifdef CONFIG_AUDIT 520#ifdef CONFIG_AUDIT
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 0c4ee9b88f85..526d66f066a3 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -99,6 +99,12 @@
99 * cease I/O to the tty driver. Can sleep. The driver should 99 * cease I/O to the tty driver. Can sleep. The driver should
100 * seek to perform this action quickly but should wait until 100 * seek to perform this action quickly but should wait until
101 * any pending driver I/O is completed. 101 * any pending driver I/O is completed.
102 *
103 * void (*dcd_change)(struct tty_struct *tty, unsigned int status,
104 * struct timespec *ts)
105 *
106 * Tells the discipline that the DCD pin has changed its status and
107 * the relative timestamp. Pointer ts can be NULL.
102 */ 108 */
103 109
104#include <linux/fs.h> 110#include <linux/fs.h>
@@ -136,6 +142,8 @@ struct tty_ldisc_ops {
136 void (*receive_buf)(struct tty_struct *, const unsigned char *cp, 142 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
137 char *fp, int count); 143 char *fp, int count);
138 void (*write_wakeup)(struct tty_struct *); 144 void (*write_wakeup)(struct tty_struct *);
145 void (*dcd_change)(struct tty_struct *, unsigned int,
146 struct timespec *);
139 147
140 struct module *owner; 148 struct module *owner;
141 149
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index f456534dcaf9..fd882261225e 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -29,7 +29,7 @@
29 _FP_FRAC_DECL_##wc(X) 29 _FP_FRAC_DECL_##wc(X)
30 30
31/* 31/*
32 * Finish truely unpacking a native fp value by classifying the kind 32 * Finish truly unpacking a native fp value by classifying the kind
33 * of fp value and normalizing both the exponent and the fraction. 33 * of fp value and normalizing both the exponent and the fraction.
34 */ 34 */
35 35
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h
index d863e5e8426d..4314a5f6a087 100644
--- a/include/media/davinci/vpfe_capture.h
+++ b/include/media/davinci/vpfe_capture.h
@@ -165,7 +165,7 @@ struct vpfe_device {
165 u8 started; 165 u8 started;
166 /* 166 /*
167 * offset where second field starts from the starting of the 167 * offset where second field starts from the starting of the
168 * buffer for field seperated YCbCr formats 168 * buffer for field separated YCbCr formats
169 */ 169 */
170 u32 field_off; 170 u32 field_off;
171}; 171};
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index 0788c23d2828..11aee7a2972a 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -97,7 +97,7 @@
97#define TTP_MAX_SDU_SIZE 0x01 97#define TTP_MAX_SDU_SIZE 0x01
98 98
99/* 99/*
100 * This structure contains all data assosiated with one instance of a TTP 100 * This structure contains all data associated with one instance of a TTP
101 * connection. 101 * connection.
102 */ 102 */
103struct tsap_cb { 103struct tsap_cb {
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 82b7be4db89a..bd10a7908993 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -100,14 +100,9 @@ struct net {
100extern struct net init_net; 100extern struct net init_net;
101 101
102#ifdef CONFIG_NET 102#ifdef CONFIG_NET
103#define INIT_NET_NS(net_ns) .net_ns = &init_net,
104
105extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); 103extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);
106 104
107#else /* CONFIG_NET */ 105#else /* CONFIG_NET */
108
109#define INIT_NET_NS(net_ns)
110
111static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) 106static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
112{ 107{
113 /* There is nothing to copy so this is a noop */ 108 /* There is nothing to copy so this is a noop */
diff --git a/include/scsi/sg.h b/include/scsi/sg.h
index 934ae389671d..a9f3c6fc3f57 100644
--- a/include/scsi/sg.h
+++ b/include/scsi/sg.h
@@ -70,6 +70,9 @@ Major new features in SG 3.x driver (cf SG 2.x drivers)
70 (for the lk 2.2 series). 70 (for the lk 2.2 series).
71*/ 71*/
72 72
73#ifdef __KERNEL__
74extern int sg_big_buff; /* for sysctl */
75#endif
73 76
74/* New interface introduced in the 3.x SG drivers follows */ 77/* New interface introduced in the 3.x SG drivers follows */
75 78
diff --git a/include/video/broadsheetfb.h b/include/video/broadsheetfb.h
index a758534c0272..548d28f4ec67 100644
--- a/include/video/broadsheetfb.h
+++ b/include/video/broadsheetfb.h
@@ -29,11 +29,19 @@
29#define BS_CMD_UPD_FULL 0x33 29#define BS_CMD_UPD_FULL 0x33
30#define BS_CMD_UPD_GDRV_CLR 0x37 30#define BS_CMD_UPD_GDRV_CLR 0x37
31 31
32/* Broadsheet register interface defines */
33#define BS_REG_REV 0x00
34#define BS_REG_PRC 0x02
35
32/* Broadsheet pin interface specific defines */ 36/* Broadsheet pin interface specific defines */
33#define BS_CS 0x01 37#define BS_CS 0x01
34#define BS_DC 0x02 38#define BS_DC 0x02
35#define BS_WR 0x03 39#define BS_WR 0x03
36 40
41/* Broadsheet IO interface specific defines */
42#define BS_MMIO_CMD 0x01
43#define BS_MMIO_DATA 0x02
44
37/* struct used by broadsheet. board specific stuff comes from *board */ 45/* struct used by broadsheet. board specific stuff comes from *board */
38struct broadsheetfb_par { 46struct broadsheetfb_par {
39 struct fb_info *info; 47 struct fb_info *info;
@@ -41,6 +49,8 @@ struct broadsheetfb_par {
41 void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val); 49 void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val);
42 u16 (*read_reg)(struct broadsheetfb_par *, u16 reg); 50 u16 (*read_reg)(struct broadsheetfb_par *, u16 reg);
43 wait_queue_head_t waitq; 51 wait_queue_head_t waitq;
52 int panel_index;
53 struct mutex io_lock;
44}; 54};
45 55
46/* board specific routines */ 56/* board specific routines */
@@ -48,12 +58,17 @@ struct broadsheet_board {
48 struct module *owner; 58 struct module *owner;
49 int (*init)(struct broadsheetfb_par *); 59 int (*init)(struct broadsheetfb_par *);
50 int (*wait_for_rdy)(struct broadsheetfb_par *); 60 int (*wait_for_rdy)(struct broadsheetfb_par *);
51 void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8);
52 void (*set_hdb)(struct broadsheetfb_par *, u16);
53 u16 (*get_hdb)(struct broadsheetfb_par *);
54 void (*cleanup)(struct broadsheetfb_par *); 61 void (*cleanup)(struct broadsheetfb_par *);
55 int (*get_panel_type)(void); 62 int (*get_panel_type)(void);
56 int (*setup_irq)(struct fb_info *); 63 int (*setup_irq)(struct fb_info *);
57};
58 64
65 /* Functions for boards that use GPIO */
66 void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8);
67 void (*set_hdb)(struct broadsheetfb_par *, u16);
68 u16 (*get_hdb)(struct broadsheetfb_par *);
69
70 /* Functions for boards that have specialized MMIO */
71 void (*mmio_write)(struct broadsheetfb_par *, int type, u16);
72 u16 (*mmio_read)(struct broadsheetfb_par *);
73};
59#endif 74#endif
diff --git a/init/Kconfig b/init/Kconfig
index 089a230e5652..eb77e8ccde1c 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -463,6 +463,7 @@ config HAVE_UNSTABLE_SCHED_CLOCK
463 463
464menuconfig CGROUPS 464menuconfig CGROUPS
465 boolean "Control Group support" 465 boolean "Control Group support"
466 depends on EVENTFD
466 help 467 help
467 This option adds support for grouping sets of processes together, for 468 This option adds support for grouping sets of processes together, for
468 use with process control subsystems such as Cpusets, CFS, memory 469 use with process control subsystems such as Cpusets, CFS, memory
diff --git a/ipc/Makefile b/ipc/Makefile
index 4e1955ea815d..9075e172e52c 100644
--- a/ipc/Makefile
+++ b/ipc/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-$(CONFIG_SYSVIPC_COMPAT) += compat.o 5obj-$(CONFIG_SYSVIPC_COMPAT) += compat.o
6obj-$(CONFIG_SYSVIPC) += util.o msgutil.o msg.o sem.o shm.o ipcns_notifier.o 6obj-$(CONFIG_SYSVIPC) += util.o msgutil.o msg.o sem.o shm.o ipcns_notifier.o syscall.o
7obj-$(CONFIG_SYSVIPC_SYSCTL) += ipc_sysctl.o 7obj-$(CONFIG_SYSVIPC_SYSCTL) += ipc_sysctl.o
8obj_mq-$(CONFIG_COMPAT) += compat_mq.o 8obj_mq-$(CONFIG_COMPAT) += compat_mq.o
9obj-$(CONFIG_POSIX_MQUEUE) += mqueue.o msgutil.o $(obj_mq-y) 9obj-$(CONFIG_POSIX_MQUEUE) += mqueue.o msgutil.o $(obj_mq-y)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index b6cb06451f4b..e4e3f04803ca 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -155,7 +155,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
155 spin_lock(&mq_lock); 155 spin_lock(&mq_lock);
156 if (u->mq_bytes + mq_bytes < u->mq_bytes || 156 if (u->mq_bytes + mq_bytes < u->mq_bytes ||
157 u->mq_bytes + mq_bytes > 157 u->mq_bytes + mq_bytes >
158 p->signal->rlim[RLIMIT_MSGQUEUE].rlim_cur) { 158 task_rlimit(p, RLIMIT_MSGQUEUE)) {
159 spin_unlock(&mq_lock); 159 spin_unlock(&mq_lock);
160 kfree(info->messages); 160 kfree(info->messages);
161 goto out_inode; 161 goto out_inode;
diff --git a/ipc/shm.c b/ipc/shm.c
index 23256b855819..1a314c89f93c 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -764,8 +764,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf)
764 if (euid != shp->shm_perm.uid && 764 if (euid != shp->shm_perm.uid &&
765 euid != shp->shm_perm.cuid) 765 euid != shp->shm_perm.cuid)
766 goto out_unlock; 766 goto out_unlock;
767 if (cmd == SHM_LOCK && 767 if (cmd == SHM_LOCK && !rlimit(RLIMIT_MEMLOCK))
768 !current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur)
769 goto out_unlock; 768 goto out_unlock;
770 } 769 }
771 770
diff --git a/ipc/syscall.c b/ipc/syscall.c
new file mode 100644
index 000000000000..355a3da9ec73
--- /dev/null
+++ b/ipc/syscall.c
@@ -0,0 +1,99 @@
1/*
2 * sys_ipc() is the old de-multiplexer for the SysV IPC calls.
3 *
4 * This is really horribly ugly, and new architectures should just wire up
5 * the individual syscalls instead.
6 */
7#include <linux/unistd.h>
8
9#ifdef __ARCH_WANT_SYS_IPC
10#include <linux/errno.h>
11#include <linux/ipc.h>
12#include <linux/shm.h>
13#include <linux/syscalls.h>
14#include <linux/uaccess.h>
15
16SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second,
17 unsigned long, third, void __user *, ptr, long, fifth)
18{
19 int version, ret;
20
21 version = call >> 16; /* hack for backward compatibility */
22 call &= 0xffff;
23
24 switch (call) {
25 case SEMOP:
26 return sys_semtimedop(first, (struct sembuf __user *)ptr,
27 second, NULL);
28 case SEMTIMEDOP:
29 return sys_semtimedop(first, (struct sembuf __user *)ptr,
30 second,
31 (const struct timespec __user *)fifth);
32
33 case SEMGET:
34 return sys_semget(first, second, third);
35 case SEMCTL: {
36 union semun fourth;
37 if (!ptr)
38 return -EINVAL;
39 if (get_user(fourth.__pad, (void __user * __user *) ptr))
40 return -EFAULT;
41 return sys_semctl(first, second, third, fourth);
42 }
43
44 case MSGSND:
45 return sys_msgsnd(first, (struct msgbuf __user *) ptr,
46 second, third);
47 case MSGRCV:
48 switch (version) {
49 case 0: {
50 struct ipc_kludge tmp;
51 if (!ptr)
52 return -EINVAL;
53
54 if (copy_from_user(&tmp,
55 (struct ipc_kludge __user *) ptr,
56 sizeof(tmp)))
57 return -EFAULT;
58 return sys_msgrcv(first, tmp.msgp, second,
59 tmp.msgtyp, third);
60 }
61 default:
62 return sys_msgrcv(first,
63 (struct msgbuf __user *) ptr,
64 second, fifth, third);
65 }
66 case MSGGET:
67 return sys_msgget((key_t) first, second);
68 case MSGCTL:
69 return sys_msgctl(first, second, (struct msqid_ds __user *)ptr);
70
71 case SHMAT:
72 switch (version) {
73 default: {
74 unsigned long raddr;
75 ret = do_shmat(first, (char __user *)ptr,
76 second, &raddr);
77 if (ret)
78 return ret;
79 return put_user(raddr, (unsigned long __user *) third);
80 }
81 case 1:
82 /*
83 * This was the entry point for kernel-originating calls
84 * from iBCS2 in 2.2 days.
85 */
86 return -EINVAL;
87 }
88 case SHMDT:
89 return sys_shmdt((char __user *)ptr);
90 case SHMGET:
91 return sys_shmget(first, second, third);
92 case SHMCTL:
93 return sys_shmctl(first, second,
94 (struct shmid_ds __user *) ptr);
95 default:
96 return -ENOSYS;
97 }
98}
99#endif
diff --git a/kernel/acct.c b/kernel/acct.c
index a6605ca921b6..24f8c81fc48d 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -588,16 +588,6 @@ out:
588} 588}
589 589
590/** 590/**
591 * acct_init_pacct - initialize a new pacct_struct
592 * @pacct: per-process accounting info struct to initialize
593 */
594void acct_init_pacct(struct pacct_struct *pacct)
595{
596 memset(pacct, 0, sizeof(struct pacct_struct));
597 pacct->ac_utime = pacct->ac_stime = cputime_zero;
598}
599
600/**
601 * acct_collect - collect accounting information into pacct_struct 591 * acct_collect - collect accounting information into pacct_struct
602 * @exitcode: task exit code 592 * @exitcode: task exit code
603 * @group_dead: not 0, if this thread is the last one in the process. 593 * @group_dead: not 0, if this thread is the last one in the process.
diff --git a/kernel/audit.c b/kernel/audit.c
index 5feed232be9d..78f7f86aa238 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -398,7 +398,7 @@ static void kauditd_send_skb(struct sk_buff *skb)
398 skb_get(skb); 398 skb_get(skb);
399 err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0); 399 err = netlink_unicast(audit_sock, skb, audit_nlk_pid, 0);
400 if (err < 0) { 400 if (err < 0) {
401 BUG_ON(err != -ECONNREFUSED); /* Shoudn't happen */ 401 BUG_ON(err != -ECONNREFUSED); /* Shouldn't happen */
402 printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid); 402 printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);
403 audit_log_lost("auditd dissapeared\n"); 403 audit_log_lost("auditd dissapeared\n");
404 audit_pid = 0; 404 audit_pid = 0;
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4fd90e129772..ef909a329750 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4,6 +4,10 @@
4 * Based originally on the cpuset system, extracted by Paul Menage 4 * Based originally on the cpuset system, extracted by Paul Menage
5 * Copyright (C) 2006 Google, Inc 5 * Copyright (C) 2006 Google, Inc
6 * 6 *
7 * Notifications support
8 * Copyright (C) 2009 Nokia Corporation
9 * Author: Kirill A. Shutemov
10 *
7 * Copyright notices from the original cpuset code: 11 * Copyright notices from the original cpuset code:
8 * -------------------------------------------------- 12 * --------------------------------------------------
9 * Copyright (C) 2003 BULL SA. 13 * Copyright (C) 2003 BULL SA.
@@ -44,6 +48,7 @@
44#include <linux/string.h> 48#include <linux/string.h>
45#include <linux/sort.h> 49#include <linux/sort.h>
46#include <linux/kmod.h> 50#include <linux/kmod.h>
51#include <linux/module.h>
47#include <linux/delayacct.h> 52#include <linux/delayacct.h>
48#include <linux/cgroupstats.h> 53#include <linux/cgroupstats.h>
49#include <linux/hash.h> 54#include <linux/hash.h>
@@ -52,15 +57,21 @@
52#include <linux/pid_namespace.h> 57#include <linux/pid_namespace.h>
53#include <linux/idr.h> 58#include <linux/idr.h>
54#include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */ 59#include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
60#include <linux/eventfd.h>
61#include <linux/poll.h>
55 62
56#include <asm/atomic.h> 63#include <asm/atomic.h>
57 64
58static DEFINE_MUTEX(cgroup_mutex); 65static DEFINE_MUTEX(cgroup_mutex);
59 66
60/* Generate an array of cgroup subsystem pointers */ 67/*
68 * Generate an array of cgroup subsystem pointers. At boot time, this is
69 * populated up to CGROUP_BUILTIN_SUBSYS_COUNT, and modular subsystems are
70 * registered after that. The mutable section of this array is protected by
71 * cgroup_mutex.
72 */
61#define SUBSYS(_x) &_x ## _subsys, 73#define SUBSYS(_x) &_x ## _subsys,
62 74static struct cgroup_subsys *subsys[CGROUP_SUBSYS_COUNT] = {
63static struct cgroup_subsys *subsys[] = {
64#include <linux/cgroup_subsys.h> 75#include <linux/cgroup_subsys.h>
65}; 76};
66 77
@@ -147,6 +158,35 @@ struct css_id {
147 unsigned short stack[0]; /* Array of Length (depth+1) */ 158 unsigned short stack[0]; /* Array of Length (depth+1) */
148}; 159};
149 160
161/*
162 * cgroup_event represents events which userspace want to recieve.
163 */
164struct cgroup_event {
165 /*
166 * Cgroup which the event belongs to.
167 */
168 struct cgroup *cgrp;
169 /*
170 * Control file which the event associated.
171 */
172 struct cftype *cft;
173 /*
174 * eventfd to signal userspace about the event.
175 */
176 struct eventfd_ctx *eventfd;
177 /*
178 * Each of these stored in a list by the cgroup.
179 */
180 struct list_head list;
181 /*
182 * All fields below needed to unregister event when
183 * userspace closes eventfd.
184 */
185 poll_table pt;
186 wait_queue_head_t *wqh;
187 wait_queue_t wait;
188 struct work_struct remove;
189};
150 190
151/* The list of hierarchy roots */ 191/* The list of hierarchy roots */
152 192
@@ -250,7 +290,8 @@ struct cg_cgroup_link {
250static struct css_set init_css_set; 290static struct css_set init_css_set;
251static struct cg_cgroup_link init_css_set_link; 291static struct cg_cgroup_link init_css_set_link;
252 292
253static int cgroup_subsys_init_idr(struct cgroup_subsys *ss); 293static int cgroup_init_idr(struct cgroup_subsys *ss,
294 struct cgroup_subsys_state *css);
254 295
255/* css_set_lock protects the list of css_set objects, and the 296/* css_set_lock protects the list of css_set objects, and the
256 * chain of tasks off each css_set. Nests outside task->alloc_lock 297 * chain of tasks off each css_set. Nests outside task->alloc_lock
@@ -448,8 +489,11 @@ static struct css_set *find_existing_css_set(
448 struct hlist_node *node; 489 struct hlist_node *node;
449 struct css_set *cg; 490 struct css_set *cg;
450 491
451 /* Built the set of subsystem state objects that we want to 492 /*
452 * see in the new css_set */ 493 * Build the set of subsystem state objects that we want to see in the
494 * new css_set. while subsystems can change globally, the entries here
495 * won't change, so no need for locking.
496 */
453 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 497 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
454 if (root->subsys_bits & (1UL << i)) { 498 if (root->subsys_bits & (1UL << i)) {
455 /* Subsystem is in this hierarchy. So we want 499 /* Subsystem is in this hierarchy. So we want
@@ -696,6 +740,7 @@ void cgroup_lock(void)
696{ 740{
697 mutex_lock(&cgroup_mutex); 741 mutex_lock(&cgroup_mutex);
698} 742}
743EXPORT_SYMBOL_GPL(cgroup_lock);
699 744
700/** 745/**
701 * cgroup_unlock - release lock on cgroup changes 746 * cgroup_unlock - release lock on cgroup changes
@@ -706,6 +751,7 @@ void cgroup_unlock(void)
706{ 751{
707 mutex_unlock(&cgroup_mutex); 752 mutex_unlock(&cgroup_mutex);
708} 753}
754EXPORT_SYMBOL_GPL(cgroup_unlock);
709 755
710/* 756/*
711 * A couple of forward declarations required, due to cyclic reference loop: 757 * A couple of forward declarations required, due to cyclic reference loop:
@@ -757,6 +803,7 @@ static int cgroup_call_pre_destroy(struct cgroup *cgrp)
757 if (ret) 803 if (ret)
758 break; 804 break;
759 } 805 }
806
760 return ret; 807 return ret;
761} 808}
762 809
@@ -884,7 +931,11 @@ void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css)
884 css_put(css); 931 css_put(css);
885} 932}
886 933
887 934/*
935 * Call with cgroup_mutex held. Drops reference counts on modules, including
936 * any duplicate ones that parse_cgroupfs_options took. If this function
937 * returns an error, no reference counts are touched.
938 */
888static int rebind_subsystems(struct cgroupfs_root *root, 939static int rebind_subsystems(struct cgroupfs_root *root,
889 unsigned long final_bits) 940 unsigned long final_bits)
890{ 941{
@@ -892,6 +943,8 @@ static int rebind_subsystems(struct cgroupfs_root *root,
892 struct cgroup *cgrp = &root->top_cgroup; 943 struct cgroup *cgrp = &root->top_cgroup;
893 int i; 944 int i;
894 945
946 BUG_ON(!mutex_is_locked(&cgroup_mutex));
947
895 removed_bits = root->actual_subsys_bits & ~final_bits; 948 removed_bits = root->actual_subsys_bits & ~final_bits;
896 added_bits = final_bits & ~root->actual_subsys_bits; 949 added_bits = final_bits & ~root->actual_subsys_bits;
897 /* Check that any added subsystems are currently free */ 950 /* Check that any added subsystems are currently free */
@@ -900,6 +953,12 @@ static int rebind_subsystems(struct cgroupfs_root *root,
900 struct cgroup_subsys *ss = subsys[i]; 953 struct cgroup_subsys *ss = subsys[i];
901 if (!(bit & added_bits)) 954 if (!(bit & added_bits))
902 continue; 955 continue;
956 /*
957 * Nobody should tell us to do a subsys that doesn't exist:
958 * parse_cgroupfs_options should catch that case and refcounts
959 * ensure that subsystems won't disappear once selected.
960 */
961 BUG_ON(ss == NULL);
903 if (ss->root != &rootnode) { 962 if (ss->root != &rootnode) {
904 /* Subsystem isn't free */ 963 /* Subsystem isn't free */
905 return -EBUSY; 964 return -EBUSY;
@@ -919,6 +978,7 @@ static int rebind_subsystems(struct cgroupfs_root *root,
919 unsigned long bit = 1UL << i; 978 unsigned long bit = 1UL << i;
920 if (bit & added_bits) { 979 if (bit & added_bits) {
921 /* We're binding this subsystem to this hierarchy */ 980 /* We're binding this subsystem to this hierarchy */
981 BUG_ON(ss == NULL);
922 BUG_ON(cgrp->subsys[i]); 982 BUG_ON(cgrp->subsys[i]);
923 BUG_ON(!dummytop->subsys[i]); 983 BUG_ON(!dummytop->subsys[i]);
924 BUG_ON(dummytop->subsys[i]->cgroup != dummytop); 984 BUG_ON(dummytop->subsys[i]->cgroup != dummytop);
@@ -930,8 +990,10 @@ static int rebind_subsystems(struct cgroupfs_root *root,
930 if (ss->bind) 990 if (ss->bind)
931 ss->bind(ss, cgrp); 991 ss->bind(ss, cgrp);
932 mutex_unlock(&ss->hierarchy_mutex); 992 mutex_unlock(&ss->hierarchy_mutex);
993 /* refcount was already taken, and we're keeping it */
933 } else if (bit & removed_bits) { 994 } else if (bit & removed_bits) {
934 /* We're removing this subsystem */ 995 /* We're removing this subsystem */
996 BUG_ON(ss == NULL);
935 BUG_ON(cgrp->subsys[i] != dummytop->subsys[i]); 997 BUG_ON(cgrp->subsys[i] != dummytop->subsys[i]);
936 BUG_ON(cgrp->subsys[i]->cgroup != cgrp); 998 BUG_ON(cgrp->subsys[i]->cgroup != cgrp);
937 mutex_lock(&ss->hierarchy_mutex); 999 mutex_lock(&ss->hierarchy_mutex);
@@ -942,9 +1004,20 @@ static int rebind_subsystems(struct cgroupfs_root *root,
942 subsys[i]->root = &rootnode; 1004 subsys[i]->root = &rootnode;
943 list_move(&ss->sibling, &rootnode.subsys_list); 1005 list_move(&ss->sibling, &rootnode.subsys_list);
944 mutex_unlock(&ss->hierarchy_mutex); 1006 mutex_unlock(&ss->hierarchy_mutex);
1007 /* subsystem is now free - drop reference on module */
1008 module_put(ss->module);
945 } else if (bit & final_bits) { 1009 } else if (bit & final_bits) {
946 /* Subsystem state should already exist */ 1010 /* Subsystem state should already exist */
1011 BUG_ON(ss == NULL);
947 BUG_ON(!cgrp->subsys[i]); 1012 BUG_ON(!cgrp->subsys[i]);
1013 /*
1014 * a refcount was taken, but we already had one, so
1015 * drop the extra reference.
1016 */
1017 module_put(ss->module);
1018#ifdef CONFIG_MODULE_UNLOAD
1019 BUG_ON(ss->module && !module_refcount(ss->module));
1020#endif
948 } else { 1021 } else {
949 /* Subsystem state shouldn't exist */ 1022 /* Subsystem state shouldn't exist */
950 BUG_ON(cgrp->subsys[i]); 1023 BUG_ON(cgrp->subsys[i]);
@@ -986,13 +1059,20 @@ struct cgroup_sb_opts {
986 1059
987}; 1060};
988 1061
989/* Convert a hierarchy specifier into a bitmask of subsystems and 1062/*
990 * flags. */ 1063 * Convert a hierarchy specifier into a bitmask of subsystems and flags. Call
991static int parse_cgroupfs_options(char *data, 1064 * with cgroup_mutex held to protect the subsys[] array. This function takes
992 struct cgroup_sb_opts *opts) 1065 * refcounts on subsystems to be used, unless it returns error, in which case
1066 * no refcounts are taken.
1067 */
1068static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
993{ 1069{
994 char *token, *o = data ?: "all"; 1070 char *token, *o = data ?: "all";
995 unsigned long mask = (unsigned long)-1; 1071 unsigned long mask = (unsigned long)-1;
1072 int i;
1073 bool module_pin_failed = false;
1074
1075 BUG_ON(!mutex_is_locked(&cgroup_mutex));
996 1076
997#ifdef CONFIG_CPUSETS 1077#ifdef CONFIG_CPUSETS
998 mask = ~(1UL << cpuset_subsys_id); 1078 mask = ~(1UL << cpuset_subsys_id);
@@ -1005,10 +1085,11 @@ static int parse_cgroupfs_options(char *data,
1005 return -EINVAL; 1085 return -EINVAL;
1006 if (!strcmp(token, "all")) { 1086 if (!strcmp(token, "all")) {
1007 /* Add all non-disabled subsystems */ 1087 /* Add all non-disabled subsystems */
1008 int i;
1009 opts->subsys_bits = 0; 1088 opts->subsys_bits = 0;
1010 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 1089 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
1011 struct cgroup_subsys *ss = subsys[i]; 1090 struct cgroup_subsys *ss = subsys[i];
1091 if (ss == NULL)
1092 continue;
1012 if (!ss->disabled) 1093 if (!ss->disabled)
1013 opts->subsys_bits |= 1ul << i; 1094 opts->subsys_bits |= 1ul << i;
1014 } 1095 }
@@ -1026,7 +1107,6 @@ static int parse_cgroupfs_options(char *data,
1026 if (!opts->release_agent) 1107 if (!opts->release_agent)
1027 return -ENOMEM; 1108 return -ENOMEM;
1028 } else if (!strncmp(token, "name=", 5)) { 1109 } else if (!strncmp(token, "name=", 5)) {
1029 int i;
1030 const char *name = token + 5; 1110 const char *name = token + 5;
1031 /* Can't specify an empty name */ 1111 /* Can't specify an empty name */
1032 if (!strlen(name)) 1112 if (!strlen(name))
@@ -1050,9 +1130,10 @@ static int parse_cgroupfs_options(char *data,
1050 return -ENOMEM; 1130 return -ENOMEM;
1051 } else { 1131 } else {
1052 struct cgroup_subsys *ss; 1132 struct cgroup_subsys *ss;
1053 int i;
1054 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 1133 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
1055 ss = subsys[i]; 1134 ss = subsys[i];
1135 if (ss == NULL)
1136 continue;
1056 if (!strcmp(token, ss->name)) { 1137 if (!strcmp(token, ss->name)) {
1057 if (!ss->disabled) 1138 if (!ss->disabled)
1058 set_bit(i, &opts->subsys_bits); 1139 set_bit(i, &opts->subsys_bits);
@@ -1087,9 +1168,54 @@ static int parse_cgroupfs_options(char *data,
1087 if (!opts->subsys_bits && !opts->name) 1168 if (!opts->subsys_bits && !opts->name)
1088 return -EINVAL; 1169 return -EINVAL;
1089 1170
1171 /*
1172 * Grab references on all the modules we'll need, so the subsystems
1173 * don't dance around before rebind_subsystems attaches them. This may
1174 * take duplicate reference counts on a subsystem that's already used,
1175 * but rebind_subsystems handles this case.
1176 */
1177 for (i = CGROUP_BUILTIN_SUBSYS_COUNT; i < CGROUP_SUBSYS_COUNT; i++) {
1178 unsigned long bit = 1UL << i;
1179
1180 if (!(bit & opts->subsys_bits))
1181 continue;
1182 if (!try_module_get(subsys[i]->module)) {
1183 module_pin_failed = true;
1184 break;
1185 }
1186 }
1187 if (module_pin_failed) {
1188 /*
1189 * oops, one of the modules was going away. this means that we
1190 * raced with a module_delete call, and to the user this is
1191 * essentially a "subsystem doesn't exist" case.
1192 */
1193 for (i--; i >= CGROUP_BUILTIN_SUBSYS_COUNT; i--) {
1194 /* drop refcounts only on the ones we took */
1195 unsigned long bit = 1UL << i;
1196
1197 if (!(bit & opts->subsys_bits))
1198 continue;
1199 module_put(subsys[i]->module);
1200 }
1201 return -ENOENT;
1202 }
1203
1090 return 0; 1204 return 0;
1091} 1205}
1092 1206
1207static void drop_parsed_module_refcounts(unsigned long subsys_bits)
1208{
1209 int i;
1210 for (i = CGROUP_BUILTIN_SUBSYS_COUNT; i < CGROUP_SUBSYS_COUNT; i++) {
1211 unsigned long bit = 1UL << i;
1212
1213 if (!(bit & subsys_bits))
1214 continue;
1215 module_put(subsys[i]->module);
1216 }
1217}
1218
1093static int cgroup_remount(struct super_block *sb, int *flags, char *data) 1219static int cgroup_remount(struct super_block *sb, int *flags, char *data)
1094{ 1220{
1095 int ret = 0; 1221 int ret = 0;
@@ -1106,21 +1232,19 @@ static int cgroup_remount(struct super_block *sb, int *flags, char *data)
1106 if (ret) 1232 if (ret)
1107 goto out_unlock; 1233 goto out_unlock;
1108 1234
1109 /* Don't allow flags to change at remount */ 1235 /* Don't allow flags or name to change at remount */
1110 if (opts.flags != root->flags) { 1236 if (opts.flags != root->flags ||
1111 ret = -EINVAL; 1237 (opts.name && strcmp(opts.name, root->name))) {
1112 goto out_unlock;
1113 }
1114
1115 /* Don't allow name to change at remount */
1116 if (opts.name && strcmp(opts.name, root->name)) {
1117 ret = -EINVAL; 1238 ret = -EINVAL;
1239 drop_parsed_module_refcounts(opts.subsys_bits);
1118 goto out_unlock; 1240 goto out_unlock;
1119 } 1241 }
1120 1242
1121 ret = rebind_subsystems(root, opts.subsys_bits); 1243 ret = rebind_subsystems(root, opts.subsys_bits);
1122 if (ret) 1244 if (ret) {
1245 drop_parsed_module_refcounts(opts.subsys_bits);
1123 goto out_unlock; 1246 goto out_unlock;
1247 }
1124 1248
1125 /* (re)populate subsystem files */ 1249 /* (re)populate subsystem files */
1126 cgroup_populate_dir(cgrp); 1250 cgroup_populate_dir(cgrp);
@@ -1151,6 +1275,8 @@ static void init_cgroup_housekeeping(struct cgroup *cgrp)
1151 INIT_LIST_HEAD(&cgrp->release_list); 1275 INIT_LIST_HEAD(&cgrp->release_list);
1152 INIT_LIST_HEAD(&cgrp->pidlists); 1276 INIT_LIST_HEAD(&cgrp->pidlists);
1153 mutex_init(&cgrp->pidlist_mutex); 1277 mutex_init(&cgrp->pidlist_mutex);
1278 INIT_LIST_HEAD(&cgrp->event_list);
1279 spin_lock_init(&cgrp->event_list_lock);
1154} 1280}
1155 1281
1156static void init_cgroup_root(struct cgroupfs_root *root) 1282static void init_cgroup_root(struct cgroupfs_root *root)
@@ -1306,7 +1432,9 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1306 struct cgroupfs_root *new_root; 1432 struct cgroupfs_root *new_root;
1307 1433
1308 /* First find the desired set of subsystems */ 1434 /* First find the desired set of subsystems */
1435 mutex_lock(&cgroup_mutex);
1309 ret = parse_cgroupfs_options(data, &opts); 1436 ret = parse_cgroupfs_options(data, &opts);
1437 mutex_unlock(&cgroup_mutex);
1310 if (ret) 1438 if (ret)
1311 goto out_err; 1439 goto out_err;
1312 1440
@@ -1317,7 +1445,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1317 new_root = cgroup_root_from_opts(&opts); 1445 new_root = cgroup_root_from_opts(&opts);
1318 if (IS_ERR(new_root)) { 1446 if (IS_ERR(new_root)) {
1319 ret = PTR_ERR(new_root); 1447 ret = PTR_ERR(new_root);
1320 goto out_err; 1448 goto drop_modules;
1321 } 1449 }
1322 opts.new_root = new_root; 1450 opts.new_root = new_root;
1323 1451
@@ -1326,7 +1454,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1326 if (IS_ERR(sb)) { 1454 if (IS_ERR(sb)) {
1327 ret = PTR_ERR(sb); 1455 ret = PTR_ERR(sb);
1328 cgroup_drop_root(opts.new_root); 1456 cgroup_drop_root(opts.new_root);
1329 goto out_err; 1457 goto drop_modules;
1330 } 1458 }
1331 1459
1332 root = sb->s_fs_info; 1460 root = sb->s_fs_info;
@@ -1382,6 +1510,11 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1382 free_cg_links(&tmp_cg_links); 1510 free_cg_links(&tmp_cg_links);
1383 goto drop_new_super; 1511 goto drop_new_super;
1384 } 1512 }
1513 /*
1514 * There must be no failure case after here, since rebinding
1515 * takes care of subsystems' refcounts, which are explicitly
1516 * dropped in the failure exit path.
1517 */
1385 1518
1386 /* EBUSY should be the only error here */ 1519 /* EBUSY should be the only error here */
1387 BUG_ON(ret); 1520 BUG_ON(ret);
@@ -1420,6 +1553,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1420 * any) is not needed 1553 * any) is not needed
1421 */ 1554 */
1422 cgroup_drop_root(opts.new_root); 1555 cgroup_drop_root(opts.new_root);
1556 /* no subsys rebinding, so refcounts don't change */
1557 drop_parsed_module_refcounts(opts.subsys_bits);
1423 } 1558 }
1424 1559
1425 simple_set_mnt(mnt, sb); 1560 simple_set_mnt(mnt, sb);
@@ -1429,6 +1564,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
1429 1564
1430 drop_new_super: 1565 drop_new_super:
1431 deactivate_locked_super(sb); 1566 deactivate_locked_super(sb);
1567 drop_modules:
1568 drop_parsed_module_refcounts(opts.subsys_bits);
1432 out_err: 1569 out_err:
1433 kfree(opts.release_agent); 1570 kfree(opts.release_agent);
1434 kfree(opts.name); 1571 kfree(opts.name);
@@ -1542,6 +1679,7 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
1542 memmove(buf, start, buf + buflen - start); 1679 memmove(buf, start, buf + buflen - start);
1543 return 0; 1680 return 0;
1544} 1681}
1682EXPORT_SYMBOL_GPL(cgroup_path);
1545 1683
1546/** 1684/**
1547 * cgroup_attach_task - attach task 'tsk' to cgroup 'cgrp' 1685 * cgroup_attach_task - attach task 'tsk' to cgroup 'cgrp'
@@ -1554,7 +1692,7 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
1554int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) 1692int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1555{ 1693{
1556 int retval = 0; 1694 int retval = 0;
1557 struct cgroup_subsys *ss; 1695 struct cgroup_subsys *ss, *failed_ss = NULL;
1558 struct cgroup *oldcgrp; 1696 struct cgroup *oldcgrp;
1559 struct css_set *cg; 1697 struct css_set *cg;
1560 struct css_set *newcg; 1698 struct css_set *newcg;
@@ -1568,8 +1706,16 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1568 for_each_subsys(root, ss) { 1706 for_each_subsys(root, ss) {
1569 if (ss->can_attach) { 1707 if (ss->can_attach) {
1570 retval = ss->can_attach(ss, cgrp, tsk, false); 1708 retval = ss->can_attach(ss, cgrp, tsk, false);
1571 if (retval) 1709 if (retval) {
1572 return retval; 1710 /*
1711 * Remember on which subsystem the can_attach()
1712 * failed, so that we only call cancel_attach()
1713 * against the subsystems whose can_attach()
1714 * succeeded. (See below)
1715 */
1716 failed_ss = ss;
1717 goto out;
1718 }
1573 } 1719 }
1574 } 1720 }
1575 1721
@@ -1583,14 +1729,17 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1583 */ 1729 */
1584 newcg = find_css_set(cg, cgrp); 1730 newcg = find_css_set(cg, cgrp);
1585 put_css_set(cg); 1731 put_css_set(cg);
1586 if (!newcg) 1732 if (!newcg) {
1587 return -ENOMEM; 1733 retval = -ENOMEM;
1734 goto out;
1735 }
1588 1736
1589 task_lock(tsk); 1737 task_lock(tsk);
1590 if (tsk->flags & PF_EXITING) { 1738 if (tsk->flags & PF_EXITING) {
1591 task_unlock(tsk); 1739 task_unlock(tsk);
1592 put_css_set(newcg); 1740 put_css_set(newcg);
1593 return -ESRCH; 1741 retval = -ESRCH;
1742 goto out;
1594 } 1743 }
1595 rcu_assign_pointer(tsk->cgroups, newcg); 1744 rcu_assign_pointer(tsk->cgroups, newcg);
1596 task_unlock(tsk); 1745 task_unlock(tsk);
@@ -1616,7 +1765,22 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
1616 * is no longer empty. 1765 * is no longer empty.
1617 */ 1766 */
1618 cgroup_wakeup_rmdir_waiter(cgrp); 1767 cgroup_wakeup_rmdir_waiter(cgrp);
1619 return 0; 1768out:
1769 if (retval) {
1770 for_each_subsys(root, ss) {
1771 if (ss == failed_ss)
1772 /*
1773 * This subsystem was the one that failed the
1774 * can_attach() check earlier, so we don't need
1775 * to call cancel_attach() against it or any
1776 * remaining subsystems.
1777 */
1778 break;
1779 if (ss->cancel_attach)
1780 ss->cancel_attach(ss, cgrp, tsk, false);
1781 }
1782 }
1783 return retval;
1620} 1784}
1621 1785
1622/* 1786/*
@@ -1682,6 +1846,7 @@ bool cgroup_lock_live_group(struct cgroup *cgrp)
1682 } 1846 }
1683 return true; 1847 return true;
1684} 1848}
1849EXPORT_SYMBOL_GPL(cgroup_lock_live_group);
1685 1850
1686static int cgroup_release_agent_write(struct cgroup *cgrp, struct cftype *cft, 1851static int cgroup_release_agent_write(struct cgroup *cgrp, struct cftype *cft,
1687 const char *buffer) 1852 const char *buffer)
@@ -1950,6 +2115,16 @@ static const struct inode_operations cgroup_dir_inode_operations = {
1950 .rename = cgroup_rename, 2115 .rename = cgroup_rename,
1951}; 2116};
1952 2117
2118/*
2119 * Check if a file is a control file
2120 */
2121static inline struct cftype *__file_cft(struct file *file)
2122{
2123 if (file->f_dentry->d_inode->i_fop != &cgroup_file_operations)
2124 return ERR_PTR(-EINVAL);
2125 return __d_cft(file->f_dentry);
2126}
2127
1953static int cgroup_create_file(struct dentry *dentry, mode_t mode, 2128static int cgroup_create_file(struct dentry *dentry, mode_t mode,
1954 struct super_block *sb) 2129 struct super_block *sb)
1955{ 2130{
@@ -2069,6 +2244,7 @@ int cgroup_add_file(struct cgroup *cgrp,
2069 error = PTR_ERR(dentry); 2244 error = PTR_ERR(dentry);
2070 return error; 2245 return error;
2071} 2246}
2247EXPORT_SYMBOL_GPL(cgroup_add_file);
2072 2248
2073int cgroup_add_files(struct cgroup *cgrp, 2249int cgroup_add_files(struct cgroup *cgrp,
2074 struct cgroup_subsys *subsys, 2250 struct cgroup_subsys *subsys,
@@ -2083,6 +2259,7 @@ int cgroup_add_files(struct cgroup *cgrp,
2083 } 2259 }
2084 return 0; 2260 return 0;
2085} 2261}
2262EXPORT_SYMBOL_GPL(cgroup_add_files);
2086 2263
2087/** 2264/**
2088 * cgroup_task_count - count the number of tasks in a cgroup. 2265 * cgroup_task_count - count the number of tasks in a cgroup.
@@ -2468,7 +2645,8 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
2468{ 2645{
2469 struct cgroup_pidlist *l; 2646 struct cgroup_pidlist *l;
2470 /* don't need task_nsproxy() if we're looking at ourself */ 2647 /* don't need task_nsproxy() if we're looking at ourself */
2471 struct pid_namespace *ns = get_pid_ns(current->nsproxy->pid_ns); 2648 struct pid_namespace *ns = current->nsproxy->pid_ns;
2649
2472 /* 2650 /*
2473 * We can't drop the pidlist_mutex before taking the l->mutex in case 2651 * We can't drop the pidlist_mutex before taking the l->mutex in case
2474 * the last ref-holder is trying to remove l from the list at the same 2652 * the last ref-holder is trying to remove l from the list at the same
@@ -2478,8 +2656,6 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
2478 mutex_lock(&cgrp->pidlist_mutex); 2656 mutex_lock(&cgrp->pidlist_mutex);
2479 list_for_each_entry(l, &cgrp->pidlists, links) { 2657 list_for_each_entry(l, &cgrp->pidlists, links) {
2480 if (l->key.type == type && l->key.ns == ns) { 2658 if (l->key.type == type && l->key.ns == ns) {
2481 /* found a matching list - drop the extra refcount */
2482 put_pid_ns(ns);
2483 /* make sure l doesn't vanish out from under us */ 2659 /* make sure l doesn't vanish out from under us */
2484 down_write(&l->mutex); 2660 down_write(&l->mutex);
2485 mutex_unlock(&cgrp->pidlist_mutex); 2661 mutex_unlock(&cgrp->pidlist_mutex);
@@ -2490,13 +2666,12 @@ static struct cgroup_pidlist *cgroup_pidlist_find(struct cgroup *cgrp,
2490 l = kmalloc(sizeof(struct cgroup_pidlist), GFP_KERNEL); 2666 l = kmalloc(sizeof(struct cgroup_pidlist), GFP_KERNEL);
2491 if (!l) { 2667 if (!l) {
2492 mutex_unlock(&cgrp->pidlist_mutex); 2668 mutex_unlock(&cgrp->pidlist_mutex);
2493 put_pid_ns(ns);
2494 return l; 2669 return l;
2495 } 2670 }
2496 init_rwsem(&l->mutex); 2671 init_rwsem(&l->mutex);
2497 down_write(&l->mutex); 2672 down_write(&l->mutex);
2498 l->key.type = type; 2673 l->key.type = type;
2499 l->key.ns = ns; 2674 l->key.ns = get_pid_ns(ns);
2500 l->use_count = 0; /* don't increment here */ 2675 l->use_count = 0; /* don't increment here */
2501 l->list = NULL; 2676 l->list = NULL;
2502 l->owner = cgrp; 2677 l->owner = cgrp;
@@ -2804,6 +2979,174 @@ static int cgroup_write_notify_on_release(struct cgroup *cgrp,
2804} 2979}
2805 2980
2806/* 2981/*
2982 * Unregister event and free resources.
2983 *
2984 * Gets called from workqueue.
2985 */
2986static void cgroup_event_remove(struct work_struct *work)
2987{
2988 struct cgroup_event *event = container_of(work, struct cgroup_event,
2989 remove);
2990 struct cgroup *cgrp = event->cgrp;
2991
2992 /* TODO: check return code */
2993 event->cft->unregister_event(cgrp, event->cft, event->eventfd);
2994
2995 eventfd_ctx_put(event->eventfd);
2996 kfree(event);
2997 dput(cgrp->dentry);
2998}
2999
3000/*
3001 * Gets called on POLLHUP on eventfd when user closes it.
3002 *
3003 * Called with wqh->lock held and interrupts disabled.
3004 */
3005static int cgroup_event_wake(wait_queue_t *wait, unsigned mode,
3006 int sync, void *key)
3007{
3008 struct cgroup_event *event = container_of(wait,
3009 struct cgroup_event, wait);
3010 struct cgroup *cgrp = event->cgrp;
3011 unsigned long flags = (unsigned long)key;
3012
3013 if (flags & POLLHUP) {
3014 remove_wait_queue_locked(event->wqh, &event->wait);
3015 spin_lock(&cgrp->event_list_lock);
3016 list_del(&event->list);
3017 spin_unlock(&cgrp->event_list_lock);
3018 /*
3019 * We are in atomic context, but cgroup_event_remove() may
3020 * sleep, so we have to call it in workqueue.
3021 */
3022 schedule_work(&event->remove);
3023 }
3024
3025 return 0;
3026}
3027
3028static void cgroup_event_ptable_queue_proc(struct file *file,
3029 wait_queue_head_t *wqh, poll_table *pt)
3030{
3031 struct cgroup_event *event = container_of(pt,
3032 struct cgroup_event, pt);
3033
3034 event->wqh = wqh;
3035 add_wait_queue(wqh, &event->wait);
3036}
3037
3038/*
3039 * Parse input and register new cgroup event handler.
3040 *
3041 * Input must be in format '<event_fd> <control_fd> <args>'.
3042 * Interpretation of args is defined by control file implementation.
3043 */
3044static int cgroup_write_event_control(struct cgroup *cgrp, struct cftype *cft,
3045 const char *buffer)
3046{
3047 struct cgroup_event *event = NULL;
3048 unsigned int efd, cfd;
3049 struct file *efile = NULL;
3050 struct file *cfile = NULL;
3051 char *endp;
3052 int ret;
3053
3054 efd = simple_strtoul(buffer, &endp, 10);
3055 if (*endp != ' ')
3056 return -EINVAL;
3057 buffer = endp + 1;
3058
3059 cfd = simple_strtoul(buffer, &endp, 10);
3060 if ((*endp != ' ') && (*endp != '\0'))
3061 return -EINVAL;
3062 buffer = endp + 1;
3063
3064 event = kzalloc(sizeof(*event), GFP_KERNEL);
3065 if (!event)
3066 return -ENOMEM;
3067 event->cgrp = cgrp;
3068 INIT_LIST_HEAD(&event->list);
3069 init_poll_funcptr(&event->pt, cgroup_event_ptable_queue_proc);
3070 init_waitqueue_func_entry(&event->wait, cgroup_event_wake);
3071 INIT_WORK(&event->remove, cgroup_event_remove);
3072
3073 efile = eventfd_fget(efd);
3074 if (IS_ERR(efile)) {
3075 ret = PTR_ERR(efile);
3076 goto fail;
3077 }
3078
3079 event->eventfd = eventfd_ctx_fileget(efile);
3080 if (IS_ERR(event->eventfd)) {
3081 ret = PTR_ERR(event->eventfd);
3082 goto fail;
3083 }
3084
3085 cfile = fget(cfd);
3086 if (!cfile) {
3087 ret = -EBADF;
3088 goto fail;
3089 }
3090
3091 /* the process need read permission on control file */
3092 ret = file_permission(cfile, MAY_READ);
3093 if (ret < 0)
3094 goto fail;
3095
3096 event->cft = __file_cft(cfile);
3097 if (IS_ERR(event->cft)) {
3098 ret = PTR_ERR(event->cft);
3099 goto fail;
3100 }
3101
3102 if (!event->cft->register_event || !event->cft->unregister_event) {
3103 ret = -EINVAL;
3104 goto fail;
3105 }
3106
3107 ret = event->cft->register_event(cgrp, event->cft,
3108 event->eventfd, buffer);
3109 if (ret)
3110 goto fail;
3111
3112 if (efile->f_op->poll(efile, &event->pt) & POLLHUP) {
3113 event->cft->unregister_event(cgrp, event->cft, event->eventfd);
3114 ret = 0;
3115 goto fail;
3116 }
3117
3118 /*
3119 * Events should be removed after rmdir of cgroup directory, but before
3120 * destroying subsystem state objects. Let's take reference to cgroup
3121 * directory dentry to do that.
3122 */
3123 dget(cgrp->dentry);
3124
3125 spin_lock(&cgrp->event_list_lock);
3126 list_add(&event->list, &cgrp->event_list);
3127 spin_unlock(&cgrp->event_list_lock);
3128
3129 fput(cfile);
3130 fput(efile);
3131
3132 return 0;
3133
3134fail:
3135 if (cfile)
3136 fput(cfile);
3137
3138 if (event && event->eventfd && !IS_ERR(event->eventfd))
3139 eventfd_ctx_put(event->eventfd);
3140
3141 if (!IS_ERR_OR_NULL(efile))
3142 fput(efile);
3143
3144 kfree(event);
3145
3146 return ret;
3147}
3148
3149/*
2807 * for the common functions, 'private' gives the type of file 3150 * for the common functions, 'private' gives the type of file
2808 */ 3151 */
2809/* for hysterical raisins, we can't put this on the older files */ 3152/* for hysterical raisins, we can't put this on the older files */
@@ -2828,6 +3171,11 @@ static struct cftype files[] = {
2828 .read_u64 = cgroup_read_notify_on_release, 3171 .read_u64 = cgroup_read_notify_on_release,
2829 .write_u64 = cgroup_write_notify_on_release, 3172 .write_u64 = cgroup_write_notify_on_release,
2830 }, 3173 },
3174 {
3175 .name = CGROUP_FILE_GENERIC_PREFIX "event_control",
3176 .write_string = cgroup_write_event_control,
3177 .mode = S_IWUGO,
3178 },
2831}; 3179};
2832 3180
2833static struct cftype cft_release_agent = { 3181static struct cftype cft_release_agent = {
@@ -2892,8 +3240,14 @@ static void cgroup_lock_hierarchy(struct cgroupfs_root *root)
2892 /* We need to take each hierarchy_mutex in a consistent order */ 3240 /* We need to take each hierarchy_mutex in a consistent order */
2893 int i; 3241 int i;
2894 3242
3243 /*
3244 * No worry about a race with rebind_subsystems that might mess up the
3245 * locking order, since both parties are under cgroup_mutex.
3246 */
2895 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3247 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
2896 struct cgroup_subsys *ss = subsys[i]; 3248 struct cgroup_subsys *ss = subsys[i];
3249 if (ss == NULL)
3250 continue;
2897 if (ss->root == root) 3251 if (ss->root == root)
2898 mutex_lock(&ss->hierarchy_mutex); 3252 mutex_lock(&ss->hierarchy_mutex);
2899 } 3253 }
@@ -2905,6 +3259,8 @@ static void cgroup_unlock_hierarchy(struct cgroupfs_root *root)
2905 3259
2906 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3260 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
2907 struct cgroup_subsys *ss = subsys[i]; 3261 struct cgroup_subsys *ss = subsys[i];
3262 if (ss == NULL)
3263 continue;
2908 if (ss->root == root) 3264 if (ss->root == root)
2909 mutex_unlock(&ss->hierarchy_mutex); 3265 mutex_unlock(&ss->hierarchy_mutex);
2910 } 3266 }
@@ -3028,11 +3384,16 @@ static int cgroup_has_css_refs(struct cgroup *cgrp)
3028 * synchronization other than RCU, and the subsystem linked 3384 * synchronization other than RCU, and the subsystem linked
3029 * list isn't RCU-safe */ 3385 * list isn't RCU-safe */
3030 int i; 3386 int i;
3387 /*
3388 * We won't need to lock the subsys array, because the subsystems
3389 * we're concerned about aren't going anywhere since our cgroup root
3390 * has a reference on them.
3391 */
3031 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3392 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
3032 struct cgroup_subsys *ss = subsys[i]; 3393 struct cgroup_subsys *ss = subsys[i];
3033 struct cgroup_subsys_state *css; 3394 struct cgroup_subsys_state *css;
3034 /* Skip subsystems not in this hierarchy */ 3395 /* Skip subsystems not present or not in this hierarchy */
3035 if (ss->root != cgrp->root) 3396 if (ss == NULL || ss->root != cgrp->root)
3036 continue; 3397 continue;
3037 css = cgrp->subsys[ss->subsys_id]; 3398 css = cgrp->subsys[ss->subsys_id];
3038 /* When called from check_for_release() it's possible 3399 /* When called from check_for_release() it's possible
@@ -3106,6 +3467,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
3106 struct dentry *d; 3467 struct dentry *d;
3107 struct cgroup *parent; 3468 struct cgroup *parent;
3108 DEFINE_WAIT(wait); 3469 DEFINE_WAIT(wait);
3470 struct cgroup_event *event, *tmp;
3109 int ret; 3471 int ret;
3110 3472
3111 /* the vfs holds both inode->i_mutex already */ 3473 /* the vfs holds both inode->i_mutex already */
@@ -3189,6 +3551,20 @@ again:
3189 set_bit(CGRP_RELEASABLE, &parent->flags); 3551 set_bit(CGRP_RELEASABLE, &parent->flags);
3190 check_for_release(parent); 3552 check_for_release(parent);
3191 3553
3554 /*
3555 * Unregister events and notify userspace.
3556 * Notify userspace about cgroup removing only after rmdir of cgroup
3557 * directory to avoid race between userspace and kernelspace
3558 */
3559 spin_lock(&cgrp->event_list_lock);
3560 list_for_each_entry_safe(event, tmp, &cgrp->event_list, list) {
3561 list_del(&event->list);
3562 remove_wait_queue(event->wqh, &event->wait);
3563 eventfd_signal(event->eventfd, 1);
3564 schedule_work(&event->remove);
3565 }
3566 spin_unlock(&cgrp->event_list_lock);
3567
3192 mutex_unlock(&cgroup_mutex); 3568 mutex_unlock(&cgroup_mutex);
3193 return 0; 3569 return 0;
3194} 3570}
@@ -3223,7 +3599,196 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss)
3223 mutex_init(&ss->hierarchy_mutex); 3599 mutex_init(&ss->hierarchy_mutex);
3224 lockdep_set_class(&ss->hierarchy_mutex, &ss->subsys_key); 3600 lockdep_set_class(&ss->hierarchy_mutex, &ss->subsys_key);
3225 ss->active = 1; 3601 ss->active = 1;
3602
3603 /* this function shouldn't be used with modular subsystems, since they
3604 * need to register a subsys_id, among other things */
3605 BUG_ON(ss->module);
3606}
3607
3608/**
3609 * cgroup_load_subsys: load and register a modular subsystem at runtime
3610 * @ss: the subsystem to load
3611 *
3612 * This function should be called in a modular subsystem's initcall. If the
3613 * subsytem is built as a module, it will be assigned a new subsys_id and set
3614 * up for use. If the subsystem is built-in anyway, work is delegated to the
3615 * simpler cgroup_init_subsys.
3616 */
3617int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss)
3618{
3619 int i;
3620 struct cgroup_subsys_state *css;
3621
3622 /* check name and function validity */
3623 if (ss->name == NULL || strlen(ss->name) > MAX_CGROUP_TYPE_NAMELEN ||
3624 ss->create == NULL || ss->destroy == NULL)
3625 return -EINVAL;
3626
3627 /*
3628 * we don't support callbacks in modular subsystems. this check is
3629 * before the ss->module check for consistency; a subsystem that could
3630 * be a module should still have no callbacks even if the user isn't
3631 * compiling it as one.
3632 */
3633 if (ss->fork || ss->exit)
3634 return -EINVAL;
3635
3636 /*
3637 * an optionally modular subsystem is built-in: we want to do nothing,
3638 * since cgroup_init_subsys will have already taken care of it.
3639 */
3640 if (ss->module == NULL) {
3641 /* a few sanity checks */
3642 BUG_ON(ss->subsys_id >= CGROUP_BUILTIN_SUBSYS_COUNT);
3643 BUG_ON(subsys[ss->subsys_id] != ss);
3644 return 0;
3645 }
3646
3647 /*
3648 * need to register a subsys id before anything else - for example,
3649 * init_cgroup_css needs it.
3650 */
3651 mutex_lock(&cgroup_mutex);
3652 /* find the first empty slot in the array */
3653 for (i = CGROUP_BUILTIN_SUBSYS_COUNT; i < CGROUP_SUBSYS_COUNT; i++) {
3654 if (subsys[i] == NULL)
3655 break;
3656 }
3657 if (i == CGROUP_SUBSYS_COUNT) {
3658 /* maximum number of subsystems already registered! */
3659 mutex_unlock(&cgroup_mutex);
3660 return -EBUSY;
3661 }
3662 /* assign ourselves the subsys_id */
3663 ss->subsys_id = i;
3664 subsys[i] = ss;
3665
3666 /*
3667 * no ss->create seems to need anything important in the ss struct, so
3668 * this can happen first (i.e. before the rootnode attachment).
3669 */
3670 css = ss->create(ss, dummytop);
3671 if (IS_ERR(css)) {
3672 /* failure case - need to deassign the subsys[] slot. */
3673 subsys[i] = NULL;
3674 mutex_unlock(&cgroup_mutex);
3675 return PTR_ERR(css);
3676 }
3677
3678 list_add(&ss->sibling, &rootnode.subsys_list);
3679 ss->root = &rootnode;
3680
3681 /* our new subsystem will be attached to the dummy hierarchy. */
3682 init_cgroup_css(css, ss, dummytop);
3683 /* init_idr must be after init_cgroup_css because it sets css->id. */
3684 if (ss->use_id) {
3685 int ret = cgroup_init_idr(ss, css);
3686 if (ret) {
3687 dummytop->subsys[ss->subsys_id] = NULL;
3688 ss->destroy(ss, dummytop);
3689 subsys[i] = NULL;
3690 mutex_unlock(&cgroup_mutex);
3691 return ret;
3692 }
3693 }
3694
3695 /*
3696 * Now we need to entangle the css into the existing css_sets. unlike
3697 * in cgroup_init_subsys, there are now multiple css_sets, so each one
3698 * will need a new pointer to it; done by iterating the css_set_table.
3699 * furthermore, modifying the existing css_sets will corrupt the hash
3700 * table state, so each changed css_set will need its hash recomputed.
3701 * this is all done under the css_set_lock.
3702 */
3703 write_lock(&css_set_lock);
3704 for (i = 0; i < CSS_SET_TABLE_SIZE; i++) {
3705 struct css_set *cg;
3706 struct hlist_node *node, *tmp;
3707 struct hlist_head *bucket = &css_set_table[i], *new_bucket;
3708
3709 hlist_for_each_entry_safe(cg, node, tmp, bucket, hlist) {
3710 /* skip entries that we already rehashed */
3711 if (cg->subsys[ss->subsys_id])
3712 continue;
3713 /* remove existing entry */
3714 hlist_del(&cg->hlist);
3715 /* set new value */
3716 cg->subsys[ss->subsys_id] = css;
3717 /* recompute hash and restore entry */
3718 new_bucket = css_set_hash(cg->subsys);
3719 hlist_add_head(&cg->hlist, new_bucket);
3720 }
3721 }
3722 write_unlock(&css_set_lock);
3723
3724 mutex_init(&ss->hierarchy_mutex);
3725 lockdep_set_class(&ss->hierarchy_mutex, &ss->subsys_key);
3726 ss->active = 1;
3727
3728 /* success! */
3729 mutex_unlock(&cgroup_mutex);
3730 return 0;
3226} 3731}
3732EXPORT_SYMBOL_GPL(cgroup_load_subsys);
3733
3734/**
3735 * cgroup_unload_subsys: unload a modular subsystem
3736 * @ss: the subsystem to unload
3737 *
3738 * This function should be called in a modular subsystem's exitcall. When this
3739 * function is invoked, the refcount on the subsystem's module will be 0, so
3740 * the subsystem will not be attached to any hierarchy.
3741 */
3742void cgroup_unload_subsys(struct cgroup_subsys *ss)
3743{
3744 struct cg_cgroup_link *link;
3745 struct hlist_head *hhead;
3746
3747 BUG_ON(ss->module == NULL);
3748
3749 /*
3750 * we shouldn't be called if the subsystem is in use, and the use of
3751 * try_module_get in parse_cgroupfs_options should ensure that it
3752 * doesn't start being used while we're killing it off.
3753 */
3754 BUG_ON(ss->root != &rootnode);
3755
3756 mutex_lock(&cgroup_mutex);
3757 /* deassign the subsys_id */
3758 BUG_ON(ss->subsys_id < CGROUP_BUILTIN_SUBSYS_COUNT);
3759 subsys[ss->subsys_id] = NULL;
3760
3761 /* remove subsystem from rootnode's list of subsystems */
3762 list_del(&ss->sibling);
3763
3764 /*
3765 * disentangle the css from all css_sets attached to the dummytop. as
3766 * in loading, we need to pay our respects to the hashtable gods.
3767 */
3768 write_lock(&css_set_lock);
3769 list_for_each_entry(link, &dummytop->css_sets, cgrp_link_list) {
3770 struct css_set *cg = link->cg;
3771
3772 hlist_del(&cg->hlist);
3773 BUG_ON(!cg->subsys[ss->subsys_id]);
3774 cg->subsys[ss->subsys_id] = NULL;
3775 hhead = css_set_hash(cg->subsys);
3776 hlist_add_head(&cg->hlist, hhead);
3777 }
3778 write_unlock(&css_set_lock);
3779
3780 /*
3781 * remove subsystem's css from the dummytop and free it - need to free
3782 * before marking as null because ss->destroy needs the cgrp->subsys
3783 * pointer to find their state. note that this also takes care of
3784 * freeing the css_id.
3785 */
3786 ss->destroy(ss, dummytop);
3787 dummytop->subsys[ss->subsys_id] = NULL;
3788
3789 mutex_unlock(&cgroup_mutex);
3790}
3791EXPORT_SYMBOL_GPL(cgroup_unload_subsys);
3227 3792
3228/** 3793/**
3229 * cgroup_init_early - cgroup initialization at system boot 3794 * cgroup_init_early - cgroup initialization at system boot
@@ -3253,7 +3818,8 @@ int __init cgroup_init_early(void)
3253 for (i = 0; i < CSS_SET_TABLE_SIZE; i++) 3818 for (i = 0; i < CSS_SET_TABLE_SIZE; i++)
3254 INIT_HLIST_HEAD(&css_set_table[i]); 3819 INIT_HLIST_HEAD(&css_set_table[i]);
3255 3820
3256 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3821 /* at bootup time, we don't worry about modular subsystems */
3822 for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
3257 struct cgroup_subsys *ss = subsys[i]; 3823 struct cgroup_subsys *ss = subsys[i];
3258 3824
3259 BUG_ON(!ss->name); 3825 BUG_ON(!ss->name);
@@ -3288,12 +3854,13 @@ int __init cgroup_init(void)
3288 if (err) 3854 if (err)
3289 return err; 3855 return err;
3290 3856
3291 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3857 /* at bootup time, we don't worry about modular subsystems */
3858 for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
3292 struct cgroup_subsys *ss = subsys[i]; 3859 struct cgroup_subsys *ss = subsys[i];
3293 if (!ss->early_init) 3860 if (!ss->early_init)
3294 cgroup_init_subsys(ss); 3861 cgroup_init_subsys(ss);
3295 if (ss->use_id) 3862 if (ss->use_id)
3296 cgroup_subsys_init_idr(ss); 3863 cgroup_init_idr(ss, init_css_set.subsys[ss->subsys_id]);
3297 } 3864 }
3298 3865
3299 /* Add init_css_set to the hash table */ 3866 /* Add init_css_set to the hash table */
@@ -3397,9 +3964,16 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
3397 int i; 3964 int i;
3398 3965
3399 seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n"); 3966 seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
3967 /*
3968 * ideally we don't want subsystems moving around while we do this.
3969 * cgroup_mutex is also necessary to guarantee an atomic snapshot of
3970 * subsys/hierarchy state.
3971 */
3400 mutex_lock(&cgroup_mutex); 3972 mutex_lock(&cgroup_mutex);
3401 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 3973 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
3402 struct cgroup_subsys *ss = subsys[i]; 3974 struct cgroup_subsys *ss = subsys[i];
3975 if (ss == NULL)
3976 continue;
3403 seq_printf(m, "%s\t%d\t%d\t%d\n", 3977 seq_printf(m, "%s\t%d\t%d\t%d\n",
3404 ss->name, ss->root->hierarchy_id, 3978 ss->name, ss->root->hierarchy_id,
3405 ss->root->number_of_cgroups, !ss->disabled); 3979 ss->root->number_of_cgroups, !ss->disabled);
@@ -3457,7 +4031,12 @@ void cgroup_fork_callbacks(struct task_struct *child)
3457{ 4031{
3458 if (need_forkexit_callback) { 4032 if (need_forkexit_callback) {
3459 int i; 4033 int i;
3460 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 4034 /*
4035 * forkexit callbacks are only supported for builtin
4036 * subsystems, and the builtin section of the subsys array is
4037 * immutable, so we don't need to lock the subsys array here.
4038 */
4039 for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
3461 struct cgroup_subsys *ss = subsys[i]; 4040 struct cgroup_subsys *ss = subsys[i];
3462 if (ss->fork) 4041 if (ss->fork)
3463 ss->fork(ss, child); 4042 ss->fork(ss, child);
@@ -3526,7 +4105,11 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks)
3526 struct css_set *cg; 4105 struct css_set *cg;
3527 4106
3528 if (run_callbacks && need_forkexit_callback) { 4107 if (run_callbacks && need_forkexit_callback) {
3529 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 4108 /*
4109 * modular subsystems can't use callbacks, so no need to lock
4110 * the subsys array
4111 */
4112 for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
3530 struct cgroup_subsys *ss = subsys[i]; 4113 struct cgroup_subsys *ss = subsys[i];
3531 if (ss->exit) 4114 if (ss->exit)
3532 ss->exit(ss, tsk); 4115 ss->exit(ss, tsk);
@@ -3720,12 +4303,13 @@ static void check_for_release(struct cgroup *cgrp)
3720 } 4303 }
3721} 4304}
3722 4305
3723void __css_put(struct cgroup_subsys_state *css) 4306/* Caller must verify that the css is not for root cgroup */
4307void __css_put(struct cgroup_subsys_state *css, int count)
3724{ 4308{
3725 struct cgroup *cgrp = css->cgroup; 4309 struct cgroup *cgrp = css->cgroup;
3726 int val; 4310 int val;
3727 rcu_read_lock(); 4311 rcu_read_lock();
3728 val = atomic_dec_return(&css->refcnt); 4312 val = atomic_sub_return(count, &css->refcnt);
3729 if (val == 1) { 4313 if (val == 1) {
3730 if (notify_on_release(cgrp)) { 4314 if (notify_on_release(cgrp)) {
3731 set_bit(CGRP_RELEASABLE, &cgrp->flags); 4315 set_bit(CGRP_RELEASABLE, &cgrp->flags);
@@ -3736,6 +4320,7 @@ void __css_put(struct cgroup_subsys_state *css)
3736 rcu_read_unlock(); 4320 rcu_read_unlock();
3737 WARN_ON_ONCE(val < 1); 4321 WARN_ON_ONCE(val < 1);
3738} 4322}
4323EXPORT_SYMBOL_GPL(__css_put);
3739 4324
3740/* 4325/*
3741 * Notify userspace when a cgroup is released, by running the 4326 * Notify userspace when a cgroup is released, by running the
@@ -3817,8 +4402,11 @@ static int __init cgroup_disable(char *str)
3817 while ((token = strsep(&str, ",")) != NULL) { 4402 while ((token = strsep(&str, ",")) != NULL) {
3818 if (!*token) 4403 if (!*token)
3819 continue; 4404 continue;
3820 4405 /*
3821 for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { 4406 * cgroup_disable, being at boot time, can't know about module
4407 * subsystems, so we don't worry about them.
4408 */
4409 for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) {
3822 struct cgroup_subsys *ss = subsys[i]; 4410 struct cgroup_subsys *ss = subsys[i];
3823 4411
3824 if (!strcmp(token, ss->name)) { 4412 if (!strcmp(token, ss->name)) {
@@ -3848,6 +4436,7 @@ unsigned short css_id(struct cgroup_subsys_state *css)
3848 return cssid->id; 4436 return cssid->id;
3849 return 0; 4437 return 0;
3850} 4438}
4439EXPORT_SYMBOL_GPL(css_id);
3851 4440
3852unsigned short css_depth(struct cgroup_subsys_state *css) 4441unsigned short css_depth(struct cgroup_subsys_state *css)
3853{ 4442{
@@ -3857,6 +4446,7 @@ unsigned short css_depth(struct cgroup_subsys_state *css)
3857 return cssid->depth; 4446 return cssid->depth;
3858 return 0; 4447 return 0;
3859} 4448}
4449EXPORT_SYMBOL_GPL(css_depth);
3860 4450
3861bool css_is_ancestor(struct cgroup_subsys_state *child, 4451bool css_is_ancestor(struct cgroup_subsys_state *child,
3862 const struct cgroup_subsys_state *root) 4452 const struct cgroup_subsys_state *root)
@@ -3893,6 +4483,7 @@ void free_css_id(struct cgroup_subsys *ss, struct cgroup_subsys_state *css)
3893 spin_unlock(&ss->id_lock); 4483 spin_unlock(&ss->id_lock);
3894 call_rcu(&id->rcu_head, __free_css_id_cb); 4484 call_rcu(&id->rcu_head, __free_css_id_cb);
3895} 4485}
4486EXPORT_SYMBOL_GPL(free_css_id);
3896 4487
3897/* 4488/*
3898 * This is called by init or create(). Then, calls to this function are 4489 * This is called by init or create(). Then, calls to this function are
@@ -3942,15 +4533,14 @@ err_out:
3942 4533
3943} 4534}
3944 4535
3945static int __init cgroup_subsys_init_idr(struct cgroup_subsys *ss) 4536static int __init_or_module cgroup_init_idr(struct cgroup_subsys *ss,
4537 struct cgroup_subsys_state *rootcss)
3946{ 4538{
3947 struct css_id *newid; 4539 struct css_id *newid;
3948 struct cgroup_subsys_state *rootcss;
3949 4540
3950 spin_lock_init(&ss->id_lock); 4541 spin_lock_init(&ss->id_lock);
3951 idr_init(&ss->idr); 4542 idr_init(&ss->idr);
3952 4543
3953 rootcss = init_css_set.subsys[ss->subsys_id];
3954 newid = get_new_cssid(ss, 0); 4544 newid = get_new_cssid(ss, 0);
3955 if (IS_ERR(newid)) 4545 if (IS_ERR(newid))
3956 return PTR_ERR(newid); 4546 return PTR_ERR(newid);
@@ -4010,6 +4600,7 @@ struct cgroup_subsys_state *css_lookup(struct cgroup_subsys *ss, int id)
4010 4600
4011 return rcu_dereference(cssid->css); 4601 return rcu_dereference(cssid->css);
4012} 4602}
4603EXPORT_SYMBOL_GPL(css_lookup);
4013 4604
4014/** 4605/**
4015 * css_get_next - lookup next cgroup under specified hierarchy. 4606 * css_get_next - lookup next cgroup under specified hierarchy.
diff --git a/kernel/fork.c b/kernel/fork.c
index b0ec34abc0bb..1beb6c303c41 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -833,17 +833,6 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
833 /* Thread group counters. */ 833 /* Thread group counters. */
834 thread_group_cputime_init(sig); 834 thread_group_cputime_init(sig);
835 835
836 /* Expiration times and increments. */
837 sig->it[CPUCLOCK_PROF].expires = cputime_zero;
838 sig->it[CPUCLOCK_PROF].incr = cputime_zero;
839 sig->it[CPUCLOCK_VIRT].expires = cputime_zero;
840 sig->it[CPUCLOCK_VIRT].incr = cputime_zero;
841
842 /* Cached expiration times. */
843 sig->cputime_expires.prof_exp = cputime_zero;
844 sig->cputime_expires.virt_exp = cputime_zero;
845 sig->cputime_expires.sched_exp = 0;
846
847 cpu_limit = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur); 836 cpu_limit = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
848 if (cpu_limit != RLIM_INFINITY) { 837 if (cpu_limit != RLIM_INFINITY) {
849 sig->cputime_expires.prof_exp = secs_to_cputime(cpu_limit); 838 sig->cputime_expires.prof_exp = secs_to_cputime(cpu_limit);
@@ -863,7 +852,7 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
863 if (clone_flags & CLONE_THREAD) 852 if (clone_flags & CLONE_THREAD)
864 return 0; 853 return 0;
865 854
866 sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); 855 sig = kmem_cache_zalloc(signal_cachep, GFP_KERNEL);
867 tsk->signal = sig; 856 tsk->signal = sig;
868 if (!sig) 857 if (!sig)
869 return -ENOMEM; 858 return -ENOMEM;
@@ -871,46 +860,21 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
871 atomic_set(&sig->count, 1); 860 atomic_set(&sig->count, 1);
872 atomic_set(&sig->live, 1); 861 atomic_set(&sig->live, 1);
873 init_waitqueue_head(&sig->wait_chldexit); 862 init_waitqueue_head(&sig->wait_chldexit);
874 sig->flags = 0;
875 if (clone_flags & CLONE_NEWPID) 863 if (clone_flags & CLONE_NEWPID)
876 sig->flags |= SIGNAL_UNKILLABLE; 864 sig->flags |= SIGNAL_UNKILLABLE;
877 sig->group_exit_code = 0;
878 sig->group_exit_task = NULL;
879 sig->group_stop_count = 0;
880 sig->curr_target = tsk; 865 sig->curr_target = tsk;
881 init_sigpending(&sig->shared_pending); 866 init_sigpending(&sig->shared_pending);
882 INIT_LIST_HEAD(&sig->posix_timers); 867 INIT_LIST_HEAD(&sig->posix_timers);
883 868
884 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 869 hrtimer_init(&sig->real_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
885 sig->it_real_incr.tv64 = 0;
886 sig->real_timer.function = it_real_fn; 870 sig->real_timer.function = it_real_fn;
887 871
888 sig->leader = 0; /* session leadership doesn't inherit */
889 sig->tty_old_pgrp = NULL;
890 sig->tty = NULL;
891
892 sig->utime = sig->stime = sig->cutime = sig->cstime = cputime_zero;
893 sig->gtime = cputime_zero;
894 sig->cgtime = cputime_zero;
895#ifndef CONFIG_VIRT_CPU_ACCOUNTING
896 sig->prev_utime = sig->prev_stime = cputime_zero;
897#endif
898 sig->nvcsw = sig->nivcsw = sig->cnvcsw = sig->cnivcsw = 0;
899 sig->min_flt = sig->maj_flt = sig->cmin_flt = sig->cmaj_flt = 0;
900 sig->inblock = sig->oublock = sig->cinblock = sig->coublock = 0;
901 sig->maxrss = sig->cmaxrss = 0;
902 task_io_accounting_init(&sig->ioac);
903 sig->sum_sched_runtime = 0;
904 taskstats_tgid_init(sig);
905
906 task_lock(current->group_leader); 872 task_lock(current->group_leader);
907 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); 873 memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
908 task_unlock(current->group_leader); 874 task_unlock(current->group_leader);
909 875
910 posix_cpu_timers_init_group(sig); 876 posix_cpu_timers_init_group(sig);
911 877
912 acct_init_pacct(&sig->pacct);
913
914 tty_audit_fork(sig); 878 tty_audit_fork(sig);
915 879
916 sig->oom_adj = current->signal->oom_adj; 880 sig->oom_adj = current->signal->oom_adj;
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index d70394f12ee9..42ec11b2af8a 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -554,7 +554,7 @@ out:
554 * signal. The occurence is latched into the irq controller hardware 554 * signal. The occurence is latched into the irq controller hardware
555 * and must be acked in order to be reenabled. After the ack another 555 * and must be acked in order to be reenabled. After the ack another
556 * interrupt can happen on the same source even before the first one 556 * interrupt can happen on the same source even before the first one
557 * is handled by the assosiacted event handler. If this happens it 557 * is handled by the associated event handler. If this happens it
558 * might be necessary to disable (mask) the interrupt depending on the 558 * might be necessary to disable (mask) the interrupt depending on the
559 * controller hardware. This requires to reenable the interrupt inside 559 * controller hardware. This requires to reenable the interrupt inside
560 * of the loop which handles the interrupts which have arrived while 560 * of the loop which handles the interrupts which have arrived while
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c
index d06df9c41cba..1ef4ffcdfa55 100644
--- a/kernel/irq/devres.c
+++ b/kernel/irq/devres.c
@@ -42,7 +42,7 @@ static int devm_irq_match(struct device *dev, void *res, void *data)
42 * automatically freed on driver detach. 42 * automatically freed on driver detach.
43 * 43 *
44 * If an IRQ allocated with this function needs to be freed 44 * If an IRQ allocated with this function needs to be freed
45 * separately, dev_free_irq() must be used. 45 * separately, devm_free_irq() must be used.
46 */ 46 */
47int devm_request_threaded_irq(struct device *dev, unsigned int irq, 47int devm_request_threaded_irq(struct device *dev, unsigned int irq,
48 irq_handler_t handler, irq_handler_t thread_fn, 48 irq_handler_t handler, irq_handler_t thread_fn,
@@ -81,7 +81,7 @@ EXPORT_SYMBOL(devm_request_threaded_irq);
81 * Except for the extra @dev argument, this function takes the 81 * Except for the extra @dev argument, this function takes the
82 * same arguments and performs the same function as free_irq(). 82 * same arguments and performs the same function as free_irq().
83 * This function instead of free_irq() should be used to manually 83 * This function instead of free_irq() should be used to manually
84 * free IRQs allocated with dev_request_irq(). 84 * free IRQs allocated with devm_request_irq().
85 */ 85 */
86void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id) 86void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id)
87{ 87{
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 6b1ccc3f0205..21fe3c426948 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -33,7 +33,7 @@ static ssize_t uevent_seqnum_show(struct kobject *kobj,
33} 33}
34KERNEL_ATTR_RO(uevent_seqnum); 34KERNEL_ATTR_RO(uevent_seqnum);
35 35
36/* uevent helper program, used during early boo */ 36/* uevent helper program, used during early boot */
37static ssize_t uevent_helper_show(struct kobject *kobj, 37static ssize_t uevent_helper_show(struct kobject *kobj,
38 struct kobj_attribute *attr, char *buf) 38 struct kobj_attribute *attr, char *buf)
39{ 39{
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index 09b4ff9711b2..2ab67233ee8f 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -24,7 +24,18 @@
24 24
25static struct kmem_cache *nsproxy_cachep; 25static struct kmem_cache *nsproxy_cachep;
26 26
27struct nsproxy init_nsproxy = INIT_NSPROXY(init_nsproxy); 27struct nsproxy init_nsproxy = {
28 .count = ATOMIC_INIT(1),
29 .uts_ns = &init_uts_ns,
30#if defined(CONFIG_POSIX_MQUEUE) || defined(CONFIG_SYSVIPC)
31 .ipc_ns = &init_ipc_ns,
32#endif
33 .mnt_ns = NULL,
34 .pid_ns = &init_pid_ns,
35#ifdef CONFIG_NET
36 .net_ns = &init_net,
37#endif
38};
28 39
29static inline struct nsproxy *create_nsproxy(void) 40static inline struct nsproxy *create_nsproxy(void)
30{ 41{
diff --git a/kernel/params.c b/kernel/params.c
index d55a53ec9234..0b30ecd53a52 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -401,8 +401,8 @@ int param_get_string(char *buffer, struct kernel_param *kp)
401} 401}
402 402
403/* sysfs output in /sys/modules/XYZ/parameters/ */ 403/* sysfs output in /sys/modules/XYZ/parameters/ */
404#define to_module_attr(n) container_of(n, struct module_attribute, attr); 404#define to_module_attr(n) container_of(n, struct module_attribute, attr)
405#define to_module_kobject(n) container_of(n, struct module_kobject, kobj); 405#define to_module_kobject(n) container_of(n, struct module_kobject, kobj)
406 406
407extern struct kernel_param __start___param[], __stop___param[]; 407extern struct kernel_param __start___param[], __stop___param[];
408 408
@@ -420,7 +420,7 @@ struct module_param_attrs
420}; 420};
421 421
422#ifdef CONFIG_SYSFS 422#ifdef CONFIG_SYSFS
423#define to_param_attr(n) container_of(n, struct param_attribute, mattr); 423#define to_param_attr(n) container_of(n, struct param_attribute, mattr)
424 424
425static ssize_t param_attr_show(struct module_attribute *mattr, 425static ssize_t param_attr_show(struct module_attribute *mattr,
426 struct module *mod, char *buf) 426 struct module *mod, char *buf)
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 86b3796b0436..79aac93acf99 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -161,13 +161,12 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
161 rcu_read_lock(); 161 rcu_read_lock();
162 162
163 /* 163 /*
164 * Use force_sig() since it clears SIGNAL_UNKILLABLE ensuring 164 * Any nested-container's init processes won't ignore the
165 * any nested-container's init processes don't ignore the 165 * SEND_SIG_NOINFO signal, see send_signal()->si_fromuser().
166 * signal
167 */ 166 */
168 task = pid_task(find_vpid(nr), PIDTYPE_PID); 167 task = pid_task(find_vpid(nr), PIDTYPE_PID);
169 if (task) 168 if (task)
170 force_sig(SIGKILL, task); 169 send_sig_info(SIGKILL, SEND_SIG_NOINFO, task);
171 170
172 rcu_read_unlock(); 171 rcu_read_unlock();
173 172
diff --git a/kernel/sched_cpupri.c b/kernel/sched_cpupri.c
index 82095bf2099f..fccf9fbb0d7b 100644
--- a/kernel/sched_cpupri.c
+++ b/kernel/sched_cpupri.c
@@ -56,7 +56,7 @@ static int convert_prio(int prio)
56 * @lowest_mask: A mask to fill in with selected CPUs (or NULL) 56 * @lowest_mask: A mask to fill in with selected CPUs (or NULL)
57 * 57 *
58 * Note: This function returns the recommended CPUs as calculated during the 58 * Note: This function returns the recommended CPUs as calculated during the
59 * current invokation. By the time the call returns, the CPUs may have in 59 * current invocation. By the time the call returns, the CPUs may have in
60 * fact changed priorities any number of times. While not ideal, it is not 60 * fact changed priorities any number of times. While not ideal, it is not
61 * an issue of correctness since the normal rebalancer logic will correct 61 * an issue of correctness since the normal rebalancer logic will correct
62 * any discrepancies created by racing against the uncertainty of the current 62 * any discrepancies created by racing against the uncertainty of the current
diff --git a/kernel/sys.c b/kernel/sys.c
index 9814e43fb23b..8298878f4f71 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -33,6 +33,7 @@
33#include <linux/task_io_accounting_ops.h> 33#include <linux/task_io_accounting_ops.h>
34#include <linux/seccomp.h> 34#include <linux/seccomp.h>
35#include <linux/cpu.h> 35#include <linux/cpu.h>
36#include <linux/personality.h>
36#include <linux/ptrace.h> 37#include <linux/ptrace.h>
37#include <linux/fs_struct.h> 38#include <linux/fs_struct.h>
38 39
@@ -1114,6 +1115,15 @@ out:
1114 1115
1115DECLARE_RWSEM(uts_sem); 1116DECLARE_RWSEM(uts_sem);
1116 1117
1118#ifdef COMPAT_UTS_MACHINE
1119#define override_architecture(name) \
1120 (current->personality == PER_LINUX32 && \
1121 copy_to_user(name->machine, COMPAT_UTS_MACHINE, \
1122 sizeof(COMPAT_UTS_MACHINE)))
1123#else
1124#define override_architecture(name) 0
1125#endif
1126
1117SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) 1127SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
1118{ 1128{
1119 int errno = 0; 1129 int errno = 0;
@@ -1122,9 +1132,66 @@ SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
1122 if (copy_to_user(name, utsname(), sizeof *name)) 1132 if (copy_to_user(name, utsname(), sizeof *name))
1123 errno = -EFAULT; 1133 errno = -EFAULT;
1124 up_read(&uts_sem); 1134 up_read(&uts_sem);
1135
1136 if (!errno && override_architecture(name))
1137 errno = -EFAULT;
1125 return errno; 1138 return errno;
1126} 1139}
1127 1140
1141#ifdef __ARCH_WANT_SYS_OLD_UNAME
1142/*
1143 * Old cruft
1144 */
1145SYSCALL_DEFINE1(uname, struct old_utsname __user *, name)
1146{
1147 int error = 0;
1148
1149 if (!name)
1150 return -EFAULT;
1151
1152 down_read(&uts_sem);
1153 if (copy_to_user(name, utsname(), sizeof(*name)))
1154 error = -EFAULT;
1155 up_read(&uts_sem);
1156
1157 if (!error && override_architecture(name))
1158 error = -EFAULT;
1159 return error;
1160}
1161
1162SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
1163{
1164 int error;
1165
1166 if (!name)
1167 return -EFAULT;
1168 if (!access_ok(VERIFY_WRITE, name, sizeof(struct oldold_utsname)))
1169 return -EFAULT;
1170
1171 down_read(&uts_sem);
1172 error = __copy_to_user(&name->sysname, &utsname()->sysname,
1173 __OLD_UTS_LEN);
1174 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
1175 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
1176 __OLD_UTS_LEN);
1177 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
1178 error |= __copy_to_user(&name->release, &utsname()->release,
1179 __OLD_UTS_LEN);
1180 error |= __put_user(0, name->release + __OLD_UTS_LEN);
1181 error |= __copy_to_user(&name->version, &utsname()->version,
1182 __OLD_UTS_LEN);
1183 error |= __put_user(0, name->version + __OLD_UTS_LEN);
1184 error |= __copy_to_user(&name->machine, &utsname()->machine,
1185 __OLD_UTS_LEN);
1186 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
1187 up_read(&uts_sem);
1188
1189 if (!error && override_architecture(name))
1190 error = -EFAULT;
1191 return error ? -EFAULT : 0;
1192}
1193#endif
1194
1128SYSCALL_DEFINE2(sethostname, char __user *, name, int, len) 1195SYSCALL_DEFINE2(sethostname, char __user *, name, int, len)
1129{ 1196{
1130 int errno; 1197 int errno;
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 695384f12a7d..70f2ea758ffe 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -126,6 +126,7 @@ cond_syscall(sys_setreuid16);
126cond_syscall(sys_setuid16); 126cond_syscall(sys_setuid16);
127cond_syscall(sys_vm86old); 127cond_syscall(sys_vm86old);
128cond_syscall(sys_vm86); 128cond_syscall(sys_vm86);
129cond_syscall(sys_ipc);
129cond_syscall(compat_sys_ipc); 130cond_syscall(compat_sys_ipc);
130cond_syscall(compat_sys_sysctl); 131cond_syscall(compat_sys_sysctl);
131cond_syscall(sys_flock); 132cond_syscall(sys_flock);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0ef19c614f6d..8686b0f5fc12 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -23,6 +23,7 @@
23#include <linux/swap.h> 23#include <linux/swap.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#include <linux/signal.h>
26#include <linux/proc_fs.h> 27#include <linux/proc_fs.h>
27#include <linux/security.h> 28#include <linux/security.h>
28#include <linux/ctype.h> 29#include <linux/ctype.h>
@@ -60,13 +61,23 @@
60#include <asm/stacktrace.h> 61#include <asm/stacktrace.h>
61#include <asm/io.h> 62#include <asm/io.h>
62#endif 63#endif
64#ifdef CONFIG_BSD_PROCESS_ACCT
65#include <linux/acct.h>
66#endif
67#ifdef CONFIG_RT_MUTEXES
68#include <linux/rtmutex.h>
69#endif
70#if defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_LOCK_STAT)
71#include <linux/lockdep.h>
72#endif
73#ifdef CONFIG_CHR_DEV_SG
74#include <scsi/sg.h>
75#endif
63 76
64 77
65#if defined(CONFIG_SYSCTL) 78#if defined(CONFIG_SYSCTL)
66 79
67/* External variables not in a header file. */ 80/* External variables not in a header file. */
68extern int C_A_D;
69extern int print_fatal_signals;
70extern int sysctl_overcommit_memory; 81extern int sysctl_overcommit_memory;
71extern int sysctl_overcommit_ratio; 82extern int sysctl_overcommit_ratio;
72extern int sysctl_panic_on_oom; 83extern int sysctl_panic_on_oom;
@@ -88,9 +99,6 @@ extern int sysctl_nr_open_min, sysctl_nr_open_max;
88#ifndef CONFIG_MMU 99#ifndef CONFIG_MMU
89extern int sysctl_nr_trim_pages; 100extern int sysctl_nr_trim_pages;
90#endif 101#endif
91#ifdef CONFIG_RCU_TORTURE_TEST
92extern int rcutorture_runnable;
93#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
94#ifdef CONFIG_BLOCK 102#ifdef CONFIG_BLOCK
95extern int blk_iopoll_enabled; 103extern int blk_iopoll_enabled;
96#endif 104#endif
@@ -120,14 +128,6 @@ static int min_percpu_pagelist_fract = 8;
120 128
121static int ngroups_max = NGROUPS_MAX; 129static int ngroups_max = NGROUPS_MAX;
122 130
123#ifdef CONFIG_MODULES
124extern char modprobe_path[];
125extern int modules_disabled;
126#endif
127#ifdef CONFIG_CHR_DEV_SG
128extern int sg_big_buff;
129#endif
130
131#ifdef CONFIG_SPARC 131#ifdef CONFIG_SPARC
132#include <asm/system.h> 132#include <asm/system.h>
133#endif 133#endif
@@ -149,10 +149,6 @@ extern int sysctl_userprocess_debug;
149extern int spin_retry; 149extern int spin_retry;
150#endif 150#endif
151 151
152#ifdef CONFIG_BSD_PROCESS_ACCT
153extern int acct_parm[];
154#endif
155
156#ifdef CONFIG_IA64 152#ifdef CONFIG_IA64
157extern int no_unaligned_warning; 153extern int no_unaligned_warning;
158extern int unaligned_dump_stack; 154extern int unaligned_dump_stack;
@@ -160,10 +156,6 @@ extern int unaligned_dump_stack;
160 156
161extern struct ratelimit_state printk_ratelimit_state; 157extern struct ratelimit_state printk_ratelimit_state;
162 158
163#ifdef CONFIG_RT_MUTEXES
164extern int max_lock_depth;
165#endif
166
167#ifdef CONFIG_PROC_SYSCTL 159#ifdef CONFIG_PROC_SYSCTL
168static int proc_do_cad_pid(struct ctl_table *table, int write, 160static int proc_do_cad_pid(struct ctl_table *table, int write,
169 void __user *buffer, size_t *lenp, loff_t *ppos); 161 void __user *buffer, size_t *lenp, loff_t *ppos);
@@ -202,9 +194,6 @@ extern struct ctl_table epoll_table[];
202int sysctl_legacy_va_layout; 194int sysctl_legacy_va_layout;
203#endif 195#endif
204 196
205extern int prove_locking;
206extern int lock_stat;
207
208/* The default sysctl tables: */ 197/* The default sysctl tables: */
209 198
210static struct ctl_table root_table[] = { 199static struct ctl_table root_table[] = {
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 0287f9f52f5a..a2f0fe951831 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2542,7 +2542,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_record_disable);
2542 * @buffer: The ring buffer to enable writes 2542 * @buffer: The ring buffer to enable writes
2543 * 2543 *
2544 * Note, multiple disables will need the same number of enables 2544 * Note, multiple disables will need the same number of enables
2545 * to truely enable the writing (much like preempt_disable). 2545 * to truly enable the writing (much like preempt_disable).
2546 */ 2546 */
2547void ring_buffer_record_enable(struct ring_buffer *buffer) 2547void ring_buffer_record_enable(struct ring_buffer *buffer)
2548{ 2548{
@@ -2578,7 +2578,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_record_disable_cpu);
2578 * @cpu: The CPU to enable. 2578 * @cpu: The CPU to enable.
2579 * 2579 *
2580 * Note, multiple disables will need the same number of enables 2580 * Note, multiple disables will need the same number of enables
2581 * to truely enable the writing (much like preempt_disable). 2581 * to truly enable the writing (much like preempt_disable).
2582 */ 2582 */
2583void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu) 2583void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu)
2584{ 2584{
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index fd05bcaf91b0..09b39112a5e2 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -550,7 +550,7 @@ static inline int ftrace_trace_task(struct task_struct *task)
550 * struct trace_parser - servers for reading the user input separated by spaces 550 * struct trace_parser - servers for reading the user input separated by spaces
551 * @cont: set if the input is not complete - no final space char was found 551 * @cont: set if the input is not complete - no final space char was found
552 * @buffer: holds the parsed user input 552 * @buffer: holds the parsed user input
553 * @idx: user input lenght 553 * @idx: user input length
554 * @size: buffer size 554 * @size: buffer size
555 */ 555 */
556struct trace_parser { 556struct trace_parser {
diff --git a/lib/zlib_inflate/inffast.c b/lib/zlib_inflate/inffast.c
index 215447c55261..2c13ecc5bb2c 100644
--- a/lib/zlib_inflate/inffast.c
+++ b/lib/zlib_inflate/inffast.c
@@ -8,21 +8,6 @@
8#include "inflate.h" 8#include "inflate.h"
9#include "inffast.h" 9#include "inffast.h"
10 10
11/* Only do the unaligned "Faster" variant when
12 * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is set
13 *
14 * On powerpc, it won't be as we don't include autoconf.h
15 * automatically for the boot wrapper, which is intended as
16 * we run in an environment where we may not be able to deal
17 * with (even rare) alignment faults. In addition, we do not
18 * define __KERNEL__ for arch/powerpc/boot unlike x86
19 */
20
21#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
22#include <asm/unaligned.h>
23#include <asm/byteorder.h>
24#endif
25
26#ifndef ASMINF 11#ifndef ASMINF
27 12
28/* Allow machine dependent optimization for post-increment or pre-increment. 13/* Allow machine dependent optimization for post-increment or pre-increment.
@@ -36,14 +21,31 @@
36 - Pentium III (Anderson) 21 - Pentium III (Anderson)
37 - M68060 (Nikl) 22 - M68060 (Nikl)
38 */ 23 */
24union uu {
25 unsigned short us;
26 unsigned char b[2];
27};
28
29/* Endian independed version */
30static inline unsigned short
31get_unaligned16(const unsigned short *p)
32{
33 union uu mm;
34 unsigned char *b = (unsigned char *)p;
35
36 mm.b[0] = b[0];
37 mm.b[1] = b[1];
38 return mm.us;
39}
40
39#ifdef POSTINC 41#ifdef POSTINC
40# define OFF 0 42# define OFF 0
41# define PUP(a) *(a)++ 43# define PUP(a) *(a)++
42# define UP_UNALIGNED(a) get_unaligned((a)++) 44# define UP_UNALIGNED(a) get_unaligned16((a)++)
43#else 45#else
44# define OFF 1 46# define OFF 1
45# define PUP(a) *++(a) 47# define PUP(a) *++(a)
46# define UP_UNALIGNED(a) get_unaligned(++(a)) 48# define UP_UNALIGNED(a) get_unaligned16(++(a))
47#endif 49#endif
48 50
49/* 51/*
@@ -256,7 +258,6 @@ void inflate_fast(z_streamp strm, unsigned start)
256 } 258 }
257 } 259 }
258 else { 260 else {
259#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
260 unsigned short *sout; 261 unsigned short *sout;
261 unsigned long loops; 262 unsigned long loops;
262 263
@@ -274,22 +275,25 @@ void inflate_fast(z_streamp strm, unsigned start)
274 sfrom = (unsigned short *)(from - OFF); 275 sfrom = (unsigned short *)(from - OFF);
275 loops = len >> 1; 276 loops = len >> 1;
276 do 277 do
278#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
279 PUP(sout) = PUP(sfrom);
280#else
277 PUP(sout) = UP_UNALIGNED(sfrom); 281 PUP(sout) = UP_UNALIGNED(sfrom);
282#endif
278 while (--loops); 283 while (--loops);
279 out = (unsigned char *)sout + OFF; 284 out = (unsigned char *)sout + OFF;
280 from = (unsigned char *)sfrom + OFF; 285 from = (unsigned char *)sfrom + OFF;
281 } else { /* dist == 1 or dist == 2 */ 286 } else { /* dist == 1 or dist == 2 */
282 unsigned short pat16; 287 unsigned short pat16;
283 288
284 pat16 = *(sout-2+2*OFF); 289 pat16 = *(sout-1+OFF);
285 if (dist == 1) 290 if (dist == 1) {
286#if defined(__BIG_ENDIAN) 291 union uu mm;
287 pat16 = (pat16 & 0xff) | ((pat16 & 0xff) << 8); 292 /* copy one char pattern to both bytes */
288#elif defined(__LITTLE_ENDIAN) 293 mm.us = pat16;
289 pat16 = (pat16 & 0xff00) | ((pat16 & 0xff00) >> 8); 294 mm.b[0] = mm.b[1];
290#else 295 pat16 = mm.us;
291#error __BIG_ENDIAN nor __LITTLE_ENDIAN is defined 296 }
292#endif
293 loops = len >> 1; 297 loops = len >> 1;
294 do 298 do
295 PUP(sout) = pat16; 299 PUP(sout) = pat16;
@@ -298,20 +302,6 @@ void inflate_fast(z_streamp strm, unsigned start)
298 } 302 }
299 if (len & 1) 303 if (len & 1)
300 PUP(out) = PUP(from); 304 PUP(out) = PUP(from);
301#else /* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
302 from = out - dist; /* copy direct from output */
303 do { /* minimum length is three */
304 PUP(out) = PUP(from);
305 PUP(out) = PUP(from);
306 PUP(out) = PUP(from);
307 len -= 3;
308 } while (len > 2);
309 if (len) {
310 PUP(out) = PUP(from);
311 if (len > 1)
312 PUP(out) = PUP(from);
313 }
314#endif /* !CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS */
315 } 305 }
316 } 306 }
317 else if ((op & 64) == 0) { /* 2nd level distance code */ 307 else if ((op & 64) == 0) { /* 2nd level distance code */
diff --git a/mm/highmem.c b/mm/highmem.c
index 9c1e627f282e..bed8a8bfd01f 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -220,7 +220,7 @@ EXPORT_SYMBOL(kmap_high);
220 * @page: &struct page to pin 220 * @page: &struct page to pin
221 * 221 *
222 * Returns the page's current virtual memory address, or NULL if no mapping 222 * Returns the page's current virtual memory address, or NULL if no mapping
223 * exists. When and only when a non null address is returned then a 223 * exists. If and only if a non null address is returned then a
224 * matching call to kunmap_high() is necessary. 224 * matching call to kunmap_high() is necessary.
225 * 225 *
226 * This can be called from any context. 226 * This can be called from any context.
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d813823ab08f..7973b5221fb8 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6,6 +6,10 @@
6 * Copyright 2007 OpenVZ SWsoft Inc 6 * Copyright 2007 OpenVZ SWsoft Inc
7 * Author: Pavel Emelianov <xemul@openvz.org> 7 * Author: Pavel Emelianov <xemul@openvz.org>
8 * 8 *
9 * Memory thresholds
10 * Copyright (C) 2009 Nokia Corporation
11 * Author: Kirill A. Shutemov
12 *
9 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by 14 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or 15 * the Free Software Foundation; either version 2 of the License, or
@@ -21,6 +25,7 @@
21#include <linux/memcontrol.h> 25#include <linux/memcontrol.h>
22#include <linux/cgroup.h> 26#include <linux/cgroup.h>
23#include <linux/mm.h> 27#include <linux/mm.h>
28#include <linux/hugetlb.h>
24#include <linux/pagemap.h> 29#include <linux/pagemap.h>
25#include <linux/smp.h> 30#include <linux/smp.h>
26#include <linux/page-flags.h> 31#include <linux/page-flags.h>
@@ -32,7 +37,10 @@
32#include <linux/rbtree.h> 37#include <linux/rbtree.h>
33#include <linux/slab.h> 38#include <linux/slab.h>
34#include <linux/swap.h> 39#include <linux/swap.h>
40#include <linux/swapops.h>
35#include <linux/spinlock.h> 41#include <linux/spinlock.h>
42#include <linux/eventfd.h>
43#include <linux/sort.h>
36#include <linux/fs.h> 44#include <linux/fs.h>
37#include <linux/seq_file.h> 45#include <linux/seq_file.h>
38#include <linux/vmalloc.h> 46#include <linux/vmalloc.h>
@@ -55,7 +63,15 @@ static int really_do_swap_account __initdata = 1; /* for remember boot option*/
55#define do_swap_account (0) 63#define do_swap_account (0)
56#endif 64#endif
57 65
58#define SOFTLIMIT_EVENTS_THRESH (1000) 66/*
67 * Per memcg event counter is incremented at every pagein/pageout. This counter
68 * is used for trigger some periodic events. This is straightforward and better
69 * than using jiffies etc. to handle periodic memcg event.
70 *
71 * These values will be used as !((event) & ((1 <<(thresh)) - 1))
72 */
73#define THRESHOLDS_EVENTS_THRESH (7) /* once in 128 */
74#define SOFTLIMIT_EVENTS_THRESH (10) /* once in 1024 */
59 75
60/* 76/*
61 * Statistics for memory cgroup. 77 * Statistics for memory cgroup.
@@ -69,62 +85,16 @@ enum mem_cgroup_stat_index {
69 MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */ 85 MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */
70 MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */ 86 MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */
71 MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */ 87 MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */
72 MEM_CGROUP_STAT_EVENTS, /* sum of pagein + pageout for internal use */
73 MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */ 88 MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
89 MEM_CGROUP_EVENTS, /* incremented at every pagein/pageout */
74 90
75 MEM_CGROUP_STAT_NSTATS, 91 MEM_CGROUP_STAT_NSTATS,
76}; 92};
77 93
78struct mem_cgroup_stat_cpu { 94struct mem_cgroup_stat_cpu {
79 s64 count[MEM_CGROUP_STAT_NSTATS]; 95 s64 count[MEM_CGROUP_STAT_NSTATS];
80} ____cacheline_aligned_in_smp;
81
82struct mem_cgroup_stat {
83 struct mem_cgroup_stat_cpu cpustat[0];
84}; 96};
85 97
86static inline void
87__mem_cgroup_stat_reset_safe(struct mem_cgroup_stat_cpu *stat,
88 enum mem_cgroup_stat_index idx)
89{
90 stat->count[idx] = 0;
91}
92
93static inline s64
94__mem_cgroup_stat_read_local(struct mem_cgroup_stat_cpu *stat,
95 enum mem_cgroup_stat_index idx)
96{
97 return stat->count[idx];
98}
99
100/*
101 * For accounting under irq disable, no need for increment preempt count.
102 */
103static inline void __mem_cgroup_stat_add_safe(struct mem_cgroup_stat_cpu *stat,
104 enum mem_cgroup_stat_index idx, int val)
105{
106 stat->count[idx] += val;
107}
108
109static s64 mem_cgroup_read_stat(struct mem_cgroup_stat *stat,
110 enum mem_cgroup_stat_index idx)
111{
112 int cpu;
113 s64 ret = 0;
114 for_each_possible_cpu(cpu)
115 ret += stat->cpustat[cpu].count[idx];
116 return ret;
117}
118
119static s64 mem_cgroup_local_usage(struct mem_cgroup_stat *stat)
120{
121 s64 ret;
122
123 ret = mem_cgroup_read_stat(stat, MEM_CGROUP_STAT_CACHE);
124 ret += mem_cgroup_read_stat(stat, MEM_CGROUP_STAT_RSS);
125 return ret;
126}
127
128/* 98/*
129 * per-zone information in memory controller. 99 * per-zone information in memory controller.
130 */ 100 */
@@ -174,6 +144,22 @@ struct mem_cgroup_tree {
174 144
175static struct mem_cgroup_tree soft_limit_tree __read_mostly; 145static struct mem_cgroup_tree soft_limit_tree __read_mostly;
176 146
147struct mem_cgroup_threshold {
148 struct eventfd_ctx *eventfd;
149 u64 threshold;
150};
151
152struct mem_cgroup_threshold_ary {
153 /* An array index points to threshold just below usage. */
154 atomic_t current_threshold;
155 /* Size of entries[] */
156 unsigned int size;
157 /* Array of thresholds */
158 struct mem_cgroup_threshold entries[0];
159};
160
161static void mem_cgroup_threshold(struct mem_cgroup *mem);
162
177/* 163/*
178 * The memory controller data structure. The memory controller controls both 164 * The memory controller data structure. The memory controller controls both
179 * page cache and RSS per cgroup. We would eventually like to provide 165 * page cache and RSS per cgroup. We would eventually like to provide
@@ -217,7 +203,7 @@ struct mem_cgroup {
217 * Should the accounting and control be hierarchical, per subtree? 203 * Should the accounting and control be hierarchical, per subtree?
218 */ 204 */
219 bool use_hierarchy; 205 bool use_hierarchy;
220 unsigned long last_oom_jiffies; 206 atomic_t oom_lock;
221 atomic_t refcnt; 207 atomic_t refcnt;
222 208
223 unsigned int swappiness; 209 unsigned int swappiness;
@@ -225,10 +211,48 @@ struct mem_cgroup {
225 /* set when res.limit == memsw.limit */ 211 /* set when res.limit == memsw.limit */
226 bool memsw_is_minimum; 212 bool memsw_is_minimum;
227 213
214 /* protect arrays of thresholds */
215 struct mutex thresholds_lock;
216
217 /* thresholds for memory usage. RCU-protected */
218 struct mem_cgroup_threshold_ary *thresholds;
219
220 /* thresholds for mem+swap usage. RCU-protected */
221 struct mem_cgroup_threshold_ary *memsw_thresholds;
222
228 /* 223 /*
229 * statistics. This must be placed at the end of memcg. 224 * Should we move charges of a task when a task is moved into this
225 * mem_cgroup ? And what type of charges should we move ?
230 */ 226 */
231 struct mem_cgroup_stat stat; 227 unsigned long move_charge_at_immigrate;
228
229 /*
230 * percpu counter.
231 */
232 struct mem_cgroup_stat_cpu *stat;
233};
234
235/* Stuffs for move charges at task migration. */
236/*
237 * Types of charges to be moved. "move_charge_at_immitgrate" is treated as a
238 * left-shifted bitmap of these types.
239 */
240enum move_type {
241 MOVE_CHARGE_TYPE_ANON, /* private anonymous page and swap of it */
242 NR_MOVE_TYPE,
243};
244
245/* "mc" and its members are protected by cgroup_mutex */
246static struct move_charge_struct {
247 struct mem_cgroup *from;
248 struct mem_cgroup *to;
249 unsigned long precharge;
250 unsigned long moved_charge;
251 unsigned long moved_swap;
252 struct task_struct *moving_task; /* a task moving charges */
253 wait_queue_head_t waitq; /* a waitq for other context */
254} mc = {
255 .waitq = __WAIT_QUEUE_HEAD_INITIALIZER(mc.waitq),
232}; 256};
233 257
234/* 258/*
@@ -371,23 +395,6 @@ mem_cgroup_remove_exceeded(struct mem_cgroup *mem,
371 spin_unlock(&mctz->lock); 395 spin_unlock(&mctz->lock);
372} 396}
373 397
374static bool mem_cgroup_soft_limit_check(struct mem_cgroup *mem)
375{
376 bool ret = false;
377 int cpu;
378 s64 val;
379 struct mem_cgroup_stat_cpu *cpustat;
380
381 cpu = get_cpu();
382 cpustat = &mem->stat.cpustat[cpu];
383 val = __mem_cgroup_stat_read_local(cpustat, MEM_CGROUP_STAT_EVENTS);
384 if (unlikely(val > SOFTLIMIT_EVENTS_THRESH)) {
385 __mem_cgroup_stat_reset_safe(cpustat, MEM_CGROUP_STAT_EVENTS);
386 ret = true;
387 }
388 put_cpu();
389 return ret;
390}
391 398
392static void mem_cgroup_update_tree(struct mem_cgroup *mem, struct page *page) 399static void mem_cgroup_update_tree(struct mem_cgroup *mem, struct page *page)
393{ 400{
@@ -481,17 +488,31 @@ mem_cgroup_largest_soft_limit_node(struct mem_cgroup_tree_per_zone *mctz)
481 return mz; 488 return mz;
482} 489}
483 490
491static s64 mem_cgroup_read_stat(struct mem_cgroup *mem,
492 enum mem_cgroup_stat_index idx)
493{
494 int cpu;
495 s64 val = 0;
496
497 for_each_possible_cpu(cpu)
498 val += per_cpu(mem->stat->count[idx], cpu);
499 return val;
500}
501
502static s64 mem_cgroup_local_usage(struct mem_cgroup *mem)
503{
504 s64 ret;
505
506 ret = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_RSS);
507 ret += mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_CACHE);
508 return ret;
509}
510
484static void mem_cgroup_swap_statistics(struct mem_cgroup *mem, 511static void mem_cgroup_swap_statistics(struct mem_cgroup *mem,
485 bool charge) 512 bool charge)
486{ 513{
487 int val = (charge) ? 1 : -1; 514 int val = (charge) ? 1 : -1;
488 struct mem_cgroup_stat *stat = &mem->stat; 515 this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_SWAPOUT], val);
489 struct mem_cgroup_stat_cpu *cpustat;
490 int cpu = get_cpu();
491
492 cpustat = &stat->cpustat[cpu];
493 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_SWAPOUT, val);
494 put_cpu();
495} 516}
496 517
497static void mem_cgroup_charge_statistics(struct mem_cgroup *mem, 518static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
@@ -499,24 +520,21 @@ static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
499 bool charge) 520 bool charge)
500{ 521{
501 int val = (charge) ? 1 : -1; 522 int val = (charge) ? 1 : -1;
502 struct mem_cgroup_stat *stat = &mem->stat;
503 struct mem_cgroup_stat_cpu *cpustat;
504 int cpu = get_cpu();
505 523
506 cpustat = &stat->cpustat[cpu]; 524 preempt_disable();
525
507 if (PageCgroupCache(pc)) 526 if (PageCgroupCache(pc))
508 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_CACHE, val); 527 __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_CACHE], val);
509 else 528 else
510 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_RSS, val); 529 __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_RSS], val);
511 530
512 if (charge) 531 if (charge)
513 __mem_cgroup_stat_add_safe(cpustat, 532 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGIN_COUNT]);
514 MEM_CGROUP_STAT_PGPGIN_COUNT, 1);
515 else 533 else
516 __mem_cgroup_stat_add_safe(cpustat, 534 __this_cpu_inc(mem->stat->count[MEM_CGROUP_STAT_PGPGOUT_COUNT]);
517 MEM_CGROUP_STAT_PGPGOUT_COUNT, 1); 535 __this_cpu_inc(mem->stat->count[MEM_CGROUP_EVENTS]);
518 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_EVENTS, 1); 536
519 put_cpu(); 537 preempt_enable();
520} 538}
521 539
522static unsigned long mem_cgroup_get_local_zonestat(struct mem_cgroup *mem, 540static unsigned long mem_cgroup_get_local_zonestat(struct mem_cgroup *mem,
@@ -534,6 +552,29 @@ static unsigned long mem_cgroup_get_local_zonestat(struct mem_cgroup *mem,
534 return total; 552 return total;
535} 553}
536 554
555static bool __memcg_event_check(struct mem_cgroup *mem, int event_mask_shift)
556{
557 s64 val;
558
559 val = this_cpu_read(mem->stat->count[MEM_CGROUP_EVENTS]);
560
561 return !(val & ((1 << event_mask_shift) - 1));
562}
563
564/*
565 * Check events in order.
566 *
567 */
568static void memcg_check_events(struct mem_cgroup *mem, struct page *page)
569{
570 /* threshold event is triggered in finer grain than soft limit */
571 if (unlikely(__memcg_event_check(mem, THRESHOLDS_EVENTS_THRESH))) {
572 mem_cgroup_threshold(mem);
573 if (unlikely(__memcg_event_check(mem, SOFTLIMIT_EVENTS_THRESH)))
574 mem_cgroup_update_tree(mem, page);
575 }
576}
577
537static struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont) 578static struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont)
538{ 579{
539 return container_of(cgroup_subsys_state(cont, 580 return container_of(cgroup_subsys_state(cont,
@@ -1000,7 +1041,7 @@ static int mem_cgroup_count_children_cb(struct mem_cgroup *mem, void *data)
1000} 1041}
1001 1042
1002/** 1043/**
1003 * mem_cgroup_print_mem_info: Called from OOM with tasklist_lock held in read mode. 1044 * mem_cgroup_print_oom_info: Called from OOM with tasklist_lock held in read mode.
1004 * @memcg: The memory cgroup that went over limit 1045 * @memcg: The memory cgroup that went over limit
1005 * @p: Task that is going to be killed 1046 * @p: Task that is going to be killed
1006 * 1047 *
@@ -1174,7 +1215,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
1174 } 1215 }
1175 } 1216 }
1176 } 1217 }
1177 if (!mem_cgroup_local_usage(&victim->stat)) { 1218 if (!mem_cgroup_local_usage(victim)) {
1178 /* this cgroup's local usage == 0 */ 1219 /* this cgroup's local usage == 0 */
1179 css_put(&victim->css); 1220 css_put(&victim->css);
1180 continue; 1221 continue;
@@ -1205,32 +1246,102 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
1205 return total; 1246 return total;
1206} 1247}
1207 1248
1208bool mem_cgroup_oom_called(struct task_struct *task) 1249static int mem_cgroup_oom_lock_cb(struct mem_cgroup *mem, void *data)
1209{ 1250{
1210 bool ret = false; 1251 int *val = (int *)data;
1211 struct mem_cgroup *mem; 1252 int x;
1212 struct mm_struct *mm; 1253 /*
1254 * Logically, we can stop scanning immediately when we find
1255 * a memcg is already locked. But condidering unlock ops and
1256 * creation/removal of memcg, scan-all is simple operation.
1257 */
1258 x = atomic_inc_return(&mem->oom_lock);
1259 *val = max(x, *val);
1260 return 0;
1261}
1262/*
1263 * Check OOM-Killer is already running under our hierarchy.
1264 * If someone is running, return false.
1265 */
1266static bool mem_cgroup_oom_lock(struct mem_cgroup *mem)
1267{
1268 int lock_count = 0;
1213 1269
1214 rcu_read_lock(); 1270 mem_cgroup_walk_tree(mem, &lock_count, mem_cgroup_oom_lock_cb);
1215 mm = task->mm; 1271
1216 if (!mm) 1272 if (lock_count == 1)
1217 mm = &init_mm; 1273 return true;
1218 mem = mem_cgroup_from_task(rcu_dereference(mm->owner)); 1274 return false;
1219 if (mem && time_before(jiffies, mem->last_oom_jiffies + HZ/10))
1220 ret = true;
1221 rcu_read_unlock();
1222 return ret;
1223} 1275}
1224 1276
1225static int record_last_oom_cb(struct mem_cgroup *mem, void *data) 1277static int mem_cgroup_oom_unlock_cb(struct mem_cgroup *mem, void *data)
1226{ 1278{
1227 mem->last_oom_jiffies = jiffies; 1279 /*
1280 * When a new child is created while the hierarchy is under oom,
1281 * mem_cgroup_oom_lock() may not be called. We have to use
1282 * atomic_add_unless() here.
1283 */
1284 atomic_add_unless(&mem->oom_lock, -1, 0);
1228 return 0; 1285 return 0;
1229} 1286}
1230 1287
1231static void record_last_oom(struct mem_cgroup *mem) 1288static void mem_cgroup_oom_unlock(struct mem_cgroup *mem)
1232{ 1289{
1233 mem_cgroup_walk_tree(mem, NULL, record_last_oom_cb); 1290 mem_cgroup_walk_tree(mem, NULL, mem_cgroup_oom_unlock_cb);
1291}
1292
1293static DEFINE_MUTEX(memcg_oom_mutex);
1294static DECLARE_WAIT_QUEUE_HEAD(memcg_oom_waitq);
1295
1296/*
1297 * try to call OOM killer. returns false if we should exit memory-reclaim loop.
1298 */
1299bool mem_cgroup_handle_oom(struct mem_cgroup *mem, gfp_t mask)
1300{
1301 DEFINE_WAIT(wait);
1302 bool locked;
1303
1304 /* At first, try to OOM lock hierarchy under mem.*/
1305 mutex_lock(&memcg_oom_mutex);
1306 locked = mem_cgroup_oom_lock(mem);
1307 /*
1308 * Even if signal_pending(), we can't quit charge() loop without
1309 * accounting. So, UNINTERRUPTIBLE is appropriate. But SIGKILL
1310 * under OOM is always welcomed, use TASK_KILLABLE here.
1311 */
1312 if (!locked)
1313 prepare_to_wait(&memcg_oom_waitq, &wait, TASK_KILLABLE);
1314 mutex_unlock(&memcg_oom_mutex);
1315
1316 if (locked)
1317 mem_cgroup_out_of_memory(mem, mask);
1318 else {
1319 schedule();
1320 finish_wait(&memcg_oom_waitq, &wait);
1321 }
1322 mutex_lock(&memcg_oom_mutex);
1323 mem_cgroup_oom_unlock(mem);
1324 /*
1325 * Here, we use global waitq .....more fine grained waitq ?
1326 * Assume following hierarchy.
1327 * A/
1328 * 01
1329 * 02
1330 * assume OOM happens both in A and 01 at the same time. Tthey are
1331 * mutually exclusive by lock. (kill in 01 helps A.)
1332 * When we use per memcg waitq, we have to wake up waiters on A and 02
1333 * in addtion to waiters on 01. We use global waitq for avoiding mess.
1334 * It will not be a big problem.
1335 * (And a task may be moved to other groups while it's waiting for OOM.)
1336 */
1337 wake_up_all(&memcg_oom_waitq);
1338 mutex_unlock(&memcg_oom_mutex);
1339
1340 if (test_thread_flag(TIF_MEMDIE) || fatal_signal_pending(current))
1341 return false;
1342 /* Give chance to dying process */
1343 schedule_timeout(1);
1344 return true;
1234} 1345}
1235 1346
1236/* 1347/*
@@ -1240,9 +1351,6 @@ static void record_last_oom(struct mem_cgroup *mem)
1240void mem_cgroup_update_file_mapped(struct page *page, int val) 1351void mem_cgroup_update_file_mapped(struct page *page, int val)
1241{ 1352{
1242 struct mem_cgroup *mem; 1353 struct mem_cgroup *mem;
1243 struct mem_cgroup_stat *stat;
1244 struct mem_cgroup_stat_cpu *cpustat;
1245 int cpu;
1246 struct page_cgroup *pc; 1354 struct page_cgroup *pc;
1247 1355
1248 pc = lookup_page_cgroup(page); 1356 pc = lookup_page_cgroup(page);
@@ -1258,13 +1366,10 @@ void mem_cgroup_update_file_mapped(struct page *page, int val)
1258 goto done; 1366 goto done;
1259 1367
1260 /* 1368 /*
1261 * Preemption is already disabled, we don't need get_cpu() 1369 * Preemption is already disabled. We can use __this_cpu_xxx
1262 */ 1370 */
1263 cpu = smp_processor_id(); 1371 __this_cpu_add(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED], val);
1264 stat = &mem->stat;
1265 cpustat = &stat->cpustat[cpu];
1266 1372
1267 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_FILE_MAPPED, val);
1268done: 1373done:
1269 unlock_page_cgroup(pc); 1374 unlock_page_cgroup(pc);
1270} 1375}
@@ -1401,19 +1506,21 @@ static int __cpuinit memcg_stock_cpu_callback(struct notifier_block *nb,
1401 * oom-killer can be invoked. 1506 * oom-killer can be invoked.
1402 */ 1507 */
1403static int __mem_cgroup_try_charge(struct mm_struct *mm, 1508static int __mem_cgroup_try_charge(struct mm_struct *mm,
1404 gfp_t gfp_mask, struct mem_cgroup **memcg, 1509 gfp_t gfp_mask, struct mem_cgroup **memcg, bool oom)
1405 bool oom, struct page *page)
1406{ 1510{
1407 struct mem_cgroup *mem, *mem_over_limit; 1511 struct mem_cgroup *mem, *mem_over_limit;
1408 int nr_retries = MEM_CGROUP_RECLAIM_RETRIES; 1512 int nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
1409 struct res_counter *fail_res; 1513 struct res_counter *fail_res;
1410 int csize = CHARGE_SIZE; 1514 int csize = CHARGE_SIZE;
1411 1515
1412 if (unlikely(test_thread_flag(TIF_MEMDIE))) { 1516 /*
1413 /* Don't account this! */ 1517 * Unlike gloval-vm's OOM-kill, we're not in memory shortage
1414 *memcg = NULL; 1518 * in system level. So, allow to go ahead dying process in addition to
1415 return 0; 1519 * MEMDIE process.
1416 } 1520 */
1521 if (unlikely(test_thread_flag(TIF_MEMDIE)
1522 || fatal_signal_pending(current)))
1523 goto bypass;
1417 1524
1418 /* 1525 /*
1419 * We always charge the cgroup the mm_struct belongs to. 1526 * We always charge the cgroup the mm_struct belongs to.
@@ -1440,7 +1547,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
1440 unsigned long flags = 0; 1547 unsigned long flags = 0;
1441 1548
1442 if (consume_stock(mem)) 1549 if (consume_stock(mem))
1443 goto charged; 1550 goto done;
1444 1551
1445 ret = res_counter_charge(&mem->res, csize, &fail_res); 1552 ret = res_counter_charge(&mem->res, csize, &fail_res);
1446 if (likely(!ret)) { 1553 if (likely(!ret)) {
@@ -1483,28 +1590,70 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
1483 if (mem_cgroup_check_under_limit(mem_over_limit)) 1590 if (mem_cgroup_check_under_limit(mem_over_limit))
1484 continue; 1591 continue;
1485 1592
1593 /* try to avoid oom while someone is moving charge */
1594 if (mc.moving_task && current != mc.moving_task) {
1595 struct mem_cgroup *from, *to;
1596 bool do_continue = false;
1597 /*
1598 * There is a small race that "from" or "to" can be
1599 * freed by rmdir, so we use css_tryget().
1600 */
1601 rcu_read_lock();
1602 from = mc.from;
1603 to = mc.to;
1604 if (from && css_tryget(&from->css)) {
1605 if (mem_over_limit->use_hierarchy)
1606 do_continue = css_is_ancestor(
1607 &from->css,
1608 &mem_over_limit->css);
1609 else
1610 do_continue = (from == mem_over_limit);
1611 css_put(&from->css);
1612 }
1613 if (!do_continue && to && css_tryget(&to->css)) {
1614 if (mem_over_limit->use_hierarchy)
1615 do_continue = css_is_ancestor(
1616 &to->css,
1617 &mem_over_limit->css);
1618 else
1619 do_continue = (to == mem_over_limit);
1620 css_put(&to->css);
1621 }
1622 rcu_read_unlock();
1623 if (do_continue) {
1624 DEFINE_WAIT(wait);
1625 prepare_to_wait(&mc.waitq, &wait,
1626 TASK_INTERRUPTIBLE);
1627 /* moving charge context might have finished. */
1628 if (mc.moving_task)
1629 schedule();
1630 finish_wait(&mc.waitq, &wait);
1631 continue;
1632 }
1633 }
1634
1486 if (!nr_retries--) { 1635 if (!nr_retries--) {
1487 if (oom) { 1636 if (!oom)
1488 mem_cgroup_out_of_memory(mem_over_limit, gfp_mask); 1637 goto nomem;
1489 record_last_oom(mem_over_limit); 1638 if (mem_cgroup_handle_oom(mem_over_limit, gfp_mask)) {
1639 nr_retries = MEM_CGROUP_RECLAIM_RETRIES;
1640 continue;
1490 } 1641 }
1491 goto nomem; 1642 /* When we reach here, current task is dying .*/
1643 css_put(&mem->css);
1644 goto bypass;
1492 } 1645 }
1493 } 1646 }
1494 if (csize > PAGE_SIZE) 1647 if (csize > PAGE_SIZE)
1495 refill_stock(mem, csize - PAGE_SIZE); 1648 refill_stock(mem, csize - PAGE_SIZE);
1496charged:
1497 /*
1498 * Insert ancestor (and ancestor's ancestors), to softlimit RB-tree.
1499 * if they exceeds softlimit.
1500 */
1501 if (mem_cgroup_soft_limit_check(mem))
1502 mem_cgroup_update_tree(mem, page);
1503done: 1649done:
1504 return 0; 1650 return 0;
1505nomem: 1651nomem:
1506 css_put(&mem->css); 1652 css_put(&mem->css);
1507 return -ENOMEM; 1653 return -ENOMEM;
1654bypass:
1655 *memcg = NULL;
1656 return 0;
1508} 1657}
1509 1658
1510/* 1659/*
@@ -1512,14 +1661,23 @@ nomem:
1512 * This function is for that and do uncharge, put css's refcnt. 1661 * This function is for that and do uncharge, put css's refcnt.
1513 * gotten by try_charge(). 1662 * gotten by try_charge().
1514 */ 1663 */
1515static void mem_cgroup_cancel_charge(struct mem_cgroup *mem) 1664static void __mem_cgroup_cancel_charge(struct mem_cgroup *mem,
1665 unsigned long count)
1516{ 1666{
1517 if (!mem_cgroup_is_root(mem)) { 1667 if (!mem_cgroup_is_root(mem)) {
1518 res_counter_uncharge(&mem->res, PAGE_SIZE); 1668 res_counter_uncharge(&mem->res, PAGE_SIZE * count);
1519 if (do_swap_account) 1669 if (do_swap_account)
1520 res_counter_uncharge(&mem->memsw, PAGE_SIZE); 1670 res_counter_uncharge(&mem->memsw, PAGE_SIZE * count);
1671 VM_BUG_ON(test_bit(CSS_ROOT, &mem->css.flags));
1672 WARN_ON_ONCE(count > INT_MAX);
1673 __css_put(&mem->css, (int)count);
1521 } 1674 }
1522 css_put(&mem->css); 1675 /* we don't need css_put for root */
1676}
1677
1678static void mem_cgroup_cancel_charge(struct mem_cgroup *mem)
1679{
1680 __mem_cgroup_cancel_charge(mem, 1);
1523} 1681}
1524 1682
1525/* 1683/*
@@ -1615,6 +1773,12 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
1615 mem_cgroup_charge_statistics(mem, pc, true); 1773 mem_cgroup_charge_statistics(mem, pc, true);
1616 1774
1617 unlock_page_cgroup(pc); 1775 unlock_page_cgroup(pc);
1776 /*
1777 * "charge_statistics" updated event counter. Then, check it.
1778 * Insert ancestor (and ancestor's ancestors), to softlimit RB-tree.
1779 * if they exceeds softlimit.
1780 */
1781 memcg_check_events(mem, pc->page);
1618} 1782}
1619 1783
1620/** 1784/**
@@ -1622,22 +1786,22 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
1622 * @pc: page_cgroup of the page. 1786 * @pc: page_cgroup of the page.
1623 * @from: mem_cgroup which the page is moved from. 1787 * @from: mem_cgroup which the page is moved from.
1624 * @to: mem_cgroup which the page is moved to. @from != @to. 1788 * @to: mem_cgroup which the page is moved to. @from != @to.
1789 * @uncharge: whether we should call uncharge and css_put against @from.
1625 * 1790 *
1626 * The caller must confirm following. 1791 * The caller must confirm following.
1627 * - page is not on LRU (isolate_page() is useful.) 1792 * - page is not on LRU (isolate_page() is useful.)
1628 * - the pc is locked, used, and ->mem_cgroup points to @from. 1793 * - the pc is locked, used, and ->mem_cgroup points to @from.
1629 * 1794 *
1630 * This function does "uncharge" from old cgroup but doesn't do "charge" to 1795 * This function doesn't do "charge" nor css_get to new cgroup. It should be
1631 * new cgroup. It should be done by a caller. 1796 * done by a caller(__mem_cgroup_try_charge would be usefull). If @uncharge is
1797 * true, this function does "uncharge" from old cgroup, but it doesn't if
1798 * @uncharge is false, so a caller should do "uncharge".
1632 */ 1799 */
1633 1800
1634static void __mem_cgroup_move_account(struct page_cgroup *pc, 1801static void __mem_cgroup_move_account(struct page_cgroup *pc,
1635 struct mem_cgroup *from, struct mem_cgroup *to) 1802 struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)
1636{ 1803{
1637 struct page *page; 1804 struct page *page;
1638 int cpu;
1639 struct mem_cgroup_stat *stat;
1640 struct mem_cgroup_stat_cpu *cpustat;
1641 1805
1642 VM_BUG_ON(from == to); 1806 VM_BUG_ON(from == to);
1643 VM_BUG_ON(PageLRU(pc->page)); 1807 VM_BUG_ON(PageLRU(pc->page));
@@ -1645,38 +1809,28 @@ static void __mem_cgroup_move_account(struct page_cgroup *pc,
1645 VM_BUG_ON(!PageCgroupUsed(pc)); 1809 VM_BUG_ON(!PageCgroupUsed(pc));
1646 VM_BUG_ON(pc->mem_cgroup != from); 1810 VM_BUG_ON(pc->mem_cgroup != from);
1647 1811
1648 if (!mem_cgroup_is_root(from))
1649 res_counter_uncharge(&from->res, PAGE_SIZE);
1650 mem_cgroup_charge_statistics(from, pc, false);
1651
1652 page = pc->page; 1812 page = pc->page;
1653 if (page_mapped(page) && !PageAnon(page)) { 1813 if (page_mapped(page) && !PageAnon(page)) {
1654 cpu = smp_processor_id(); 1814 /* Update mapped_file data for mem_cgroup */
1655 /* Update mapped_file data for mem_cgroup "from" */ 1815 preempt_disable();
1656 stat = &from->stat; 1816 __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
1657 cpustat = &stat->cpustat[cpu]; 1817 __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
1658 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_FILE_MAPPED, 1818 preempt_enable();
1659 -1);
1660
1661 /* Update mapped_file data for mem_cgroup "to" */
1662 stat = &to->stat;
1663 cpustat = &stat->cpustat[cpu];
1664 __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_FILE_MAPPED,
1665 1);
1666 } 1819 }
1820 mem_cgroup_charge_statistics(from, pc, false);
1821 if (uncharge)
1822 /* This is not "cancel", but cancel_charge does all we need. */
1823 mem_cgroup_cancel_charge(from);
1667 1824
1668 if (do_swap_account && !mem_cgroup_is_root(from)) 1825 /* caller should have done css_get */
1669 res_counter_uncharge(&from->memsw, PAGE_SIZE);
1670 css_put(&from->css);
1671
1672 css_get(&to->css);
1673 pc->mem_cgroup = to; 1826 pc->mem_cgroup = to;
1674 mem_cgroup_charge_statistics(to, pc, true); 1827 mem_cgroup_charge_statistics(to, pc, true);
1675 /* 1828 /*
1676 * We charges against "to" which may not have any tasks. Then, "to" 1829 * We charges against "to" which may not have any tasks. Then, "to"
1677 * can be under rmdir(). But in current implementation, caller of 1830 * can be under rmdir(). But in current implementation, caller of
1678 * this function is just force_empty() and it's garanteed that 1831 * this function is just force_empty() and move charge, so it's
1679 * "to" is never removed. So, we don't check rmdir status here. 1832 * garanteed that "to" is never removed. So, we don't check rmdir
1833 * status here.
1680 */ 1834 */
1681} 1835}
1682 1836
@@ -1685,15 +1839,20 @@ static void __mem_cgroup_move_account(struct page_cgroup *pc,
1685 * __mem_cgroup_move_account() 1839 * __mem_cgroup_move_account()
1686 */ 1840 */
1687static int mem_cgroup_move_account(struct page_cgroup *pc, 1841static int mem_cgroup_move_account(struct page_cgroup *pc,
1688 struct mem_cgroup *from, struct mem_cgroup *to) 1842 struct mem_cgroup *from, struct mem_cgroup *to, bool uncharge)
1689{ 1843{
1690 int ret = -EINVAL; 1844 int ret = -EINVAL;
1691 lock_page_cgroup(pc); 1845 lock_page_cgroup(pc);
1692 if (PageCgroupUsed(pc) && pc->mem_cgroup == from) { 1846 if (PageCgroupUsed(pc) && pc->mem_cgroup == from) {
1693 __mem_cgroup_move_account(pc, from, to); 1847 __mem_cgroup_move_account(pc, from, to, uncharge);
1694 ret = 0; 1848 ret = 0;
1695 } 1849 }
1696 unlock_page_cgroup(pc); 1850 unlock_page_cgroup(pc);
1851 /*
1852 * check events
1853 */
1854 memcg_check_events(to, pc->page);
1855 memcg_check_events(from, pc->page);
1697 return ret; 1856 return ret;
1698} 1857}
1699 1858
@@ -1722,15 +1881,13 @@ static int mem_cgroup_move_parent(struct page_cgroup *pc,
1722 goto put; 1881 goto put;
1723 1882
1724 parent = mem_cgroup_from_cont(pcg); 1883 parent = mem_cgroup_from_cont(pcg);
1725 ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false, page); 1884 ret = __mem_cgroup_try_charge(NULL, gfp_mask, &parent, false);
1726 if (ret || !parent) 1885 if (ret || !parent)
1727 goto put_back; 1886 goto put_back;
1728 1887
1729 ret = mem_cgroup_move_account(pc, child, parent); 1888 ret = mem_cgroup_move_account(pc, child, parent, true);
1730 if (!ret) 1889 if (ret)
1731 css_put(&parent->css); /* drop extra refcnt by try_charge() */ 1890 mem_cgroup_cancel_charge(parent);
1732 else
1733 mem_cgroup_cancel_charge(parent); /* does css_put */
1734put_back: 1891put_back:
1735 putback_lru_page(page); 1892 putback_lru_page(page);
1736put: 1893put:
@@ -1760,7 +1917,7 @@ static int mem_cgroup_charge_common(struct page *page, struct mm_struct *mm,
1760 prefetchw(pc); 1917 prefetchw(pc);
1761 1918
1762 mem = memcg; 1919 mem = memcg;
1763 ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, true, page); 1920 ret = __mem_cgroup_try_charge(mm, gfp_mask, &mem, true);
1764 if (ret || !mem) 1921 if (ret || !mem)
1765 return ret; 1922 return ret;
1766 1923
@@ -1880,14 +2037,14 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
1880 if (!mem) 2037 if (!mem)
1881 goto charge_cur_mm; 2038 goto charge_cur_mm;
1882 *ptr = mem; 2039 *ptr = mem;
1883 ret = __mem_cgroup_try_charge(NULL, mask, ptr, true, page); 2040 ret = __mem_cgroup_try_charge(NULL, mask, ptr, true);
1884 /* drop extra refcnt from tryget */ 2041 /* drop extra refcnt from tryget */
1885 css_put(&mem->css); 2042 css_put(&mem->css);
1886 return ret; 2043 return ret;
1887charge_cur_mm: 2044charge_cur_mm:
1888 if (unlikely(!mm)) 2045 if (unlikely(!mm))
1889 mm = &init_mm; 2046 mm = &init_mm;
1890 return __mem_cgroup_try_charge(mm, mask, ptr, true, page); 2047 return __mem_cgroup_try_charge(mm, mask, ptr, true);
1891} 2048}
1892 2049
1893static void 2050static void
@@ -2064,8 +2221,7 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
2064 mz = page_cgroup_zoneinfo(pc); 2221 mz = page_cgroup_zoneinfo(pc);
2065 unlock_page_cgroup(pc); 2222 unlock_page_cgroup(pc);
2066 2223
2067 if (mem_cgroup_soft_limit_check(mem)) 2224 memcg_check_events(mem, page);
2068 mem_cgroup_update_tree(mem, page);
2069 /* at swapout, this memcg will be accessed to record to swap */ 2225 /* at swapout, this memcg will be accessed to record to swap */
2070 if (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT) 2226 if (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT)
2071 css_put(&mem->css); 2227 css_put(&mem->css);
@@ -2192,6 +2348,64 @@ void mem_cgroup_uncharge_swap(swp_entry_t ent)
2192 } 2348 }
2193 rcu_read_unlock(); 2349 rcu_read_unlock();
2194} 2350}
2351
2352/**
2353 * mem_cgroup_move_swap_account - move swap charge and swap_cgroup's record.
2354 * @entry: swap entry to be moved
2355 * @from: mem_cgroup which the entry is moved from
2356 * @to: mem_cgroup which the entry is moved to
2357 * @need_fixup: whether we should fixup res_counters and refcounts.
2358 *
2359 * It succeeds only when the swap_cgroup's record for this entry is the same
2360 * as the mem_cgroup's id of @from.
2361 *
2362 * Returns 0 on success, -EINVAL on failure.
2363 *
2364 * The caller must have charged to @to, IOW, called res_counter_charge() about
2365 * both res and memsw, and called css_get().
2366 */
2367static int mem_cgroup_move_swap_account(swp_entry_t entry,
2368 struct mem_cgroup *from, struct mem_cgroup *to, bool need_fixup)
2369{
2370 unsigned short old_id, new_id;
2371
2372 old_id = css_id(&from->css);
2373 new_id = css_id(&to->css);
2374
2375 if (swap_cgroup_cmpxchg(entry, old_id, new_id) == old_id) {
2376 mem_cgroup_swap_statistics(from, false);
2377 mem_cgroup_swap_statistics(to, true);
2378 /*
2379 * This function is only called from task migration context now.
2380 * It postpones res_counter and refcount handling till the end
2381 * of task migration(mem_cgroup_clear_mc()) for performance
2382 * improvement. But we cannot postpone mem_cgroup_get(to)
2383 * because if the process that has been moved to @to does
2384 * swap-in, the refcount of @to might be decreased to 0.
2385 */
2386 mem_cgroup_get(to);
2387 if (need_fixup) {
2388 if (!mem_cgroup_is_root(from))
2389 res_counter_uncharge(&from->memsw, PAGE_SIZE);
2390 mem_cgroup_put(from);
2391 /*
2392 * we charged both to->res and to->memsw, so we should
2393 * uncharge to->res.
2394 */
2395 if (!mem_cgroup_is_root(to))
2396 res_counter_uncharge(&to->res, PAGE_SIZE);
2397 css_put(&to->css);
2398 }
2399 return 0;
2400 }
2401 return -EINVAL;
2402}
2403#else
2404static inline int mem_cgroup_move_swap_account(swp_entry_t entry,
2405 struct mem_cgroup *from, struct mem_cgroup *to, bool need_fixup)
2406{
2407 return -EINVAL;
2408}
2195#endif 2409#endif
2196 2410
2197/* 2411/*
@@ -2216,8 +2430,7 @@ int mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr)
2216 unlock_page_cgroup(pc); 2430 unlock_page_cgroup(pc);
2217 2431
2218 if (mem) { 2432 if (mem) {
2219 ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false, 2433 ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false);
2220 page);
2221 css_put(&mem->css); 2434 css_put(&mem->css);
2222 } 2435 }
2223 *ptr = mem; 2436 *ptr = mem;
@@ -2704,7 +2917,7 @@ static int
2704mem_cgroup_get_idx_stat(struct mem_cgroup *mem, void *data) 2917mem_cgroup_get_idx_stat(struct mem_cgroup *mem, void *data)
2705{ 2918{
2706 struct mem_cgroup_idx_data *d = data; 2919 struct mem_cgroup_idx_data *d = data;
2707 d->val += mem_cgroup_read_stat(&mem->stat, d->idx); 2920 d->val += mem_cgroup_read_stat(mem, d->idx);
2708 return 0; 2921 return 0;
2709} 2922}
2710 2923
@@ -2719,40 +2932,50 @@ mem_cgroup_get_recursive_idx_stat(struct mem_cgroup *mem,
2719 *val = d.val; 2932 *val = d.val;
2720} 2933}
2721 2934
2935static inline u64 mem_cgroup_usage(struct mem_cgroup *mem, bool swap)
2936{
2937 u64 idx_val, val;
2938
2939 if (!mem_cgroup_is_root(mem)) {
2940 if (!swap)
2941 return res_counter_read_u64(&mem->res, RES_USAGE);
2942 else
2943 return res_counter_read_u64(&mem->memsw, RES_USAGE);
2944 }
2945
2946 mem_cgroup_get_recursive_idx_stat(mem, MEM_CGROUP_STAT_CACHE, &idx_val);
2947 val = idx_val;
2948 mem_cgroup_get_recursive_idx_stat(mem, MEM_CGROUP_STAT_RSS, &idx_val);
2949 val += idx_val;
2950
2951 if (swap) {
2952 mem_cgroup_get_recursive_idx_stat(mem,
2953 MEM_CGROUP_STAT_SWAPOUT, &idx_val);
2954 val += idx_val;
2955 }
2956
2957 return val << PAGE_SHIFT;
2958}
2959
2722static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft) 2960static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
2723{ 2961{
2724 struct mem_cgroup *mem = mem_cgroup_from_cont(cont); 2962 struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
2725 u64 idx_val, val; 2963 u64 val;
2726 int type, name; 2964 int type, name;
2727 2965
2728 type = MEMFILE_TYPE(cft->private); 2966 type = MEMFILE_TYPE(cft->private);
2729 name = MEMFILE_ATTR(cft->private); 2967 name = MEMFILE_ATTR(cft->private);
2730 switch (type) { 2968 switch (type) {
2731 case _MEM: 2969 case _MEM:
2732 if (name == RES_USAGE && mem_cgroup_is_root(mem)) { 2970 if (name == RES_USAGE)
2733 mem_cgroup_get_recursive_idx_stat(mem, 2971 val = mem_cgroup_usage(mem, false);
2734 MEM_CGROUP_STAT_CACHE, &idx_val); 2972 else
2735 val = idx_val;
2736 mem_cgroup_get_recursive_idx_stat(mem,
2737 MEM_CGROUP_STAT_RSS, &idx_val);
2738 val += idx_val;
2739 val <<= PAGE_SHIFT;
2740 } else
2741 val = res_counter_read_u64(&mem->res, name); 2973 val = res_counter_read_u64(&mem->res, name);
2742 break; 2974 break;
2743 case _MEMSWAP: 2975 case _MEMSWAP:
2744 if (name == RES_USAGE && mem_cgroup_is_root(mem)) { 2976 if (name == RES_USAGE)
2745 mem_cgroup_get_recursive_idx_stat(mem, 2977 val = mem_cgroup_usage(mem, true);
2746 MEM_CGROUP_STAT_CACHE, &idx_val); 2978 else
2747 val = idx_val;
2748 mem_cgroup_get_recursive_idx_stat(mem,
2749 MEM_CGROUP_STAT_RSS, &idx_val);
2750 val += idx_val;
2751 mem_cgroup_get_recursive_idx_stat(mem,
2752 MEM_CGROUP_STAT_SWAPOUT, &idx_val);
2753 val += idx_val;
2754 val <<= PAGE_SHIFT;
2755 } else
2756 val = res_counter_read_u64(&mem->memsw, name); 2979 val = res_counter_read_u64(&mem->memsw, name);
2757 break; 2980 break;
2758 default: 2981 default:
@@ -2865,6 +3088,39 @@ static int mem_cgroup_reset(struct cgroup *cont, unsigned int event)
2865 return 0; 3088 return 0;
2866} 3089}
2867 3090
3091static u64 mem_cgroup_move_charge_read(struct cgroup *cgrp,
3092 struct cftype *cft)
3093{
3094 return mem_cgroup_from_cont(cgrp)->move_charge_at_immigrate;
3095}
3096
3097#ifdef CONFIG_MMU
3098static int mem_cgroup_move_charge_write(struct cgroup *cgrp,
3099 struct cftype *cft, u64 val)
3100{
3101 struct mem_cgroup *mem = mem_cgroup_from_cont(cgrp);
3102
3103 if (val >= (1 << NR_MOVE_TYPE))
3104 return -EINVAL;
3105 /*
3106 * We check this value several times in both in can_attach() and
3107 * attach(), so we need cgroup lock to prevent this value from being
3108 * inconsistent.
3109 */
3110 cgroup_lock();
3111 mem->move_charge_at_immigrate = val;
3112 cgroup_unlock();
3113
3114 return 0;
3115}
3116#else
3117static int mem_cgroup_move_charge_write(struct cgroup *cgrp,
3118 struct cftype *cft, u64 val)
3119{
3120 return -ENOSYS;
3121}
3122#endif
3123
2868 3124
2869/* For read statistics */ 3125/* For read statistics */
2870enum { 3126enum {
@@ -2910,18 +3166,18 @@ static int mem_cgroup_get_local_stat(struct mem_cgroup *mem, void *data)
2910 s64 val; 3166 s64 val;
2911 3167
2912 /* per cpu stat */ 3168 /* per cpu stat */
2913 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_CACHE); 3169 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_CACHE);
2914 s->stat[MCS_CACHE] += val * PAGE_SIZE; 3170 s->stat[MCS_CACHE] += val * PAGE_SIZE;
2915 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_RSS); 3171 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_RSS);
2916 s->stat[MCS_RSS] += val * PAGE_SIZE; 3172 s->stat[MCS_RSS] += val * PAGE_SIZE;
2917 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_FILE_MAPPED); 3173 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_FILE_MAPPED);
2918 s->stat[MCS_FILE_MAPPED] += val * PAGE_SIZE; 3174 s->stat[MCS_FILE_MAPPED] += val * PAGE_SIZE;
2919 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_PGPGIN_COUNT); 3175 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_PGPGIN_COUNT);
2920 s->stat[MCS_PGPGIN] += val; 3176 s->stat[MCS_PGPGIN] += val;
2921 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_PGPGOUT_COUNT); 3177 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_PGPGOUT_COUNT);
2922 s->stat[MCS_PGPGOUT] += val; 3178 s->stat[MCS_PGPGOUT] += val;
2923 if (do_swap_account) { 3179 if (do_swap_account) {
2924 val = mem_cgroup_read_stat(&mem->stat, MEM_CGROUP_STAT_SWAPOUT); 3180 val = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_SWAPOUT);
2925 s->stat[MCS_SWAP] += val * PAGE_SIZE; 3181 s->stat[MCS_SWAP] += val * PAGE_SIZE;
2926 } 3182 }
2927 3183
@@ -3049,12 +3305,249 @@ static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft,
3049 return 0; 3305 return 0;
3050} 3306}
3051 3307
3308static void __mem_cgroup_threshold(struct mem_cgroup *memcg, bool swap)
3309{
3310 struct mem_cgroup_threshold_ary *t;
3311 u64 usage;
3312 int i;
3313
3314 rcu_read_lock();
3315 if (!swap)
3316 t = rcu_dereference(memcg->thresholds);
3317 else
3318 t = rcu_dereference(memcg->memsw_thresholds);
3319
3320 if (!t)
3321 goto unlock;
3322
3323 usage = mem_cgroup_usage(memcg, swap);
3324
3325 /*
3326 * current_threshold points to threshold just below usage.
3327 * If it's not true, a threshold was crossed after last
3328 * call of __mem_cgroup_threshold().
3329 */
3330 i = atomic_read(&t->current_threshold);
3331
3332 /*
3333 * Iterate backward over array of thresholds starting from
3334 * current_threshold and check if a threshold is crossed.
3335 * If none of thresholds below usage is crossed, we read
3336 * only one element of the array here.
3337 */
3338 for (; i >= 0 && unlikely(t->entries[i].threshold > usage); i--)
3339 eventfd_signal(t->entries[i].eventfd, 1);
3340
3341 /* i = current_threshold + 1 */
3342 i++;
3343
3344 /*
3345 * Iterate forward over array of thresholds starting from
3346 * current_threshold+1 and check if a threshold is crossed.
3347 * If none of thresholds above usage is crossed, we read
3348 * only one element of the array here.
3349 */
3350 for (; i < t->size && unlikely(t->entries[i].threshold <= usage); i++)
3351 eventfd_signal(t->entries[i].eventfd, 1);
3352
3353 /* Update current_threshold */
3354 atomic_set(&t->current_threshold, i - 1);
3355unlock:
3356 rcu_read_unlock();
3357}
3358
3359static void mem_cgroup_threshold(struct mem_cgroup *memcg)
3360{
3361 __mem_cgroup_threshold(memcg, false);
3362 if (do_swap_account)
3363 __mem_cgroup_threshold(memcg, true);
3364}
3365
3366static int compare_thresholds(const void *a, const void *b)
3367{
3368 const struct mem_cgroup_threshold *_a = a;
3369 const struct mem_cgroup_threshold *_b = b;
3370
3371 return _a->threshold - _b->threshold;
3372}
3373
3374static int mem_cgroup_register_event(struct cgroup *cgrp, struct cftype *cft,
3375 struct eventfd_ctx *eventfd, const char *args)
3376{
3377 struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
3378 struct mem_cgroup_threshold_ary *thresholds, *thresholds_new;
3379 int type = MEMFILE_TYPE(cft->private);
3380 u64 threshold, usage;
3381 int size;
3382 int i, ret;
3383
3384 ret = res_counter_memparse_write_strategy(args, &threshold);
3385 if (ret)
3386 return ret;
3387
3388 mutex_lock(&memcg->thresholds_lock);
3389 if (type == _MEM)
3390 thresholds = memcg->thresholds;
3391 else if (type == _MEMSWAP)
3392 thresholds = memcg->memsw_thresholds;
3393 else
3394 BUG();
3395
3396 usage = mem_cgroup_usage(memcg, type == _MEMSWAP);
3397
3398 /* Check if a threshold crossed before adding a new one */
3399 if (thresholds)
3400 __mem_cgroup_threshold(memcg, type == _MEMSWAP);
3401
3402 if (thresholds)
3403 size = thresholds->size + 1;
3404 else
3405 size = 1;
3406
3407 /* Allocate memory for new array of thresholds */
3408 thresholds_new = kmalloc(sizeof(*thresholds_new) +
3409 size * sizeof(struct mem_cgroup_threshold),
3410 GFP_KERNEL);
3411 if (!thresholds_new) {
3412 ret = -ENOMEM;
3413 goto unlock;
3414 }
3415 thresholds_new->size = size;
3416
3417 /* Copy thresholds (if any) to new array */
3418 if (thresholds)
3419 memcpy(thresholds_new->entries, thresholds->entries,
3420 thresholds->size *
3421 sizeof(struct mem_cgroup_threshold));
3422 /* Add new threshold */
3423 thresholds_new->entries[size - 1].eventfd = eventfd;
3424 thresholds_new->entries[size - 1].threshold = threshold;
3425
3426 /* Sort thresholds. Registering of new threshold isn't time-critical */
3427 sort(thresholds_new->entries, size,
3428 sizeof(struct mem_cgroup_threshold),
3429 compare_thresholds, NULL);
3430
3431 /* Find current threshold */
3432 atomic_set(&thresholds_new->current_threshold, -1);
3433 for (i = 0; i < size; i++) {
3434 if (thresholds_new->entries[i].threshold < usage) {
3435 /*
3436 * thresholds_new->current_threshold will not be used
3437 * until rcu_assign_pointer(), so it's safe to increment
3438 * it here.
3439 */
3440 atomic_inc(&thresholds_new->current_threshold);
3441 }
3442 }
3443
3444 if (type == _MEM)
3445 rcu_assign_pointer(memcg->thresholds, thresholds_new);
3446 else
3447 rcu_assign_pointer(memcg->memsw_thresholds, thresholds_new);
3448
3449 /* To be sure that nobody uses thresholds before freeing it */
3450 synchronize_rcu();
3451
3452 kfree(thresholds);
3453unlock:
3454 mutex_unlock(&memcg->thresholds_lock);
3455
3456 return ret;
3457}
3458
3459static int mem_cgroup_unregister_event(struct cgroup *cgrp, struct cftype *cft,
3460 struct eventfd_ctx *eventfd)
3461{
3462 struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
3463 struct mem_cgroup_threshold_ary *thresholds, *thresholds_new;
3464 int type = MEMFILE_TYPE(cft->private);
3465 u64 usage;
3466 int size = 0;
3467 int i, j, ret;
3468
3469 mutex_lock(&memcg->thresholds_lock);
3470 if (type == _MEM)
3471 thresholds = memcg->thresholds;
3472 else if (type == _MEMSWAP)
3473 thresholds = memcg->memsw_thresholds;
3474 else
3475 BUG();
3476
3477 /*
3478 * Something went wrong if we trying to unregister a threshold
3479 * if we don't have thresholds
3480 */
3481 BUG_ON(!thresholds);
3482
3483 usage = mem_cgroup_usage(memcg, type == _MEMSWAP);
3484
3485 /* Check if a threshold crossed before removing */
3486 __mem_cgroup_threshold(memcg, type == _MEMSWAP);
3487
3488 /* Calculate new number of threshold */
3489 for (i = 0; i < thresholds->size; i++) {
3490 if (thresholds->entries[i].eventfd != eventfd)
3491 size++;
3492 }
3493
3494 /* Set thresholds array to NULL if we don't have thresholds */
3495 if (!size) {
3496 thresholds_new = NULL;
3497 goto assign;
3498 }
3499
3500 /* Allocate memory for new array of thresholds */
3501 thresholds_new = kmalloc(sizeof(*thresholds_new) +
3502 size * sizeof(struct mem_cgroup_threshold),
3503 GFP_KERNEL);
3504 if (!thresholds_new) {
3505 ret = -ENOMEM;
3506 goto unlock;
3507 }
3508 thresholds_new->size = size;
3509
3510 /* Copy thresholds and find current threshold */
3511 atomic_set(&thresholds_new->current_threshold, -1);
3512 for (i = 0, j = 0; i < thresholds->size; i++) {
3513 if (thresholds->entries[i].eventfd == eventfd)
3514 continue;
3515
3516 thresholds_new->entries[j] = thresholds->entries[i];
3517 if (thresholds_new->entries[j].threshold < usage) {
3518 /*
3519 * thresholds_new->current_threshold will not be used
3520 * until rcu_assign_pointer(), so it's safe to increment
3521 * it here.
3522 */
3523 atomic_inc(&thresholds_new->current_threshold);
3524 }
3525 j++;
3526 }
3527
3528assign:
3529 if (type == _MEM)
3530 rcu_assign_pointer(memcg->thresholds, thresholds_new);
3531 else
3532 rcu_assign_pointer(memcg->memsw_thresholds, thresholds_new);
3533
3534 /* To be sure that nobody uses thresholds before freeing it */
3535 synchronize_rcu();
3536
3537 kfree(thresholds);
3538unlock:
3539 mutex_unlock(&memcg->thresholds_lock);
3540
3541 return ret;
3542}
3052 3543
3053static struct cftype mem_cgroup_files[] = { 3544static struct cftype mem_cgroup_files[] = {
3054 { 3545 {
3055 .name = "usage_in_bytes", 3546 .name = "usage_in_bytes",
3056 .private = MEMFILE_PRIVATE(_MEM, RES_USAGE), 3547 .private = MEMFILE_PRIVATE(_MEM, RES_USAGE),
3057 .read_u64 = mem_cgroup_read, 3548 .read_u64 = mem_cgroup_read,
3549 .register_event = mem_cgroup_register_event,
3550 .unregister_event = mem_cgroup_unregister_event,
3058 }, 3551 },
3059 { 3552 {
3060 .name = "max_usage_in_bytes", 3553 .name = "max_usage_in_bytes",
@@ -3098,6 +3591,11 @@ static struct cftype mem_cgroup_files[] = {
3098 .read_u64 = mem_cgroup_swappiness_read, 3591 .read_u64 = mem_cgroup_swappiness_read,
3099 .write_u64 = mem_cgroup_swappiness_write, 3592 .write_u64 = mem_cgroup_swappiness_write,
3100 }, 3593 },
3594 {
3595 .name = "move_charge_at_immigrate",
3596 .read_u64 = mem_cgroup_move_charge_read,
3597 .write_u64 = mem_cgroup_move_charge_write,
3598 },
3101}; 3599};
3102 3600
3103#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 3601#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
@@ -3106,6 +3604,8 @@ static struct cftype memsw_cgroup_files[] = {
3106 .name = "memsw.usage_in_bytes", 3604 .name = "memsw.usage_in_bytes",
3107 .private = MEMFILE_PRIVATE(_MEMSWAP, RES_USAGE), 3605 .private = MEMFILE_PRIVATE(_MEMSWAP, RES_USAGE),
3108 .read_u64 = mem_cgroup_read, 3606 .read_u64 = mem_cgroup_read,
3607 .register_event = mem_cgroup_register_event,
3608 .unregister_event = mem_cgroup_unregister_event,
3109 }, 3609 },
3110 { 3610 {
3111 .name = "memsw.max_usage_in_bytes", 3611 .name = "memsw.max_usage_in_bytes",
@@ -3180,17 +3680,12 @@ static void free_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
3180 kfree(mem->info.nodeinfo[node]); 3680 kfree(mem->info.nodeinfo[node]);
3181} 3681}
3182 3682
3183static int mem_cgroup_size(void)
3184{
3185 int cpustat_size = nr_cpu_ids * sizeof(struct mem_cgroup_stat_cpu);
3186 return sizeof(struct mem_cgroup) + cpustat_size;
3187}
3188
3189static struct mem_cgroup *mem_cgroup_alloc(void) 3683static struct mem_cgroup *mem_cgroup_alloc(void)
3190{ 3684{
3191 struct mem_cgroup *mem; 3685 struct mem_cgroup *mem;
3192 int size = mem_cgroup_size(); 3686 int size = sizeof(struct mem_cgroup);
3193 3687
3688 /* Can be very big if MAX_NUMNODES is very big */
3194 if (size < PAGE_SIZE) 3689 if (size < PAGE_SIZE)
3195 mem = kmalloc(size, GFP_KERNEL); 3690 mem = kmalloc(size, GFP_KERNEL);
3196 else 3691 else
@@ -3198,6 +3693,14 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
3198 3693
3199 if (mem) 3694 if (mem)
3200 memset(mem, 0, size); 3695 memset(mem, 0, size);
3696 mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
3697 if (!mem->stat) {
3698 if (size < PAGE_SIZE)
3699 kfree(mem);
3700 else
3701 vfree(mem);
3702 mem = NULL;
3703 }
3201 return mem; 3704 return mem;
3202} 3705}
3203 3706
@@ -3222,7 +3725,8 @@ static void __mem_cgroup_free(struct mem_cgroup *mem)
3222 for_each_node_state(node, N_POSSIBLE) 3725 for_each_node_state(node, N_POSSIBLE)
3223 free_mem_cgroup_per_zone_info(mem, node); 3726 free_mem_cgroup_per_zone_info(mem, node);
3224 3727
3225 if (mem_cgroup_size() < PAGE_SIZE) 3728 free_percpu(mem->stat);
3729 if (sizeof(struct mem_cgroup) < PAGE_SIZE)
3226 kfree(mem); 3730 kfree(mem);
3227 else 3731 else
3228 vfree(mem); 3732 vfree(mem);
@@ -3233,9 +3737,9 @@ static void mem_cgroup_get(struct mem_cgroup *mem)
3233 atomic_inc(&mem->refcnt); 3737 atomic_inc(&mem->refcnt);
3234} 3738}
3235 3739
3236static void mem_cgroup_put(struct mem_cgroup *mem) 3740static void __mem_cgroup_put(struct mem_cgroup *mem, int count)
3237{ 3741{
3238 if (atomic_dec_and_test(&mem->refcnt)) { 3742 if (atomic_sub_and_test(count, &mem->refcnt)) {
3239 struct mem_cgroup *parent = parent_mem_cgroup(mem); 3743 struct mem_cgroup *parent = parent_mem_cgroup(mem);
3240 __mem_cgroup_free(mem); 3744 __mem_cgroup_free(mem);
3241 if (parent) 3745 if (parent)
@@ -3243,6 +3747,11 @@ static void mem_cgroup_put(struct mem_cgroup *mem)
3243 } 3747 }
3244} 3748}
3245 3749
3750static void mem_cgroup_put(struct mem_cgroup *mem)
3751{
3752 __mem_cgroup_put(mem, 1);
3753}
3754
3246/* 3755/*
3247 * Returns the parent mem_cgroup in memcgroup hierarchy with hierarchy enabled. 3756 * Returns the parent mem_cgroup in memcgroup hierarchy with hierarchy enabled.
3248 */ 3757 */
@@ -3319,7 +3828,6 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
3319 INIT_WORK(&stock->work, drain_local_stock); 3828 INIT_WORK(&stock->work, drain_local_stock);
3320 } 3829 }
3321 hotcpu_notifier(memcg_stock_cpu_callback, 0); 3830 hotcpu_notifier(memcg_stock_cpu_callback, 0);
3322
3323 } else { 3831 } else {
3324 parent = mem_cgroup_from_cont(cont->parent); 3832 parent = mem_cgroup_from_cont(cont->parent);
3325 mem->use_hierarchy = parent->use_hierarchy; 3833 mem->use_hierarchy = parent->use_hierarchy;
@@ -3345,6 +3853,8 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
3345 if (parent) 3853 if (parent)
3346 mem->swappiness = get_swappiness(parent); 3854 mem->swappiness = get_swappiness(parent);
3347 atomic_set(&mem->refcnt, 1); 3855 atomic_set(&mem->refcnt, 1);
3856 mem->move_charge_at_immigrate = 0;
3857 mutex_init(&mem->thresholds_lock);
3348 return &mem->css; 3858 return &mem->css;
3349free_out: 3859free_out:
3350 __mem_cgroup_free(mem); 3860 __mem_cgroup_free(mem);
@@ -3381,16 +3891,444 @@ static int mem_cgroup_populate(struct cgroup_subsys *ss,
3381 return ret; 3891 return ret;
3382} 3892}
3383 3893
3894#ifdef CONFIG_MMU
3895/* Handlers for move charge at task migration. */
3896#define PRECHARGE_COUNT_AT_ONCE 256
3897static int mem_cgroup_do_precharge(unsigned long count)
3898{
3899 int ret = 0;
3900 int batch_count = PRECHARGE_COUNT_AT_ONCE;
3901 struct mem_cgroup *mem = mc.to;
3902
3903 if (mem_cgroup_is_root(mem)) {
3904 mc.precharge += count;
3905 /* we don't need css_get for root */
3906 return ret;
3907 }
3908 /* try to charge at once */
3909 if (count > 1) {
3910 struct res_counter *dummy;
3911 /*
3912 * "mem" cannot be under rmdir() because we've already checked
3913 * by cgroup_lock_live_cgroup() that it is not removed and we
3914 * are still under the same cgroup_mutex. So we can postpone
3915 * css_get().
3916 */
3917 if (res_counter_charge(&mem->res, PAGE_SIZE * count, &dummy))
3918 goto one_by_one;
3919 if (do_swap_account && res_counter_charge(&mem->memsw,
3920 PAGE_SIZE * count, &dummy)) {
3921 res_counter_uncharge(&mem->res, PAGE_SIZE * count);
3922 goto one_by_one;
3923 }
3924 mc.precharge += count;
3925 VM_BUG_ON(test_bit(CSS_ROOT, &mem->css.flags));
3926 WARN_ON_ONCE(count > INT_MAX);
3927 __css_get(&mem->css, (int)count);
3928 return ret;
3929 }
3930one_by_one:
3931 /* fall back to one by one charge */
3932 while (count--) {
3933 if (signal_pending(current)) {
3934 ret = -EINTR;
3935 break;
3936 }
3937 if (!batch_count--) {
3938 batch_count = PRECHARGE_COUNT_AT_ONCE;
3939 cond_resched();
3940 }
3941 ret = __mem_cgroup_try_charge(NULL, GFP_KERNEL, &mem, false);
3942 if (ret || !mem)
3943 /* mem_cgroup_clear_mc() will do uncharge later */
3944 return -ENOMEM;
3945 mc.precharge++;
3946 }
3947 return ret;
3948}
3949#else /* !CONFIG_MMU */
3950static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
3951 struct cgroup *cgroup,
3952 struct task_struct *p,
3953 bool threadgroup)
3954{
3955 return 0;
3956}
3957static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
3958 struct cgroup *cgroup,
3959 struct task_struct *p,
3960 bool threadgroup)
3961{
3962}
3384static void mem_cgroup_move_task(struct cgroup_subsys *ss, 3963static void mem_cgroup_move_task(struct cgroup_subsys *ss,
3385 struct cgroup *cont, 3964 struct cgroup *cont,
3386 struct cgroup *old_cont, 3965 struct cgroup *old_cont,
3387 struct task_struct *p, 3966 struct task_struct *p,
3388 bool threadgroup) 3967 bool threadgroup)
3389{ 3968{
3969}
3970#endif
3971
3972/**
3973 * is_target_pte_for_mc - check a pte whether it is valid for move charge
3974 * @vma: the vma the pte to be checked belongs
3975 * @addr: the address corresponding to the pte to be checked
3976 * @ptent: the pte to be checked
3977 * @target: the pointer the target page or swap ent will be stored(can be NULL)
3978 *
3979 * Returns
3980 * 0(MC_TARGET_NONE): if the pte is not a target for move charge.
3981 * 1(MC_TARGET_PAGE): if the page corresponding to this pte is a target for
3982 * move charge. if @target is not NULL, the page is stored in target->page
3983 * with extra refcnt got(Callers should handle it).
3984 * 2(MC_TARGET_SWAP): if the swap entry corresponding to this pte is a
3985 * target for charge migration. if @target is not NULL, the entry is stored
3986 * in target->ent.
3987 *
3988 * Called with pte lock held.
3989 */
3990union mc_target {
3991 struct page *page;
3992 swp_entry_t ent;
3993};
3994
3995enum mc_target_type {
3996 MC_TARGET_NONE, /* not used */
3997 MC_TARGET_PAGE,
3998 MC_TARGET_SWAP,
3999};
4000
4001static int is_target_pte_for_mc(struct vm_area_struct *vma,
4002 unsigned long addr, pte_t ptent, union mc_target *target)
4003{
4004 struct page *page = NULL;
4005 struct page_cgroup *pc;
4006 int ret = 0;
4007 swp_entry_t ent = { .val = 0 };
4008 int usage_count = 0;
4009 bool move_anon = test_bit(MOVE_CHARGE_TYPE_ANON,
4010 &mc.to->move_charge_at_immigrate);
4011
4012 if (!pte_present(ptent)) {
4013 /* TODO: handle swap of shmes/tmpfs */
4014 if (pte_none(ptent) || pte_file(ptent))
4015 return 0;
4016 else if (is_swap_pte(ptent)) {
4017 ent = pte_to_swp_entry(ptent);
4018 if (!move_anon || non_swap_entry(ent))
4019 return 0;
4020 usage_count = mem_cgroup_count_swap_user(ent, &page);
4021 }
4022 } else {
4023 page = vm_normal_page(vma, addr, ptent);
4024 if (!page || !page_mapped(page))
4025 return 0;
4026 /*
4027 * TODO: We don't move charges of file(including shmem/tmpfs)
4028 * pages for now.
4029 */
4030 if (!move_anon || !PageAnon(page))
4031 return 0;
4032 if (!get_page_unless_zero(page))
4033 return 0;
4034 usage_count = page_mapcount(page);
4035 }
4036 if (usage_count > 1) {
4037 /*
4038 * TODO: We don't move charges of shared(used by multiple
4039 * processes) pages for now.
4040 */
4041 if (page)
4042 put_page(page);
4043 return 0;
4044 }
4045 if (page) {
4046 pc = lookup_page_cgroup(page);
4047 /*
4048 * Do only loose check w/o page_cgroup lock.
4049 * mem_cgroup_move_account() checks the pc is valid or not under
4050 * the lock.
4051 */
4052 if (PageCgroupUsed(pc) && pc->mem_cgroup == mc.from) {
4053 ret = MC_TARGET_PAGE;
4054 if (target)
4055 target->page = page;
4056 }
4057 if (!ret || !target)
4058 put_page(page);
4059 }
4060 /* throught */
4061 if (ent.val && do_swap_account && !ret &&
4062 css_id(&mc.from->css) == lookup_swap_cgroup(ent)) {
4063 ret = MC_TARGET_SWAP;
4064 if (target)
4065 target->ent = ent;
4066 }
4067 return ret;
4068}
4069
4070static int mem_cgroup_count_precharge_pte_range(pmd_t *pmd,
4071 unsigned long addr, unsigned long end,
4072 struct mm_walk *walk)
4073{
4074 struct vm_area_struct *vma = walk->private;
4075 pte_t *pte;
4076 spinlock_t *ptl;
4077
4078 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
4079 for (; addr != end; pte++, addr += PAGE_SIZE)
4080 if (is_target_pte_for_mc(vma, addr, *pte, NULL))
4081 mc.precharge++; /* increment precharge temporarily */
4082 pte_unmap_unlock(pte - 1, ptl);
4083 cond_resched();
4084
4085 return 0;
4086}
4087
4088static unsigned long mem_cgroup_count_precharge(struct mm_struct *mm)
4089{
4090 unsigned long precharge;
4091 struct vm_area_struct *vma;
4092
4093 down_read(&mm->mmap_sem);
4094 for (vma = mm->mmap; vma; vma = vma->vm_next) {
4095 struct mm_walk mem_cgroup_count_precharge_walk = {
4096 .pmd_entry = mem_cgroup_count_precharge_pte_range,
4097 .mm = mm,
4098 .private = vma,
4099 };
4100 if (is_vm_hugetlb_page(vma))
4101 continue;
4102 /* TODO: We don't move charges of shmem/tmpfs pages for now. */
4103 if (vma->vm_flags & VM_SHARED)
4104 continue;
4105 walk_page_range(vma->vm_start, vma->vm_end,
4106 &mem_cgroup_count_precharge_walk);
4107 }
4108 up_read(&mm->mmap_sem);
4109
4110 precharge = mc.precharge;
4111 mc.precharge = 0;
4112
4113 return precharge;
4114}
4115
4116static int mem_cgroup_precharge_mc(struct mm_struct *mm)
4117{
4118 return mem_cgroup_do_precharge(mem_cgroup_count_precharge(mm));
4119}
4120
4121static void mem_cgroup_clear_mc(void)
4122{
4123 /* we must uncharge all the leftover precharges from mc.to */
4124 if (mc.precharge) {
4125 __mem_cgroup_cancel_charge(mc.to, mc.precharge);
4126 mc.precharge = 0;
4127 }
3390 /* 4128 /*
3391 * FIXME: It's better to move charges of this process from old 4129 * we didn't uncharge from mc.from at mem_cgroup_move_account(), so
3392 * memcg to new memcg. But it's just on TODO-List now. 4130 * we must uncharge here.
3393 */ 4131 */
4132 if (mc.moved_charge) {
4133 __mem_cgroup_cancel_charge(mc.from, mc.moved_charge);
4134 mc.moved_charge = 0;
4135 }
4136 /* we must fixup refcnts and charges */
4137 if (mc.moved_swap) {
4138 WARN_ON_ONCE(mc.moved_swap > INT_MAX);
4139 /* uncharge swap account from the old cgroup */
4140 if (!mem_cgroup_is_root(mc.from))
4141 res_counter_uncharge(&mc.from->memsw,
4142 PAGE_SIZE * mc.moved_swap);
4143 __mem_cgroup_put(mc.from, mc.moved_swap);
4144
4145 if (!mem_cgroup_is_root(mc.to)) {
4146 /*
4147 * we charged both to->res and to->memsw, so we should
4148 * uncharge to->res.
4149 */
4150 res_counter_uncharge(&mc.to->res,
4151 PAGE_SIZE * mc.moved_swap);
4152 VM_BUG_ON(test_bit(CSS_ROOT, &mc.to->css.flags));
4153 __css_put(&mc.to->css, mc.moved_swap);
4154 }
4155 /* we've already done mem_cgroup_get(mc.to) */
4156
4157 mc.moved_swap = 0;
4158 }
4159 mc.from = NULL;
4160 mc.to = NULL;
4161 mc.moving_task = NULL;
4162 wake_up_all(&mc.waitq);
4163}
4164
4165static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
4166 struct cgroup *cgroup,
4167 struct task_struct *p,
4168 bool threadgroup)
4169{
4170 int ret = 0;
4171 struct mem_cgroup *mem = mem_cgroup_from_cont(cgroup);
4172
4173 if (mem->move_charge_at_immigrate) {
4174 struct mm_struct *mm;
4175 struct mem_cgroup *from = mem_cgroup_from_task(p);
4176
4177 VM_BUG_ON(from == mem);
4178
4179 mm = get_task_mm(p);
4180 if (!mm)
4181 return 0;
4182 /* We move charges only when we move a owner of the mm */
4183 if (mm->owner == p) {
4184 VM_BUG_ON(mc.from);
4185 VM_BUG_ON(mc.to);
4186 VM_BUG_ON(mc.precharge);
4187 VM_BUG_ON(mc.moved_charge);
4188 VM_BUG_ON(mc.moved_swap);
4189 VM_BUG_ON(mc.moving_task);
4190 mc.from = from;
4191 mc.to = mem;
4192 mc.precharge = 0;
4193 mc.moved_charge = 0;
4194 mc.moved_swap = 0;
4195 mc.moving_task = current;
4196
4197 ret = mem_cgroup_precharge_mc(mm);
4198 if (ret)
4199 mem_cgroup_clear_mc();
4200 }
4201 mmput(mm);
4202 }
4203 return ret;
4204}
4205
4206static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss,
4207 struct cgroup *cgroup,
4208 struct task_struct *p,
4209 bool threadgroup)
4210{
4211 mem_cgroup_clear_mc();
4212}
4213
4214static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
4215 unsigned long addr, unsigned long end,
4216 struct mm_walk *walk)
4217{
4218 int ret = 0;
4219 struct vm_area_struct *vma = walk->private;
4220 pte_t *pte;
4221 spinlock_t *ptl;
4222
4223retry:
4224 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
4225 for (; addr != end; addr += PAGE_SIZE) {
4226 pte_t ptent = *(pte++);
4227 union mc_target target;
4228 int type;
4229 struct page *page;
4230 struct page_cgroup *pc;
4231 swp_entry_t ent;
4232
4233 if (!mc.precharge)
4234 break;
4235
4236 type = is_target_pte_for_mc(vma, addr, ptent, &target);
4237 switch (type) {
4238 case MC_TARGET_PAGE:
4239 page = target.page;
4240 if (isolate_lru_page(page))
4241 goto put;
4242 pc = lookup_page_cgroup(page);
4243 if (!mem_cgroup_move_account(pc,
4244 mc.from, mc.to, false)) {
4245 mc.precharge--;
4246 /* we uncharge from mc.from later. */
4247 mc.moved_charge++;
4248 }
4249 putback_lru_page(page);
4250put: /* is_target_pte_for_mc() gets the page */
4251 put_page(page);
4252 break;
4253 case MC_TARGET_SWAP:
4254 ent = target.ent;
4255 if (!mem_cgroup_move_swap_account(ent,
4256 mc.from, mc.to, false)) {
4257 mc.precharge--;
4258 /* we fixup refcnts and charges later. */
4259 mc.moved_swap++;
4260 }
4261 break;
4262 default:
4263 break;
4264 }
4265 }
4266 pte_unmap_unlock(pte - 1, ptl);
4267 cond_resched();
4268
4269 if (addr != end) {
4270 /*
4271 * We have consumed all precharges we got in can_attach().
4272 * We try charge one by one, but don't do any additional
4273 * charges to mc.to if we have failed in charge once in attach()
4274 * phase.
4275 */
4276 ret = mem_cgroup_do_precharge(1);
4277 if (!ret)
4278 goto retry;
4279 }
4280
4281 return ret;
4282}
4283
4284static void mem_cgroup_move_charge(struct mm_struct *mm)
4285{
4286 struct vm_area_struct *vma;
4287
4288 lru_add_drain_all();
4289 down_read(&mm->mmap_sem);
4290 for (vma = mm->mmap; vma; vma = vma->vm_next) {
4291 int ret;
4292 struct mm_walk mem_cgroup_move_charge_walk = {
4293 .pmd_entry = mem_cgroup_move_charge_pte_range,
4294 .mm = mm,
4295 .private = vma,
4296 };
4297 if (is_vm_hugetlb_page(vma))
4298 continue;
4299 /* TODO: We don't move charges of shmem/tmpfs pages for now. */
4300 if (vma->vm_flags & VM_SHARED)
4301 continue;
4302 ret = walk_page_range(vma->vm_start, vma->vm_end,
4303 &mem_cgroup_move_charge_walk);
4304 if (ret)
4305 /*
4306 * means we have consumed all precharges and failed in
4307 * doing additional charge. Just abandon here.
4308 */
4309 break;
4310 }
4311 up_read(&mm->mmap_sem);
4312}
4313
4314static void mem_cgroup_move_task(struct cgroup_subsys *ss,
4315 struct cgroup *cont,
4316 struct cgroup *old_cont,
4317 struct task_struct *p,
4318 bool threadgroup)
4319{
4320 struct mm_struct *mm;
4321
4322 if (!mc.to)
4323 /* no need to move charge */
4324 return;
4325
4326 mm = get_task_mm(p);
4327 if (mm) {
4328 mem_cgroup_move_charge(mm);
4329 mmput(mm);
4330 }
4331 mem_cgroup_clear_mc();
3394} 4332}
3395 4333
3396struct cgroup_subsys mem_cgroup_subsys = { 4334struct cgroup_subsys mem_cgroup_subsys = {
@@ -3400,6 +4338,8 @@ struct cgroup_subsys mem_cgroup_subsys = {
3400 .pre_destroy = mem_cgroup_pre_destroy, 4338 .pre_destroy = mem_cgroup_pre_destroy,
3401 .destroy = mem_cgroup_destroy, 4339 .destroy = mem_cgroup_destroy,
3402 .populate = mem_cgroup_populate, 4340 .populate = mem_cgroup_populate,
4341 .can_attach = mem_cgroup_can_attach,
4342 .cancel_attach = mem_cgroup_cancel_attach,
3403 .attach = mem_cgroup_move_task, 4343 .attach = mem_cgroup_move_task,
3404 .early_init = 0, 4344 .early_init = 0,
3405 .use_id = 1, 4345 .use_id = 1,
diff --git a/mm/memory.c b/mm/memory.c
index d1153e37e9ba..5b7f2002e54b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -190,9 +190,6 @@ static void check_sync_rss_stat(struct task_struct *task)
190{ 190{
191} 191}
192 192
193void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
194{
195}
196#endif 193#endif
197 194
198/* 195/*
@@ -512,12 +509,8 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr,
512 "BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n", 509 "BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n",
513 current->comm, 510 current->comm,
514 (long long)pte_val(pte), (long long)pmd_val(*pmd)); 511 (long long)pte_val(pte), (long long)pmd_val(*pmd));
515 if (page) { 512 if (page)
516 printk(KERN_ALERT 513 dump_page(page);
517 "page:%p flags:%p count:%d mapcount:%d mapping:%p index:%lx\n",
518 page, (void *)page->flags, page_count(page),
519 page_mapcount(page), page->mapping, page->index);
520 }
521 printk(KERN_ALERT 514 printk(KERN_ALERT
522 "addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n", 515 "addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n",
523 (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index); 516 (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 78e34e63c7b8..be211a582930 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -688,9 +688,9 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
688 if (page_count(page)) 688 if (page_count(page))
689 not_managed++; 689 not_managed++;
690#ifdef CONFIG_DEBUG_VM 690#ifdef CONFIG_DEBUG_VM
691 printk(KERN_INFO "removing from LRU failed" 691 printk(KERN_ALERT "removing pfn %lx from LRU failed\n",
692 " %lx/%d/%lx\n", 692 pfn);
693 pfn, page_count(page), page->flags); 693 dump_page(page);
694#endif 694#endif
695 } 695 }
696 } 696 }
diff --git a/mm/mmap.c b/mm/mmap.c
index f1b4448626bf..75557c639ad4 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1088,6 +1088,30 @@ out:
1088 return retval; 1088 return retval;
1089} 1089}
1090 1090
1091#ifdef __ARCH_WANT_SYS_OLD_MMAP
1092struct mmap_arg_struct {
1093 unsigned long addr;
1094 unsigned long len;
1095 unsigned long prot;
1096 unsigned long flags;
1097 unsigned long fd;
1098 unsigned long offset;
1099};
1100
1101SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg)
1102{
1103 struct mmap_arg_struct a;
1104
1105 if (copy_from_user(&a, arg, sizeof(a)))
1106 return -EFAULT;
1107 if (a.offset & ~PAGE_MASK)
1108 return -EINVAL;
1109
1110 return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
1111 a.offset >> PAGE_SHIFT);
1112}
1113#endif /* __ARCH_WANT_SYS_OLD_MMAP */
1114
1091/* 1115/*
1092 * Some shared mappigns will want the pages marked read-only 1116 * Some shared mappigns will want the pages marked read-only
1093 * to track write events. If so, we'll downgrade vm_page_prot 1117 * to track write events. If so, we'll downgrade vm_page_prot
diff --git a/mm/nommu.c b/mm/nommu.c
index b9b5cceb1b68..605ace8982a8 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1428,6 +1428,30 @@ out:
1428 return retval; 1428 return retval;
1429} 1429}
1430 1430
1431#ifdef __ARCH_WANT_SYS_OLD_MMAP
1432struct mmap_arg_struct {
1433 unsigned long addr;
1434 unsigned long len;
1435 unsigned long prot;
1436 unsigned long flags;
1437 unsigned long fd;
1438 unsigned long offset;
1439};
1440
1441SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg)
1442{
1443 struct mmap_arg_struct a;
1444
1445 if (copy_from_user(&a, arg, sizeof(a)))
1446 return -EFAULT;
1447 if (a.offset & ~PAGE_MASK)
1448 return -EINVAL;
1449
1450 return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
1451 a.offset >> PAGE_SHIFT);
1452}
1453#endif /* __ARCH_WANT_SYS_OLD_MMAP */
1454
1431/* 1455/*
1432 * split a vma into two pieces at address 'addr', a new vma is allocated either 1456 * split a vma into two pieces at address 'addr', a new vma is allocated either
1433 * for the first part or the tail. 1457 * for the first part or the tail.
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 35755a4156d6..9b223af6a147 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -473,6 +473,8 @@ void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask)
473 unsigned long points = 0; 473 unsigned long points = 0;
474 struct task_struct *p; 474 struct task_struct *p;
475 475
476 if (sysctl_panic_on_oom == 2)
477 panic("out of memory(memcg). panic_on_oom is selected.\n");
476 read_lock(&tasklist_lock); 478 read_lock(&tasklist_lock);
477retry: 479retry:
478 p = select_bad_process(&points, mem); 480 p = select_bad_process(&points, mem);
@@ -601,13 +603,6 @@ void pagefault_out_of_memory(void)
601 /* Got some memory back in the last second. */ 603 /* Got some memory back in the last second. */
602 return; 604 return;
603 605
604 /*
605 * If this is from memcg, oom-killer is already invoked.
606 * and not worth to go system-wide-oom.
607 */
608 if (mem_cgroup_oom_called(current))
609 goto rest_and_return;
610
611 if (sysctl_panic_on_oom) 606 if (sysctl_panic_on_oom)
612 panic("out of memory from page fault. panic_on_oom is selected.\n"); 607 panic("out of memory from page fault. panic_on_oom is selected.\n");
613 608
@@ -619,7 +614,6 @@ void pagefault_out_of_memory(void)
619 * Give "p" a good chance of killing itself before we 614 * Give "p" a good chance of killing itself before we
620 * retry to allocate memory. 615 * retry to allocate memory.
621 */ 616 */
622rest_and_return:
623 if (!test_thread_flag(TIF_MEMDIE)) 617 if (!test_thread_flag(TIF_MEMDIE))
624 schedule_timeout_uninterruptible(1); 618 schedule_timeout_uninterruptible(1);
625} 619}
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a8182c89de59..d03c946d5566 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -50,6 +50,7 @@
50#include <linux/kmemleak.h> 50#include <linux/kmemleak.h>
51#include <linux/memory.h> 51#include <linux/memory.h>
52#include <trace/events/kmem.h> 52#include <trace/events/kmem.h>
53#include <linux/ftrace_event.h>
53 54
54#include <asm/tlbflush.h> 55#include <asm/tlbflush.h>
55#include <asm/div64.h> 56#include <asm/div64.h>
@@ -288,10 +289,7 @@ static void bad_page(struct page *page)
288 289
289 printk(KERN_ALERT "BUG: Bad page state in process %s pfn:%05lx\n", 290 printk(KERN_ALERT "BUG: Bad page state in process %s pfn:%05lx\n",
290 current->comm, page_to_pfn(page)); 291 current->comm, page_to_pfn(page));
291 printk(KERN_ALERT 292 dump_page(page);
292 "page:%p flags:%p count:%d mapcount:%d mapping:%p index:%lx\n",
293 page, (void *)page->flags, page_count(page),
294 page_mapcount(page), page->mapping, page->index);
295 293
296 dump_stack(); 294 dump_stack();
297out: 295out:
@@ -3224,7 +3222,7 @@ static int __zone_pcp_update(void *data)
3224 int cpu; 3222 int cpu;
3225 unsigned long batch = zone_batchsize(zone), flags; 3223 unsigned long batch = zone_batchsize(zone), flags;
3226 3224
3227 for (cpu = 0; cpu < NR_CPUS; cpu++) { 3225 for_each_possible_cpu(cpu) {
3228 struct per_cpu_pageset *pset; 3226 struct per_cpu_pageset *pset;
3229 struct per_cpu_pages *pcp; 3227 struct per_cpu_pages *pcp;
3230 3228
@@ -5183,3 +5181,80 @@ bool is_free_buddy_page(struct page *page)
5183 return order < MAX_ORDER; 5181 return order < MAX_ORDER;
5184} 5182}
5185#endif 5183#endif
5184
5185static struct trace_print_flags pageflag_names[] = {
5186 {1UL << PG_locked, "locked" },
5187 {1UL << PG_error, "error" },
5188 {1UL << PG_referenced, "referenced" },
5189 {1UL << PG_uptodate, "uptodate" },
5190 {1UL << PG_dirty, "dirty" },
5191 {1UL << PG_lru, "lru" },
5192 {1UL << PG_active, "active" },
5193 {1UL << PG_slab, "slab" },
5194 {1UL << PG_owner_priv_1, "owner_priv_1" },
5195 {1UL << PG_arch_1, "arch_1" },
5196 {1UL << PG_reserved, "reserved" },
5197 {1UL << PG_private, "private" },
5198 {1UL << PG_private_2, "private_2" },
5199 {1UL << PG_writeback, "writeback" },
5200#ifdef CONFIG_PAGEFLAGS_EXTENDED
5201 {1UL << PG_head, "head" },
5202 {1UL << PG_tail, "tail" },
5203#else
5204 {1UL << PG_compound, "compound" },
5205#endif
5206 {1UL << PG_swapcache, "swapcache" },
5207 {1UL << PG_mappedtodisk, "mappedtodisk" },
5208 {1UL << PG_reclaim, "reclaim" },
5209 {1UL << PG_buddy, "buddy" },
5210 {1UL << PG_swapbacked, "swapbacked" },
5211 {1UL << PG_unevictable, "unevictable" },
5212#ifdef CONFIG_MMU
5213 {1UL << PG_mlocked, "mlocked" },
5214#endif
5215#ifdef CONFIG_ARCH_USES_PG_UNCACHED
5216 {1UL << PG_uncached, "uncached" },
5217#endif
5218#ifdef CONFIG_MEMORY_FAILURE
5219 {1UL << PG_hwpoison, "hwpoison" },
5220#endif
5221 {-1UL, NULL },
5222};
5223
5224static void dump_page_flags(unsigned long flags)
5225{
5226 const char *delim = "";
5227 unsigned long mask;
5228 int i;
5229
5230 printk(KERN_ALERT "page flags: %#lx(", flags);
5231
5232 /* remove zone id */
5233 flags &= (1UL << NR_PAGEFLAGS) - 1;
5234
5235 for (i = 0; pageflag_names[i].name && flags; i++) {
5236
5237 mask = pageflag_names[i].mask;
5238 if ((flags & mask) != mask)
5239 continue;
5240
5241 flags &= ~mask;
5242 printk("%s%s", delim, pageflag_names[i].name);
5243 delim = "|";
5244 }
5245
5246 /* check for left over flags */
5247 if (flags)
5248 printk("%s%#lx", delim, flags);
5249
5250 printk(")\n");
5251}
5252
5253void dump_page(struct page *page)
5254{
5255 printk(KERN_ALERT
5256 "page:%p count:%d mapcount:%d mapping:%p index:%#lx\n",
5257 page, page_count(page), page_mapcount(page),
5258 page->mapping, page->index);
5259 dump_page_flags(page->flags);
5260}
diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 3d535d594826..3dd88539a0e6 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -335,6 +335,37 @@ not_enough_page:
335} 335}
336 336
337/** 337/**
338 * swap_cgroup_cmpxchg - cmpxchg mem_cgroup's id for this swp_entry.
339 * @end: swap entry to be cmpxchged
340 * @old: old id
341 * @new: new id
342 *
343 * Returns old id at success, 0 at failure.
344 * (There is no mem_cgroup useing 0 as its id)
345 */
346unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
347 unsigned short old, unsigned short new)
348{
349 int type = swp_type(ent);
350 unsigned long offset = swp_offset(ent);
351 unsigned long idx = offset / SC_PER_PAGE;
352 unsigned long pos = offset & SC_POS_MASK;
353 struct swap_cgroup_ctrl *ctrl;
354 struct page *mappage;
355 struct swap_cgroup *sc;
356
357 ctrl = &swap_cgroup_ctrl[type];
358
359 mappage = ctrl->map[idx];
360 sc = page_address(mappage);
361 sc += pos;
362 if (cmpxchg(&sc->id, old, new) == old)
363 return old;
364 else
365 return 0;
366}
367
368/**
338 * swap_cgroup_record - record mem_cgroup for this swp_entry. 369 * swap_cgroup_record - record mem_cgroup for this swp_entry.
339 * @ent: swap entry to be recorded into 370 * @ent: swap entry to be recorded into
340 * @mem: mem_cgroup to be recorded 371 * @mem: mem_cgroup to be recorded
@@ -358,8 +389,7 @@ unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
358 mappage = ctrl->map[idx]; 389 mappage = ctrl->map[idx];
359 sc = page_address(mappage); 390 sc = page_address(mappage);
360 sc += pos; 391 sc += pos;
361 old = sc->id; 392 old = xchg(&sc->id, id);
362 sc->id = id;
363 393
364 return old; 394 return old;
365} 395}
diff --git a/mm/slub.c b/mm/slub.c
index a2b8969ba6d0..b364844a1068 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2960,7 +2960,7 @@ static void slab_mem_offline_callback(void *arg)
2960 /* 2960 /*
2961 * if n->nr_slabs > 0, slabs still exist on the node 2961 * if n->nr_slabs > 0, slabs still exist on the node
2962 * that is going down. We were unable to free them, 2962 * that is going down. We were unable to free them,
2963 * and offline_pages() function shoudn't call this 2963 * and offline_pages() function shouldn't call this
2964 * callback. So, we must fail. 2964 * callback. So, we must fail.
2965 */ 2965 */
2966 BUG_ON(slabs_node(s, offline_node)); 2966 BUG_ON(slabs_node(s, offline_node));
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 84374d8cf814..6cd0a8f90dc7 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -723,6 +723,37 @@ int free_swap_and_cache(swp_entry_t entry)
723 return p != NULL; 723 return p != NULL;
724} 724}
725 725
726#ifdef CONFIG_CGROUP_MEM_RES_CTLR
727/**
728 * mem_cgroup_count_swap_user - count the user of a swap entry
729 * @ent: the swap entry to be checked
730 * @pagep: the pointer for the swap cache page of the entry to be stored
731 *
732 * Returns the number of the user of the swap entry. The number is valid only
733 * for swaps of anonymous pages.
734 * If the entry is found on swap cache, the page is stored to pagep with
735 * refcount of it being incremented.
736 */
737int mem_cgroup_count_swap_user(swp_entry_t ent, struct page **pagep)
738{
739 struct page *page;
740 struct swap_info_struct *p;
741 int count = 0;
742
743 page = find_get_page(&swapper_space, ent.val);
744 if (page)
745 count += page_mapcount(page);
746 p = swap_info_get(ent);
747 if (p) {
748 count += swap_count(p->swap_map[swp_offset(ent)]);
749 spin_unlock(&swap_lock);
750 }
751
752 *pagep = page;
753 return count;
754}
755#endif
756
726#ifdef CONFIG_HIBERNATION 757#ifdef CONFIG_HIBERNATION
727/* 758/*
728 * Find the swap type that corresponds to given device (if any). 759 * Find the swap type that corresponds to given device (if any).
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index a17629b8912e..b2e6bbccaee1 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -134,7 +134,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk)
134} 134}
135 135
136/* This function calculates a "timeout" which is equivalent to the timeout of a 136/* This function calculates a "timeout" which is equivalent to the timeout of a
137 * TCP connection after "boundary" unsucessful, exponentially backed-off 137 * TCP connection after "boundary" unsuccessful, exponentially backed-off
138 * retransmissions with an initial RTO of TCP_RTO_MIN. 138 * retransmissions with an initial RTO of TCP_RTO_MIN.
139 */ 139 */
140static bool retransmits_timed_out(struct sock *sk, 140static bool retransmits_timed_out(struct sock *sk,
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index bc4e20e57ff5..1a29c4a8139e 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -744,7 +744,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
744 break; 744 break;
745 default: 745 default:
746 /* should not get here, PLINK_BLOCKED is dealt with at the 746 /* should not get here, PLINK_BLOCKED is dealt with at the
747 * beggining of the function 747 * beginning of the function
748 */ 748 */
749 spin_unlock_bh(&sta->lock); 749 spin_unlock_bh(&sta->lock);
750 break; 750 break;
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 8dd75d90efc0..c6cd1b84eddd 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -284,7 +284,7 @@ EXPORT_SYMBOL_GPL(ct_sip_parse_request);
284 * tabs, spaces and continuation lines, which are treated as a single whitespace 284 * tabs, spaces and continuation lines, which are treated as a single whitespace
285 * character. 285 * character.
286 * 286 *
287 * Some headers may appear multiple times. A comma seperated list of values is 287 * Some headers may appear multiple times. A comma separated list of values is
288 * equivalent to multiple headers. 288 * equivalent to multiple headers.
289 */ 289 */
290static const struct sip_header ct_sip_hdrs[] = { 290static const struct sip_header ct_sip_hdrs[] = {
@@ -421,7 +421,7 @@ int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
421} 421}
422EXPORT_SYMBOL_GPL(ct_sip_get_header); 422EXPORT_SYMBOL_GPL(ct_sip_get_header);
423 423
424/* Get next header field in a list of comma seperated values */ 424/* Get next header field in a list of comma separated values */
425static int ct_sip_next_header(const struct nf_conn *ct, const char *dptr, 425static int ct_sip_next_header(const struct nf_conn *ct, const char *dptr,
426 unsigned int dataoff, unsigned int datalen, 426 unsigned int dataoff, unsigned int datalen,
427 enum sip_header_types type, 427 enum sip_header_types type,
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index d952806b6469..9e9c48963942 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * xt_hashlimit - Netfilter module to limit the number of packets per time 2 * xt_hashlimit - Netfilter module to limit the number of packets per time
3 * seperately for each hashbucket (sourceip/sourceport/dstip/dstport) 3 * separately for each hashbucket (sourceip/sourceport/dstip/dstport)
4 * 4 *
5 * (C) 2003-2004 by Harald Welte <laforge@netfilter.org> 5 * (C) 2003-2004 by Harald Welte <laforge@netfilter.org>
6 * Copyright © CC Computer Consultants GmbH, 2007 - 2008 6 * Copyright © CC Computer Consultants GmbH, 2007 - 2008
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 4e4ca65cd320..500886bda9b4 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -475,7 +475,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
475 * used to provide an upper bound to this doubling operation. 475 * used to provide an upper bound to this doubling operation.
476 * 476 *
477 * Special Case: the first HB doesn't trigger exponential backoff. 477 * Special Case: the first HB doesn't trigger exponential backoff.
478 * The first unacknowleged HB triggers it. We do this with a flag 478 * The first unacknowledged HB triggers it. We do this with a flag
479 * that indicates that we have an outstanding HB. 479 * that indicates that we have an outstanding HB.
480 */ 480 */
481 if (!is_hb || transport->hb_sent) { 481 if (!is_hb || transport->hb_sent) {
diff --git a/scripts/gfp-translate b/scripts/gfp-translate
index 073cb6d152a0..d81b968d864e 100644
--- a/scripts/gfp-translate
+++ b/scripts/gfp-translate
@@ -19,7 +19,7 @@ usage() {
19 exit 0 19 exit 0
20} 20}
21 21
22# Parse command-line arguements 22# Parse command-line arguments
23while [ $# -gt 0 ]; do 23while [ $# -gt 0 ]; do
24 case $1 in 24 case $1 in
25 --source) 25 --source)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 208ad3b0ca51..c7865c362d28 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -2103,7 +2103,7 @@ sub process_file($) {
2103 $section = $newsection; 2103 $section = $newsection;
2104 } elsif (/$doc_end/) { 2104 } elsif (/$doc_end/) {
2105 2105
2106 if ($contents ne "") { 2106 if (($contents ne "") && ($contents ne "\n")) {
2107 dump_section($file, $section, xml_escape($contents)); 2107 dump_section($file, $section, xml_escape($contents));
2108 $section = $section_default; 2108 $section = $section_default;
2109 $contents = ""; 2109 $contents = "";
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index db0fd9f33499..989fef82563a 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -337,7 +337,7 @@ static inline struct avc_node *avc_search_node(u32 ssid, u32 tsid, u16 tclass)
337 * Look up an AVC entry that is valid for the 337 * Look up an AVC entry that is valid for the
338 * (@ssid, @tsid), interpreting the permissions 338 * (@ssid, @tsid), interpreting the permissions
339 * based on @tclass. If a valid AVC entry exists, 339 * based on @tclass. If a valid AVC entry exists,
340 * then this function return the avc_node. 340 * then this function returns the avc_node.
341 * Otherwise, this function returns NULL. 341 * Otherwise, this function returns NULL.
342 */ 342 */
343static struct avc_node *avc_lookup(u32 ssid, u32 tsid, u16 tclass) 343static struct avc_node *avc_lookup(u32 ssid, u32 tsid, u16 tclass)
@@ -523,7 +523,7 @@ void avc_audit(u32 ssid, u32 tsid,
523 * @perms: permissions 523 * @perms: permissions
524 * 524 *
525 * Register a callback function for events in the set @events 525 * Register a callback function for events in the set @events
526 * related to the SID pair (@ssid, @tsid) and 526 * related to the SID pair (@ssid, @tsid)
527 * and the permissions @perms, interpreting 527 * and the permissions @perms, interpreting
528 * @perms based on @tclass. Returns %0 on success or 528 * @perms based on @tclass. Returns %0 on success or
529 * -%ENOMEM if insufficient memory exists to add the callback. 529 * -%ENOMEM if insufficient memory exists to add the callback.
@@ -568,7 +568,7 @@ static inline int avc_sidcmp(u32 x, u32 y)
568 * 568 *
569 * if a valid AVC entry doesn't exist,this function returns -ENOENT. 569 * if a valid AVC entry doesn't exist,this function returns -ENOENT.
570 * if kmalloc() called internal returns NULL, this function returns -ENOMEM. 570 * if kmalloc() called internal returns NULL, this function returns -ENOMEM.
571 * otherwise, this function update the AVC entry. The original AVC-entry object 571 * otherwise, this function updates the AVC entry. The original AVC-entry object
572 * will release later by RCU. 572 * will release later by RCU.
573 */ 573 */
574static int avc_update_node(u32 event, u32 perms, u32 ssid, u32 tsid, u16 tclass, 574static int avc_update_node(u32 event, u32 perms, u32 ssid, u32 tsid, u16 tclass,
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 6fdca97186e7..88eec3847df2 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -22,7 +22,6 @@
22 22
23#include <asm/irq.h> 23#include <asm/irq.h>
24#include <mach/regs-ac97.h> 24#include <mach/regs-ac97.h>
25#include <mach/pxa2xx-gpio.h>
26#include <mach/audio.h> 25#include <mach/audio.h>
27 26
28static DEFINE_MUTEX(car_mutex); 27static DEFINE_MUTEX(car_mutex);
@@ -32,6 +31,8 @@ static struct clk *ac97_clk;
32static struct clk *ac97conf_clk; 31static struct clk *ac97conf_clk;
33static int reset_gpio; 32static int reset_gpio;
34 33
34extern void pxa27x_assert_ac97reset(int reset_gpio, int on);
35
35/* 36/*
36 * Beware PXA27x bugs: 37 * Beware PXA27x bugs:
37 * 38 *
@@ -42,45 +43,6 @@ static int reset_gpio;
42 * 1 jiffy timeout if interrupt never comes). 43 * 1 jiffy timeout if interrupt never comes).
43 */ 44 */
44 45
45enum {
46 RESETGPIO_FORCE_HIGH,
47 RESETGPIO_FORCE_LOW,
48 RESETGPIO_NORMAL_ALTFUNC
49};
50
51/**
52 * set_resetgpio_mode - computes and sets the AC97_RESET gpio mode on PXA
53 * @mode: chosen action
54 *
55 * As the PXA27x CPUs suffer from a AC97 bug, a manual control of the reset line
56 * must be done to insure proper work of AC97 reset line. This function
57 * computes the correct gpio_mode for further use by reset functions, and
58 * applied the change through pxa_gpio_mode.
59 */
60static void set_resetgpio_mode(int resetgpio_action)
61{
62 int mode = 0;
63
64 if (reset_gpio)
65 switch (resetgpio_action) {
66 case RESETGPIO_NORMAL_ALTFUNC:
67 if (reset_gpio == 113)
68 mode = 113 | GPIO_ALT_FN_2_OUT;
69 if (reset_gpio == 95)
70 mode = 95 | GPIO_ALT_FN_1_OUT;
71 break;
72 case RESETGPIO_FORCE_LOW:
73 mode = reset_gpio | GPIO_OUT | GPIO_DFLT_LOW;
74 break;
75 case RESETGPIO_FORCE_HIGH:
76 mode = reset_gpio | GPIO_OUT | GPIO_DFLT_HIGH;
77 break;
78 };
79
80 if (mode)
81 pxa_gpio_mode(mode);
82}
83
84unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg) 46unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
85{ 47{
86 unsigned short val = -1; 48 unsigned short val = -1;
@@ -174,12 +136,11 @@ static inline void pxa_ac97_warm_pxa27x(void)
174{ 136{
175 gsr_bits = 0; 137 gsr_bits = 0;
176 138
177 /* warm reset broken on Bulverde, 139 /* warm reset broken on Bulverde, so manually keep AC97 reset high */
178 so manually keep AC97 reset high */ 140 pxa27x_assert_ac97reset(reset_gpio, 1);
179 set_resetgpio_mode(RESETGPIO_FORCE_HIGH);
180 udelay(10); 141 udelay(10);
181 GCR |= GCR_WARM_RST; 142 GCR |= GCR_WARM_RST;
182 set_resetgpio_mode(RESETGPIO_NORMAL_ALTFUNC); 143 pxa27x_assert_ac97reset(reset_gpio, 0);
183 udelay(500); 144 udelay(500);
184} 145}
185 146
@@ -345,16 +306,6 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
345 306
346int pxa2xx_ac97_hw_resume(void) 307int pxa2xx_ac97_hw_resume(void)
347{ 308{
348 if (cpu_is_pxa25x() || cpu_is_pxa27x()) {
349 pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
350 pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
351 pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
352 pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
353 }
354 if (cpu_is_pxa27x()) {
355 /* Use GPIO 113 or 95 as AC97 Reset on Bulverde */
356 set_resetgpio_mode(RESETGPIO_NORMAL_ALTFUNC);
357 }
358 clk_enable(ac97_clk); 309 clk_enable(ac97_clk);
359 return 0; 310 return 0;
360} 311}
@@ -386,16 +337,9 @@ int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)
386 reset_gpio = 113; 337 reset_gpio = 113;
387 } 338 }
388 339
389 if (cpu_is_pxa25x() || cpu_is_pxa27x()) {
390 pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
391 pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
392 pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
393 pxa_gpio_mode(GPIO29_SDATA_IN_AC97_MD);
394 }
395
396 if (cpu_is_pxa27x()) { 340 if (cpu_is_pxa27x()) {
397 /* Use GPIO 113 as AC97 Reset on Bulverde */ 341 /* Use GPIO 113 as AC97 Reset on Bulverde */
398 set_resetgpio_mode(RESETGPIO_NORMAL_ALTFUNC); 342 pxa27x_assert_ac97reset(reset_gpio, 0);
399 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK"); 343 ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
400 if (IS_ERR(ac97conf_clk)) { 344 if (IS_ERR(ac97conf_clk)) {
401 ret = PTR_ERR(ac97conf_clk); 345 ret = PTR_ERR(ac97conf_clk);
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 3d72c1effeef..547b713d7204 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -2479,7 +2479,7 @@ static int snd_hdspm_put_qs_wire(struct snd_kcontrol *kcontrol,
2479 on MADICARD 2479 on MADICARD
2480 - playback mixer matrix: [channelout+64] [output] [value] 2480 - playback mixer matrix: [channelout+64] [output] [value]
2481 - input(thru) mixer matrix: [channelin] [output] [value] 2481 - input(thru) mixer matrix: [channelin] [output] [value]
2482 (better do 2 kontrols for seperation ?) 2482 (better do 2 kontrols for separation ?)
2483*/ 2483*/
2484 2484
2485#define HDSPM_MIXER(xname, xindex) \ 2485#define HDSPM_MIXER(xname, xindex) \
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index a54dc77b7f34..056b787b6ee0 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -990,7 +990,7 @@ static int wm8990_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
990 reg = snd_soc_read(codec, WM8990_CLOCKING_2); 990 reg = snd_soc_read(codec, WM8990_CLOCKING_2);
991 snd_soc_write(codec, WM8990_CLOCKING_2, reg | WM8990_SYSCLK_SRC); 991 snd_soc_write(codec, WM8990_CLOCKING_2, reg | WM8990_SYSCLK_SRC);
992 992
993 /* set up N , fractional mode and pre-divisor if neccessary */ 993 /* set up N , fractional mode and pre-divisor if necessary */
994 snd_soc_write(codec, WM8990_PLL1, pll_div.n | WM8990_SDM | 994 snd_soc_write(codec, WM8990_PLL1, pll_div.n | WM8990_SDM |
995 (pll_div.div2?WM8990_PRESCALE:0)); 995 (pll_div.div2?WM8990_PRESCALE:0));
996 snd_soc_write(codec, WM8990_PLL2, (u8)(pll_div.k>>8)); 996 snd_soc_write(codec, WM8990_PLL2, (u8)(pll_div.k>>8));
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index e69397f40f72..9e95e5117c88 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -42,11 +42,14 @@
42 * SSP audio private data 42 * SSP audio private data
43 */ 43 */
44struct ssp_priv { 44struct ssp_priv {
45 struct ssp_dev dev; 45 struct ssp_device *ssp;
46 unsigned int sysclk; 46 unsigned int sysclk;
47 int dai_fmt; 47 int dai_fmt;
48#ifdef CONFIG_PM 48#ifdef CONFIG_PM
49 struct ssp_state state; 49 uint32_t cr0;
50 uint32_t cr1;
51 uint32_t to;
52 uint32_t psp;
50#endif 53#endif
51}; 54};
52 55
@@ -61,6 +64,22 @@ static void dump_registers(struct ssp_device *ssp)
61 ssp_read_reg(ssp, SSACD)); 64 ssp_read_reg(ssp, SSACD));
62} 65}
63 66
67static void ssp_enable(struct ssp_device *ssp)
68{
69 uint32_t sscr0;
70
71 sscr0 = __raw_readl(ssp->mmio_base + SSCR0) | SSCR0_SSE;
72 __raw_writel(sscr0, ssp->mmio_base + SSCR0);
73}
74
75static void ssp_disable(struct ssp_device *ssp)
76{
77 uint32_t sscr0;
78
79 sscr0 = __raw_readl(ssp->mmio_base + SSCR0) & ~SSCR0_SSE;
80 __raw_writel(sscr0, ssp->mmio_base + SSCR0);
81}
82
64struct pxa2xx_pcm_dma_data { 83struct pxa2xx_pcm_dma_data {
65 struct pxa2xx_pcm_dma_params params; 84 struct pxa2xx_pcm_dma_params params;
66 char name[20]; 85 char name[20];
@@ -94,13 +113,12 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream,
94 struct snd_soc_pcm_runtime *rtd = substream->private_data; 113 struct snd_soc_pcm_runtime *rtd = substream->private_data;
95 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 114 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
96 struct ssp_priv *priv = cpu_dai->private_data; 115 struct ssp_priv *priv = cpu_dai->private_data;
116 struct ssp_device *ssp = priv->ssp;
97 int ret = 0; 117 int ret = 0;
98 118
99 if (!cpu_dai->active) { 119 if (!cpu_dai->active) {
100 priv->dev.port = cpu_dai->id + 1; 120 clk_enable(ssp->clk);
101 priv->dev.irq = NO_IRQ; 121 ssp_disable(ssp);
102 clk_enable(priv->dev.ssp->clk);
103 ssp_disable(&priv->dev);
104 } 122 }
105 123
106 if (cpu_dai->dma_data) { 124 if (cpu_dai->dma_data) {
@@ -116,10 +134,11 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
116 struct snd_soc_pcm_runtime *rtd = substream->private_data; 134 struct snd_soc_pcm_runtime *rtd = substream->private_data;
117 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 135 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
118 struct ssp_priv *priv = cpu_dai->private_data; 136 struct ssp_priv *priv = cpu_dai->private_data;
137 struct ssp_device *ssp = priv->ssp;
119 138
120 if (!cpu_dai->active) { 139 if (!cpu_dai->active) {
121 ssp_disable(&priv->dev); 140 ssp_disable(ssp);
122 clk_disable(priv->dev.ssp->clk); 141 clk_disable(ssp->clk);
123 } 142 }
124 143
125 if (cpu_dai->dma_data) { 144 if (cpu_dai->dma_data) {
@@ -133,27 +152,39 @@ static void pxa_ssp_shutdown(struct snd_pcm_substream *substream,
133static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai) 152static int pxa_ssp_suspend(struct snd_soc_dai *cpu_dai)
134{ 153{
135 struct ssp_priv *priv = cpu_dai->private_data; 154 struct ssp_priv *priv = cpu_dai->private_data;
155 struct ssp_device *ssp = priv->ssp;
136 156
137 if (!cpu_dai->active) 157 if (!cpu_dai->active)
138 clk_enable(priv->dev.ssp->clk); 158 clk_enable(ssp->clk);
139 159
140 ssp_save_state(&priv->dev, &priv->state); 160 priv->cr0 = __raw_readl(ssp->mmio_base + SSCR0);
141 clk_disable(priv->dev.ssp->clk); 161 priv->cr1 = __raw_readl(ssp->mmio_base + SSCR1);
162 priv->to = __raw_readl(ssp->mmio_base + SSTO);
163 priv->psp = __raw_readl(ssp->mmio_base + SSPSP);
142 164
165 ssp_disable(ssp);
166 clk_disable(ssp->clk);
143 return 0; 167 return 0;
144} 168}
145 169
146static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai) 170static int pxa_ssp_resume(struct snd_soc_dai *cpu_dai)
147{ 171{
148 struct ssp_priv *priv = cpu_dai->private_data; 172 struct ssp_priv *priv = cpu_dai->private_data;
173 struct ssp_device *ssp = priv->ssp;
174 uint32_t sssr = SSSR_ROR | SSSR_TUR | SSSR_BCE;
175
176 clk_enable(ssp->clk);
149 177
150 clk_enable(priv->dev.ssp->clk); 178 __raw_writel(sssr, ssp->mmio_base + SSSR);
151 ssp_restore_state(&priv->dev, &priv->state); 179 __raw_writel(priv->cr0 & ~SSCR0_SSE, ssp->mmio_base + SSCR0);
180 __raw_writel(priv->cr1, ssp->mmio_base + SSCR1);
181 __raw_writel(priv->to, ssp->mmio_base + SSTO);
182 __raw_writel(priv->psp, ssp->mmio_base + SSPSP);
152 183
153 if (cpu_dai->active) 184 if (cpu_dai->active)
154 ssp_enable(&priv->dev); 185 ssp_enable(ssp);
155 else 186 else
156 clk_disable(priv->dev.ssp->clk); 187 clk_disable(ssp->clk);
157 188
158 return 0; 189 return 0;
159} 190}
@@ -203,7 +234,7 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
203 int clk_id, unsigned int freq, int dir) 234 int clk_id, unsigned int freq, int dir)
204{ 235{
205 struct ssp_priv *priv = cpu_dai->private_data; 236 struct ssp_priv *priv = cpu_dai->private_data;
206 struct ssp_device *ssp = priv->dev.ssp; 237 struct ssp_device *ssp = priv->ssp;
207 int val; 238 int val;
208 239
209 u32 sscr0 = ssp_read_reg(ssp, SSCR0) & 240 u32 sscr0 = ssp_read_reg(ssp, SSCR0) &
@@ -244,11 +275,11 @@ static int pxa_ssp_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
244 /* The SSP clock must be disabled when changing SSP clock mode 275 /* The SSP clock must be disabled when changing SSP clock mode
245 * on PXA2xx. On PXA3xx it must be enabled when doing so. */ 276 * on PXA2xx. On PXA3xx it must be enabled when doing so. */
246 if (!cpu_is_pxa3xx()) 277 if (!cpu_is_pxa3xx())
247 clk_disable(priv->dev.ssp->clk); 278 clk_disable(ssp->clk);
248 val = ssp_read_reg(ssp, SSCR0) | sscr0; 279 val = ssp_read_reg(ssp, SSCR0) | sscr0;
249 ssp_write_reg(ssp, SSCR0, val); 280 ssp_write_reg(ssp, SSCR0, val);
250 if (!cpu_is_pxa3xx()) 281 if (!cpu_is_pxa3xx())
251 clk_enable(priv->dev.ssp->clk); 282 clk_enable(ssp->clk);
252 283
253 return 0; 284 return 0;
254} 285}
@@ -260,7 +291,7 @@ static int pxa_ssp_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
260 int div_id, int div) 291 int div_id, int div)
261{ 292{
262 struct ssp_priv *priv = cpu_dai->private_data; 293 struct ssp_priv *priv = cpu_dai->private_data;
263 struct ssp_device *ssp = priv->dev.ssp; 294 struct ssp_device *ssp = priv->ssp;
264 int val; 295 int val;
265 296
266 switch (div_id) { 297 switch (div_id) {
@@ -311,7 +342,7 @@ static int pxa_ssp_set_dai_pll(struct snd_soc_dai *cpu_dai, int pll_id,
311 int source, unsigned int freq_in, unsigned int freq_out) 342 int source, unsigned int freq_in, unsigned int freq_out)
312{ 343{
313 struct ssp_priv *priv = cpu_dai->private_data; 344 struct ssp_priv *priv = cpu_dai->private_data;
314 struct ssp_device *ssp = priv->dev.ssp; 345 struct ssp_device *ssp = priv->ssp;
315 u32 ssacd = ssp_read_reg(ssp, SSACD) & ~0x70; 346 u32 ssacd = ssp_read_reg(ssp, SSACD) & ~0x70;
316 347
317#if defined(CONFIG_PXA3xx) 348#if defined(CONFIG_PXA3xx)
@@ -380,7 +411,7 @@ static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
380 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 411 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
381{ 412{
382 struct ssp_priv *priv = cpu_dai->private_data; 413 struct ssp_priv *priv = cpu_dai->private_data;
383 struct ssp_device *ssp = priv->dev.ssp; 414 struct ssp_device *ssp = priv->ssp;
384 u32 sscr0; 415 u32 sscr0;
385 416
386 sscr0 = ssp_read_reg(ssp, SSCR0); 417 sscr0 = ssp_read_reg(ssp, SSCR0);
@@ -415,7 +446,7 @@ static int pxa_ssp_set_dai_tristate(struct snd_soc_dai *cpu_dai,
415 int tristate) 446 int tristate)
416{ 447{
417 struct ssp_priv *priv = cpu_dai->private_data; 448 struct ssp_priv *priv = cpu_dai->private_data;
418 struct ssp_device *ssp = priv->dev.ssp; 449 struct ssp_device *ssp = priv->ssp;
419 u32 sscr1; 450 u32 sscr1;
420 451
421 sscr1 = ssp_read_reg(ssp, SSCR1); 452 sscr1 = ssp_read_reg(ssp, SSCR1);
@@ -437,7 +468,7 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
437 unsigned int fmt) 468 unsigned int fmt)
438{ 469{
439 struct ssp_priv *priv = cpu_dai->private_data; 470 struct ssp_priv *priv = cpu_dai->private_data;
440 struct ssp_device *ssp = priv->dev.ssp; 471 struct ssp_device *ssp = priv->ssp;
441 u32 sscr0; 472 u32 sscr0;
442 u32 sscr1; 473 u32 sscr1;
443 u32 sspsp; 474 u32 sspsp;
@@ -532,7 +563,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream,
532 struct snd_soc_pcm_runtime *rtd = substream->private_data; 563 struct snd_soc_pcm_runtime *rtd = substream->private_data;
533 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 564 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
534 struct ssp_priv *priv = cpu_dai->private_data; 565 struct ssp_priv *priv = cpu_dai->private_data;
535 struct ssp_device *ssp = priv->dev.ssp; 566 struct ssp_device *ssp = priv->ssp;
536 int chn = params_channels(params); 567 int chn = params_channels(params);
537 u32 sscr0; 568 u32 sscr0;
538 u32 sspsp; 569 u32 sspsp;
@@ -642,12 +673,12 @@ static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
642 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 673 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
643 int ret = 0; 674 int ret = 0;
644 struct ssp_priv *priv = cpu_dai->private_data; 675 struct ssp_priv *priv = cpu_dai->private_data;
645 struct ssp_device *ssp = priv->dev.ssp; 676 struct ssp_device *ssp = priv->ssp;
646 int val; 677 int val;
647 678
648 switch (cmd) { 679 switch (cmd) {
649 case SNDRV_PCM_TRIGGER_RESUME: 680 case SNDRV_PCM_TRIGGER_RESUME:
650 ssp_enable(&priv->dev); 681 ssp_enable(ssp);
651 break; 682 break;
652 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 683 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
653 val = ssp_read_reg(ssp, SSCR1); 684 val = ssp_read_reg(ssp, SSCR1);
@@ -666,7 +697,7 @@ static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
666 else 697 else
667 val |= SSCR1_RSRE; 698 val |= SSCR1_RSRE;
668 ssp_write_reg(ssp, SSCR1, val); 699 ssp_write_reg(ssp, SSCR1, val);
669 ssp_enable(&priv->dev); 700 ssp_enable(ssp);
670 break; 701 break;
671 case SNDRV_PCM_TRIGGER_STOP: 702 case SNDRV_PCM_TRIGGER_STOP:
672 val = ssp_read_reg(ssp, SSCR1); 703 val = ssp_read_reg(ssp, SSCR1);
@@ -677,7 +708,7 @@ static int pxa_ssp_trigger(struct snd_pcm_substream *substream, int cmd,
677 ssp_write_reg(ssp, SSCR1, val); 708 ssp_write_reg(ssp, SSCR1, val);
678 break; 709 break;
679 case SNDRV_PCM_TRIGGER_SUSPEND: 710 case SNDRV_PCM_TRIGGER_SUSPEND:
680 ssp_disable(&priv->dev); 711 ssp_disable(ssp);
681 break; 712 break;
682 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 713 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
683 val = ssp_read_reg(ssp, SSCR1); 714 val = ssp_read_reg(ssp, SSCR1);
@@ -707,8 +738,8 @@ static int pxa_ssp_probe(struct platform_device *pdev,
707 if (!priv) 738 if (!priv)
708 return -ENOMEM; 739 return -ENOMEM;
709 740
710 priv->dev.ssp = ssp_request(dai->id + 1, "SoC audio"); 741 priv->ssp = ssp_request(dai->id + 1, "SoC audio");
711 if (priv->dev.ssp == NULL) { 742 if (priv->ssp == NULL) {
712 ret = -ENODEV; 743 ret = -ENODEV;
713 goto err_priv; 744 goto err_priv;
714 } 745 }
@@ -727,7 +758,7 @@ static void pxa_ssp_remove(struct platform_device *pdev,
727 struct snd_soc_dai *dai) 758 struct snd_soc_dai *dai)
728{ 759{
729 struct ssp_priv *priv = dai->private_data; 760 struct ssp_priv *priv = dai->private_data;
730 ssp_free(priv->dev.ssp); 761 ssp_free(priv->ssp);
731} 762}
732 763
733#define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\ 764#define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index 93ed3aad1631..a72c251401ac 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -22,8 +22,8 @@
22#include <sound/soc.h> 22#include <sound/soc.h>
23 23
24#include <plat/regs-s3c2412-iis.h> 24#include <plat/regs-s3c2412-iis.h>
25#include <plat/gpio-bank-d.h> 25#include <mach/gpio-bank-d.h>
26#include <plat/gpio-bank-e.h> 26#include <mach/gpio-bank-e.h>
27#include <plat/gpio-cfg.h> 27#include <plat/gpio-cfg.h>
28 28
29#include <mach/map.h> 29#include <mach/map.h>
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 57cb107c1f13..cd32c200cdb3 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -445,7 +445,7 @@ int main(int argc, const char **argv)
445 445
446 /* 446 /*
447 * We use PATH to find perf commands, but we prepend some higher 447 * We use PATH to find perf commands, but we prepend some higher
448 * precidence paths: the "--exec-path" option, the PERF_EXEC_PATH 448 * precedence paths: the "--exec-path" option, the PERF_EXEC_PATH
449 * environment, and the $(perfexecdir) from the Makefile at build 449 * environment, and the $(perfexecdir) from the Makefile at build
450 * time. 450 * time.
451 */ 451 */
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index e8daf5ca6fd2..44408c2621cf 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -321,7 +321,7 @@ static size_t __callchain__fprintf_graph(FILE *fp, struct callchain_node *self,
321 new_depth_mask &= ~(1 << (depth - 1)); 321 new_depth_mask &= ~(1 << (depth - 1));
322 322
323 /* 323 /*
324 * But we keep the older depth mask for the line seperator 324 * But we keep the older depth mask for the line separator
325 * to keep the level link until we reach the last child 325 * to keep the level link until we reach the last child
326 */ 326 */
327 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask, 327 ret += ipchain__fprintf_graph_line(fp, depth, depth_mask,